diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8c8e4274c41..15ed135559e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,21 +20,3 @@ updates: applies-to: version-updates patterns: ["*"] update-types: ["major", "minor", "patch"] - - # GitHub Actions updates targeting the 12.9.x branch - - package-ecosystem: github-actions - directory: / - target-branch: "12.9.x" # keep in sync with backport_branch in ci/versions.yml - schedule: - interval: "monthly" - time: "09:00" - timezone: "America/Los_Angeles" - - # Keep churn down: only one open PR from this ecosystem at a time - open-pull-requests-limit: 1 - - groups: - actions-monthly: - applies-to: version-updates - patterns: ["*"] - update-types: ["major", "minor", "patch"] diff --git a/.github/labeler.yml b/.github/labeler.yml index 62b46533816..9ed0178d9ab 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -7,7 +7,9 @@ cuda.bindings: - changed-files: - - any-glob-to-any-file: 'cuda_bindings/**' + - any-glob-to-any-file: + - 'cuda_bindings/**' + - 'cuda_bindings_12/**' cuda.core: - changed-files: diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index a3573bc14d4..a94045c57d1 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,19 +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 -name: "CI: Backport the merged PR" +name: "CI: Backport a pull request" on: - pull_request_target: - types: [closed, labeled] - branches: - - main workflow_dispatch: inputs: backport-branch: description: "Branch to backport commits onto" - required: false + required: true type: string pull-request: description: "PR to backport" @@ -26,44 +22,14 @@ permissions: pull-requests: write # so it can create pull requests jobs: - backport-from-pr: - name: Backport directly from a pull request - if: ${{ github.repository_owner == 'nvidia' && - github.event.pull_request.merged == true && - contains( github.event.pull_request.labels.*.name, 'to-be-backported') - }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Load branch name - id: get-branch - run: | - OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) - echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV - - - name: Create backport pull requests - uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2 - with: - copy_assignees: true - copy_labels_pattern: true - copy_requested_reviewers: true - target_branches: ${{ env.OLD_BRANCH }} backport-to-branch: name: Backport a specific PR against a specific branch - if: github.repository_owner == 'nvidia' && github.event_name == 'workflow_dispatch' + if: github.repository_owner == 'nvidia' runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - name: Load branch from environment name - if: inputs.backport-branch == null - run: | - BACKPORT_BRANCH=$(yq '.backport_branch' ci/versions.yml) - echo "BACKPORT_BRANCH=${BRANCH}" >> $GITHUB_ENV - - name: Load branch name from input - if: inputs.backport-branch != null run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV - name: Create backport pull requests diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7bb70809556..8c8914ac715 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -62,10 +62,16 @@ jobs: - name: Read build CTK version run: | + VERSION_KEY='.cuda.build.version' + BINDINGS_COMPONENT_DIR='cuda_bindings' + if [[ "${{ inputs.is-release }}" == "true" && "${{ inputs.git-tag }}" == v12.9.* ]]; then + VERSION_KEY='.cuda.prev_build.version' + BINDINGS_COMPONENT_DIR='cuda_bindings_12' + fi if [[ -f ci/versions.yml ]]; then - BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml) + BUILD_CTK_VER=$(yq "${VERSION_KEY}" ci/versions.yml) elif [[ -f ci/versions.json ]]; then - BUILD_CTK_VER=$(jq -r '.cuda.build.version' ci/versions.json) + BUILD_CTK_VER=$(jq -r "${VERSION_KEY}" ci/versions.json) else echo "error: cannot find ci/versions.yml or ci/versions.json" >&2 exit 1 @@ -75,6 +81,7 @@ jobs: exit 1 fi echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV" + echo "BINDINGS_COMPONENT_DIR=${BINDINGS_COMPONENT_DIR}" >> "$GITHUB_ENV" # TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache @@ -126,22 +133,26 @@ jobs: CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64" echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV - echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV + echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/${BINDINGS_COMPONENT_DIR}/dist")" >> $GITHUB_ENV + echo "CUDA_PYTHON_ARTIFACT_NAME=cuda-python-wheel-cuda${BUILD_CTK_VER}" >> $GITHUB_ENV - name: Download cuda-python build artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: cuda-python-wheel + name: ${{ env.CUDA_PYTHON_ARTIFACT_NAME }} path: . run-id: ${{ inputs.run-id }} github-token: ${{ github.token }} - name: Display structure of downloaded cuda-python artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }} run: | pwd ls -lahR . - name: Download cuda-pathfinder build artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -150,6 +161,7 @@ jobs: github-token: ${{ github.token }} - name: Display structure of downloaded cuda-pathfinder artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }} run: | pwd ls -lahR cuda_pathfinder @@ -162,7 +174,7 @@ jobs: path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - name: Download cuda.bindings build artifacts - if: ${{ inputs.is-release }} + if: ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} @@ -172,6 +184,7 @@ jobs: github-token: ${{ github.token }} - name: Display structure of downloaded cuda.bindings artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' }} run: | pwd ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR @@ -184,7 +197,7 @@ jobs: path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - name: Download cuda.core build artifacts - if: ${{ inputs.is-release }} + if: ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-core') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }} @@ -194,26 +207,37 @@ jobs: github-token: ${{ github.token }} - name: Display structure of downloaded cuda.core build artifacts + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-core' }} run: | pwd ls -lahR $CUDA_CORE_ARTIFACTS_DIR - - name: Install all packages + - name: Install cuda-pathfinder + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }} run: | pushd cuda_pathfinder pip install *.whl popd + - name: Install cuda.bindings + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' }} + run: | pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}" pip install *.whl popd + - name: Install cuda.core + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-core' }} + run: | pushd "${CUDA_CORE_ARTIFACTS_DIR}" pip install *.whl popd - # Subpackages are already installed from CI artifacts above. - # --no-deps avoids re-resolving cuda-core from PyPI during tag releases. + - name: Install cuda-python + if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }} + run: | + # Documentation builds do not exercise runtime dependencies. + # --no-deps also avoids resolving artifacts absent from focused tag runs. pip install --no-deps cuda_python*.whl # This step sets the PR_NUMBER/BUILD_LATEST/BUILD_PREVIEW env vars. @@ -246,6 +270,9 @@ jobs: if: ${{ inputs.component != 'all' }} run: | COMPONENT=$(echo "${{ inputs.component }}" | tr '-' '_') + if [[ "${{ inputs.component }}" == "cuda-bindings" ]]; then + COMPONENT="${BINDINGS_COMPONENT_DIR}" + fi pushd ${COMPONENT}/docs/ if [[ "${{ inputs.is-release }}" == "false" ]]; then ./build_docs.sh latest-only diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 7e233244843..6c69cde41b0 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -33,10 +33,18 @@ jobs: env: BUILD_PATHFINDER: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_build }} BUILD_BINDINGS: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.needs_build }} + BUILD_BINDINGS_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.variants.cu12.needs_build }} + BUILD_BINDINGS_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.variants.cu13.needs_build }} BUILD_CORE: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.needs_build }} BUILD_PYTHON: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.python.needs_build }} + BUILD_PYTHON_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.python.variants.cu12.needs_build }} + BUILD_PYTHON_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.python.variants.cu13.needs_build }} TEST_BINDINGS: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.needs_test }} + TEST_BINDINGS_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.variants.cu12.needs_test }} + TEST_BINDINGS_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.variants.cu13.needs_test }} TEST_CORE: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.needs_test }} + TEST_CORE_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.variants.cu12.needs_test }} + TEST_CORE_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.variants.cu13.needs_test }} BASELINE_RUN_ID: ${{ inputs.workplan != '' && fromJSON(inputs.workplan).baseline.run_id || '' }} BASELINE_SHA: ${{ inputs.workplan != '' && fromJSON(inputs.workplan).baseline.sha || '' }} strategy: @@ -129,6 +137,7 @@ jobs: - name: Set environment variables env: CUDA_VER: ${{ inputs.cuda-version }} + PREV_CUDA_VER: ${{ inputs.prev-cuda-version }} HOST_PLATFORM: ${{ inputs.host-platform }} PY_VER: ${{ matrix.python-version }} SHA: ${{ github.sha }} @@ -151,7 +160,7 @@ jobs: popd - name: Download reusable cuda.pathfinder wheel - if: ${{ env.BUILD_PATHFINDER != 'true' }} + if: ${{ env.BUILD_PATHFINDER != 'true' && env.BASELINE_RUN_ID != '' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -160,6 +169,7 @@ jobs: run-id: ${{ env.BASELINE_RUN_ID }} - name: List the cuda.pathfinder artifacts directory + if: ${{ env.BUILD_PATHFINDER == 'true' || env.BASELINE_RUN_ID != '' }} run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then export CHOWN=chown @@ -180,18 +190,23 @@ jobs: if: ${{ env.BUILD_BINDINGS == 'true' }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) - test "${#pathfinder_wheels[@]}" -eq 1 - test -f "${pathfinder_wheels[0]}" mkdir -p wheel-constraints - if [[ "${{ inputs.host-platform }}" == win* ]]; then - pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")" + if [[ "${#pathfinder_wheels[@]}" -eq 1 && -f "${pathfinder_wheels[0]}" ]]; then + if [[ "${{ inputs.host-platform }}" == win* ]]; then + pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")" + else + pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + fi + printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" > wheel-constraints/cuda-bindings.txt else - pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + # Release-tag workplans intentionally build only one bindings line + # and have no baseline run; let pip resolve released pathfinder. + : > wheel-constraints/cuda-bindings.txt fi - printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt + cat wheel-constraints/cuda-bindings.txt - name: Upload cuda.pathfinder build artifacts - if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + if: ${{ (env.BUILD_PATHFINDER == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: cuda-pathfinder-wheel @@ -199,19 +214,19 @@ jobs: if-no-files-found: error - name: Set up mini CTK - if: ${{ env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' }} + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' || env.BUILD_CORE == 'true' || env.TEST_BINDINGS_CU13 == 'true' || env.TEST_CORE_CU13 == 'true' }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} - - name: Build cuda.bindings wheel - if: ${{ env.BUILD_BINDINGS == 'true' }} + - name: Build CUDA 13 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' }} uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: ./cuda_bindings/ - output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + output-dir: ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_BEFORE_BUILD_LINUX: 'python -m pip install --upgrade "pip>=25.3"' @@ -252,43 +267,44 @@ jobs: CIBW_TEST_COMMAND: > echo "ok!" - - name: Report sccache stats (cuda.bindings) - if: ${{ env.BUILD_BINDINGS == 'true' && inputs.host-platform != 'win-64' }} + - name: Report sccache stats (CUDA 13 cuda.bindings) + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' && 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" + label: "CUDA 13 cuda.bindings" + build-step: "Build CUDA 13 cuda.bindings wheel" - - name: Download reusable cuda.bindings wheel - if: ${{ env.BUILD_BINDINGS != 'true' }} + - name: Download reusable CUDA 13 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU13 != 'true' && env.BASELINE_RUN_ID != '' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: ${{ env.CUDA_BINDINGS_ARTIFACT_BASENAME }}-${{ env.BASELINE_SHA }} - path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + name: ${{ env.CUDA_BINDINGS_CU13_ARTIFACT_BASENAME }}-${{ env.BASELINE_SHA }} + path: ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }} github-token: ${{ github.token }} run-id: ${{ env.BASELINE_RUN_ID }} - - name: List the cuda.bindings artifacts directory + - name: List the CUDA 13 cuda.bindings artifacts directory + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' || env.BASELINE_RUN_ID != '' }} run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then export CHOWN=chown else export CHOWN="sudo chown" fi - $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }} + ls -lahR ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }} - - name: Check cuda.bindings wheel - if: ${{ env.BUILD_BINDINGS == 'true' }} + - name: Check CUDA 13 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' }} run: | - twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + twine check --strict ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }}/*.whl - name: Constrain cuda.core to the local cuda.bindings wheel if: ${{ env.BUILD_CORE == 'true' }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) - bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_CUDA_MAJOR}".*.whl) + bindings_wheels=("${CUDA_BINDINGS_CU13_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_CUDA_MAJOR}".*.whl) test "${#pathfinder_wheels[@]}" -eq 1 test "${#bindings_wheels[@]}" -eq 1 test -f "${pathfinder_wheels[0]}" @@ -306,11 +322,12 @@ jobs: printf 'cuda-bindings @ %s\n' "${bindings_uri}" } | tee wheel-constraints/cuda-core.txt - - name: Upload cuda.bindings build artifacts + - name: Upload CUDA 13 cuda.bindings build artifacts + if: ${{ env.BUILD_BINDINGS_CU13 == 'true' || env.BASELINE_RUN_ID != '' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} - path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + name: ${{ env.CUDA_BINDINGS_CU13_ARTIFACT_NAME }} + path: ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }}/*.whl if-no-files-found: error - name: Build cuda.core wheel @@ -393,7 +410,7 @@ jobs: ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - name: Download reusable cuda.core wheel - if: ${{ env.BUILD_CORE != 'true' }} + if: ${{ env.BUILD_CORE != 'true' && env.BASELINE_RUN_ID != '' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_BASENAME }}-${{ env.BASELINE_SHA }} @@ -401,42 +418,72 @@ jobs: github-token: ${{ github.token }} run-id: ${{ env.BASELINE_RUN_ID }} - # We only need/want a single pure python wheel, pick linux-64 index 0. - - name: Build and check cuda-python wheel - if: ${{ env.BUILD_PYTHON == 'true' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + # We only need/want one copy of each pure Python wheel, so use linux-64 index 0. + - name: Build and check CUDA 12 cuda-python wheel + if: ${{ env.BUILD_PYTHON_CU12 == 'true' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | + mkdir -p cuda_python/dist/cu12 pushd cuda_python - pip wheel -v --no-deps . - twine check --strict *.whl + if [[ -n "${CUDA12_SCM_VERSION}" ]]; then + export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_PYTHON="${CUDA12_SCM_VERSION}" + fi + CUDA_PYTHON_BUILD_MAJOR=12 pip wheel -v --no-deps --wheel-dir dist/cu12 . + twine check --strict dist/cu12/*.whl popd - - name: Download reusable cuda-python wheel - if: ${{ env.BUILD_PYTHON != 'true' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + - name: Download reusable CUDA 12 cuda-python wheel + if: ${{ env.BUILD_PYTHON_CU12 != 'true' && env.BASELINE_RUN_ID != '' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: cuda-python-wheel - path: cuda_python + name: ${{ env.CUDA_PYTHON_CU12_ARTIFACT_NAME }} + path: cuda_python/dist/cu12 github-token: ${{ github.token }} run-id: ${{ env.BASELINE_RUN_ID }} - - name: List the cuda-python artifacts directory - if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + - name: Upload CUDA 12 cuda-python build artifacts + if: ${{ (env.BUILD_PYTHON_CU12 == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_PYTHON_CU12_ARTIFACT_NAME }} + path: cuda_python/dist/cu12/*.whl + if-no-files-found: error + + - name: Build and check CUDA 13 cuda-python wheel + if: ${{ env.BUILD_PYTHON_CU13 == 'true' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + run: | + mkdir -p cuda_python/dist/cu13 + pushd cuda_python + CUDA_PYTHON_BUILD_MAJOR=13 pip wheel -v --no-deps --wheel-dir dist/cu13 . + twine check --strict dist/cu13/*.whl + popd + + - name: Download reusable CUDA 13 cuda-python wheel + if: ${{ env.BUILD_PYTHON_CU13 != 'true' && env.BASELINE_RUN_ID != '' && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_PYTHON_CU13_ARTIFACT_NAME }} + path: cuda_python/dist/cu13 + github-token: ${{ github.token }} + run-id: ${{ env.BASELINE_RUN_ID }} + + - name: Upload CUDA 13 cuda-python build artifacts + if: ${{ (env.BUILD_PYTHON_CU13 == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_PYTHON_CU13_ARTIFACT_NAME }} + path: cuda_python/dist/cu13/*.whl + if-no-files-found: error + + - name: List the cuda-python artifacts directories + if: ${{ (env.BUILD_PYTHON == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then export CHOWN=chown else export CHOWN="sudo chown" fi - $CHOWN -R $(whoami) cuda_python/*.whl - ls -lahR cuda_python - - - name: Upload cuda-python build artifacts - if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cuda-python-wheel - path: cuda_python/*.whl - if-no-files-found: error + $CHOWN -R $(whoami) cuda_python/dist + ls -lahR cuda_python/dist - name: Set up Python id: setup-python2 @@ -471,7 +518,13 @@ jobs: - name: Install cuda.pathfinder (required for next step) if: ${{ env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' }} run: | - pip install cuda_pathfinder/*.whl + pathfinder_wheels=(cuda_pathfinder/*.whl) + if [[ "${#pathfinder_wheels[@]}" -eq 1 && -f "${pathfinder_wheels[0]}" ]]; then + pip install "${pathfinder_wheels[0]}" + else + # Line-specific release tags intentionally omit unrelated local artifacts. + pip install cuda-pathfinder + fi - name: Hide GNU link.exe so Meson finds MSVC link.exe if: ${{ startsWith(inputs.host-platform, 'win') && (env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true') }} @@ -480,26 +533,26 @@ jobs: mv "/c/Program Files/Git/usr/bin/link.exe" "/c/Program Files/Git/usr/bin/link.exe.bak" fi - - name: Build cuda.bindings Cython tests - if: ${{ env.TEST_BINDINGS == 'true' }} + - name: Build CUDA 13 cuda.bindings Cython tests + if: ${{ env.TEST_BINDINGS_CU13 == 'true' }} run: | - pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test - pushd ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} + pip install ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test + pushd ${{ env.CUDA_BINDINGS_CU13_CYTHON_TESTS_DIR }} bash build_tests.sh popd - - name: Upload cuda.bindings Cython tests - if: ${{ env.TEST_BINDINGS == 'true' }} + - name: Upload CUDA 13 cuda.bindings Cython tests + if: ${{ env.TEST_BINDINGS_CU13 == 'true' }} 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 }} + name: ${{ env.CUDA_BINDINGS_CU13_ARTIFACT_NAME }}-tests + path: ${{ env.CUDA_BINDINGS_CU13_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} if-no-files-found: error - - name: Build cuda.core Cython tests - if: ${{ env.TEST_CORE == 'true' }} + - name: Build CUDA 13 cuda.core Cython tests + if: ${{ env.TEST_CORE_CU13 == 'true' }} run: | - pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + pip install ${{ env.CUDA_BINDINGS_CU13_ARTIFACTS_DIR }}/*.whl if ${{ env.BUILD_CORE == 'true' }}; then core_wheel=$(find "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_CUDA_MAJOR}" -maxdepth 1 -type f -name '*.whl' -print -quit) else @@ -514,17 +567,17 @@ jobs: bash build_tests.sh popd - - name: Upload cuda.core Cython tests - if: ${{ env.TEST_CORE == 'true' }} + - name: Upload CUDA 13 cuda.core Cython tests + if: ${{ env.TEST_CORE_CU13 == 'true' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-cu13-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} if-no-files-found: error - # Note: This overwrites CUDA_PATH etc - - name: Set up mini CTK - if: ${{ env.BUILD_CORE == 'true' || env.TEST_CORE == 'true' }} + # Note: This overwrites CUDA_PATH etc. + - name: Set up CUDA 12 mini CTK + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' || env.BUILD_CORE == 'true' || env.TEST_BINDINGS_CU12 == 'true' || env.TEST_CORE_CU12 == 'true' }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -549,47 +602,111 @@ jobs: ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/*.lib if-no-files-found: error - - name: Download cuda.bindings build artifacts from the prior branch - if: ${{ env.BUILD_CORE == 'true' }} + - name: Build CUDA 12 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' }} + uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 + with: + package-dir: ./cuda_bindings_12/ + output-dir: ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }} env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_BEFORE_BUILD_LINUX: 'python -m pip install --upgrade "pip>=25.3"' + CIBW_BEFORE_BUILD_WINDOWS: 'python -m pip install --upgrade "pip>=25.3" delvewheel' + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: 'delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}' + CIBW_ENABLE: cpython-prerelease + CIBW_ENVIRONMENT_LINUX: > + ${{ env.CUDA12_SCM_ENV }} + CUDA_PATH=/host/${{ env.CUDA_PATH }} + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + PIP_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + PIP_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + CC="/host/${{ env.SCCACHE_PATH }} cc" + CXX="/host/${{ env.SCCACHE_PATH }} c++" + SCCACHE_GHA_ENABLED=true + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} + CIBW_ENVIRONMENT_WINDOWS: > + ${{ env.CUDA12_SCM_ENV }} + CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + PIP_BUILD_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-bindings.txt)" + PIP_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-bindings.txt)" + CIBW_BEFORE_TEST_LINUX: > + "/host/${{ env.SCCACHE_PATH }}" --show-adv-stats && + "/host/${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_bindings_cu12.json + CIBW_TEST_COMMAND: > + echo "ok!" + + - name: Report sccache stats (CUDA 12 cuda.bindings) + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' && inputs.host-platform != 'win-64' }} + uses: ./.github/actions/sccache-summary + with: + json-file: sccache_bindings_cu12.json + label: "CUDA 12 cuda.bindings" + build-step: "Build CUDA 12 cuda.bindings wheel" + + - name: Download reusable CUDA 12 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU12 != 'true' && env.BASELINE_RUN_ID != '' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_BINDINGS_CU12_ARTIFACT_BASENAME }}-${{ env.BASELINE_SHA }} + path: ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }} + github-token: ${{ github.token }} + run-id: ${{ env.BASELINE_RUN_ID }} + + - name: List the CUDA 12 cuda.bindings artifacts directory + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' || env.BASELINE_RUN_ID != '' }} run: | - if ! (command -v gh 2>&1 >/dev/null); then - # See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt. - # gh is needed for artifact fetching. - mkdir -p -m 755 /etc/apt/keyrings \ - && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ - && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ - && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && apt update \ - && apt install gh -y + if [[ "${{ inputs.host-platform }}" == win* ]]; then + export CHOWN=chown + else + export CHOWN="sudo chown" fi + $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }} + ls -lahR ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }} - OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) - OLD_ARTIFACT_PATTERN="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}-*[0-9a-f]" - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id \ - --branch "${OLD_BRANCH}" \ - --artifact "${OLD_ARTIFACT_PATTERN}" \ - NVIDIA/cuda-python "CI") - PREV_BINDINGS_DIR="cuda_bindings/dist-prev" - - gh run download \ - "${LATEST_PRIOR_RUN_ID}" \ - -p "${OLD_ARTIFACT_PATTERN}" \ - -R NVIDIA/cuda-python - OLD_ARTIFACT_DIR=$(compgen -G "${OLD_ARTIFACT_PATTERN}") - test -d "${OLD_ARTIFACT_DIR}" - ls -al "${OLD_ARTIFACT_DIR}" - mkdir -p "${PREV_BINDINGS_DIR}" - mv "${OLD_ARTIFACT_DIR}"/*.whl "${PREV_BINDINGS_DIR}" - rmdir "${OLD_ARTIFACT_DIR}" + - name: Check CUDA 12 cuda.bindings wheel + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' }} + run: twine check --strict ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }}/*.whl + + - name: Upload CUDA 12 cuda.bindings build artifacts + if: ${{ env.BUILD_BINDINGS_CU12 == 'true' || env.BASELINE_RUN_ID != '' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_BINDINGS_CU12_ARTIFACT_NAME }} + path: ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }}/*.whl + if-no-files-found: error + + - name: Build CUDA 12 cuda.bindings Cython tests + if: ${{ env.TEST_BINDINGS_CU12 == 'true' }} + run: | + pip uninstall -y cuda-bindings + bindings_wheels=(${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }}/*.whl) + test "${#bindings_wheels[@]}" -eq 1 + test -f "${bindings_wheels[0]}" + pip install "${bindings_wheels[0]}[test]" + pushd ${{ env.CUDA_BINDINGS_CU12_CYTHON_TESTS_DIR }} + bash build_tests.sh + popd + + - name: Upload CUDA 12 cuda.bindings Cython tests + if: ${{ env.TEST_BINDINGS_CU12 == 'true' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_BINDINGS_CU12_ARTIFACT_NAME }}-tests + path: ${{ env.CUDA_BINDINGS_CU12_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} + if-no-files-found: error - name: Constrain previous cuda.core to the downloaded cuda.bindings wheel if: ${{ env.BUILD_CORE == 'true' }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) - bindings_wheels=(cuda_bindings/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl) + bindings_wheels=("${CUDA_BINDINGS_CU12_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl) test "${#pathfinder_wheels[@]}" -eq 1 test "${#bindings_wheels[@]}" -eq 1 test -f "${pathfinder_wheels[0]}" @@ -687,6 +804,40 @@ jobs: ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + - name: Build CUDA 12 cuda.core Cython tests + if: ${{ env.TEST_CORE_CU12 == 'true' }} + run: | + # The CUDA 13 test extensions were built in this same source tree. + # Remove generated outputs so Cython and the compiler cannot reuse them. + find "${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}" -maxdepth 1 -type f \ + \( -name 'test_*.cpp' -o -name 'test_*.so' -o -name 'test_*.pyd' \) -delete + if [[ -d "${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/build" ]]; then + find "${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/build" -type f -delete + fi + pip uninstall -y cuda-bindings cuda-core + pip install ${{ env.CUDA_BINDINGS_CU12_ARTIFACTS_DIR }}/*.whl + if ${{ env.BUILD_CORE == 'true' }}; then + core_wheel=$(find "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_PREV_CUDA_MAJOR}" -maxdepth 1 -type f -name '*.whl' -print -quit) + else + core_wheel=$(find "${{ env.CUDA_CORE_ARTIFACTS_DIR }}" -maxdepth 1 -type f -name '*.whl' -print -quit) + fi + if [[ -z "${core_wheel}" ]]; then + echo "No cuda.core wheel found" >&2 + exit 1 + fi + pip install "${core_wheel}" --group ./cuda_core/pyproject.toml:test + pushd ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} + bash build_tests.sh + popd + + - name: Upload CUDA 12 cuda.core Cython tests + if: ${{ env.TEST_CORE_CU12 == 'true' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-cu12-tests + path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} + if-no-files-found: error + - name: Merge cuda.core wheels if: ${{ env.BUILD_CORE == 'true' }} run: | @@ -702,6 +853,7 @@ jobs: twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl - name: Upload cuda.core build artifacts + if: ${{ env.BUILD_CORE == 'true' || env.BASELINE_RUN_ID != '' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml index faae759d9ba..b86a53e94e5 100644 --- a/.github/workflows/ci-nightly.yml +++ b/.github/workflows/ci-nightly.yml @@ -55,6 +55,7 @@ jobs: RUN_ID: ${{ steps.find.outputs.run_id }} HEAD_SHA: ${{ steps.find.outputs.head_sha }} CUDA_BUILD_VER: ${{ steps.find.outputs.cuda_build_ver }} + CUDA_PREV_BUILD_VER: ${{ steps.find.outputs.cuda_prev_build_ver }} steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -83,20 +84,24 @@ jobs: exit 1 fi - CUDA_BUILD_VER=$(gh api \ + VERSIONS_YAML=$(gh api \ "repos/${{ github.repository }}/contents/ci/versions.yml?ref=$HEAD_SHA" \ --jq '.content' \ - | base64 -d \ - | yq '.cuda.build.version') + | base64 -d) - if [[ -z "$CUDA_BUILD_VER" || "$CUDA_BUILD_VER" == "null" ]]; then - echo "::error::Could not resolve CUDA build version from $HEAD_SHA" + CUDA_BUILD_VER=$(yq '.cuda.build.version' <<< "$VERSIONS_YAML") + CUDA_PREV_BUILD_VER=$(yq '.cuda.prev_build.version' <<< "$VERSIONS_YAML") + + if [[ -z "$CUDA_BUILD_VER" || "$CUDA_BUILD_VER" == "null" || + -z "$CUDA_PREV_BUILD_VER" || "$CUDA_PREV_BUILD_VER" == "null" ]]; then + echo "::error::Could not resolve CUDA build versions 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 + echo "cuda_prev_build_ver=$CUDA_PREV_BUILD_VER" >> $GITHUB_OUTPUT # ── PyTorch interop tests ── @@ -113,6 +118,7 @@ jobs: build-type: nightly host-platform: linux-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-pytorch @@ -131,6 +137,7 @@ jobs: build-type: nightly host-platform: linux-aarch64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-pytorch @@ -149,6 +156,7 @@ jobs: build-type: nightly host-platform: win-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-pytorch @@ -169,6 +177,7 @@ jobs: build-type: nightly host-platform: linux-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-numba-cuda @@ -187,6 +196,7 @@ jobs: build-type: nightly host-platform: linux-aarch64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-numba-cuda @@ -205,6 +215,7 @@ jobs: build-type: nightly host-platform: win-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-numba-cuda @@ -225,6 +236,7 @@ jobs: build-type: nightly host-platform: linux-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-numba-cuda-mlir @@ -243,6 +255,7 @@ jobs: build-type: nightly host-platform: win-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-numba-cuda-mlir @@ -263,6 +276,7 @@ jobs: build-type: nightly host-platform: linux-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-cuda-core @@ -281,6 +295,7 @@ jobs: build-type: nightly host-platform: win-64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: nightly-cuda-core @@ -301,6 +316,7 @@ jobs: build-type: nightly host-platform: linux-aarch64 build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_PREV_BUILD_VER }} run-id: ${{ needs.find-wheels.outputs.RUN_ID }} sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} test-mode: standard diff --git a/.github/workflows/ci-pixi-source-test.yml b/.github/workflows/ci-pixi-source-test.yml index cdae1b0cf26..8412fcc0530 100644 --- a/.github/workflows/ci-pixi-source-test.yml +++ b/.github/workflows/ci-pixi-source-test.yml @@ -34,9 +34,13 @@ on: - "**/pixi.toml" - "**/pixi.lock" - "cuda_bindings/build_hooks.py" + - "cuda_bindings_12/build_hooks.py" - "cuda_core/build_hooks.py" - "cuda_bindings/cuda/bindings/**" # generated bindings sources + - "cuda_bindings_12/cuda/bindings/**" + - "cuda_bindings_12/docs/**" - "cuda_bindings/tests/cython/**" + - "cuda_bindings_12/tests/cython/**" - "cuda_core/tests/cython/**" - "ci/versions.yml" - ".github/workflows/ci-pixi-source-test.yml" @@ -61,7 +65,7 @@ env: jobs: # ── PR guard: CPU-only build + import + placement smoke ── build-smoke: - name: "build smoke (cu13, linux-64, CPU)" + name: "build smoke (selected CUDA lines, linux-64, CPU)" if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest timeout-minutes: 45 @@ -73,6 +77,7 @@ jobs: # 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 + filter: blob:none - name: Setup pixi # Pinned to a commit SHA; install logic lives in the action and is @@ -82,32 +87,104 @@ jobs: pixi-version: ${{ env.PIXI_VERSION }} run-install: false - - name: Source-build + import + cython-placement smoke + - name: Select CUDA environments env: - CUDA_ENV: ${{ inputs.cuda-env || 'cu13' }} + BASE_SHA: ${{ github.event.pull_request.base.sha || '' }} + EVENT_NAME: ${{ github.event_name }} + REQUESTED_CUDA_ENV: ${{ inputs.cuda-env || '' }} + run: | + cuda_envs=() + validate_cu12_docs=false + if [[ "${EVENT_NAME}" == "workflow_dispatch" ]]; then + case "${REQUESTED_CUDA_ENV}" in + cu12|cu13) cuda_envs+=("${REQUESTED_CUDA_ENV}") ;; + *) echo "::error::cuda-env must be cu12 or cu13"; exit 1 ;; + esac + else + merge_base=$(git merge-base HEAD "${BASE_SHA}") + workplan=$(python3 ci/tools/compute_ci_plan.py \ + --merge-base "${merge_base}" \ + --baseline-run-id pixi-source) + need_cu12=$(jq -r '.jobs.test_cuda_majors.cu12' <<< "${workplan}") + need_cu13=$(jq -r '.jobs.test_cuda_majors.cu13' <<< "${workplan}") + + # Pixi manifests are deliberately ignored by the wheel planner. + # Add their package-local impact to its source/test decisions, and + # validate CUDA 12 docs in the line-specific Pixi environment. + while IFS= read -r -d '' path; do + case "${path}" in + cuda_bindings_12/docs/*) + need_cu12=true + validate_cu12_docs=true + ;; + cuda_bindings_12/pixi.toml|cuda_bindings_12/pixi.lock) + need_cu12=true + ;; + cuda_bindings/pixi.toml|cuda_bindings/pixi.lock) + need_cu13=true + ;; + */pixi.toml|*/pixi.lock|pixi.toml|pixi.lock) + need_cu12=true + need_cu13=true + ;; + esac + done < <(git diff --no-renames --name-only -z "${merge_base}" HEAD) + + ${need_cu12} && cuda_envs+=(cu12) + ${need_cu13} && cuda_envs+=(cu13) + fi + + if (( ${#cuda_envs[@]} == 0 )); then + echo "::error::no CUDA environment selected for source-build smoke tests" + exit 1 + fi + echo "CUDA_ENVS=${cuda_envs[*]}" | tee -a "$GITHUB_ENV" + echo "VALIDATE_CU12_DOCS=${validate_cu12_docs}" | tee -a "$GITHUB_ENV" + + - name: Source-build + import + cython-placement smoke 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 + for CUDA_ENV in ${CUDA_ENVS}; do + echo "::group::Source-build ${CUDA_ENV}" + # Avoid carrying Cython outputs between CUDA-major environments. + rm -rf cuda_core/build/cython cuda_core/cython_debug + find cuda_core/cuda/core -type f -name '*.so' -delete + find cuda_bindings/tests/cython cuda_bindings_12/tests/cython cuda_core/tests/cython \ + -maxdepth 1 -type f \( -name 'test_*.cpp' -o -name 'test_*.so' \) -delete + + # pathfinder: pure-Python, no GPU. + pixi run -e "${CUDA_ENV}" test-pathfinder + + if [[ "${CUDA_ENV}" == "cu12" ]]; then + BINDINGS_ROOT="cuda_bindings_12" + else + BINDINGS_ROOT="cuda_bindings" fi + + # Force both source builds and import them to catch compile/ABI + # regressions such as #2182. cuda-core's cu12 environment uses the + # published 12.x bindings by design; wheel CI covers local pairing. + pixi run --manifest-path "${BINDINGS_ROOT}" -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')" + pixi run --manifest-path "${BINDINGS_ROOT}" -e "${CUDA_ENV}" build-cython-tests + pixi run --manifest-path cuda_core -e "${CUDA_ENV}" build-cython-tests + + # Confirm each extension landed next to its .pyx (catches #2180). + for d in "${BINDINGS_ROOT}/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 "::endgroup::" done echo "cython test extensions placed correctly" + - name: Build CUDA 12 bindings docs + if: ${{ env.VALIDATE_CU12_DOCS == 'true' }} + run: pixi run --manifest-path cuda_bindings_12 -e docs build-docs + # ── Nightly: full `pixi run test` on a GPU runner ── full-test: name: "pixi run test (${{ inputs.cuda-env || 'cu13' }}, linux-64, GPU)" @@ -136,6 +213,7 @@ jobs: # 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 + filter: blob:none - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a1068fb7b0..b179aaf317d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 # Note: This name is referred to in the test job, so make sure any changes are sync'd up! -# Further this is referencing a run in the backport branch to fetch old bindings. name: "CI" concurrency: @@ -86,19 +85,22 @@ jobs: # # Dependency graph (verified in pyproject.toml files): # cuda_pathfinder -> (no internal deps) - # cuda_bindings -> cuda_pathfinder + # cuda_bindings_12 -> cuda_pathfinder (CUDA 12.9 line) + # cuda_bindings -> cuda_pathfinder (CUDA 13 line) # cuda_core -> cuda_pathfinder, cuda_bindings # cuda_python -> cuda_pathfinder, cuda_bindings, cuda_core (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. + # downstream module. A change to either bindings line rebuilds cuda_core + # against both majors, but rebuilds only the matching bindings package. # A change to cuda_core alone skips rebuilding/retesting cuda_bindings and # cuda_pathfinder, but still retests the downstream cuda-python metapackage. # Shared build/orchestration changes run the full pipeline; test-only CI # infrastructure runs every test suite without rebuilding package wheels. - # 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. + # On pushes to main, schedule, workflow_dispatch, or non-bindings release + # tags we unconditionally run everything because there is no meaningful + # "changed paths" baseline for those events. Bare v12.9/v13 tags select the + # corresponding cuda.bindings and cuda-python release line. detect-changes: runs-on: ubuntu-latest needs: should-skip @@ -107,6 +109,7 @@ jobs: contents: read outputs: workplan: ${{ steps.workplan.outputs.workplan }} + sdist-cuda-majors: ${{ steps.workplan.outputs.sdist-cuda-majors }} steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -187,11 +190,24 @@ jobs: } missing=() - for name in cuda-pathfinder-wheel cuda-python-wheel; do + has_artifact cuda-pathfinder-wheel || missing+=(cuda-pathfinder-wheel) + + if ! prev_cuda_version=$(yq '.cuda.prev_build.version' ci/versions.yml); then + unavailable + fi + if ! cuda_version=$(yq '.cuda.build.version' ci/versions.yml); then + unavailable + fi + if [[ -z "${prev_cuda_version}" || "${prev_cuda_version}" == "null" || + -z "${cuda_version}" || "${cuda_version}" == "null" ]]; then + unavailable + fi + cuda_versions=("${prev_cuda_version}" "${cuda_version}") + for version in "${cuda_versions[@]}"; do + name="cuda-python-wheel-cuda${version}" has_artifact "$name" || missing+=("$name") done - cuda_version=$(yq '.cuda.build.version' ci/versions.yml) if ! python_versions=$(yq -r '.jobs.build.strategy.matrix."python-version"[]' .github/workflows/build-wheel.yml); then unavailable fi @@ -204,9 +220,11 @@ jobs: while IFS= read -r python_version; do python=${python_version//./} while IFS= read -r platform; do - binding="cuda-bindings-python${python}-cuda${cuda_version}-${platform}-${merge_base}" + for version in "${cuda_versions[@]}"; do + binding="cuda-bindings-python${python}-cuda${version}-${platform}-${merge_base}" + has_artifact "$binding" || missing+=("$binding") + done core="cuda-core-python${python}-${platform}-${merge_base}" - has_artifact "$binding" || missing+=("$binding") has_artifact "$core" || missing+=("$core") done <<< "${platforms}" done <<< "${python_versions}" @@ -230,12 +248,19 @@ jobs: env: MERGE_BASE: ${{ steps.merge-base.outputs.sha }} BASELINE_RUN_ID: ${{ steps.baseline.outputs.run_id }} + RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }} run: | set -euo pipefail - workplan=$(python3 ci/tools/compute_ci_plan.py \ - --merge-base "$MERGE_BASE" \ - --baseline-run-id "$BASELINE_RUN_ID") + planner_args=( + --merge-base "$MERGE_BASE" + --baseline-run-id "$BASELINE_RUN_ID" + ) + if [[ -n "$RELEASE_TAG" ]]; then + planner_args+=(--release-tag "$RELEASE_TAG") + fi + workplan=$(python3 ci/tools/compute_ci_plan.py "${planner_args[@]}") echo "workplan=$workplan" >> "$GITHUB_OUTPUT" + echo "sdist-cuda-majors=$(jq -c '[.jobs.sdist_cuda_majors | to_entries[] | select(.value) | .key]' <<< "$workplan")" >> "$GITHUB_OUTPUT" { echo echo "### CI workplan" @@ -418,12 +443,16 @@ jobs: # - host-platform value # - uses: (test-sdist-linux.yml vs test-sdist-windows.yml) test-sdist-linux: + strategy: + fail-fast: false + matrix: + cuda-major: ${{ fromJSON(needs.detect-changes.outputs.sdist-cuda-majors) }} needs: - ci-vars - should-skip - detect-changes - build-linux-64 - name: Test sdist linux-64 + name: Test sdist linux-64 (${{ matrix.cuda-major }}) if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) && @@ -435,18 +464,22 @@ jobs: uses: ./.github/workflows/test-sdist-linux.yml with: host-platform: linux-64 - cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-version: ${{ matrix.cuda-major == 'cu12' && needs.ci-vars.outputs.CUDA_PREV_BUILD_VER || needs.ci-vars.outputs.CUDA_BUILD_VER }} workplan: ${{ needs.detect-changes.outputs.workplan }} # See test-sdist-linux for why sdist test jobs are split by platform. test-sdist-windows: + strategy: + fail-fast: false + matrix: + cuda-major: ${{ fromJSON(needs.detect-changes.outputs.sdist-cuda-majors) }} needs: - ci-vars - should-skip - detect-changes - build-linux-64 - build-windows - name: Test sdist win-64 + name: Test sdist win-64 (${{ matrix.cuda-major }}) if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) && @@ -458,7 +491,7 @@ jobs: uses: ./.github/workflows/test-sdist-windows.yml with: host-platform: win-64 - cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-version: ${{ matrix.cuda-major == 'cu12' && needs.ci-vars.outputs.CUDA_PREV_BUILD_VER || needs.ci-vars.outputs.CUDA_BUILD_VER }} workplan: ${{ needs.detect-changes.outputs.workplan }} # NOTE: Test jobs are split by platform for the same reason as build jobs (see @@ -490,6 +523,7 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} workplan: ${{ needs.detect-changes.outputs.workplan }} @@ -519,6 +553,7 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} workplan: ${{ needs.detect-changes.outputs.workplan }} @@ -548,6 +583,7 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + prev-build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} workplan: ${{ needs.detect-changes.outputs.workplan }} @@ -565,6 +601,12 @@ jobs: secrets: inherit uses: ./.github/workflows/build-docs.yml with: + # Bare v12.9/v13 tags intentionally produce only their matching + # cuda.bindings and cuda-python artifacts. Keep tag docs on that focused + # artifact set; component-specific release runs build the other docs. + component: ${{ (startsWith(github.ref_name, 'v12.9.') || startsWith(github.ref_name, 'v13.')) && 'cuda-bindings' || 'all' }} + git-tag: ${{ github.ref_type == 'tag' && github.ref_name || '' }} + run-id: ${{ github.run_id }} is-release: ${{ github.ref_type == 'tag' }} precommit-windows: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fc234999fca..d1795cca6a6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest outputs: CUDA_VER: ${{ steps.get-vars.outputs.cuda_ver }} + CUDA_PREV_VER: ${{ steps.get-vars.outputs.cuda_prev_ver }} steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -28,6 +29,8 @@ jobs: run: | cuda_ver=$(yq '.cuda.build.version' ci/versions.yml) echo "cuda_ver=$cuda_ver" >> $GITHUB_OUTPUT + cuda_prev_ver=$(yq '.cuda.prev_build.version' ci/versions.yml) + echo "cuda_prev_ver=$cuda_prev_ver" >> $GITHUB_OUTPUT coverage-linux: name: Coverage (Linux) @@ -43,6 +46,7 @@ jobs: HOST_PLATFORM: "linux-64" ARCH: "x86_64" CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }} + CUDA_PREV_VER: ${{ needs.coverage-vars.outputs.CUDA_PREV_VER }} # Our self-hosted runners require a container # TODO: use a different (nvidia?) container container: @@ -89,6 +93,7 @@ jobs: - name: Set environment variables env: BUILD_CUDA_VER: ${{ env.CUDA_VER }} + PREV_BUILD_CUDA_VER: ${{ env.CUDA_PREV_VER }} CUDA_VER: ${{ env.CUDA_VER }} HOST_PLATFORM: ${{ env.HOST_PLATFORM }} LOCAL_CTK: ${{ env.LOCAL_CTK }} diff --git a/.github/workflows/release-upload.yml b/.github/workflows/release-upload.yml index 77681096ed9..eb2131f6643 100644 --- a/.github/workflows/release-upload.yml +++ b/.github/workflows/release-upload.yml @@ -83,7 +83,12 @@ jobs: GH_TOKEN: ${{ github.token }} run: | # Use the shared script to download wheels - ./ci/tools/download-wheels "${{ inputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "release/wheels" + ./ci/tools/download-wheels \ + "${{ inputs.run-id }}" \ + "${{ inputs.component }}" \ + "${{ github.repository }}" \ + "release/wheels" \ + "${{ inputs.git-tag }}" # Validate that release wheels match the expected version from tag. ./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "release/wheels" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f2c54f4509..4ceb001f2e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,26 +9,9 @@ name: "CI: Release" # 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. +# Maintenance note: validate non-trivial changes with dry-run workflow_dispatch +# runs for both a v12.9 tag and a v13 tag. Leave run-id blank so automatic +# tag-run discovery, artifact filtering, and version validation are exercised. on: workflow_dispatch: @@ -54,11 +37,6 @@ on: 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 @@ -170,8 +148,7 @@ jobs: run: | python ci/tools/check_release_notes.py \ --git-tag "${{ inputs.git-tag }}" \ - --component "${{ inputs.component }}" \ - --backport-git-tag "${{ inputs.backport-git-tag }}" + --component "${{ inputs.component }}" doc: name: Build release docs @@ -234,7 +211,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./ci/tools/download-wheels "${{ needs.determine-run-id.outputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist" + ./ci/tools/download-wheels \ + "${{ needs.determine-run-id.outputs.run-id }}" \ + "${{ inputs.component }}" \ + "${{ github.repository }}" \ + "dist" \ + "${{ inputs.git-tag }}" - name: Validate wheel versions for release tag run: | @@ -265,7 +247,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./ci/tools/download-wheels "${{ needs.determine-run-id.outputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist" + ./ci/tools/download-wheels \ + "${{ needs.determine-run-id.outputs.run-id }}" \ + "${{ inputs.component }}" \ + "${{ github.repository }}" \ + "dist" \ + "${{ inputs.git-tag }}" - name: Validate wheel versions for release tag run: | diff --git a/.github/workflows/test-sdist-linux.yml b/.github/workflows/test-sdist-linux.yml index ba7cdfc6ef1..9e8b0fa5678 100644 --- a/.github/workflows/test-sdist-linux.yml +++ b/.github/workflows/test-sdist-linux.yml @@ -28,12 +28,22 @@ permissions: jobs: test-sdist: name: Test sdist builds - if: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_tests }} + if: ${{ (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_tests) && + ((startsWith(inputs.cuda-version, '12.') && (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_cuda_majors.cu12)) || + (startsWith(inputs.cuda-version, '13.') && (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_cuda_majors.cu13))) }} env: + BINDINGS_ROOT: ${{ startsWith(inputs.cuda-version, '12.') && 'cuda_bindings_12' || 'cuda_bindings' }} + CUDA_PYTHON_BUILD_MAJOR: ${{ startsWith(inputs.cuda-version, '12.') && '12' || '13' }} BUILD_PATHFINDER: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_build }} - BUILD_BINDINGS: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.needs_build }} - BUILD_CORE: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.needs_build }} - BUILD_PYTHON: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.python.needs_build }} + BUILD_BINDINGS: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.bindings.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.bindings.variants.cu13.needs_build) }} + BUILD_CORE: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.core.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.core.variants.cu13.needs_build) }} + BUILD_PYTHON: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.python.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.python.variants.cu13.needs_build) }} timeout-minutes: 60 runs-on: linux-amd64-cpu8 steps: @@ -53,6 +63,14 @@ jobs: - name: Install build tools run: python -m pip install "pip>=25.3" build + - name: Set CUDA 12 development versions + if: ${{ startsWith(inputs.cuda-version, '12.') && + (github.ref_type != 'tag' || startsWith(github.ref_name, 'v12.9.') == false) }} + run: | + version="12.9.8.dev0+g${GITHUB_SHA:0:7}" + echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_BINDINGS=${version}" >> "$GITHUB_ENV" + echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_PYTHON=${version}" >> "$GITHUB_ENV" + # Pure Python packages -- no CTK needed. - name: Build cuda.pathfinder sdist and wheel-from-sdist if: ${{ env.BUILD_PATHFINDER == 'true' }} @@ -67,7 +85,8 @@ jobs: pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz - name: Download cuda.pathfinder wheel - if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') }} + if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') && + (inputs.workplan == '' || fromJSON(inputs.workplan).baseline.run_id != '') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -77,11 +96,14 @@ jobs: if: ${{ env.BUILD_BINDINGS == 'true' }} run: | pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) - test "${#pathfinder_wheels[@]}" -eq 1 - test -f "${pathfinder_wheels[0]}" mkdir -p wheel-constraints - pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")" - printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt + if [[ "${#pathfinder_wheels[@]}" -eq 1 && -f "${pathfinder_wheels[0]}" ]]; then + pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")" + printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" > wheel-constraints/cuda-bindings.txt + else + : > wheel-constraints/cuda-bindings.txt + fi + cat wheel-constraints/cuda-bindings.txt # Cython packages need CTK + sccache. # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN @@ -126,22 +148,22 @@ jobs: export CXX="sccache c++" export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-bindings.txt" export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}" - python -m build --sdist cuda_bindings/ - pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + python -m build --sdist "${BINDINGS_ROOT}/" + pip wheel --no-deps --wheel-dir "${BINDINGS_ROOT}/dist" "${BINDINGS_ROOT}"/dist/*.tar.gz - name: Download cuda.bindings wheel if: ${{ env.BUILD_BINDINGS != 'true' && env.BUILD_CORE == 'true' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }} - path: cuda_bindings/dist + path: ${{ env.BINDINGS_ROOT }}/dist - name: Constrain cuda.core to the local cuda.bindings wheel if: ${{ env.BUILD_CORE == 'true' }} run: | CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) - bindings_wheels=(cuda_bindings/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl) + bindings_wheels=("${BINDINGS_ROOT}"/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl) test "${#pathfinder_wheels[@]}" -eq 1 test "${#bindings_wheels[@]}" -eq 1 test -f "${pathfinder_wheels[0]}" diff --git a/.github/workflows/test-sdist-windows.yml b/.github/workflows/test-sdist-windows.yml index a0594800eba..89d013edce2 100644 --- a/.github/workflows/test-sdist-windows.yml +++ b/.github/workflows/test-sdist-windows.yml @@ -34,12 +34,22 @@ permissions: jobs: test-sdist: name: Test sdist builds - if: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_tests }} + if: ${{ (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_tests) && + ((startsWith(inputs.cuda-version, '12.') && (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_cuda_majors.cu12)) || + (startsWith(inputs.cuda-version, '13.') && (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.sdist_cuda_majors.cu13))) }} env: + BINDINGS_ROOT: ${{ startsWith(inputs.cuda-version, '12.') && 'cuda_bindings_12' || 'cuda_bindings' }} + CUDA_PYTHON_BUILD_MAJOR: ${{ startsWith(inputs.cuda-version, '12.') && '12' || '13' }} BUILD_PATHFINDER: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_build }} - BUILD_BINDINGS: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.bindings.needs_build }} - BUILD_CORE: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.core.needs_build }} - BUILD_PYTHON: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.python.needs_build }} + BUILD_BINDINGS: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.bindings.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.bindings.variants.cu13.needs_build) }} + BUILD_CORE: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.core.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.core.variants.cu13.needs_build) }} + BUILD_PYTHON: ${{ inputs.workplan == '' || + (startsWith(inputs.cuda-version, '12.') && fromJSON(inputs.workplan).modules.python.variants.cu12.needs_build) || + (startsWith(inputs.cuda-version, '13.') && fromJSON(inputs.workplan).modules.python.variants.cu13.needs_build) }} timeout-minutes: 60 runs-on: windows-2022 steps: @@ -63,6 +73,15 @@ jobs: - name: Install build tools run: python -m pip install "pip>=25.3" build + - name: Set CUDA 12 development versions + if: ${{ startsWith(inputs.cuda-version, '12.') && + (github.ref_type != 'tag' || startsWith(github.ref_name, 'v12.9.') == false) }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: | + version="12.9.8.dev0+g${GITHUB_SHA:0:7}" + echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_BINDINGS=${version}" >> "$GITHUB_ENV" + echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_PYTHON=${version}" >> "$GITHUB_ENV" + # Pure Python packages -- no CTK needed. - name: Build cuda.pathfinder sdist and wheel-from-sdist if: ${{ env.BUILD_PATHFINDER == 'true' }} @@ -77,7 +96,8 @@ jobs: pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz - name: Download cuda.pathfinder wheel - if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') }} + if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') && + (inputs.workplan == '' || fromJSON(inputs.workplan).baseline.run_id != '') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -87,11 +107,14 @@ jobs: if: ${{ env.BUILD_BINDINGS == 'true' }} run: | pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) - test "${#pathfinder_wheels[@]}" -eq 1 - test -f "${pathfinder_wheels[0]}" mkdir -p wheel-constraints - pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")" - printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt + if [[ "${#pathfinder_wheels[@]}" -eq 1 && -f "${pathfinder_wheels[0]}" ]]; then + pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")" + printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" > wheel-constraints/cuda-bindings.txt + else + : > wheel-constraints/cuda-bindings.txt + fi + cat wheel-constraints/cuda-bindings.txt # Cython packages need CTK. No sccache on Windows (this is a correctness # smoke test, not a production build; see build-wheel.yml which also @@ -114,22 +137,22 @@ jobs: export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-bindings.txt")" export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}" - python -m build --sdist cuda_bindings/ - pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + python -m build --sdist "${BINDINGS_ROOT}/" + pip wheel --no-deps --wheel-dir "${BINDINGS_ROOT}/dist" "${BINDINGS_ROOT}"/dist/*.tar.gz - name: Download cuda.bindings wheel if: ${{ env.BUILD_BINDINGS != 'true' && env.BUILD_CORE == 'true' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }} - path: cuda_bindings/dist + path: ${{ env.BINDINGS_ROOT }}/dist - name: Constrain cuda.core to the local cuda.bindings wheel if: ${{ env.BUILD_CORE == 'true' }} run: | CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) - bindings_wheels=(cuda_bindings/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl) + bindings_wheels=("${BINDINGS_ROOT}"/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl) test "${#pathfinder_wheels[@]}" -eq 1 test "${#bindings_wheels[@]}" -eq 1 test -f "${pathfinder_wheels[0]}" diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 814e4e756b0..f06dc1f3902 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -16,6 +16,9 @@ on: build-ctk-ver: type: string required: true + prev-build-ctk-ver: + type: string + required: true matrix_filter: type: string default: "." @@ -52,14 +55,16 @@ defaults: jobs: compute-matrix: + if: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13 }} runs-on: ubuntu-latest env: BUILD_TYPE: ${{ inputs.build-type }} + TEST_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 }} + TEST_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13 }} ARCH: ${{ (inputs.host-platform == 'linux-64' && 'amd64') || (inputs.host-platform == 'linux-aarch64' && 'arm64') }} outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} - OLD_BRANCH: ${{ steps.compute-matrix.outputs.OLD_BRANCH }} steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -89,14 +94,18 @@ jobs: # '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') + MATRIX=$(echo "$TEST_MATRIX" | jq -c \ + --argjson test_cu12 "${TEST_CU12}" \ + --argjson test_cu13 "${TEST_CU13}" \ + '${{ inputs.matrix_filter }} + | map(select((((.CUDA_VER | split(".")[0]) == "12") and $test_cu12) + or (((.CUDA_VER | split(".")[0]) == "13") and $test_cu13))) + | 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 after CUDA-major workplan filtering\n" | halt_error(1) end') echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" - # This job has yq already installed, so let's do it here - OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) - echo "OLD_BRANCH=${OLD_BRANCH}" >> "$GITHUB_OUTPUT" - test: env: TEST_PATHFINDER: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_test }} @@ -113,7 +122,8 @@ jobs: # 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() }} + if: ${{ github.repository_owner == 'nvidia' && !cancelled() && + (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13) }} # Our self-hosted runners require a container # TODO: use a different (nvidia?) container container: @@ -156,6 +166,7 @@ jobs: - name: Set environment variables env: BUILD_CUDA_VER: ${{ inputs.build-ctk-ver }} + PREV_BUILD_CUDA_VER: ${{ inputs.prev-build-ctk-ver }} CUDA_VER: ${{ matrix.CUDA_VER }} HOST_PLATFORM: ${{ inputs.host-platform }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} @@ -171,7 +182,8 @@ jobs: run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" - name: Download cuda-pathfinder build artifacts - if: ${{ env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true' }} + if: ${{ (env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && + (inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_build || fromJSON(inputs.workplan).baseline.run_id != '') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -180,17 +192,17 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'local' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: cuda-python-wheel + name: ${{ env.CUDA_PYTHON_ARTIFACT_NAME }} path: . run-id: ${{ inputs.run-id || github.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts if: ${{ (env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && - env.BINDINGS_SOURCE == 'main' }} + env.BINDINGS_SOURCE == 'local' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} @@ -198,55 +210,6 @@ jobs: 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.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && - env.BINDINGS_SOURCE == 'backport' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt. - # gh is needed for artifact fetching. - mkdir -p -m 755 /etc/apt/keyrings \ - && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ - && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ - && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && apt update \ - && apt install gh -y - - OLD_BRANCH=${{ needs.compute-matrix.outputs.OLD_BRANCH }} - OLD_ARTIFACT_PATTERN="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}-*[0-9a-f]" - LOOKUP_ARGS=( - --branch "${OLD_BRANCH}" - --artifact "${OLD_ARTIFACT_PATTERN}" - ) - if ${{ env.TEST_PYTHON == 'true' }}; then - LOOKUP_ARGS+=(--artifact cuda-python-wheel) - fi - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id \ - "${LOOKUP_ARGS[@]}" NVIDIA/cuda-python "CI") - - gh run download \ - "${LATEST_PRIOR_RUN_ID}" \ - -p "${OLD_ARTIFACT_PATTERN}" \ - -R NVIDIA/cuda-python - OLD_ARTIFACT_DIR=$(compgen -G "${OLD_ARTIFACT_PATTERN}") - test -d "${OLD_ARTIFACT_DIR}" - ls -al "${OLD_ARTIFACT_DIR}" - mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" - mv "${OLD_ARTIFACT_DIR}"/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/ - rmdir "${OLD_ARTIFACT_DIR}" - - if ${{ env.TEST_PYTHON == 'true' }}; then - gh run download \ - "${LATEST_PRIOR_RUN_ID}" \ - -p cuda-python-wheel \ - -R NVIDIA/cuda-python - ls -al cuda-python-wheel - mv cuda-python-wheel/*.whl . - rmdir cuda-python-wheel - fi - - name: Display structure of downloaded cuda-python artifacts if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE != 'published' }} run: | @@ -294,7 +257,7 @@ jobs: if: ${{ env.TEST_CORE == 'true' && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests + name: ${{ env.CUDA_CORE_CYTHON_TEST_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} run-id: ${{ inputs.run-id || github.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -393,7 +356,7 @@ jobs: run: run-tests core - name: Ensure cuda-python installable - if: ${{ inputs.test-mode == 'standard' && env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-mode == 'standard' && env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'local' }} run: | # Package suites install their own dependencies. A metapackage-only # run has no preceding suite, so install the exact local internal diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 3da9c180dd2..c6b7b0ba4a2 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -16,6 +16,9 @@ on: build-ctk-ver: type: string required: true + prev-build-ctk-ver: + type: string + required: true matrix_filter: type: string default: "." @@ -48,12 +51,15 @@ on: jobs: compute-matrix: + if: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13 }} runs-on: ubuntu-latest defaults: run: shell: bash --noprofile --norc -xeuo pipefail {0} env: BUILD_TYPE: ${{ inputs.build-type }} + TEST_CU12: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 }} + TEST_CU13: ${{ inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13 }} ARCH: ${{ (inputs.host-platform == 'win-64' && 'amd64') }} outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} @@ -83,7 +89,14 @@ jobs: # 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') + MATRIX=$(echo "$TEST_MATRIX" | jq -c \ + --argjson test_cu12 "${TEST_CU12}" \ + --argjson test_cu13 "${TEST_CU13}" \ + '${{ inputs.matrix_filter }} + | map(select((((.CUDA_VER | split(".")[0]) == "12") and $test_cu12) + or (((.CUDA_VER | split(".")[0]) == "13") and $test_cu13))) + | map(. + {RUNNER_DRIVER: (if .DRIVER == "latest" or .DRIVER == "earliest" then .DRIVER else "latest" end)}) + | if (. | length) > 0 then {include: .} else "Error: Empty matrix after CUDA-major workplan filtering\n" | halt_error(1) end') echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" @@ -100,7 +113,8 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} - if: ${{ github.repository_owner == 'nvidia' && !cancelled() }} + if: ${{ github.repository_owner == 'nvidia' && !cancelled() && + (inputs.workplan == '' || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu12 || fromJSON(inputs.workplan).jobs.test_cuda_majors.cu13) }} # 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 }}" @@ -143,6 +157,7 @@ jobs: - name: Set environment variables env: BUILD_CUDA_VER: ${{ inputs.build-ctk-ver }} + PREV_BUILD_CUDA_VER: ${{ inputs.prev-build-ctk-ver }} CUDA_VER: ${{ matrix.CUDA_VER }} HOST_PLATFORM: ${{ inputs.host-platform }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} @@ -160,7 +175,8 @@ jobs: run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" - name: Download cuda-pathfinder build artifacts - if: ${{ env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true' }} + if: ${{ (env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && + (inputs.workplan == '' || fromJSON(inputs.workplan).modules.pathfinder.needs_build || fromJSON(inputs.workplan).baseline.run_id != '') }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -169,17 +185,17 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'local' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: cuda-python-wheel + name: ${{ env.CUDA_PYTHON_ARTIFACT_NAME }} path: . run-id: ${{ inputs.run-id || github.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts if: ${{ (env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && - env.BINDINGS_SOURCE == 'main' }} + env.BINDINGS_SOURCE == 'local' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} @@ -187,46 +203,6 @@ jobs: 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.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') && - 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_ARTIFACT_PATTERN="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}-*[0-9a-f]" - LOOKUP_ARGS=( - --branch "${OLD_BRANCH}" - --artifact "${OLD_ARTIFACT_PATTERN}" - ) - if ${{ env.TEST_PYTHON == 'true' }}; then - LOOKUP_ARGS+=(--artifact cuda-python-wheel) - fi - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id \ - "${LOOKUP_ARGS[@]}" NVIDIA/cuda-python "CI") - - gh run download \ - "${LATEST_PRIOR_RUN_ID}" \ - -p "${OLD_ARTIFACT_PATTERN}" \ - -R NVIDIA/cuda-python - OLD_ARTIFACT_DIR=$(compgen -G "${OLD_ARTIFACT_PATTERN}") - test -d "${OLD_ARTIFACT_DIR}" - ls -al "${OLD_ARTIFACT_DIR}" - mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" - mv "${OLD_ARTIFACT_DIR}"/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/ - rmdir "${OLD_ARTIFACT_DIR}" - - if ${{ env.TEST_PYTHON == 'true' }}; then - gh run download \ - "${LATEST_PRIOR_RUN_ID}" \ - -p cuda-python-wheel \ - -R NVIDIA/cuda-python - ls -al cuda-python-wheel - mv cuda-python-wheel/*.whl . - rmdir cuda-python-wheel - fi - - name: Display structure of downloaded cuda-python artifacts if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE != 'published' }} run: | @@ -274,7 +250,7 @@ jobs: if: ${{ env.TEST_CORE == 'true' && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests + name: ${{ env.CUDA_CORE_CYTHON_TEST_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} run-id: ${{ inputs.run-id || github.run_id }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -363,7 +339,7 @@ jobs: run: run-tests core - name: Ensure cuda-python installable - if: ${{ inputs.test-mode == 'standard' && env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-mode == 'standard' && env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'local' }} run: | # Package suites install their own dependencies. A metapackage-only # run has no preceding suite, so install the exact local internal diff --git a/.gitignore b/.gitignore index 6b6a7dfc0b5..e09ca429ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,25 @@ cuda_bindings/cuda/bindings/_internal/runtime.pyx cuda_bindings/cuda/bindings/_internal/runtime_ptds.pyx cuda_bindings/cuda/bindings/utils/_get_handle.pyx +# CUDA 12 bindings source generation +cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd +cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx +cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd +cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx +cuda_bindings_12/cuda/bindings/_internal/cufile.pyx +cuda_bindings_12/cuda/bindings/_internal/driver.pyx +cuda_bindings_12/cuda/bindings/_internal/nvfatbin.pyx +cuda_bindings_12/cuda/bindings/_internal/nvjitlink.pyx +cuda_bindings_12/cuda/bindings/_internal/nvml.pyx +cuda_bindings_12/cuda/bindings/_internal/nvrtc.pyx +cuda_bindings_12/cuda/bindings/_internal/nvvm.pyx +cuda_bindings_12/cuda/bindings/cyruntime.pxd +cuda_bindings_12/cuda/bindings/cyruntime.pyx +cuda_bindings_12/cuda/bindings/cyruntime_functions.pxi +cuda_bindings_12/cuda/bindings/cyruntime_types.pxi +cuda_bindings_12/cuda/bindings/runtime.pxd +cuda_bindings_12/cuda/bindings/runtime.pyx + # Version files from setuptools_scm _version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62220467b71..436596f825a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: hooks: - id: ruff-check args: [--fix, --show-fixes] - exclude: (^cuda_bindings/cuda/bindings/_internal/_fast_enum\.py$)|(.*\.pyi$) + exclude: (^cuda_bindings(?:_12)?/cuda/bindings/_internal/_fast_enum\.py$)|(.*\.pyi$) - id: ruff-format exclude: .*\.pyi$ @@ -55,7 +55,7 @@ repos: name: Check generated-file seals entry: python ./toolshed/check_generated_file_seals.py language: python - files: ^cuda_bindings/ + files: ^cuda_bindings(?:_12)?/ types: [text] - id: check-pixi-cuda-version @@ -80,6 +80,9 @@ repos: - "_" # fake script name, because bash considers $0 (the first argument) to be the script name language: system files: '^.*/docs/source/.*\.md$' + # The imported CUDA 12.9 documentation retains its historical MyST + # sources; new documentation elsewhere must continue to use reST. + exclude: '^cuda_bindings_12/docs/source/' - id: stubgen-pyx-cuda-core name: Generate .pyi stubs for cuda_core @@ -108,7 +111,7 @@ repos: rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0 hooks: - id: check-added-large-files - exclude: cuda_bindings/cuda/bindings/nvml.pyx + exclude: '^(?:cuda_bindings(?:_12)?/cuda/bindings/(?:driver\.pyx|runtime\.pyx\.in|nvml\.pyx)|cuda_bindings_12/pixi\.lock)$' - id: check-case-conflict - id: check-docstring-first - id: check-merge-conflict @@ -117,14 +120,14 @@ repos: - id: check-yaml - id: debug-statements - id: end-of-file-fixer - exclude: &gen_exclude '^(?:cuda_python/README\.md|(?:.*/)?CLAUDE\.md|(?:.*/)?\.git_archival\.txt|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?|.*\.pyi)$' + exclude: &gen_exclude '^(?:cuda_python/README\.md|(?:.*/)?CLAUDE\.md|(?:.*/)?\.git_archival\.txt|cuda_bindings(?:_12)?/cuda/bindings/.*\.in?|cuda_bindings(?:_12)?/docs/source/module/.*\.rst?|.*\.pyi)$' - id: mixed-line-ending - id: trailing-whitespace exclude: | (?x)^(?: cuda_python/README\.md| - cuda_bindings/cuda/bindings/.*\.in?| - cuda_bindings/docs/source/module/.*\.rst?| + cuda_bindings(?:_12)?/cuda/bindings/.*\.in?| + cuda_bindings(?:_12)?/docs/source/module/.*\.rst?| .*\.patch$ )$ @@ -166,7 +169,7 @@ repos: hooks: - id: cython-lint args: [--no-pycodestyle] - exclude: ^cuda_bindings/ + exclude: ^cuda_bindings(?:_12)?/ default_language_version: diff --git a/AGENTS.md b/AGENTS.md index 05f4d9b780d..ae820a5445c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,6 +9,7 @@ guide for package-specific conventions and workflows. - `cuda_pathfinder/`: Pure-Python library discovery and loading utilities. - `cuda_bindings/`: Low-level CUDA host API bindings (Cython-heavy). +- `cuda_bindings_12/`: CUDA 12.9-compatible low-level bindings release line. - `cuda_core/`: High-level Pythonic CUDA APIs built on top of bindings. - `cuda_python/`: Metapackage and docs aggregation. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7474ac4d840..2674ea9d1c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -275,7 +275,7 @@ flowchart TD B2["linux-aarch64
(Self-hosted)"] B3["win-64
(GitHub-hosted)"] end - BUILD_DETAILS["• Python versions: 3.10, 3.11, 3.12, 3.13, 3.14
• CUDA version: 13.0.0 (build-time)
• Components: cuda-core, cuda-bindings,
cuda-pathfinder, cuda-python"] + BUILD_DETAILS["• Python versions: 3.10, 3.11, 3.12, 3.13, 3.14
• CUDA build lines: configured 12.9 and 13.x
• Components: cuda-core, cuda-bindings 12/13,
cuda-pathfinder, cuda-python"] end %% Artifact Storage @@ -296,7 +296,7 @@ flowchart TD TS3["win-64
(GitHub-hosted)"] end TEST_DETAILS["• Download wheels from artifacts
• Test against multiple CUDA runtime versions
• Run Python unit tests, Cython tests, examples"] - ARTIFACT_FLOWS["Artifact Flows:
• cuda-pathfinder: main → backport
• cuda-bindings: backport → main"] + ARTIFACT_FLOWS["Artifact Flows:
• cuda_bindings_12 → CUDA 12 tests
• cuda_bindings → CUDA 13 tests"] end %% Release Pipeline @@ -344,20 +344,19 @@ flowchart TD - **Build Stage**: Different architectures/operating systems (linux-64, linux-aarch64, win-64) are built in parallel across their respective runners - **Test Stage**: Different architectures/operating systems/CUDA versions are tested in parallel; documentation preview is also built in parallel with testing -### Branch-specific Artifact Flow +### CUDA-major Artifact Flow #### Main Branch - **Build** → **Test** → **Documentation** → **Potential Release** -- Artifacts stored as `{component}-python{version}-{platform}-{sha}` -- Full test coverage across all platforms and CUDA versions -- **Artifact flow out**: `cuda-pathfinder` artifacts → backport branches - -#### Backport Branches -- **Build** → **Test** → **Backport PR Creation** -- Artifacts used for validation before creating backport pull requests -- Maintains compatibility with older CUDA versions -- **Artifact flow in**: `cuda-pathfinder` artifacts ← main branch -- **Artifact flow out**: older `cuda-bindings` artifacts → main branch +- CUDA 12.9 bindings are maintained in `cuda_bindings_12/`; CUDA 13 bindings are maintained in `cuda_bindings/` +- The conditional workplan builds the changed bindings line and reuses the unaffected line's baseline artifacts +- Artifacts include their Python version, CUDA Toolkit version, platform, and source SHA where applicable +- Shared dependency changes and scheduled runs cover both CUDA majors across all supported platforms + +#### Legacy 12.9.x Branch +- The branch remains available for legacy compatibility and exceptional manual backports +- Routine CUDA 12.9 builds, tests, documentation, and releases use `cuda_bindings_12/` on `main` +- Main CI and releases do not fetch package artifacts from the legacy branch ### Key Infrastructure Details diff --git a/benchmarks/cuda_bindings/runner/runtime.py b/benchmarks/cuda_bindings/runner/runtime.py index 153d92f259d..7e3ba127ff3 100644 --- a/benchmarks/cuda_bindings/runner/runtime.py +++ b/benchmarks/cuda_bindings/runner/runtime.py @@ -30,7 +30,10 @@ def ensure_context() -> int: assert_drv(err) _device = device - err, ctx = cuda.cuCtxCreate(None, 0, device) + if cuda.CUDA_VERSION < 13000: + err, ctx = cuda.cuCtxCreate(0, device) + else: + err, ctx = cuda.cuCtxCreate(None, 0, device) assert_drv(err) _ctx = ctx return ctx diff --git a/ci/ci-pipeline.svg b/ci/ci-pipeline.svg index eeff4c69fd1..995703da52f 100644 --- a/ci/ci-pipeline.svg +++ b/ci/ci-pipeline.svg @@ -1,5 +1,5 @@ - + @@ -130,8 +130,8 @@ • Test against multiple CUDA runtime versions • Run Python unit tests, Cython tests, examples Artifact Flows: - • cuda-pathfinder: main → backport - • cuda-bindings: backport → main + • cuda_bindings_12 → CUDA 12 tests + • cuda_bindings → CUDA 13 tests diff --git a/ci/tools/check_release_notes.py b/ci/tools/check_release_notes.py index 1c99ddb019a..3acc17a21a5 100644 --- a/ci/tools/check_release_notes.py +++ b/ci/tools/check_release_notes.py @@ -15,7 +15,6 @@ from __future__ import annotations import argparse -import os import re import sys from pathlib import Path @@ -40,11 +39,6 @@ "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. @@ -63,28 +57,6 @@ def is_post_release(version: str) -> bool: return ".post" in version -def load_backport_branch(repo_root: Path = Path(".")) -> str | None: - path = 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) -> Path: return Path(package, "docs", "source", "release", f"{version}-notes.rst") @@ -108,7 +80,10 @@ def check_release_notes(git_tag: str, component: str, repo_root: Path = Path("." if is_post_release(version): return [] - path = notes_path(COMPONENT_TO_PACKAGE[component], version) + package = COMPONENT_TO_PACKAGE[component] + if component == "cuda-bindings" and version.startswith("12.9."): + package = "cuda_bindings_12" + path = notes_path(package, version) full = repo_root / path if not full.is_file(): return [(path, "missing")] @@ -117,101 +92,11 @@ def check_release_notes(git_tag: str, component: str, repo_root: Path = Path("." 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 | Path, 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: Path, -) -> tuple[int | None, list[tuple[str | Path, 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=Path("."), type=Path) - 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) @@ -226,24 +111,7 @@ def main(argv: list[str] | None = None) -> int: 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) + 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}.") diff --git a/ci/tools/compute_ci_plan.py b/ci/tools/compute_ci_plan.py index 9f94c67173d..bbcd792e6b0 100644 --- a/ci/tools/compute_ci_plan.py +++ b/ci/tools/compute_ci_plan.py @@ -10,24 +10,76 @@ import argparse import json +import re import subprocess from pathlib import Path, PurePosixPath REPO_ROOT = Path(__file__).resolve().parents[2] MODULES = ("pathfinder", "bindings", "core", "python") +VARIANT_MODULES = ("bindings", "core", "python") +CUDA_VARIANTS = ("cu12", "cu13") PLATFORMS = ("linux", "windows") -PACKAGE_MODULES = {f"cuda_{module}": module for module in MODULES} +PACKAGE_TARGETS = { + "cuda_pathfinder": ("pathfinder", None), + "cuda_bindings_12": ("bindings", "cu12"), + "cuda_bindings": ("bindings", "cu13"), + "cuda_core": ("core", None), + "cuda_python": ("python", None), +} +ALL_TARGETS = frozenset( + {("pathfinder", None), *((module, variant) for module in VARIANT_MODULES for variant in CUDA_VARIANTS)} +) # Source changes have different build and test consumers. In particular, # cuda-python source needs a same-version bindings wheel, while a core-only # change can reuse the baseline cuda-python wheel. SOURCE_IMPACT = { - "pathfinder": (set(MODULES), set(MODULES)), - "bindings": ({"bindings", "core", "python"}, {"bindings", "core", "python"}), - "core": ({"core"}, {"core", "python"}), - "python": ({"bindings", "python"}, {"python"}), + ("pathfinder", None): (ALL_TARGETS, ALL_TARGETS), + ("bindings", "cu12"): ( + frozenset( + { + ("bindings", "cu12"), + ("core", "cu12"), + ("core", "cu13"), + ("python", "cu12"), + } + ), + frozenset({("bindings", "cu12"), ("core", "cu12"), ("python", "cu12")}), + ), + ("bindings", "cu13"): ( + frozenset( + { + ("bindings", "cu13"), + ("core", "cu12"), + ("core", "cu13"), + ("python", "cu13"), + } + ), + frozenset({("bindings", "cu13"), ("core", "cu13"), ("python", "cu13")}), + ), + ("core", None): ( + frozenset({("core", variant) for variant in CUDA_VARIANTS}), + frozenset({(module, variant) for module in ("core", "python") for variant in CUDA_VARIANTS}), + ), + ("python", None): ( + frozenset({(module, variant) for module in ("bindings", "python") for variant in CUDA_VARIANTS}), + frozenset({("python", variant) for variant in CUDA_VARIANTS}), + ), +} + +SOURCE_SDIST_VARIANTS = { + ("pathfinder", None): frozenset(CUDA_VARIANTS), + ("bindings", "cu12"): frozenset({"cu12"}), + ("bindings", "cu13"): frozenset({"cu13"}), + ("core", None): frozenset(CUDA_VARIANTS), + ("python", None): frozenset(CUDA_VARIANTS), } +RELEASE_TAG_VARIANTS = ( + (re.compile(r"^v12\.9\.\d+$"), "cu12"), + (re.compile(r"^v13\.\d+\.\d+(?:[ab]\d+)?$"), "cu13"), +) + IGNORED_BASENAMES = {"AGENTS.md", "CLAUDE.md", "pixi.lock", "pixi.toml"} IGNORED_SUFFIXES = {".md", ".svg"} IGNORED_PATHS = { @@ -60,15 +112,22 @@ def compute_workplan( merge_base: str, baseline_run_id: str, linked_paths: set[str] | None = None, + release_tag: str = "", ) -> dict[str, object]: """Return the final CI decisions for the supplied changed paths.""" linked_paths = linked_paths or set() - source_changes: set[str] = set() - test_changes: set[str] = set() + source_changes: set[tuple[str, str | None]] = set() + test_changes: set[tuple[str, str | None]] = set() test_platforms: set[str] = set() - force_all = not merge_base or not baseline_run_id + release_variant = next( + (variant for pattern, variant in RELEASE_TAG_VARIANTS if pattern.fullmatch(release_tag)), + None, + ) + force_all = (bool(release_tag) and release_variant is None) or ( + release_variant is None and (not merge_base or not baseline_run_id) + ) - if not force_all: + if release_variant is None and not force_all: for path in paths: path_parts = PurePosixPath(path).parts if not path_parts: @@ -87,8 +146,9 @@ def compute_workplan( if path_parts[0] == ".github" or path_parts[-1] in IGNORED_BASENAMES: continue - module = PACKAGE_MODULES.get(path_parts[0]) - if module is not None and len(path_parts) > 1: + target = PACKAGE_TARGETS.get(path_parts[0]) + if target is not None and len(path_parts) > 1: + module, variant = target relative = path_parts[1:] if relative[0] == "docs": continue @@ -97,16 +157,19 @@ def compute_workplan( or relative[0] == "examples" or (module == "core" and relative == ("pytest.ini",)) ): - test_changes.add(module) + if variant is None and module in VARIANT_MODULES: + test_changes.update((module, cuda_variant) for cuda_variant in CUDA_VARIANTS) + else: + test_changes.add(target) elif PurePosixPath(path).suffix in IGNORED_SUFFIXES and path not in linked_paths: continue else: - source_changes.add(module) + source_changes.add(target) continue is_test_path = any(part in {"test", "tests"} for part in path_parts[:-1]) if is_test_path: - test_changes.update(MODULES) + test_changes.update(ALL_TARGETS) elif ( path in IGNORED_PATHS or PurePosixPath(path).suffix in IGNORED_SUFFIXES @@ -114,31 +177,58 @@ def compute_workplan( ): continue elif path_parts[0] in {"benchmarks", "cuda_python_test_helpers"}: - test_changes.update(MODULES) + test_changes.update(ALL_TARGETS) else: force_all = True break - if force_all: - builds = set(MODULES) - tests = set(MODULES) + if release_variant is not None: + builds = {("bindings", release_variant), ("python", release_variant)} + tests = set(builds) test_platforms = set(PLATFORMS) + sdist_cuda_variants = {release_variant} + elif force_all: + builds = set(ALL_TARGETS) + tests = set(ALL_TARGETS) + test_platforms = set(PLATFORMS) + sdist_cuda_variants = set(CUDA_VARIANTS) else: - builds: set[str] = set() - tests = set(MODULES) if test_platforms else set(test_changes) - for module in source_changes: - build_impact, test_impact = SOURCE_IMPACT[module] + builds: set[tuple[str, str | None]] = set() + tests = set(ALL_TARGETS) if test_platforms else set(test_changes) + sdist_cuda_variants: set[str] = set() + for target in source_changes: + build_impact, test_impact = SOURCE_IMPACT[target] builds.update(build_impact) tests.update(test_impact) + sdist_cuda_variants.update(SOURCE_SDIST_VARIANTS[target]) if source_changes or test_changes: test_platforms.update(PLATFORMS) - modules = { - module: { - "needs_build": module in builds, - "needs_test": module in tests, + modules: dict[str, dict[str, object]] = { + "pathfinder": { + "needs_build": ("pathfinder", None) in builds, + "needs_test": ("pathfinder", None) in tests, + } + } + for module in VARIANT_MODULES: + variants = { + variant: { + "needs_build": (module, variant) in builds, + "needs_test": (module, variant) in tests, + } + for variant in CUDA_VARIANTS } - for module in MODULES + modules[module] = { + "needs_build": any(decision["needs_build"] for decision in variants.values()), + "needs_test": any(decision["needs_test"] for decision in variants.values()), + "variants": variants, + } + + test_cuda_variants = { + variant + for variant in CUDA_VARIANTS + if modules["pathfinder"]["needs_test"] + or any(modules[module]["variants"][variant]["needs_test"] for module in VARIANT_MODULES) } return { "modules": modules, @@ -146,12 +236,14 @@ def compute_workplan( # These gates cover both optional artifact builds and wheel tests. "platforms": {platform: platform in test_platforms for platform in PLATFORMS}, "sdist_tests": bool(builds), - "core_api_checks": force_all or "core" in source_changes, + "core_api_checks": force_all or ("core", None) in source_changes, + "test_cuda_majors": {variant: variant in test_cuda_variants for variant in CUDA_VARIANTS}, + "sdist_cuda_majors": {variant: variant in sdist_cuda_variants for variant in CUDA_VARIANTS}, }, "merge_base": merge_base, "baseline": { - "run_id": baseline_run_id if not force_all else "", - "sha": merge_base if not force_all else "", + "run_id": baseline_run_id if release_variant is None and not force_all else "", + "sha": merge_base if release_variant is None and not force_all else "", }, } @@ -196,15 +288,17 @@ def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--merge-base", default="") parser.add_argument("--baseline-run-id", default="") + parser.add_argument("--release-tag", default="") args = parser.parse_args() - reusable_baseline = bool(args.merge_base and args.baseline_run_id) + reusable_baseline = bool(args.merge_base and args.baseline_run_id and not args.release_tag) paths, linked_paths = _changed_paths(args.merge_base) if reusable_baseline else ([], set()) plan = compute_workplan( paths, merge_base=args.merge_base, baseline_run_id=args.baseline_run_id, linked_paths=linked_paths, + release_tag=args.release_tag, ) print(json.dumps(plan, separators=(",", ":"), sort_keys=True)) diff --git a/ci/tools/download-wheels b/ci/tools/download-wheels index 20f31fb73d5..3869207c64d 100755 --- a/ci/tools/download-wheels +++ b/ci/tools/download-wheels @@ -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 @@ -11,11 +11,12 @@ set -euo pipefail # Check required arguments if [[ $# -lt 3 ]]; then - echo "Usage: $0 [output-dir]" >&2 + echo "Usage: $0 [output-dir] [git-tag]" >&2 echo " run-id: The GitHub Actions run ID containing the artifacts" >&2 echo " component: The component name pattern to download (e.g., cuda-core, cuda-bindings)" >&2 echo " repository: The GitHub repository (e.g., NVIDIA/cuda-python)" >&2 echo " output-dir: Optional output directory (default: ./dist)" >&2 + echo " git-tag: Optional release tag used to select CUDA 12 or 13 artifacts" >&2 exit 1 fi @@ -23,6 +24,7 @@ RUN_ID="$1" COMPONENT="$2" REPOSITORY="$3" OUTPUT_DIR="${4:-./dist}" +GIT_TAG="${5:-}" # Ensure we have a GitHub token if [[ -z "${GH_TOKEN:-}" ]]; then @@ -37,7 +39,11 @@ if [[ "$COMPONENT" == "all" ]]; then # Download all component patterns gh run download "$RUN_ID" -p "cuda-*" -R "$REPOSITORY" else - gh run download "$RUN_ID" -p "${COMPONENT}*" -R "$REPOSITORY" + ARTIFACT_PATTERN="${COMPONENT}*" + if [[ "$COMPONENT" =~ ^cuda-(bindings|python)$ && "$GIT_TAG" =~ ^v(12|13)\. ]]; then + ARTIFACT_PATTERN="${COMPONENT}*cuda${BASH_REMATCH[1]}.*" + fi + gh run download "$RUN_ID" -p "$ARTIFACT_PATTERN" -R "$REPOSITORY" fi # Create output directory diff --git a/ci/tools/env-vars b/ci/tools/env-vars index 8ffbfa13472..e766b43df7b 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -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 @@ -29,9 +29,10 @@ fi echo "${TOOLS_PATH}" >> $GITHUB_PATH echo "CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${HOST_PLATFORM}" +CUDA_CORE_ARTIFACT_NAME="${CUDA_CORE_ARTIFACT_BASENAME}-${SHA}" { echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" - echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${SHA}" + echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_NAME}" 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")" @@ -42,49 +43,92 @@ if [[ "${1}" == "build" ]]; then # platform is handled by the default value of platform (`auto`) in cibuildwheel # here we only need to specify the python version we want echo "CIBW_BUILD=cp${PYTHON_VERSION_FORMATTED}-*" >> $GITHUB_ENV - BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})" - echo "BUILD_CUDA_MAJOR=${BUILD_CUDA_MAJOR}" >> $GITHUB_ENV - echo "BUILD_PREV_CUDA_MAJOR=$((${BUILD_CUDA_MAJOR} - 1))" >> $GITHUB_ENV - CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${CUDA_VER}-${HOST_PLATFORM}" + : "${PREV_CUDA_VER:?PREV_CUDA_VER must identify the CUDA 12 build line}" + BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< "${CUDA_VER}")" + BUILD_PREV_CUDA_MAJOR="$(cut -d '.' -f 1 <<< "${PREV_CUDA_VER}")" + if [[ "${BUILD_CUDA_MAJOR}" != "13" || "${BUILD_PREV_CUDA_MAJOR}" != "12" ]]; then + echo "Error: expected CUDA 13 current and CUDA 12 previous build versions, got ${CUDA_VER} and ${PREV_CUDA_VER}" >&2 + exit 1 + fi + + CUDA_BINDINGS_CU13_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${CUDA_VER}-${HOST_PLATFORM}" + CUDA_BINDINGS_CU12_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${PREV_CUDA_VER}-${HOST_PLATFORM}" + CUDA_BINDINGS_ARTIFACT_BASENAME="${CUDA_BINDINGS_CU13_ARTIFACT_BASENAME}" + CUDA_BINDINGS_ARTIFACTS_DIR="$(realpath "${REPO_DIR}/cuda_bindings/dist")" + CUDA_BINDINGS_CYTHON_TESTS_DIR="$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" + CUDA12_SCM_VERSION="" + CUDA12_SCM_ENV="" + if [[ "${GITHUB_REF_TYPE:-}" != "tag" || "${GITHUB_REF_NAME:-}" != v12.9.* ]]; then + CUDA12_SCM_VERSION="12.9.8.dev0+g${SHA:0:7}" + CUDA12_SCM_ENV="SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_BINDINGS=${CUDA12_SCM_VERSION}" + fi + + { + echo "BUILD_CUDA_MAJOR=${BUILD_CUDA_MAJOR}" + echo "BUILD_PREV_CUDA_MAJOR=${BUILD_PREV_CUDA_MAJOR}" + echo "CUDA12_SCM_VERSION=${CUDA12_SCM_VERSION}" + echo "CUDA12_SCM_ENV=${CUDA12_SCM_ENV}" + echo "CUDA_BINDINGS_CU13_ARTIFACT_BASENAME=${CUDA_BINDINGS_CU13_ARTIFACT_BASENAME}" + echo "CUDA_BINDINGS_CU13_ARTIFACT_NAME=${CUDA_BINDINGS_CU13_ARTIFACT_BASENAME}-${SHA}" + echo "CUDA_BINDINGS_CU13_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" + echo "CUDA_BINDINGS_CU13_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" + echo "CUDA_BINDINGS_CU12_ARTIFACT_BASENAME=${CUDA_BINDINGS_CU12_ARTIFACT_BASENAME}" + echo "CUDA_BINDINGS_CU12_ARTIFACT_NAME=${CUDA_BINDINGS_CU12_ARTIFACT_BASENAME}-${SHA}" + echo "CUDA_BINDINGS_CU12_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings_12/dist")" + echo "CUDA_BINDINGS_CU12_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings_12/tests/cython")" + echo "CUDA_PYTHON_CU12_ARTIFACT_NAME=cuda-python-wheel-cuda${PREV_CUDA_VER}" + echo "CUDA_PYTHON_CU13_ARTIFACT_NAME=cuda-python-wheel-cuda${CUDA_VER}" + } >> $GITHUB_ENV # Enforce an explicit cache dir so that we can reuse this path later echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=1G" >> $GITHUB_ENV 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}" + : "${PREV_BUILD_CUDA_VER:?PREV_BUILD_CUDA_VER must identify the CUDA 12 build line}" + BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< "${BUILD_CUDA_VER}")" + PREV_BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< "${PREV_BUILD_CUDA_VER}")" + TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< "${CUDA_VER}")" # 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 + # local — use the matching CUDA 12 or 13 wheel from this CI run # 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. + if [[ "${CUDA_VER}" == "${BUILD_CUDA_VER}" ]]; then + BINDINGS_SOURCE=local + BINDINGS_BUILD_CUDA_VER="${BUILD_CUDA_VER}" + CUDA_BINDINGS_ROOT="cuda_bindings" + elif [[ "${CUDA_VER}" == "${PREV_BUILD_CUDA_VER}" ]]; then + BINDINGS_SOURCE=local + BINDINGS_BUILD_CUDA_VER="${PREV_BUILD_CUDA_VER}" + CUDA_BINDINGS_ROOT="cuda_bindings_12" + else + # Older minors use published bindings to exercise the supported + # backward-compatibility path. BINDINGS_SOURCE=published SKIP_CUDA_BINDINGS_TEST=1 SKIP_CYTHON_TEST=1 - else - # Exact match: use the just-built bindings wheel. - BINDINGS_SOURCE=main + fi + + if [[ "${BINDINGS_SOURCE}" == "local" ]]; then if [[ "${SKIP_BINDINGS_TEST_OVERRIDE:-0}" == "1" ]]; then SKIP_CUDA_BINDINGS_TEST=1 else SKIP_CUDA_BINDINGS_TEST=0 fi SKIP_CYTHON_TEST=0 + CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BINDINGS_BUILD_CUDA_VER}-${HOST_PLATFORM}" + CUDA_BINDINGS_ARTIFACTS_DIR="$(realpath "${REPO_DIR}/${CUDA_BINDINGS_ROOT}/dist")" + CUDA_BINDINGS_CYTHON_TESTS_DIR="$(realpath "${REPO_DIR}/${CUDA_BINDINGS_ROOT}/tests/cython")" + else + # These are unused for published bindings, but deterministic paths make + # environment dumps and ad-hoc invocations easier to understand. + CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CUDA_VER}-${HOST_PLATFORM}" + CUDA_BINDINGS_ARTIFACTS_DIR="$(realpath "${REPO_DIR}/cuda_bindings/dist")" + CUDA_BINDINGS_CYTHON_TESTS_DIR="$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" 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 @@ -99,6 +143,8 @@ elif [[ "${1}" == "test" ]]; then { echo "SETUP_SANITIZER=${SETUP_SANITIZER}" echo "BINDINGS_SOURCE=${BINDINGS_SOURCE}" + echo "CUDA_BINDINGS_ROOT=${CUDA_BINDINGS_ROOT:-cuda_bindings}" + echo "CUDA_PYTHON_ARTIFACT_NAME=cuda-python-wheel-cuda${BINDINGS_BUILD_CUDA_VER:-${CUDA_VER}}" echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" echo "SKIP_CYTHON_TEST=${SKIP_CYTHON_TEST}" echo "TEST_CUDA_MAJOR=${TEST_CUDA_MAJOR}" @@ -109,6 +155,7 @@ fi { echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${SHA}" - echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" - echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" + echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR:-$(realpath "${REPO_DIR}/cuda_bindings/dist")}" + echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=${CUDA_BINDINGS_CYTHON_TESTS_DIR:-$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")}" + echo "CUDA_CORE_CYTHON_TEST_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_NAME}-cu${TEST_CUDA_MAJOR:-${BUILD_CUDA_MAJOR}}-tests" } >> $GITHUB_ENV diff --git a/ci/tools/lookup-run-id b/ci/tools/lookup-run-id index b177727cde5..57906f6dd33 100755 --- a/ci/tools/lookup-run-id +++ b/ci/tools/lookup-run-id @@ -31,7 +31,7 @@ Options: Examples: $0 --tag v13.0.1 NVIDIA/cuda-python $0 --branch main NVIDIA/cuda-python - $0 --branch 12.9.x --artifact 'cuda-bindings-python313-*' NVIDIA/cuda-python + $0 --branch main --artifact 'cuda-bindings-*-cuda12.*' NVIDIA/cuda-python $0 --branch main --head-sha NVIDIA/cuda-python "CI" EOF exit 1 diff --git a/ci/tools/run-tests b/ci/tools/run-tests index f9cc5a9e870..0c9d0a7bd52 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -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 @@ -26,7 +26,13 @@ test_module=${1} if [[ "${test_module}" != nightly-* ]]; then pushd ./cuda_pathfinder echo "Installing pathfinder wheel" - pip install ./*.whl --group test + pathfinder_wheels=(./*.whl) + if [[ "${#pathfinder_wheels[@]}" -eq 1 && -f "${pathfinder_wheels[0]}" ]]; then + pip install "${pathfinder_wheels[0]}" --group test + else + # Line-specific release-tag runs intentionally omit unrelated artifacts. + pip install cuda-pathfinder --group test + fi popd fi @@ -44,11 +50,22 @@ if [[ "${test_module}" == "pathfinder" ]]; then popd elif [[ "${test_module}" == "bindings" ]]; then echo "Installing bindings wheel" - pushd ./cuda_bindings - if [[ "${LOCAL_CTK}" == 1 ]]; then - pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl --group test + pushd "./${CUDA_BINDINGS_ROOT}" + bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl) + if [[ "${#bindings_wheels[@]}" -ne 1 || ! -f "${bindings_wheels[0]}" ]]; then + echo "Expected exactly one cuda-bindings wheel in ${CUDA_BINDINGS_ARTIFACTS_DIR}" >&2 + exit 1 + fi + if [[ "${CUDA_BINDINGS_ROOT}" == "cuda_bindings_12" ]]; then + if [[ "${LOCAL_CTK}" == 1 ]]; then + pip install "${bindings_wheels[0]}[test]" + else + pip install "${bindings_wheels[0]}[all,test]" + fi + elif [[ "${LOCAL_CTK}" == 1 ]]; then + pip install "${bindings_wheels[0]}" --group test else - pip install $(ls "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)[all] --group test + pip install "${bindings_wheels[0]}[all]" --group test fi echo "Running bindings tests" ${SANITIZER_CMD} pytest -rxXs -v --randomly-dont-reorganize tests/ @@ -67,7 +84,7 @@ elif [[ "${test_module}" == "core" || "${test_module}" == nightly-* ]]; then fi # Resolve bindings based on BINDINGS_SOURCE (set by env-vars): - # main/backport → local wheel from artifacts dir + # local → matching CUDA 12 or 13 wheel from this run # published → install from PyPI by version BINDINGS_ARGS=() if [[ "${BINDINGS_SOURCE}" == "published" ]]; then diff --git a/ci/tools/tests/test_check_release_notes.py b/ci/tools/tests/test_check_release_notes.py index e08eac6610d..2db79622e01 100644 --- a/ci/tools/tests/test_check_release_notes.py +++ b/ci/tools/tests/test_check_release_notes.py @@ -6,11 +6,12 @@ import sys from pathlib import Path +import pytest + sys.path.insert(0, str(Path(__file__).parent.parent)) from check_release_notes import ( check_release_notes, is_post_release, - load_backport_branch, main, parse_version_from_tag, ) @@ -126,24 +127,11 @@ def test_plain_v_tag(self, tmp_path): problems = check_release_notes("v13.1.0", "cuda-python", 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(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(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(tmp_path) is None + @pytest.mark.agent_authored(model="gpt-5.6") + def test_v12_bindings_notes_use_imported_tree(self, tmp_path): + self._make_notes(tmp_path, "cuda_bindings_12", "12.9.8") + problems = check_release_notes("v12.9.8", "cuda-bindings", tmp_path) + assert problems == [] class TestMain: @@ -187,147 +175,3 @@ def test_component_prefix_mismatch_returns_2(self, 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/tests/test_compute_ci_plan.py b/ci/tools/tests/test_compute_ci_plan.py index 79a83394dfa..9aec126aeb7 100644 --- a/ci/tools/tests/test_compute_ci_plan.py +++ b/ci/tools/tests/test_compute_ci_plan.py @@ -12,18 +12,22 @@ ALL_MODULES = {"pathfinder", "bindings", "core", "python"} ALL_PLATFORMS = {"linux", "windows"} +VARIANT_MODULES = {"bindings", "core", "python"} +CUDA_VARIANTS = {"cu12", "cu13"} def plan_for( *paths: str, baseline: bool = True, linked_paths: set[str] | None = None, + release_tag: str = "", ) -> dict[str, object]: return compute_workplan( list(paths), merge_base="base", baseline_run_id="123" if baseline else "", linked_paths=linked_paths, + release_tag=release_tag, ) @@ -42,6 +46,26 @@ def selected_platforms(plan: dict[str, object]) -> set[str]: return {name for name, enabled in platforms.items() if enabled} +def selected_variants(plan: dict[str, object], module: str, key: str) -> set[str]: + modules = plan["modules"] + assert isinstance(modules, dict) + decision = modules[module] + assert isinstance(decision, dict) + variants = decision["variants"] + assert isinstance(variants, dict) + assert set(variants) == CUDA_VARIANTS + return {name for name, variant_decision in variants.items() if variant_decision[key]} + + +def selected_cuda_majors(plan: dict[str, object], key: str) -> set[str]: + jobs = plan["jobs"] + assert isinstance(jobs, dict) + majors = jobs[key] + assert isinstance(majors, dict) + assert set(majors) == CUDA_VARIANTS + return {name for name, enabled in majors.items() if enabled} + + class ComputeWorkplanTest(unittest.TestCase): def test_path_impacts(self) -> None: cases = { @@ -51,11 +75,17 @@ def test_path_impacts(self) -> None: {"bindings", "core", "python"}, False, ), + "cuda_bindings_12/cuda/bindings/driver.pyx": ( + {"bindings", "core", "python"}, + {"bindings", "core", "python"}, + False, + ), "cuda_core/cuda/core/_device.py": ({"core"}, {"core", "python"}, True), "cuda_core/cuda/core/examples/demo.py": ({"core"}, {"core", "python"}, True), "cuda_python/pyproject.toml": ({"bindings", "python"}, {"python"}, False), "cuda_pathfinder/tests/test_loader.py": (set(), {"pathfinder"}, False), "cuda_bindings/examples/0_Introduction/vectorAddDrv.py": (set(), {"bindings"}, False), + "cuda_bindings_12/examples/0_Introduction/vectorAddDrv.py": (set(), {"bindings"}, False), "cuda_bindings/tests/README.md": (set(), {"bindings"}, False), "cuda_core/pytest.ini": (set(), {"core"}, False), "cuda_python/tests/test_import.py": (set(), {"python"}, False), @@ -80,6 +110,112 @@ def test_path_impacts(self) -> None: assert plan["jobs"]["sdist_tests"] == bool(builds) assert plan["jobs"]["core_api_checks"] == core_api + self._check_variant_path_impacts() + + def _check_variant_path_impacts(self) -> None: + all_variant_modules = dict.fromkeys(VARIANT_MODULES, CUDA_VARIANTS) + cases = ( + ( + ("cuda_bindings_12/cuda/bindings/driver.pyx",), + {"bindings": {"cu12"}, "core": CUDA_VARIANTS, "python": {"cu12"}}, + {"bindings": {"cu12"}, "core": {"cu12"}, "python": {"cu12"}}, + {"cu12"}, + {"cu12"}, + ), + ( + ("cuda_bindings/cuda/bindings/driver.pyx",), + {"bindings": {"cu13"}, "core": CUDA_VARIANTS, "python": {"cu13"}}, + {"bindings": {"cu13"}, "core": {"cu13"}, "python": {"cu13"}}, + {"cu13"}, + {"cu13"}, + ), + ( + ("cuda_bindings_12/examples/0_Introduction/vectorAddDrv.py",), + {}, + {"bindings": {"cu12"}}, + {"cu12"}, + set(), + ), + ( + ("cuda_bindings/tests/test_driver.py",), + {}, + {"bindings": {"cu13"}}, + {"cu13"}, + set(), + ), + ( + ("cuda_core/cuda/core/_device.py",), + {"core": CUDA_VARIANTS}, + {"core": CUDA_VARIANTS, "python": CUDA_VARIANTS}, + CUDA_VARIANTS, + CUDA_VARIANTS, + ), + ( + ("cuda_python/pyproject.toml",), + {"bindings": CUDA_VARIANTS, "python": CUDA_VARIANTS}, + {"python": CUDA_VARIANTS}, + CUDA_VARIANTS, + CUDA_VARIANTS, + ), + ( + ("cuda_pathfinder/cuda/pathfinder/_loader.py",), + all_variant_modules, + all_variant_modules, + CUDA_VARIANTS, + CUDA_VARIANTS, + ), + ( + ( + "cuda_bindings_12/cuda/bindings/driver.pyx", + "cuda_bindings/cuda/bindings/runtime.pyx", + ), + all_variant_modules, + all_variant_modules, + CUDA_VARIANTS, + CUDA_VARIANTS, + ), + ) + + for paths, variant_builds, variant_tests, test_majors, sdist_majors in cases: + with self.subTest(paths=paths): + plan = plan_for(*paths) + for module in VARIANT_MODULES: + builds = selected_variants(plan, module, "needs_build") + tests = selected_variants(plan, module, "needs_test") + assert builds == variant_builds.get(module, set()) + assert tests == variant_tests.get(module, set()) + + modules = plan["modules"] + assert isinstance(modules, dict) + decision = modules[module] + assert decision["needs_build"] == bool(builds) + assert decision["needs_test"] == bool(tests) + + assert selected_cuda_majors(plan, "test_cuda_majors") == test_majors + assert selected_cuda_majors(plan, "sdist_cuda_majors") == sdist_majors + + release_tags = ( + ("v12.9.9", "cu12"), + ("v13.5.0", "cu13"), + ("v13.5.0b1", "cu13"), + ) + for release_tag, variant in release_tags: + with self.subTest(release_tag=release_tag): + plan = plan_for(baseline=False, release_tag=release_tag) + assert selected(plan, "needs_build") == {"bindings", "python"} + assert selected(plan, "needs_test") == {"bindings", "python"} + for module in ("bindings", "python"): + assert selected_variants(plan, module, "needs_build") == {variant} + assert selected_variants(plan, module, "needs_test") == {variant} + assert not selected_variants(plan, "core", "needs_build") + assert not selected_variants(plan, "core", "needs_test") + assert selected_cuda_majors(plan, "test_cuda_majors") == {variant} + assert selected_cuda_majors(plan, "sdist_cuda_majors") == {variant} + assert selected_platforms(plan) == ALL_PLATFORMS + assert plan["jobs"]["sdist_tests"] + assert not plan["jobs"]["core_api_checks"] + assert plan["baseline"] == {"run_id": "", "sha": ""} + def test_test_infrastructure_platforms(self) -> None: cases = { ".github/workflows/test-wheel-linux.yml": {"linux"}, @@ -96,9 +232,13 @@ def test_test_infrastructure_platforms(self) -> None: plan = plan_for(path) assert not selected(plan, "needs_build") assert selected(plan, "needs_test") == ALL_MODULES + for module in VARIANT_MODULES: + assert selected_variants(plan, module, "needs_test") == CUDA_VARIANTS assert selected_platforms(plan) == platforms assert not plan["jobs"]["sdist_tests"] assert not plan["jobs"]["core_api_checks"] + assert selected_cuda_majors(plan, "test_cuda_majors") == CUDA_VARIANTS + assert not selected_cuda_majors(plan, "sdist_cuda_majors") mixed_plan = plan_for("ci/tools/install_gpu_driver.sh", "ci/tools/install_gpu_driver.ps1") assert selected_platforms(mixed_plan) == ALL_PLATFORMS @@ -115,6 +255,8 @@ def test_ignored_paths_select_no_work(self) -> None: "benchmarks/cuda_bindings/AGENTS.md", "cuda_core/cuda/core/_cpp/DESIGN.md", "cuda_bindings/README.md", + "cuda_bindings_12/README.md", + "cuda_bindings_12/docs/index.rst", "cuda_core/README.md", "new-area/pixi.toml", "notes.md", @@ -126,7 +268,12 @@ def test_ignored_paths_select_no_work(self) -> None: plan = plan_for(path) assert not selected(plan, "needs_build") assert not selected(plan, "needs_test") + for module in VARIANT_MODULES: + assert not selected_variants(plan, module, "needs_build") + assert not selected_variants(plan, module, "needs_test") assert not selected_platforms(plan) + assert not selected_cuda_majors(plan, "test_cuda_majors") + assert not selected_cuda_majors(plan, "sdist_cuda_majors") def test_unknown_path_and_missing_baseline_force_all(self) -> None: for plan in ( @@ -137,19 +284,35 @@ def test_unknown_path_and_missing_baseline_force_all(self) -> None: plan_for("ci/ci-pipeline.svg"), plan_for("cuda_core/docs/index.rst", baseline=False), compute_workplan([], merge_base="", baseline_run_id="123"), + plan_for(baseline=False, release_tag="cuda-core-v1.3.0"), + plan_for(baseline=False, release_tag="v12.9.9.post1"), + plan_for(baseline=False, release_tag="v13.5.0rc1"), + plan_for(baseline=False, release_tag="v12.8.1"), + plan_for(baseline=False, release_tag="v14.0.0"), ): assert selected(plan, "needs_build") == ALL_MODULES assert selected(plan, "needs_test") == ALL_MODULES + for module in VARIANT_MODULES: + assert selected_variants(plan, module, "needs_build") == CUDA_VARIANTS + assert selected_variants(plan, module, "needs_test") == CUDA_VARIANTS assert selected_platforms(plan) == ALL_PLATFORMS assert plan["jobs"]["core_api_checks"] + assert selected_cuda_majors(plan, "test_cuda_majors") == CUDA_VARIANTS + assert selected_cuda_majors(plan, "sdist_cuda_majors") == CUDA_VARIANTS assert plan["baseline"] == {"run_id": "", "sha": ""} def test_mixed_changes_are_combined(self) -> None: plan = plan_for("cuda_core/tests/test_device.py", "cuda_python/pyproject.toml") assert selected(plan, "needs_build") == {"bindings", "python"} assert selected(plan, "needs_test") == {"core", "python"} + assert selected_variants(plan, "bindings", "needs_build") == CUDA_VARIANTS + assert selected_variants(plan, "python", "needs_build") == CUDA_VARIANTS + assert selected_variants(plan, "core", "needs_test") == CUDA_VARIANTS + assert selected_variants(plan, "python", "needs_test") == CUDA_VARIANTS assert selected_platforms(plan) == ALL_PLATFORMS assert plan["jobs"]["sdist_tests"] + assert selected_cuda_majors(plan, "test_cuda_majors") == CUDA_VARIANTS + assert selected_cuda_majors(plan, "sdist_cuda_majors") == CUDA_VARIANTS assert plan["baseline"] == {"run_id": "123", "sha": "base"} def test_changed_symlink_targets_include_their_consumers(self) -> None: @@ -171,10 +334,16 @@ def test_changed_symlink_targets_include_their_consumers(self) -> None: plan = plan_for(*paths, linked_paths={"cuda_python/README.md"}) assert selected(plan, "needs_build") == {"bindings", "python"} assert selected(plan, "needs_test") == {"python"} + for module in ("bindings", "python"): + assert selected_variants(plan, module, "needs_build") == CUDA_VARIANTS + assert selected_variants(plan, "python", "needs_test") == CUDA_VARIANTS removed_link = plan_for("cuda_python/README.md", linked_paths={"cuda_python/README.md"}) assert selected(removed_link, "needs_build") == {"bindings", "python"} assert selected(removed_link, "needs_test") == {"python"} + for module in ("bindings", "python"): + assert selected_variants(removed_link, module, "needs_build") == CUDA_VARIANTS + assert selected_variants(removed_link, "python", "needs_test") == CUDA_VARIANTS if __name__ == "__main__": diff --git a/ci/versions.yml b/ci/versions.yml index 0f0ab251e50..68b35d9bdaf 100644 --- a/ci/versions.yml +++ b/ci/versions.yml @@ -1,8 +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: Apache-2.0 -backport_branch: "12.9.x" # keep in sync with target-branch in .github/dependabot.yml - cuda: build: version: "13.3.0" diff --git a/cuda_bindings/docs/source/install.rst b/cuda_bindings/docs/source/install.rst index d77464ec91f..44732db9994 100644 --- a/cuda_bindings/docs/source/install.rst +++ b/cuda_bindings/docs/source/install.rst @@ -108,9 +108,9 @@ obtain the most recent build, use the following commands: 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. +with ``linux-aarch64``; for Windows, use ``win-64``. To use the CUDA 12 line, +replace ``cuda13`` with ``cuda12`` in both commands. Both supported CUDA major +lines are published by CI from ``main``. Installing from Source ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 15ee1782eed..5e4794eade6 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -103,5 +103,5 @@ markers = [ root = ".." version_file = "cuda/bindings/_version.py" # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. -tag_regex = "^(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)" -git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"] +tag_regex = "^(?Pv13\\.\\d+\\.\\d+(?:[ab]\\d+)?)" +git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v13.*"] diff --git a/cuda_bindings_12/.git_archival.txt b/cuda_bindings_12/.git_archival.txt new file mode 120000 index 00000000000..d7a42b253d8 --- /dev/null +++ b/cuda_bindings_12/.git_archival.txt @@ -0,0 +1 @@ +../.git_archival.txt \ No newline at end of file diff --git a/cuda_bindings_12/DESCRIPTION.rst b/cuda_bindings_12/DESCRIPTION.rst new file mode 100644 index 00000000000..7330febf035 --- /dev/null +++ b/cuda_bindings_12/DESCRIPTION.rst @@ -0,0 +1,15 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +**************************************** +cuda-bindings: Low-level CUDA interfaces +**************************************** + +`cuda.bindings `_ is a standard set of low-level interfaces, providing full coverage of and 1:1 access to the CUDA host APIs from Python. Checkout the `Overview `_ for the workflow and performance results. + +* `Repository `_ +* `Documentation `_ +* `Examples `_ +* `Issue tracker `_ + +For the installation instruction, please refer to the `Installation `_ page. diff --git a/cuda_bindings_12/LICENSE b/cuda_bindings_12/LICENSE new file mode 100644 index 00000000000..f3fe76ecadf --- /dev/null +++ b/cuda_bindings_12/LICENSE @@ -0,0 +1,203 @@ +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 + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cuda_bindings_12/MANIFEST.in b/cuda_bindings_12/MANIFEST.in new file mode 100644 index 00000000000..d381e04d59e --- /dev/null +++ b/cuda_bindings_12/MANIFEST.in @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +recursive-include cuda/ *.pyx *.pxd *.pxi +# at least with setuptools 75.0.0 this folder was added erroneously +# to the payload, causing file copying to the build environment failed +exclude cuda/bindings cuda?bindings +exclude cuda/bindings/_bindings cuda?bindings?_bindings diff --git a/cuda_bindings_12/README.md b/cuda_bindings_12/README.md new file mode 100644 index 00000000000..a0657706d06 --- /dev/null +++ b/cuda_bindings_12/README.md @@ -0,0 +1,67 @@ +# `cuda.bindings`: Low-level CUDA interfaces + +`cuda.bindings` is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. Checkout the [Overview page](https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html) for the workflow and performance results. + +## Installing + +Please refer to the [Installation page](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html) for instructions and required/optional dependencies. + +## Developing + +This subpackage adheres to the developing practices described in the parent metapackage [CONTRIBUTING.md](https://github.com/NVIDIA/cuda-python/blob/main/CONTRIBUTING.md). + +## Testing + +Testing dependencies can be installed using the `[test]` optional dependency identifier. For example, `pip install -v -e .[test]`. + +Multiple testing options are available: + +* Python Unit Tests +* Cython Unit Tests +* Samples +* Benchmark + +### Python Unit Tests + +Responsible for validating different binding usage patterns. Unit test `test_kernelParams.py` is particularly special since it demonstrates various approaches in setting up kernel launch parameters. + +To run these tests: +* `python -m pytest tests/` against editable installations +* `pytest tests/` against installed packages + +### Cython Unit Tests + +Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [Installing from Source](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them: + +1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation. +2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them. + +To run these tests: +* `python -m pytest tests/cython/` against editable installations +* `pytest tests/cython/` against installed packages + +### Samples + +Various [CUDA Samples](https://github.com/NVIDIA/cuda-samples/tree/master) that were rewritten using CUDA Python are located in `examples`. + +In addition, extra examples are included: + +* `examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and + launch a kernel on the device. Includes device memory allocation / + deallocation, transfers between host and device, creation and usage of + streams, and context management. +* `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management + plugin, showing that this CUDA Python Driver API can coexist with other + wrappers of the driver API. + +To run these samples: +* `python -m pytest tests/cython/` against editable installations +* `pytest tests/cython/` against installed packages + +### Benchmark + +Allows for analyzing binding performance using plugin [pytest-benchmark](https://github.com/ionelmc/pytest-benchmark). + +To run these benchmarks: +* `python -m pytest --benchmark-only benchmarks/` against editable installations +* `pytest --benchmark-only benchmarks/` against installed packages diff --git a/cuda_bindings_12/benchmarks/conftest.py b/cuda_bindings_12/benchmarks/conftest.py new file mode 100644 index 00000000000..0719dca47b8 --- /dev/null +++ b/cuda_bindings_12/benchmarks/conftest.py @@ -0,0 +1,91 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import numpy as np +import pytest + +from cuda import cuda, cudart, nvrtc + + +def ASSERT_DRV(err): + if isinstance(err, cuda.CUresult): + if err != cuda.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"Cuda Error: {err}") + elif isinstance(err, cudart.cudaError_t): + if err != cudart.cudaError_t.cudaSuccess: + raise RuntimeError(f"Cudart Error: {err}") + elif isinstance(err, nvrtc.nvrtcResult): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(f"Nvrtc Error: {err}") + else: + raise RuntimeError(f"Unknown error type: {err}") + + +@pytest.fixture(scope="function") +def init_cuda(): + # Initialize + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, device = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, ctx = cuda.cuCtxCreate(0, device) + ASSERT_DRV(err) + + # create stream + err, stream = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) + ASSERT_DRV(err) + + yield device, ctx, stream + + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(ctx) + ASSERT_DRV(err) + + +@pytest.fixture(scope="function") +def load_module(): + module = None + + def _load_module(kernel_string, device): + nonlocal module + # Get module + err, major = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device + ) + ASSERT_DRV(err) + err, minor = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device + ) + ASSERT_DRV(err) + + err, prog = nvrtc.nvrtcCreateProgram(str.encode(kernel_string), b"kernelString.cu", 0, [], []) + ASSERT_DRV(err) + opts = [b"--fmad=false", bytes("--gpu-architecture=sm_" + str(major) + str(minor), "ascii")] + (err,) = nvrtc.nvrtcCompileProgram(prog, 2, opts) + + err_log, logSize = nvrtc.nvrtcGetProgramLogSize(prog) + ASSERT_DRV(err_log) + log = b" " * logSize + (err_log,) = nvrtc.nvrtcGetProgramLog(prog, log) + ASSERT_DRV(err_log) + result = log.decode() + if len(result) > 1: + print(result) + + ASSERT_DRV(err) + err, cubinSize = nvrtc.nvrtcGetCUBINSize(prog) + ASSERT_DRV(err) + cubin = b" " * cubinSize + (err,) = nvrtc.nvrtcGetCUBIN(prog, cubin) + ASSERT_DRV(err) + cubin = np.char.array(cubin) + err, module = cuda.cuModuleLoadData(cubin) + ASSERT_DRV(err) + + return module + + yield _load_module + + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) diff --git a/cuda_bindings_12/benchmarks/kernels.py b/cuda_bindings_12/benchmarks/kernels.py new file mode 100644 index 00000000000..89f1e1a0a87 --- /dev/null +++ b/cuda_bindings_12/benchmarks/kernels.py @@ -0,0 +1,159 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +kernel_string = """\ +#define ITEM_PARAM(x, T) T x +#define REP1(x, T) , ITEM_PARAM(x, T) +#define REP2(x, T) REP1(x##0, T) REP1(x##1, T) +#define REP4(x, T) REP2(x##0, T) REP2(x##1, T) +#define REP8(x, T) REP4(x##0, T) REP4(x##1, T) +#define REP16(x, T) REP8(x##0, T) REP8(x##1, T) +#define REP32(x, T) REP16(x##0, T) REP16(x##1, T) +#define REP64(x, T) REP32(x##0, T) REP32(x##1, T) +#define REP128(x, T) REP64(x##0, T) REP64(x##1, T) +#define REP256(x, T) REP128(x##0, T) REP128(x##1, T) + +template +struct KernelFunctionParam +{ + unsigned char p[maxBytes]; +}; + +extern "C" __global__ void small_kernel(float *f) +{ + *f = 0.0f; +} + +extern "C" __global__ void empty_kernel() +{ + return; +} + +extern "C" __global__ +void small_kernel_512_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*) + REP256(A, int*)) +{ + *F = 0; +} + +extern "C" __global__ +void small_kernel_512_bools( + ITEM_PARAM(F, bool) + REP1(A, bool) + REP2(A, bool) + REP4(A, bool) + REP8(A, bool) + REP16(A, bool) + REP32(A, bool) + REP64(A, bool) + REP128(A, bool) + REP256(A, bool)) +{ + return; +} + +extern "C" __global__ +void small_kernel_512_ints( + ITEM_PARAM(F, int) + REP1(A, int) + REP2(A, int) + REP4(A, int) + REP8(A, int) + REP16(A, int) + REP32(A, int) + REP64(A, int) + REP128(A, int) + REP256(A, int)) +{ + return; +} + +extern "C" __global__ +void small_kernel_512_doubles( + ITEM_PARAM(F, double) + REP1(A, double) + REP2(A, double) + REP4(A, double) + REP8(A, double) + REP16(A, double) + REP32(A, double) + REP64(A, double) + REP128(A, double) + REP256(A, double)) +{ + return; +} + +extern "C" __global__ +void small_kernel_512_chars( + ITEM_PARAM(F, char) + REP1(A, char) + REP2(A, char) + REP4(A, char) + REP8(A, char) + REP16(A, char) + REP32(A, char) + REP64(A, char) + REP128(A, char) + REP256(A, char)) +{ + return; +} + +extern "C" __global__ +void small_kernel_512_longlongs( + ITEM_PARAM(F, long long) + REP1(A, long long) + REP2(A, long long) + REP4(A, long long) + REP8(A, long long) + REP16(A, long long) + REP32(A, long long) + REP64(A, long long) + REP128(A, long long) + REP256(A, long long)) +{ + return; +} + +extern "C" __global__ +void small_kernel_256_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*)) +{ + *F = 0; +} + +extern "C" __global__ +void small_kernel_16_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*)) +{ + *F = 0; +} + +extern "C" __global__ void small_kernel_2048B(KernelFunctionParam<2048> param) +{ + // Do not touch param to prevent compiler from copying + // the whole structure from const bank to lmem. +} +""" diff --git a/cuda_bindings_12/benchmarks/pytest.ini b/cuda_bindings_12/benchmarks/pytest.ini new file mode 100644 index 00000000000..99da0054320 --- /dev/null +++ b/cuda_bindings_12/benchmarks/pytest.ini @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[pytest] +required_plugins = pytest-benchmark +addopts = --benchmark-skip diff --git a/cuda_bindings_12/benchmarks/test_cupy.py b/cuda_bindings_12/benchmarks/test_cupy.py new file mode 100644 index 00000000000..cd6c6740350 --- /dev/null +++ b/cuda_bindings_12/benchmarks/test_cupy.py @@ -0,0 +1,199 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes + +import pytest + +try: + import cupy + + skip_tests = False +except ImportError: + skip_tests = True + +from kernels import kernel_string + + +def launch(kernel, args=()): + kernel((1,), (1,), args) + + +# Measure launch latency with no parmaeters +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_empty_kernel(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("empty_kernel") + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel) + stream.synchronize() + + +# Measure launch latency with a single parameter +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel") + cupy.cuda.set_allocator() + arg = cupy.cuda.alloc(ctypes.sizeof(ctypes.c_float)) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, (arg,)) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_args(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_args") + cupy.cuda.set_allocator() + + args = [] + for _ in range(512): + args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_bools(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_bools") + cupy.cuda.set_allocator() + + args = [True] * 512 + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_doubles(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_doubles") + cupy.cuda.set_allocator() + + args = [1.2345] * 512 + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_ints(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_ints") + cupy.cuda.set_allocator() + + args = [123] * 512 + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_bytes(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_chars") + cupy.cuda.set_allocator() + + args = [127] * 512 + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_512_longlongs(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_512_longlongs") + cupy.cuda.set_allocator() + + args = [9223372036854775806] * 512 + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_256_args(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_256_args") + cupy.cuda.set_allocator() + + args = [] + for _ in range(256): + args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.skipif(skip_tests, reason="cupy is not installed") +@pytest.mark.benchmark(group="cupy") +def test_launch_latency_small_kernel_16_args(benchmark): + module = cupy.RawModule(code=kernel_string) + kernel = module.get_function("small_kernel_16_args") + cupy.cuda.set_allocator() + + args = [] + for _ in range(16): + args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) + args = tuple(args) + + stream = cupy.cuda.stream.Stream(non_blocking=True) + + with stream: + benchmark(launch, kernel, args) + stream.synchronize() diff --git a/cuda_bindings_12/benchmarks/test_launch_latency.py b/cuda_bindings_12/benchmarks/test_launch_latency.py new file mode 100755 index 00000000000..541db98d556 --- /dev/null +++ b/cuda_bindings_12/benchmarks/test_launch_latency.py @@ -0,0 +1,336 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes + +import pytest +from conftest import ASSERT_DRV +from kernels import kernel_string + +from cuda import cuda + + +def launch(kernel, stream, args=(), arg_types=()): + cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + (args, arg_types), + 0, + ) # arguments + + +def launch_packed(kernel, stream, params): + cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + params, + 0, + ) # arguments + + +# Measure launch latency with no parmaeters +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_empty_kernel(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"empty_kernel") + ASSERT_DRV(err) + + benchmark(launch, func, stream) + + cuda.cuCtxSynchronize() + + +# Measure launch latency with a single parameter +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel") + ASSERT_DRV(err) + + err, f = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_float)) + ASSERT_DRV(err) + + benchmark(launch, func, stream, args=(f,), arg_types=(None,)) + + cuda.cuCtxSynchronize() + + (err,) = cuda.cuMemFree(f) + ASSERT_DRV(err) + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_args(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") + ASSERT_DRV(err) + + args = [] + arg_types = [None] * 512 + for _ in arg_types: + err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + args.append(p) + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + for p in args: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_bools(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_bools") + ASSERT_DRV(err) + + args = [True] * 512 + arg_types = [ctypes.c_bool] * 512 + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_doubles(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_doubles") + ASSERT_DRV(err) + + args = [1.2345] * 512 + arg_types = [ctypes.c_double] * 512 + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_ints(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_ints") + ASSERT_DRV(err) + + args = [123] * 512 + arg_types = [ctypes.c_int] * 512 + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_bytes(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_chars") + ASSERT_DRV(err) + + args = [127] * 512 + arg_types = [ctypes.c_byte] * 512 + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_longlongs(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_longlongs") + ASSERT_DRV(err) + + args = [9223372036854775806] * 512 + arg_types = [ctypes.c_longlong] * 512 + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_256_args(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_256_args") + ASSERT_DRV(err) + + args = [] + arg_types = [None] * 256 + for _ in arg_types: + err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + args.append(p) + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + for p in args: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +# Measure launch latency with many parameters using builtin parameter packing +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_16_args(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_16_args") + ASSERT_DRV(err) + + args = [] + arg_types = [None] * 16 + for _ in arg_types: + err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + args.append(p) + + args = tuple(args) + arg_types = tuple(arg_types) + + benchmark(launch, func, stream, args=args, arg_types=arg_types) + + cuda.cuCtxSynchronize() + + for p in args: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +# Measure launch latency with many parameters, excluding parameter packing +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_args_ctypes(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") + ASSERT_DRV(err) + + vals = [] + val_ps = [] + for i in range(512): + err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + vals.append(p) + val_ps.append(ctypes.c_void_p(int(vals[i]))) + + packagedParams = (ctypes.c_void_p * 512)() + for i in range(512): + packagedParams[i] = ctypes.addressof(val_ps[i]) + + benchmark(launch_packed, func, stream, packagedParams) + + cuda.cuCtxSynchronize() + + for p in vals: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +def pack_and_launch(kernel, stream, params): + packed_params = (ctypes.c_void_p * len(params))() + ptrs = [0] * len(params) + for i in range(len(params)): + ptrs[i] = ctypes.c_void_p(int(params[i])) + packed_params[i] = ctypes.addressof(ptrs[i]) + + cuda.cuLaunchKernel(kernel, 1, 1, 1, 1, 1, 1, 0, stream, packed_params, 0) + + +# Measure launch latency plus parameter packing using ctypes +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_512_args_ctypes_with_packing(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") + ASSERT_DRV(err) + + vals = [] + for i in range(512): + err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + vals.append(p) + + benchmark(pack_and_launch, func, stream, vals) + + cuda.cuCtxSynchronize() + + for p in vals: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +# Measure launch latency with a single large struct parameter +@pytest.mark.benchmark(group="launch-latency") +def test_launch_latency_small_kernel_2048B(benchmark, init_cuda, load_module): + device, ctx, stream = init_cuda + module = load_module(kernel_string, device) + + err, func = cuda.cuModuleGetFunction(module, b"small_kernel_2048B") + ASSERT_DRV(err) + + class struct_2048B(ctypes.Structure): + _fields_ = [("values", ctypes.c_uint8 * 2048)] + + benchmark(launch, func, stream, args=(struct_2048B(),), arg_types=(None,)) + + cuda.cuCtxSynchronize() diff --git a/cuda_bindings_12/benchmarks/test_numba.py b/cuda_bindings_12/benchmarks/test_numba.py new file mode 100644 index 00000000000..4f708bf69d7 --- /dev/null +++ b/cuda_bindings_12/benchmarks/test_numba.py @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import numpy as np +import pytest + +try: + from numba import cuda + + skip_tests = False +except ImportError: + skip_tests = True + + +def launch_empty(kernel, stream): + kernel[1, 1, stream]() + + +def launch(kernel, stream, arg): + kernel[1, 1, stream](arg) + + +# Measure launch latency with no parmaeters +@pytest.mark.skipif(skip_tests, reason="Numba is not installed") +@pytest.mark.benchmark(group="numba", min_rounds=1000) +def test_launch_latency_empty_kernel(benchmark): + stream = cuda.stream() + + @cuda.jit + def empty_kernel(): + return + + benchmark(launch_empty, empty_kernel, stream) + + cuda.synchronize() + + +# Measure launch latency with a single parameter +@pytest.mark.skipif(skip_tests, reason="Numba is not installed") +@pytest.mark.benchmark(group="numba", min_rounds=1000) +def test_launch_latency_small_kernel(benchmark): + stream = cuda.stream() + + arg = cuda.device_array(1, dtype=np.float32, stream=stream) + + @cuda.jit + def small_kernel(array): + array[0] = 0.0 + + benchmark(launch, small_kernel, stream, arg) + + cuda.synchronize() diff --git a/cuda_bindings_12/benchmarks/test_pointer_attributes.py b/cuda_bindings_12/benchmarks/test_pointer_attributes.py new file mode 100644 index 00000000000..136d4be19f0 --- /dev/null +++ b/cuda_bindings_12/benchmarks/test_pointer_attributes.py @@ -0,0 +1,112 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import random + +import pytest +from conftest import ASSERT_DRV + +from cuda import cuda + +random.seed(0) + +idx = 0 + + +def query_attribute(attribute, ptrs): + global idx + ptr = ptrs[idx] + idx = (idx + 1) % len(ptrs) + + cuda.cuPointerGetAttribute(attribute, ptr) + + +def query_attributes(attributes, ptrs): + global idx + ptr = ptrs[idx] + idx = (idx + 1) % len(ptrs) + + cuda.cuPointerGetAttributes(len(attributes), attributes, ptr) + + +@pytest.mark.benchmark(group="pointer-attributes") +# Measure cuPointerGetAttribute in the same way as C benchmarks +def test_pointer_get_attribute(benchmark, init_cuda): + _ = init_cuda + + ptrs = [] + for _ in range(500): + err, ptr = cuda.cuMemAlloc(1 << 18) + ASSERT_DRV(err) + ptrs.append(ptr) + + random.shuffle(ptrs) + + benchmark(query_attribute, cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, ptrs) + + for p in ptrs: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +@pytest.mark.benchmark(group="pointer-attributes") +# Measure cuPointerGetAttributes with all attributes +def test_pointer_get_attributes_all(benchmark, init_cuda): + _ = init_cuda + + ptrs = [] + for _ in range(500): + err, ptr = cuda.cuMemAlloc(1 << 18) + ASSERT_DRV(err) + ptrs.append(ptr) + + random.shuffle(ptrs) + + attributes = [ + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_CONTEXT, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_HOST_POINTER, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_P2P_TOKENS, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_BUFFER_ID, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_SIZE, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPED, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE, + ] + + benchmark(query_attributes, attributes, ptrs) + + for p in ptrs: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) + + +@pytest.mark.benchmark(group="pointer-attributes") +# Measure cuPointerGetAttributes with a single attribute +def test_pointer_get_attributes_single(benchmark, init_cuda): + _ = init_cuda + + ptrs = [] + for _ in range(500): + err, ptr = cuda.cuMemAlloc(1 << 18) + ASSERT_DRV(err) + ptrs.append(ptr) + + random.shuffle(ptrs) + + attributes = [ + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + ] + + benchmark(query_attributes, attributes, ptrs) + + for p in ptrs: + (err,) = cuda.cuMemFree(p) + ASSERT_DRV(err) diff --git a/cuda_bindings_12/build_hooks.py b/cuda_bindings_12/build_hooks.py new file mode 100644 index 00000000000..f09ee822a50 --- /dev/null +++ b/cuda_bindings_12/build_hooks.py @@ -0,0 +1,460 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This module implements basic PEP 517 backend support to defer CUDA-dependent +# logic (header parsing, code generation, cythonization) to build time. See: +# - https://peps.python.org/pep-0517/ +# - https://setuptools.pypa.io/en/latest/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks +# - https://github.com/NVIDIA/cuda-python/issues/1635 + +import atexit +import contextlib +import functools +import glob +import os +import shutil +import sys +import sysconfig +import tempfile +from warnings import warn + +from setuptools import build_meta as _build_meta +from setuptools.extension import Extension + +# Metadata hooks delegate directly to setuptools -- no CUDA needed. +prepare_metadata_for_build_editable = _build_meta.prepare_metadata_for_build_editable +prepare_metadata_for_build_wheel = _build_meta.prepare_metadata_for_build_wheel +build_sdist = _build_meta.build_sdist +get_requires_for_build_sdist = _build_meta.get_requires_for_build_sdist +get_requires_for_build_wheel = _build_meta.get_requires_for_build_wheel +get_requires_for_build_editable = _build_meta.get_requires_for_build_editable + +# Populated by _build_cuda_bindings(); consumed by setup.py. +_extensions = None + + +@functools.cache +def _get_cuda_paths() -> list[str]: + CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None)) + if not CUDA_HOME: + raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") + CUDA_HOME = CUDA_HOME.split(os.pathsep) + print("CUDA paths:", CUDA_HOME) + return CUDA_HOME + + +# ----------------------------------------------------------------------- +# Header parsing helpers (called only from _build_cuda_bindings) + +_REQUIRED_HEADERS = { + "runtime": [ + "driver_types.h", + "vector_types.h", + "cuda_runtime.h", + "surface_types.h", + "texture_types.h", + "library_types.h", + "cuda_runtime_api.h", + "device_types.h", + "driver_functions.h", + "cuda_profiler_api.h", + ], + # nvrtc: headers no longer parsed at build time (pre-generated by cybind). + # During compilation, Cython will reference C headers that are not + # explicitly parsed above. These are the known dependencies: + # + # - crt/host_defines.h + # - builtin_types.h + # - cuda_device_runtime_api.h +} + + +class _Struct: + def __init__(self, name, members): + self._name = name + self._member_names = [] + self._member_types = [] + self._member_declarators = [] + for var_name, var_type, _ in members: + base_type = var_type[0] + base_type = base_type.removeprefix("struct ") + base_type = base_type.removeprefix("union ") + + self._member_names += [var_name] + self._member_types += [base_type] + self._member_declarators += [tuple(var_type[1:])] + + def member_type(self, member_name): + try: + return self._member_types[self._member_names.index(member_name)] + except ValueError: + return None + + def member_array_length(self, member_name): + try: + declarators = self._member_declarators[self._member_names.index(member_name)] + except ValueError: + return None + + for declarator in declarators: + if isinstance(declarator, list) and len(declarator) == 1: + return declarator[0] + return None + + def discoverMembers(self, memberDict, prefix, seen=None): + if seen is None: + seen = set() + elif self._name in seen: + return [] + + discovered = [] + next_seen = set(seen) + next_seen.add(self._name) + + for memberName, memberType in zip(self._member_names, self._member_types): + if memberName: + discovered.append(".".join([prefix, memberName])) + + t = memberType.replace("const ", "").replace("volatile ", "").strip().rstrip(" *") + if t in memberDict and t != self._name: + discovered += memberDict[t].discoverMembers( + memberDict, discovered[-1] if memberName else prefix, next_seen + ) + + return discovered + + def __repr__(self): + return f"{self._name}: {self._member_names} with types {self._member_types}" + + +def _fetch_header_paths(required_headers, include_path_list): + header_dict = {} + missing_headers = [] + for library, header_list in required_headers.items(): + header_paths = [] + for header in header_list: + path_candidate = [os.path.join(path, header) for path in include_path_list] + for path in path_candidate: + if os.path.exists(path): + header_paths += [path] + break + else: + missing_headers += [header] + + header_dict[library] = header_paths + + if missing_headers: + error_message = "Couldn't find required headers: " + error_message += ", ".join(missing_headers) + cuda_paths = _get_cuda_paths() + raise RuntimeError(f'{error_message}\nIs CUDA_HOME setup correctly? (CUDA_HOME="{cuda_paths}")') + + return header_dict + + +def _parse_headers(header_dict, include_path_list, parser_caching): + from pyclibrary import CParser + + found_types = [] + found_functions = [] + found_values = [] + found_struct = [] + struct_list = {} + + replace = { + " __device_builtin__ ": " ", + "CUDARTAPI ": " ", + "typedef __device_builtin__ enum cudaError cudaError_t;": "typedef cudaError cudaError_t;", + "typedef __device_builtin__ enum cudaOutputMode cudaOutputMode_t;": "typedef cudaOutputMode cudaOutputMode_t;", + "typedef enum cudaError cudaError_t;": "typedef cudaError cudaError_t;", + "typedef enum cudaOutputMode cudaOutputMode_t;": "typedef cudaOutputMode cudaOutputMode_t;", + "typedef enum cudaDataType_t cudaDataType_t;": "", + "typedef enum libraryPropertyType_t libraryPropertyType_t;": "", + " enum ": " ", + ", enum ": ", ", + "\\(enum ": "(", + # Since we only support 64 bit architectures, we can inline the sizeof(T*) to 8 and then compute the + # result in Python. The arithmetic expression is preserved to help with clarity and understanding + r"char reserved\[52 - sizeof\(CUcheckpointGpuPair \*\)\];": rf"char reserved[{52 - 8}];", + r"char reserved\[64 - sizeof\(CUcheckpointGpuPair \*\) - sizeof\(unsigned int\)\];": ( + rf"char reserved[{64 - 8 - 4}];" + ), + } + + print(f'Parsing headers in "{include_path_list}" (Caching = {parser_caching})', flush=True) + for library, header_paths in header_dict.items(): + print(f"Parsing {library} headers", flush=True) + parser = CParser( + header_paths, cache="./cache_{}".format(library.split(".")[0]) if parser_caching else None, replace=replace + ) + + if library == "driver": + CUDA_VERSION = parser.defs["macros"].get("CUDA_VERSION", "Unknown") + print(f"Found CUDA_VERSION: {CUDA_VERSION}", flush=True) + + found_types += {key for key in parser.defs["types"]} + found_types += {key for key in parser.defs["structs"]} + found_types += {key for key in parser.defs["unions"]} + found_types += {key for key in parser.defs["enums"]} + found_functions += {key for key in parser.defs["functions"]} + found_values += {key for key in parser.defs["values"]} + + for key, value in parser.defs["structs"].items(): + struct_list[key] = _Struct(key, value["members"]) + for key, value in parser.defs["unions"].items(): + struct_list[key] = _Struct(key, value["members"]) + + for key, value in struct_list.items(): + if key.startswith("anon_union") or key.startswith("anon_struct"): + continue + + found_struct += [key] + discovered = value.discoverMembers(struct_list, key) + if discovered: + found_struct += discovered + + # TODO(#1312): make this work properly + found_types.append("CUstreamAtomicReductionDataType_enum") + + return found_types, found_functions, found_values, found_struct, struct_list + + +# ----------------------------------------------------------------------- +# Code generation helpers + + +def _fetch_input_files(path): + return [os.path.join(path, f) for f in os.listdir(path) if f.endswith(".in")] + + +def _generate_output(infile, template_vars): + from Cython import Tempita + + assert infile.endswith(".in") + outfile = infile[:-3] + + with open(infile, encoding="utf-8") as f: + pxdcontent = Tempita.Template(f.read()).substitute(template_vars) + + if os.path.exists(outfile): + with open(outfile, encoding="utf-8") as f: + if f.read() == pxdcontent: + print(f"Skipping {infile} (No change)", flush=True) + return + with open(outfile, "w", encoding="utf-8") as f: + print(f"Generating {infile}", flush=True) + f.write(pxdcontent) + + +# ----------------------------------------------------------------------- +# Extension preparation helpers + + +def _rename_architecture_specific_files(): + path = os.path.join("cuda", "bindings", "_internal") + if sys.platform == "linux": + src_files = glob.glob(os.path.join(path, "*_linux.pyx")) + elif sys.platform == "win32": + src_files = glob.glob(os.path.join(path, "*_windows.pyx")) + else: + raise RuntimeError(f"platform is unrecognized: {sys.platform}") + dst_files = [] + for src in src_files: + with tempfile.NamedTemporaryFile(delete=False, dir=".") as f: + shutil.copy2(src, f.name) + f_name = f.name + dst = src.replace("_linux", "").replace("_windows", "") + os.replace(f_name, f"./{dst}") + dst_files.append(dst) + return dst_files + + +def _prep_extensions(sources, libraries, include_dirs, library_dirs, extra_compile_args, extra_link_args): + pattern = sources[0] + files = glob.glob(pattern) + libraries = libraries if libraries else [] + exts = [] + for pyx in files: + mod_name = pyx.replace(".pyx", "").replace(os.sep, ".").replace("/", ".") + exts.append( + Extension( + mod_name, + sources=[pyx, *sources[1:]], + include_dirs=include_dirs, + library_dirs=library_dirs, + runtime_library_dirs=[], + libraries=libraries, + language="c++", + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, + ) + ) + return exts + + +# ----------------------------------------------------------------------- +# Main build function + + +def _build_cuda_bindings(strip=False): + """Build all cuda-bindings extensions. + + All CUDA-dependent logic (header parsing, code generation, cythonization) + is deferred to this function so that metadata queries do not require a + CUDA toolkit installation. + """ + from Cython.Build import cythonize + + global _extensions + + cuda_paths = _get_cuda_paths() + + if os.environ.get("PARALLEL_LEVEL") is not None: + warn( + "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead", + DeprecationWarning, + stacklevel=2, + ) + nthreads = int(os.environ.get("PARALLEL_LEVEL", "0")) + else: + nthreads = int(os.environ.get("CUDA_PYTHON_PARALLEL_LEVEL", "0") or "0") + + parser_caching = bool(os.environ.get("CUDA_PYTHON_PARSER_CACHING", False)) + compile_for_coverage = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0"))) + + # Parse CUDA headers + include_path_list = [os.path.join(path, "include") for path in cuda_paths] + header_dict = _fetch_header_paths(_REQUIRED_HEADERS, include_path_list) + found_types, found_functions, found_values, found_struct, struct_list = _parse_headers( + header_dict, include_path_list, parser_caching + ) + struct_field_types = {} + struct_field_array_lengths = {} + for struct_name, struct in struct_list.items(): + for member_name in struct._member_names: + key = f"{struct_name}.{member_name}" + struct_field_types[key] = struct.member_type(member_name) + struct_field_array_lengths[key] = struct.member_array_length(member_name) + + # Generate code from .in templates + path_list = [ + os.path.join("cuda"), + os.path.join("cuda", "bindings"), + os.path.join("cuda", "bindings", "_bindings"), + os.path.join("cuda", "bindings", "_internal"), + os.path.join("cuda", "bindings", "_lib"), + os.path.join("cuda", "bindings", "utils"), + ] + input_files = [] + for path in path_list: + input_files += _fetch_input_files(path) + + import platform + + template_vars = { + "found_types": found_types, + "found_functions": found_functions, + "found_values": found_values, + "found_struct": found_struct, + "struct_list": struct_list, + "struct_field_types": struct_field_types, + "struct_field_array_lengths": struct_field_array_lengths, + "os": os, + "sys": sys, + "platform": platform, + } + for file in input_files: + _generate_output(file, template_vars) + + # Prepare compile/link arguments + include_dirs = [ + os.path.dirname(sysconfig.get_path("include")), + ] + include_path_list + library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] + cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"] + library_dirs.extend(os.path.join(prefix, subdir) for prefix in cuda_paths for subdir in cudalib_subdirs) + + extra_compile_args = [] + extra_link_args = [] + extra_cythonize_kwargs = {} + if sys.platform != "win32": + extra_compile_args += [ + "-std=c++14", + "-fpermissive", + "-Wno-deprecated-declarations", + "-fno-var-tracking-assignments", + ] + if "--debug" in sys.argv: + extra_cythonize_kwargs["gdb_debug"] = True + extra_compile_args += ["-g", "-O0"] + extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"] + else: + extra_compile_args += ["-O3"] + if strip and sys.platform == "linux": + extra_link_args += ["-Wl,--strip-all"] + if compile_for_coverage: + # CYTHON_TRACE_NOGIL indicates to trace nogil functions. It is not + # related to free-threading builds. + extra_compile_args += ["-DCYTHON_TRACE_NOGIL=1", "-DCYTHON_USE_SYS_MONITORING=0"] + + # Rename architecture-specific files + dst_files = _rename_architecture_specific_files() + + @atexit.register + def _cleanup_dst_files(): + for dst in dst_files: + with contextlib.suppress(FileNotFoundError): + os.remove(dst) + + # Build extension list + extensions = [] + static_runtime_libraries = ["cudart_static", "rt"] if sys.platform == "linux" else ["cudart_static"] + cuda_bindings_files = glob.glob("cuda/bindings/*.pyx") + if sys.platform == "win32": + cuda_bindings_files = [f for f in cuda_bindings_files if "cufile" not in f] + sources_list = [ + # private + (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), + (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), + # utils + (["cuda/bindings/utils/*.pyx"], None), + # public + *(([f], None) for f in cuda_bindings_files), + # public (deprecated, to be removed) + (["cuda/*.pyx"], None), + # internal files used by generated bindings + (["cuda/bindings/_internal/utils.pyx"], None), + *(([f], None) for f in dst_files if f.endswith(".pyx")), + ] + + for sources, libraries in sources_list: + extensions += _prep_extensions( + sources, libraries, include_dirs, library_dirs, extra_compile_args, extra_link_args + ) + + # Cythonize + cython_directives = dict(language_level=3, embedsignature=True, binding=True, freethreading_compatible=True) + if compile_for_coverage: + cython_directives["linetrace"] = True + + _extensions = cythonize( + extensions, + nthreads=nthreads, + build_dir="build/cython", + compiler_directives=cython_directives, + **extra_cythonize_kwargs, + ) + + +# ----------------------------------------------------------------------- +# PEP 517 build hooks + + +def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): + _build_cuda_bindings(strip=True) + return _build_meta.build_wheel(wheel_directory, config_settings, metadata_directory) + + +def build_editable(wheel_directory, config_settings=None, metadata_directory=None): + _build_cuda_bindings(strip=False) + return _build_meta.build_editable(wheel_directory, config_settings, metadata_directory) diff --git a/cuda_bindings_12/cuda/bindings/__init__.pxd b/cuda_bindings_12/cuda/bindings/__init__.pxd new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/cuda/bindings/__init__.py b/cuda_bindings_12/cuda/bindings/__init__.py new file mode 100644 index 00000000000..ea1daae3e0b --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/__init__.py @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings import utils +from cuda.bindings._version import __version__ diff --git a/cuda_bindings_12/cuda/bindings/_bindings/__init__.py b/cuda_bindings_12/cuda/bindings/_bindings/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in new file mode 100644 index 00000000000..52389ddf04a --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in @@ -0,0 +1,1468 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=497222751557bdc4a8756fe4782b96e2baa2e59daf890a40b166d80f97a74bf8 +include "../cyruntime_types.pxi" + +include "../_lib/cyruntime/cyruntime.pxd" + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} + +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} + +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil +{{endif}} + +{{if 'make_cudaPos' in found_functions}} + +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} + +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in new file mode 100644 index 00000000000..eb86cdbf5aa --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in @@ -0,0 +1,2659 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3eb7a8ac79c0415fa1dfeb13d6f9f72ff7ff9b867f08b683c267219576c8df15 +include "../cyruntime_functions.pxi" + +import os +cimport cuda.bindings._bindings.cyruntime_ptds as ptds +cimport cython + +cdef bint __cudaPythonInit = False +cdef bint __usePTDS = False +cdef int _cudaPythonInit() except -1 nogil: + global __cudaPythonInit + global __usePTDS + + with gil: + __usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))) + __cudaPythonInit = True + return __usePTDS + +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cudaPythonInit() except -1 nogil: + if __cudaPythonInit: + return __usePTDS + return _cudaPythonInit() + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceReset() + return cudaDeviceReset() +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSynchronize() + return cudaDeviceSynchronize() +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSetLimit(limit, value) + return cudaDeviceSetLimit(limit, value) +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetLimit(pValue, limit) + return cudaDeviceGetLimit(pValue, limit) +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device) + return cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device) +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetCacheConfig(pCacheConfig) + return cudaDeviceGetCacheConfig(pCacheConfig) +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority) + return cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority) +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSetCacheConfig(cacheConfig) + return cudaDeviceSetCacheConfig(cacheConfig) +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetByPCIBusId(device, pciBusId) + return cudaDeviceGetByPCIBusId(device, pciBusId) +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetPCIBusId(pciBusId, length, device) + return cudaDeviceGetPCIBusId(pciBusId, length, device) +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaIpcGetEventHandle(handle, event) + return cudaIpcGetEventHandle(handle, event) +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaIpcOpenEventHandle(event, handle) + return cudaIpcOpenEventHandle(event, handle) +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaIpcGetMemHandle(handle, devPtr) + return cudaIpcGetMemHandle(handle, devPtr) +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaIpcOpenMemHandle(devPtr, handle, flags) + return cudaIpcOpenMemHandle(devPtr, handle, flags) +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaIpcCloseMemHandle(devPtr) + return cudaIpcCloseMemHandle(devPtr) +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceFlushGPUDirectRDMAWrites(target, scope) + return cudaDeviceFlushGPUDirectRDMAWrites(target, scope) +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) + return cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceUnregisterAsyncNotification(device, callback) + return cudaDeviceUnregisterAsyncNotification(device, callback) +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetSharedMemConfig(pConfig) + return cudaDeviceGetSharedMemConfig(pConfig) +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSetSharedMemConfig(config) + return cudaDeviceSetSharedMemConfig(config) +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetLastError() + return cudaGetLastError() +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaPeekAtLastError() + return cudaPeekAtLastError() +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetErrorName(error) + return cudaGetErrorName(error) +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetErrorString(error) + return cudaGetErrorString(error) +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDeviceCount(count) + return cudaGetDeviceCount(count) +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDeviceProperties_v2(prop, device) + return cudaGetDeviceProperties_v2(prop, device) +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetAttribute(value, attr, device) + return cudaDeviceGetAttribute(value, attr, device) +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetDefaultMemPool(memPool, device) + return cudaDeviceGetDefaultMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSetMemPool(device, memPool) + return cudaDeviceSetMemPool(device, memPool) +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetMemPool(memPool, device) + return cudaDeviceGetMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags) + return cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags) +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) + return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaChooseDevice(device, prop) + return cudaChooseDevice(device, prop) +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaInitDevice(device, deviceFlags, flags) + return cudaInitDevice(device, deviceFlags, flags) +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaSetDevice(device) + return cudaSetDevice(device) +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDevice(device) + return cudaGetDevice(device) +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaSetDeviceFlags(flags) + return cudaSetDeviceFlags(flags) +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDeviceFlags(flags) + return cudaGetDeviceFlags(flags) +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamCreate(pStream) + return cudaStreamCreate(pStream) +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamCreateWithFlags(pStream, flags) + return cudaStreamCreateWithFlags(pStream, flags) +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamCreateWithPriority(pStream, flags, priority) + return cudaStreamCreateWithPriority(pStream, flags, priority) +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetPriority(hStream, priority) + return cudaStreamGetPriority(hStream, priority) +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetFlags(hStream, flags) + return cudaStreamGetFlags(hStream, flags) +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetId(hStream, streamId) + return cudaStreamGetId(hStream, streamId) +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetDevice(hStream, device) + return cudaStreamGetDevice(hStream, device) +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaCtxResetPersistingL2Cache() + return cudaCtxResetPersistingL2Cache() +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamCopyAttributes(dst, src) + return cudaStreamCopyAttributes(dst, src) +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetAttribute(hStream, attr, value_out) + return cudaStreamGetAttribute(hStream, attr, value_out) +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamSetAttribute(hStream, attr, value) + return cudaStreamSetAttribute(hStream, attr, value) +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamDestroy(stream) + return cudaStreamDestroy(stream) +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamWaitEvent(stream, event, flags) + return cudaStreamWaitEvent(stream, event, flags) +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamAddCallback(stream, callback, userData, flags) + return cudaStreamAddCallback(stream, callback, userData, flags) +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamSynchronize(stream) + return cudaStreamSynchronize(stream) +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamQuery(stream) + return cudaStreamQuery(stream) +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamAttachMemAsync(stream, devPtr, length, flags) + return cudaStreamAttachMemAsync(stream, devPtr, length, flags) +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamBeginCapture(stream, mode) + return cudaStreamBeginCapture(stream, mode) +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode) + return cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode) +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaThreadExchangeStreamCaptureMode(mode) + return cudaThreadExchangeStreamCaptureMode(mode) +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamEndCapture(stream, pGraph) + return cudaStreamEndCapture(stream, pGraph) +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamIsCapturing(stream, pCaptureStatus) + return cudaStreamIsCapturing(stream, pCaptureStatus) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) + return cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) + return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) + return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventCreate(event) + return cudaEventCreate(event) +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventCreateWithFlags(event, flags) + return cudaEventCreateWithFlags(event, flags) +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventRecord(event, stream) + return cudaEventRecord(event, stream) +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventRecordWithFlags(event, stream, flags) + return cudaEventRecordWithFlags(event, stream, flags) +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventQuery(event) + return cudaEventQuery(event) +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventSynchronize(event) + return cudaEventSynchronize(event) +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventDestroy(event) + return cudaEventDestroy(event) +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventElapsedTime(ms, start, end) + return cudaEventElapsedTime(ms, start, end) +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaEventElapsedTime_v2(ms, start, end) + return cudaEventElapsedTime_v2(ms, start, end) +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaImportExternalMemory(extMem_out, memHandleDesc) + return cudaImportExternalMemory(extMem_out, memHandleDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) + return cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) + return cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDestroyExternalMemory(extMem) + return cudaDestroyExternalMemory(extMem) +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaImportExternalSemaphore(extSem_out, semHandleDesc) + return cudaImportExternalSemaphore(extSem_out, semHandleDesc) +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) + return cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDestroyExternalSemaphore(extSem) + return cudaDestroyExternalSemaphore(extSem) +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFuncSetCacheConfig(func, cacheConfig) + return cudaFuncSetCacheConfig(func, cacheConfig) +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFuncGetAttributes(attr, func) + return cudaFuncGetAttributes(attr, func) +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFuncSetAttribute(func, attr, value) + return cudaFuncSetAttribute(func, attr, value) +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLaunchHostFunc(stream, fn, userData) + return cudaLaunchHostFunc(stream, fn, userData) +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFuncSetSharedMemConfig(func, config) + return cudaFuncSetSharedMemConfig(func, config) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) + return cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) + return cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) + return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocManaged(devPtr, size, flags) + return cudaMallocManaged(devPtr, size, flags) +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMalloc(devPtr, size) + return cudaMalloc(devPtr, size) +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocHost(ptr, size) + return cudaMallocHost(ptr, size) +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocPitch(devPtr, pitch, width, height) + return cudaMallocPitch(devPtr, pitch, width, height) +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocArray(array, desc, width, height, flags) + return cudaMallocArray(array, desc, width, height, flags) +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFree(devPtr) + return cudaFree(devPtr) +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFreeHost(ptr) + return cudaFreeHost(ptr) +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFreeArray(array) + return cudaFreeArray(array) +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFreeMipmappedArray(mipmappedArray) + return cudaFreeMipmappedArray(mipmappedArray) +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaHostAlloc(pHost, size, flags) + return cudaHostAlloc(pHost, size, flags) +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaHostRegister(ptr, size, flags) + return cudaHostRegister(ptr, size, flags) +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaHostUnregister(ptr) + return cudaHostUnregister(ptr) +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaHostGetDevicePointer(pDevice, pHost, flags) + return cudaHostGetDevicePointer(pDevice, pHost, flags) +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaHostGetFlags(pFlags, pHost) + return cudaHostGetFlags(pFlags, pHost) +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMalloc3D(pitchedDevPtr, extent) + return cudaMalloc3D(pitchedDevPtr, extent) +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMalloc3DArray(array, desc, extent, flags) + return cudaMalloc3DArray(array, desc, extent, flags) +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags) + return cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags) +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level) + return cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level) +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy3D(p) + return cudaMemcpy3D(p) +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy3DPeer(p) + return cudaMemcpy3DPeer(p) +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy3DAsync(p, stream) + return cudaMemcpy3DAsync(p, stream) +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy3DPeerAsync(p, stream) + return cudaMemcpy3DPeerAsync(p, stream) +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemGetInfo(free, total) + return cudaMemGetInfo(free, total) +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaArrayGetInfo(desc, extent, flags, array) + return cudaArrayGetInfo(desc, extent, flags, array) +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaArrayGetPlane(pPlaneArray, hArray, planeIdx) + return cudaArrayGetPlane(pPlaneArray, hArray, planeIdx) +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaArrayGetMemoryRequirements(memoryRequirements, array, device) + return cudaArrayGetMemoryRequirements(memoryRequirements, array, device) +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) + return cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaArrayGetSparseProperties(sparseProperties, array) + return cudaArrayGetSparseProperties(sparseProperties, array) +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap) + return cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap) +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy(dst, src, count, kind) + return cudaMemcpy(dst, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count) + return cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count) +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind) + return cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind) + return cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind) + return cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind) + return cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind) +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyAsync(dst, src, count, kind, stream) + return cudaMemcpyAsync(dst, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream) + return cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream) +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) + return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) + return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream) + return cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream) + return cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream) + return cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemset(devPtr, value, count) + return cudaMemset(devPtr, value, count) +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemset2D(devPtr, pitch, value, width, height) + return cudaMemset2D(devPtr, pitch, value, width, height) +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemset3D(pitchedDevPtr, value, extent) + return cudaMemset3D(pitchedDevPtr, value, extent) +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemsetAsync(devPtr, value, count, stream) + return cudaMemsetAsync(devPtr, value, count, stream) +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemset2DAsync(devPtr, pitch, value, width, height, stream) + return cudaMemset2DAsync(devPtr, pitch, value, width, height, stream) +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemset3DAsync(pitchedDevPtr, value, extent, stream) + return cudaMemset3DAsync(pitchedDevPtr, value, extent, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) + return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) + return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemAdvise(devPtr, count, advice, device) + return cudaMemAdvise(devPtr, count, advice, device) +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemAdvise_v2(devPtr, count, advice, location) + return cudaMemAdvise_v2(devPtr, count, advice, location) +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) + return cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) + return cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind) + return cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind) + return cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind) +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind) + return cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind) +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream) + return cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream) + return cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream) +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocAsync(devPtr, size, hStream) + return cudaMallocAsync(devPtr, size, hStream) +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaFreeAsync(devPtr, hStream) + return cudaFreeAsync(devPtr, hStream) +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolTrimTo(memPool, minBytesToKeep) + return cudaMemPoolTrimTo(memPool, minBytesToKeep) +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolSetAttribute(memPool, attr, value) + return cudaMemPoolSetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolGetAttribute(memPool, attr, value) + return cudaMemPoolGetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolSetAccess(memPool, descList, count) + return cudaMemPoolSetAccess(memPool, descList, count) +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolGetAccess(flags, memPool, location) + return cudaMemPoolGetAccess(flags, memPool, location) +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolCreate(memPool, poolProps) + return cudaMemPoolCreate(memPool, poolProps) +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolDestroy(memPool) + return cudaMemPoolDestroy(memPool) +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMallocFromPoolAsync(ptr, size, memPool, stream) + return cudaMallocFromPoolAsync(ptr, size, memPool, stream) +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags) + return cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags) + return cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolExportPointer(exportData, ptr) + return cudaMemPoolExportPointer(exportData, ptr) +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemPoolImportPointer(ptr, memPool, exportData) + return cudaMemPoolImportPointer(ptr, memPool, exportData) +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaPointerGetAttributes(attributes, ptr) + return cudaPointerGetAttributes(attributes, ptr) +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice) + return cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice) +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceEnablePeerAccess(peerDevice, flags) + return cudaDeviceEnablePeerAccess(peerDevice, flags) +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceDisablePeerAccess(peerDevice) + return cudaDeviceDisablePeerAccess(peerDevice) +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsUnregisterResource(resource) + return cudaGraphicsUnregisterResource(resource) +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsResourceSetMapFlags(resource, flags) + return cudaGraphicsResourceSetMapFlags(resource, flags) +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsMapResources(count, resources, stream) + return cudaGraphicsMapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsUnmapResources(count, resources, stream) + return cudaGraphicsUnmapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsResourceGetMappedPointer(devPtr, size, resource) + return cudaGraphicsResourceGetMappedPointer(devPtr, size, resource) +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel) + return cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource) + return cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource) +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetChannelDesc(desc, array) + return cudaGetChannelDesc(desc, array) +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaCreateChannelDesc(x, y, z, w, f) + return cudaCreateChannelDesc(x, y, z, w, f) +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc) + return cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc) +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDestroyTextureObject(texObject) + return cudaDestroyTextureObject(texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetTextureObjectResourceDesc(pResDesc, texObject) + return cudaGetTextureObjectResourceDesc(pResDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetTextureObjectTextureDesc(pTexDesc, texObject) + return cudaGetTextureObjectTextureDesc(pTexDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject) + return cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject) +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaCreateSurfaceObject(pSurfObject, pResDesc) + return cudaCreateSurfaceObject(pSurfObject, pResDesc) +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDestroySurfaceObject(surfObject) + return cudaDestroySurfaceObject(surfObject) +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject) + return cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject) +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDriverGetVersion(driverVersion) + return cudaDriverGetVersion(driverVersion) +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaRuntimeGetVersion(runtimeVersion) + return cudaRuntimeGetVersion(runtimeVersion) +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphCreate(pGraph, flags) + return cudaGraphCreate(pGraph, flags) +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) + return cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphKernelNodeGetParams(node, pNodeParams) + return cudaGraphKernelNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphKernelNodeSetParams(node, pNodeParams) + return cudaGraphKernelNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphKernelNodeCopyAttributes(hSrc, hDst) + return cudaGraphKernelNodeCopyAttributes(hSrc, hDst) +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphKernelNodeGetAttribute(hNode, attr, value_out) + return cudaGraphKernelNodeGetAttribute(hNode, attr, value_out) +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphKernelNodeSetAttribute(hNode, attr, value) + return cudaGraphKernelNodeSetAttribute(hNode, attr, value) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams) + return cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind) + return cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemcpyNodeGetParams(node, pNodeParams) + return cudaGraphMemcpyNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemcpyNodeSetParams(node, pNodeParams) + return cudaGraphMemcpyNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind) + return cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams) + return cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemsetNodeGetParams(node, pNodeParams) + return cudaGraphMemsetNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemsetNodeSetParams(node, pNodeParams) + return cudaGraphMemsetNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) + return cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphHostNodeGetParams(node, pNodeParams) + return cudaGraphHostNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphHostNodeSetParams(node, pNodeParams) + return cudaGraphHostNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph) + return cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph) +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphChildGraphNodeGetGraph(node, pGraph) + return cudaGraphChildGraphNodeGetGraph(node, pGraph) +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies) + return cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies) +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event) + return cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphEventRecordNodeGetEvent(node, event_out) + return cudaGraphEventRecordNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphEventRecordNodeSetEvent(node, event) + return cudaGraphEventRecordNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event) + return cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphEventWaitNodeGetEvent(node, event_out) + return cudaGraphEventWaitNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphEventWaitNodeSetEvent(node, event) + return cudaGraphEventWaitNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) + return cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) + return cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) + return cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) + return cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) + return cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) + return cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) + return cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemAllocNodeGetParams(node, params_out) + return cudaGraphMemAllocNodeGetParams(node, params_out) +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr) + return cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr) +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphMemFreeNodeGetParams(node, dptr_out) + return cudaGraphMemFreeNodeGetParams(node, dptr_out) +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGraphMemTrim(device) + return cudaDeviceGraphMemTrim(device) +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceGetGraphMemAttribute(device, attr, value) + return cudaDeviceGetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaDeviceSetGraphMemAttribute(device, attr, value) + return cudaDeviceSetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphClone(pGraphClone, originalGraph) + return cudaGraphClone(pGraphClone, originalGraph) +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph) + return cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph) +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetType(node, pType) + return cudaGraphNodeGetType(node, pType) +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphGetNodes(graph, nodes, numNodes) + return cudaGraphGetNodes(graph, nodes, numNodes) +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes) + return cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes) +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphGetEdges(graph, from_, to, numEdges) + return cudaGraphGetEdges(graph, from_, to, numEdges) +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) + return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) + return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) + return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) + return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) + return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddDependencies(graph, from_, to, numDependencies) + return cudaGraphAddDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) + return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphRemoveDependencies(graph, from_, to, numDependencies) + return cudaGraphRemoveDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) + return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphDestroyNode(node) + return cudaGraphDestroyNode(node) +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphInstantiate(pGraphExec, graph, flags) + return cudaGraphInstantiate(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphInstantiateWithFlags(pGraphExec, graph, flags) + return cudaGraphInstantiateWithFlags(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams) + return cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams) +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecGetFlags(graphExec, flags) + return cudaGraphExecGetFlags(graphExec, flags) +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams) + return cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams) + return cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind) + return cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams) + return cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams) + return cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph) + return cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph) +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) + return cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) + return cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) + return cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) + return cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) + return cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) + return cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo) + return cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo) +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphUpload(graphExec, stream) + return cudaGraphUpload(graphExec, stream) +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphLaunch(graphExec, stream) + return cudaGraphLaunch(graphExec, stream) +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecDestroy(graphExec) + return cudaGraphExecDestroy(graphExec) +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphDestroy(graph) + return cudaGraphDestroy(graph) +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphDebugDotPrint(graph, path, flags) + return cudaGraphDebugDotPrint(graph, path, flags) +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) + return cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaUserObjectRetain(object, count) + return cudaUserObjectRetain(object, count) +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaUserObjectRelease(object, count) + return cudaUserObjectRelease(object, count) +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphRetainUserObject(graph, object, count, flags) + return cudaGraphRetainUserObject(graph, object, count, flags) +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphReleaseUserObject(graph, object, count) + return cudaGraphReleaseUserObject(graph, object, count) +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) + return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) + return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphNodeSetParams(node, nodeParams) + return cudaGraphNodeSetParams(node, nodeParams) +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphExecNodeSetParams(graphExec, node, nodeParams) + return cudaGraphExecNodeSetParams(graphExec, node, nodeParams) +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags) + return cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags) +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus) + return cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus) +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus) + return cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus) +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + return cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + return cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryUnload(library) + return cudaLibraryUnload(library) +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryGetKernel(pKernel, library, name) + return cudaLibraryGetKernel(pKernel, library, name) +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryGetGlobal(dptr, numbytes, library, name) + return cudaLibraryGetGlobal(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryGetManaged(dptr, numbytes, library, name) + return cudaLibraryGetManaged(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryGetUnifiedFunction(fptr, library, symbol) + return cudaLibraryGetUnifiedFunction(fptr, library, symbol) +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryGetKernelCount(count, lib) + return cudaLibraryGetKernelCount(count, lib) +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaLibraryEnumerateKernels(kernels, numKernels, lib) + return cudaLibraryEnumerateKernels(kernels, numKernels, lib) +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaKernelSetAttributeForDevice(kernel, attr, value, device) + return cudaKernelSetAttributeForDevice(kernel, attr, value, device) +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetExportTable(ppExportTable, pExportTableId) + return cudaGetExportTable(ppExportTable, pExportTableId) +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaGetKernel(kernelPtr, entryFuncAddr) + return cudaGetKernel(kernelPtr, entryFuncAddr) +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._make_cudaPitchedPtr(d, p, xsz, ysz) + return make_cudaPitchedPtr(d, p, xsz, ysz) +{{endif}} + +{{if 'make_cudaPos' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._make_cudaPos(x, y, z) + return make_cudaPos(x, y, z) +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._make_cudaExtent(w, h, d) + return make_cudaExtent(w, h, d) +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaProfilerStart() + return cudaProfilerStart() +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaProfilerStop() + return cudaProfilerStop() +{{endif}} + + +include "../_lib/cyruntime/cyruntime.pxi" diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in new file mode 100644 index 00000000000..43792e1e18c --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in @@ -0,0 +1,1471 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=58ec8deb9f130e6305b7842d14d609fd871cd1d3f7bf0f0ff714957cd77772b5 +cdef extern from "": + """ + #define CUDA_API_PER_THREAD_DEFAULT_STREAM + """ + +include "../cyruntime_types.pxi" + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} + +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} + +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil +{{endif}} + +{{if 'make_cudaPos' in found_functions}} + +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} + +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} diff --git a/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in new file mode 100644 index 00000000000..df2a7422a95 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in @@ -0,0 +1,1765 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9ef99cae70f08efa9f2a007ad5234e8632e797d6fd4109ca8e61034c69bd9658 +cdef extern from "": + """ + #define CUDA_API_PER_THREAD_DEFAULT_STREAM + """ + +include "../cyruntime_functions.pxi" + +cimport cython + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceReset() +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t _cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSynchronize() +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSetLimit(limit, value) +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t _cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetLimit(pValue, limit) +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t _cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device) +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetCacheConfig(pCacheConfig) +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t _cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority) +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSetCacheConfig(cacheConfig) +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetByPCIBusId(device, pciBusId) +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t _cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetPCIBusId(pciBusId, length, device) +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaIpcGetEventHandle(handle, event) +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaIpcOpenEventHandle(event, handle) +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaIpcGetMemHandle(handle, devPtr) +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaIpcOpenMemHandle(devPtr, handle, flags) +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t _cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaIpcCloseMemHandle(devPtr) +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t _cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceFlushGPUDirectRDMAWrites(target, scope) +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t _cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceUnregisterAsyncNotification(device, callback) +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetSharedMemConfig(pConfig) +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSetSharedMemConfig(config) +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t _cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetLastError() +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t _cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaPeekAtLastError() +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* _cudaGetErrorName(cudaError_t error) except ?NULL nogil: + return cudaGetErrorName(error) +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* _cudaGetErrorString(cudaError_t error) except ?NULL nogil: + return cudaGetErrorString(error) +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t _cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDeviceCount(count) +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t _cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDeviceProperties_v2(prop, device) +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetAttribute(value, attr, device) +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetDefaultMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSetMemPool(device, memPool) +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t _cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t _cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags) +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t _cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaChooseDevice(device, prop) +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t _cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaInitDevice(device, deviceFlags, flags) +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t _cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaSetDevice(device) +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t _cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDevice(device) +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaSetDeviceFlags(flags) +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t _cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDeviceFlags(flags) +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t _cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamCreate(pStream) +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamCreateWithFlags(pStream, flags) +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t _cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamCreateWithPriority(pStream, flags, priority) +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t _cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetPriority(hStream, priority) +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t _cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetFlags(hStream, flags) +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t _cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetId(hStream, streamId) +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t _cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetDevice(hStream, device) +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t _cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaCtxResetPersistingL2Cache() +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamCopyAttributes(dst, src) +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetAttribute(hStream, attr, value_out) +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t _cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamSetAttribute(hStream, attr, value) +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t _cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamDestroy(stream) +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t _cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamWaitEvent(stream, event, flags) +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t _cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamAddCallback(stream, callback, userData, flags) +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t _cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamSynchronize(stream) +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t _cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamQuery(stream) +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamAttachMemAsync(stream, devPtr, length, flags) +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamBeginCapture(stream, mode) +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode) +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t _cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaThreadExchangeStreamCaptureMode(mode) +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t _cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamEndCapture(stream, pGraph) +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t _cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamIsCapturing(stream, pCaptureStatus) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetCaptureInfo_v2_ptsz(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t _cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t _cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventCreate(event) +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventCreateWithFlags(event, flags) +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t _cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventRecord(event, stream) +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t _cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventRecordWithFlags(event, stream, flags) +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t _cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventQuery(event) +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t _cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventSynchronize(event) +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t _cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventDestroy(event) +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventElapsedTime(ms, start, end) +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t _cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaEventElapsedTime_v2(ms, start, end) +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t _cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaImportExternalMemory(extMem_out, memHandleDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDestroyExternalMemory(extMem) +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaImportExternalSemaphore(extSem_out, semHandleDesc) +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaSignalExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t _cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaWaitExternalSemaphoresAsync_v2_ptsz(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t _cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDestroyExternalSemaphore(extSem) +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFuncSetCacheConfig(func, cacheConfig) +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t _cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFuncGetAttributes(attr, func) +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t _cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFuncSetAttribute(func, attr, value) +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t _cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLaunchHostFunc(stream, fn, userData) +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t _cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFuncSetSharedMemConfig(func, config) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t _cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t _cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t _cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocManaged(devPtr, size, flags) +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t _cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMalloc(devPtr, size) +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t _cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocHost(ptr, size) +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t _cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocPitch(devPtr, pitch, width, height) +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t _cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocArray(array, desc, width, height, flags) +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t _cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFree(devPtr) +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t _cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFreeHost(ptr) +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t _cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFreeArray(array) +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFreeMipmappedArray(mipmappedArray) +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t _cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaHostAlloc(pHost, size, flags) +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t _cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaHostRegister(ptr, size, flags) +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t _cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaHostUnregister(ptr) +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t _cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaHostGetDevicePointer(pDevice, pHost, flags) +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t _cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaHostGetFlags(pFlags, pHost) +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t _cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMalloc3D(pitchedDevPtr, extent) +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t _cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMalloc3DArray(array, desc, extent, flags) +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags) +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t _cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level) +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t _cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3D(p) +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3DPeer(p) +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3DAsync(p, stream) +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3DPeerAsync(p, stream) +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t _cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemGetInfo(free, total) +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t _cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaArrayGetInfo(desc, extent, flags, array) +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t _cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaArrayGetPlane(pPlaneArray, hArray, planeIdx) +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaArrayGetMemoryRequirements(memoryRequirements, array, device) +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaArrayGetSparseProperties(sparseProperties, array) +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t _cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap) +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t _cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy(dst, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count) +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t _cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind) +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyAsync(dst, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream) +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t _cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemset(devPtr, value, count) +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t _cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemset2D(devPtr, pitch, value, width, height) +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t _cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemset3D(pitchedDevPtr, value, extent) +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t _cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemsetAsync(devPtr, value, count, stream) +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemset2DAsync(devPtr, pitch, value, width, height, stream) +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t _cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemset3DAsync(pitchedDevPtr, value, extent, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t _cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t _cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemAdvise(devPtr, count, advice, device) +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t _cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemAdvise_v2(devPtr, count, advice, location) +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t _cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind) +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t _cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind) +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t _cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream) +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t _cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocAsync(devPtr, size, hStream) +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t _cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaFreeAsync(devPtr, hStream) +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t _cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolTrimTo(memPool, minBytesToKeep) +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolSetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolGetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolSetAccess(memPool, descList, count) +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t _cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolGetAccess(flags, memPool, location) +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t _cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolCreate(memPool, poolProps) +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t _cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolDestroy(memPool) +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t _cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMallocFromPoolAsync(ptr, size, memPool, stream) +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolExportPointer(exportData, ptr) +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t _cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaMemPoolImportPointer(ptr, memPool, exportData) +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t _cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaPointerGetAttributes(attributes, ptr) +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t _cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice) +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceEnablePeerAccess(peerDevice, flags) +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t _cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceDisablePeerAccess(peerDevice) +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsUnregisterResource(resource) +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsResourceSetMapFlags(resource, flags) +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsMapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t _cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsUnmapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsResourceGetMappedPointer(devPtr, size, resource) +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t _cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource) +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t _cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetChannelDesc(desc, array) +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaChannelFormatDesc _cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil: + return cudaCreateChannelDesc(x, y, z, w, f) +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t _cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc) +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t _cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDestroyTextureObject(texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetTextureObjectResourceDesc(pResDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetTextureObjectTextureDesc(pTexDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t _cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject) +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t _cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaCreateSurfaceObject(pSurfObject, pResDesc) +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t _cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDestroySurfaceObject(surfObject) +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t _cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject) +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t _cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDriverGetVersion(driverVersion) +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaRuntimeGetVersion(runtimeVersion) +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t _cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphCreate(pGraph, flags) +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeCopyAttributes(hSrc, hDst) +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeGetAttribute(hNode, attr, value_out) +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t _cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphKernelNodeSetAttribute(hNode, attr, value) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemcpyNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemcpyNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemsetNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemsetNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphHostNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphHostNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph) +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t _cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphChildGraphNodeGetGraph(node, pGraph) +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies) +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphEventRecordNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphEventRecordNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphEventWaitNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphEventWaitNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemAllocNodeGetParams(node, params_out) +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr) +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t _cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphMemFreeNodeGetParams(node, dptr_out) +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t _cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGraphMemTrim(device) +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceGetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t _cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaDeviceSetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t _cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphClone(pGraphClone, originalGraph) +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t _cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph) +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetType(node, pType) +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphGetNodes(graph, nodes, numNodes) +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t _cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes) +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphGetEdges(graph, from_, to, numEdges) +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t _cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphRemoveDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t _cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t _cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphDestroyNode(node) +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphInstantiate(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphInstantiateWithFlags(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t _cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams) +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t _cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecGetFlags(graphExec, flags) +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph) +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t _cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t _cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t _cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo) +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t _cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphUpload(graphExec, stream) +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t _cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphLaunch(graphExec, stream) +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecDestroy(graphExec) +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t _cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphDestroy(graph) +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t _cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphDebugDotPrint(graph, path, flags) +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t _cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t _cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaUserObjectRetain(object, count) +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t _cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaUserObjectRelease(object, count) +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphRetainUserObject(graph, object, count, flags) +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t _cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphReleaseUserObject(graph, object, count) +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t _cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphNodeSetParams(node, nodeParams) +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t _cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphExecNodeSetParams(graphExec, node, nodeParams) +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t _cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags) +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus) +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t _cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus) +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t _cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t _cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryUnload(library) +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryGetKernel(pKernel, library, name) +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t _cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryGetGlobal(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t _cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryGetManaged(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t _cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryGetUnifiedFunction(fptr, library, symbol) +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t _cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryGetKernelCount(count, lib) +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t _cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaLibraryEnumerateKernels(kernels, numKernels, lib) +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t _cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaKernelSetAttributeForDevice(kernel, attr, value, device) +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t _cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetExportTable(ppExportTable, pExportTableId) +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t _cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaGetKernel(kernelPtr, entryFuncAddr) +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPitchedPtr _make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil: + return make_cudaPitchedPtr(d, p, xsz, ysz) +{{endif}} + +{{if 'make_cudaPos' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPos _make_cudaPos(size_t x, size_t y, size_t z) except* nogil: + return make_cudaPos(x, y, z) +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaExtent _make_cudaExtent(size_t w, size_t h, size_t d) except* nogil: + return make_cudaExtent(w, h, d) +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t _cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaProfilerStart() +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaProfilerStop() +{{endif}} diff --git a/cuda_bindings_12/cuda/bindings/_internal/__init__.py b/cuda_bindings_12/cuda/bindings/_internal/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py b/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py new file mode 100644 index 00000000000..63a2336da1a --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py @@ -0,0 +1,74 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=581469c1fadb5f72c43b478d73f2b905562136c8723a25e2f4240b5b681e2894 +""" +This is a replacement for the stdlib enum.IntEnum. + +Notably, it has much better import time performance, since it doesn't generate +and evaluate Python code at startup time. + +It supports the most important subset of the IntEnum API. See `test_enum` in +`cuda_bindings/tests/test_basics.py` for details. +""" + +from typing import Any, Iterator + + +class FastEnumMetaclass(type): + def __init__(cls, name, bases, namespace): + super().__init__(name, bases, namespace) + + cls.__singletons__ = {} + cls.__members__ = {} + for name, value in cls.__dict__.items(): + if name.startswith("__") and name.endswith("__"): + continue + + if isinstance(value, tuple): + value, doc = value + elif isinstance(value, int): + doc = None + else: + continue + + singleton = int.__new__(cls, value) + singleton.__doc__ = doc + singleton._name = name + cls.__singletons__[value] = singleton + cls.__members__[name] = singleton + + for name, member in cls.__members__.items(): + setattr(cls, name, member) + + def __repr__(cls) -> str: + return f"" + + def __len__(cls) -> int: + return len(cls.__members__) + + def __iter__(cls) -> Iterator["FastEnum"]: + return iter(cls.__members__.values()) + + def __contains__(cls, item: Any) -> bool: + return item in cls.__singletons__ + + +class FastEnum(int, metaclass=FastEnumMetaclass): + def __new__(cls, value: int) -> "FastEnum": + singleton: FastEnum = cls.__singletons__.get(value) + if singleton is None: + raise ValueError(f"{value} is not a valid {cls.__name__}") + return singleton + + def __repr__(self) -> str: + return f"<{self.__class__.__name__}.{self._name}: {int(self)}>" + + @property + def name(self) -> str: + return self._name + + @property + def value(self) -> int: + return int(self) diff --git a/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd b/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd new file mode 100644 index 00000000000..62658be1e1f --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/cufile.pxd @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=754c0fc21d3ba16995b80db0257818b472b3a2e9f9b95df721d27d031787f4ee + + +# <<<< PREAMBLE CONTENT >>>> + +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from ..cycufile cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUfileError_t _cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil +cdef void _cuFileHandleDeregister(CUfileHandle_t fh) except* nogil +cdef CUfileError_t _cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t _cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef ssize_t _cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef CUfileError_t _cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil +cdef long _cuFileUseCount() except* nogil +cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil +cdef void _cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil +cdef CUfileError_t _cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx new file mode 100644 index 00000000000..cd388b4a76a --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx @@ -0,0 +1,764 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6baa85b885ea8a9f8fc01db7ce4c55af185d9080c0856563f15cc15d115db48f + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +cimport cython as _cyb_cython +from libc.stdint cimport intptr_t +from libcpp cimport bool as _cyb_bool + +import threading as _cyb_threading + +cdef int _cyb___py_cufile_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + + +cdef void* __cuFileHandleRegister = NULL +cdef void* __cuFileHandleDeregister = NULL +cdef void* __cuFileBufRegister = NULL +cdef void* __cuFileBufDeregister = NULL +cdef void* __cuFileRead = NULL +cdef void* __cuFileWrite = NULL +cdef void* __cuFileDriverOpen = NULL +cdef void* __cuFileDriverClose = NULL +cdef void* __cuFileDriverClose_v2 = NULL +cdef void* __cuFileUseCount = NULL +cdef void* __cuFileDriverGetProperties = NULL +cdef void* __cuFileDriverSetPollMode = NULL +cdef void* __cuFileDriverSetMaxDirectIOSize = NULL +cdef void* __cuFileDriverSetMaxCacheSize = NULL +cdef void* __cuFileDriverSetMaxPinnedMemSize = NULL +cdef void* __cuFileBatchIOSetUp = NULL +cdef void* __cuFileBatchIOSubmit = NULL +cdef void* __cuFileBatchIOGetStatus = NULL +cdef void* __cuFileBatchIOCancel = NULL +cdef void* __cuFileBatchIODestroy = NULL +cdef void* __cuFileReadAsync = NULL +cdef void* __cuFileWriteAsync = NULL +cdef void* __cuFileStreamRegister = NULL +cdef void* __cuFileStreamDeregister = NULL +cdef void* __cuFileGetVersion = NULL +cdef void* __cuFileGetParameterSizeT = NULL +cdef void* __cuFileGetParameterBool = NULL +cdef void* __cuFileGetParameterString = NULL +cdef void* __cuFileSetParameterSizeT = NULL +cdef void* __cuFileSetParameterBool = NULL +cdef void* __cuFileSetParameterString = NULL + +cdef int _init_cufile() except -1 nogil: + global _cyb___py_cufile_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_cufile_init: return 0 + + global __cuFileHandleRegister + __cuFileHandleRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileHandleRegister') + if __cuFileHandleRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileHandleRegister = _cyb_dlsym(handle, 'cuFileHandleRegister') + + global __cuFileHandleDeregister + __cuFileHandleDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileHandleDeregister') + if __cuFileHandleDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileHandleDeregister = _cyb_dlsym(handle, 'cuFileHandleDeregister') + + global __cuFileBufRegister + __cuFileBufRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBufRegister') + if __cuFileBufRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileBufRegister = _cyb_dlsym(handle, 'cuFileBufRegister') + + global __cuFileBufDeregister + __cuFileBufDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBufDeregister') + if __cuFileBufDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileBufDeregister = _cyb_dlsym(handle, 'cuFileBufDeregister') + + global __cuFileRead + __cuFileRead = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileRead') + if __cuFileRead == NULL: + if handle == NULL: + handle = load_library() + __cuFileRead = _cyb_dlsym(handle, 'cuFileRead') + + global __cuFileWrite + __cuFileWrite = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileWrite') + if __cuFileWrite == NULL: + if handle == NULL: + handle = load_library() + __cuFileWrite = _cyb_dlsym(handle, 'cuFileWrite') + + global __cuFileDriverOpen + __cuFileDriverOpen = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverOpen') + if __cuFileDriverOpen == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverOpen = _cyb_dlsym(handle, 'cuFileDriverOpen') + + global __cuFileDriverClose + __cuFileDriverClose = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverClose') + if __cuFileDriverClose == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverClose = _cyb_dlsym(handle, 'cuFileDriverClose') + + global __cuFileDriverClose_v2 + __cuFileDriverClose_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverClose_v2') + if __cuFileDriverClose_v2 == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverClose_v2 = _cyb_dlsym(handle, 'cuFileDriverClose_v2') + + global __cuFileUseCount + __cuFileUseCount = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileUseCount') + if __cuFileUseCount == NULL: + if handle == NULL: + handle = load_library() + __cuFileUseCount = _cyb_dlsym(handle, 'cuFileUseCount') + + global __cuFileDriverGetProperties + __cuFileDriverGetProperties = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverGetProperties') + if __cuFileDriverGetProperties == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverGetProperties = _cyb_dlsym(handle, 'cuFileDriverGetProperties') + + global __cuFileDriverSetPollMode + __cuFileDriverSetPollMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetPollMode') + if __cuFileDriverSetPollMode == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetPollMode = _cyb_dlsym(handle, 'cuFileDriverSetPollMode') + + global __cuFileDriverSetMaxDirectIOSize + __cuFileDriverSetMaxDirectIOSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') + if __cuFileDriverSetMaxDirectIOSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxDirectIOSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') + + global __cuFileDriverSetMaxCacheSize + __cuFileDriverSetMaxCacheSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') + if __cuFileDriverSetMaxCacheSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxCacheSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxCacheSize') + + global __cuFileDriverSetMaxPinnedMemSize + __cuFileDriverSetMaxPinnedMemSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') + if __cuFileDriverSetMaxPinnedMemSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxPinnedMemSize = _cyb_dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') + + global __cuFileBatchIOSetUp + __cuFileBatchIOSetUp = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOSetUp') + if __cuFileBatchIOSetUp == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOSetUp = _cyb_dlsym(handle, 'cuFileBatchIOSetUp') + + global __cuFileBatchIOSubmit + __cuFileBatchIOSubmit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOSubmit') + if __cuFileBatchIOSubmit == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOSubmit = _cyb_dlsym(handle, 'cuFileBatchIOSubmit') + + global __cuFileBatchIOGetStatus + __cuFileBatchIOGetStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOGetStatus') + if __cuFileBatchIOGetStatus == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOGetStatus = _cyb_dlsym(handle, 'cuFileBatchIOGetStatus') + + global __cuFileBatchIOCancel + __cuFileBatchIOCancel = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIOCancel') + if __cuFileBatchIOCancel == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOCancel = _cyb_dlsym(handle, 'cuFileBatchIOCancel') + + global __cuFileBatchIODestroy + __cuFileBatchIODestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileBatchIODestroy') + if __cuFileBatchIODestroy == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIODestroy = _cyb_dlsym(handle, 'cuFileBatchIODestroy') + + global __cuFileReadAsync + __cuFileReadAsync = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileReadAsync') + if __cuFileReadAsync == NULL: + if handle == NULL: + handle = load_library() + __cuFileReadAsync = _cyb_dlsym(handle, 'cuFileReadAsync') + + global __cuFileWriteAsync + __cuFileWriteAsync = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileWriteAsync') + if __cuFileWriteAsync == NULL: + if handle == NULL: + handle = load_library() + __cuFileWriteAsync = _cyb_dlsym(handle, 'cuFileWriteAsync') + + global __cuFileStreamRegister + __cuFileStreamRegister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileStreamRegister') + if __cuFileStreamRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileStreamRegister = _cyb_dlsym(handle, 'cuFileStreamRegister') + + global __cuFileStreamDeregister + __cuFileStreamDeregister = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileStreamDeregister') + if __cuFileStreamDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileStreamDeregister = _cyb_dlsym(handle, 'cuFileStreamDeregister') + + global __cuFileGetVersion + __cuFileGetVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetVersion') + if __cuFileGetVersion == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetVersion = _cyb_dlsym(handle, 'cuFileGetVersion') + + global __cuFileGetParameterSizeT + __cuFileGetParameterSizeT = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterSizeT') + if __cuFileGetParameterSizeT == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterSizeT = _cyb_dlsym(handle, 'cuFileGetParameterSizeT') + + global __cuFileGetParameterBool + __cuFileGetParameterBool = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterBool') + if __cuFileGetParameterBool == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterBool = _cyb_dlsym(handle, 'cuFileGetParameterBool') + + global __cuFileGetParameterString + __cuFileGetParameterString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileGetParameterString') + if __cuFileGetParameterString == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterString = _cyb_dlsym(handle, 'cuFileGetParameterString') + + global __cuFileSetParameterSizeT + __cuFileSetParameterSizeT = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterSizeT') + if __cuFileSetParameterSizeT == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterSizeT = _cyb_dlsym(handle, 'cuFileSetParameterSizeT') + + global __cuFileSetParameterBool + __cuFileSetParameterBool = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterBool') + if __cuFileSetParameterBool == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterBool = _cyb_dlsym(handle, 'cuFileSetParameterBool') + + global __cuFileSetParameterString + __cuFileSetParameterString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileSetParameterString') + if __cuFileSetParameterString == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterString = _cyb_dlsym(handle, 'cuFileSetParameterString') + + _cyb_atomic_int_store(&_cyb___py_cufile_init, 1) + return 0 + +cdef inline int _check_or_init_cufile() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_cufile_init): + return 0 + + return _init_cufile() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_cufile() + cdef dict data = {} + global __cuFileHandleRegister + data["__cuFileHandleRegister"] = __cuFileHandleRegister + + global __cuFileHandleDeregister + data["__cuFileHandleDeregister"] = __cuFileHandleDeregister + + global __cuFileBufRegister + data["__cuFileBufRegister"] = __cuFileBufRegister + + global __cuFileBufDeregister + data["__cuFileBufDeregister"] = __cuFileBufDeregister + + global __cuFileRead + data["__cuFileRead"] = __cuFileRead + + global __cuFileWrite + data["__cuFileWrite"] = __cuFileWrite + + global __cuFileDriverOpen + data["__cuFileDriverOpen"] = __cuFileDriverOpen + + global __cuFileDriverClose + data["__cuFileDriverClose"] = __cuFileDriverClose + + global __cuFileDriverClose_v2 + data["__cuFileDriverClose_v2"] = __cuFileDriverClose_v2 + + global __cuFileUseCount + data["__cuFileUseCount"] = __cuFileUseCount + + global __cuFileDriverGetProperties + data["__cuFileDriverGetProperties"] = __cuFileDriverGetProperties + + global __cuFileDriverSetPollMode + data["__cuFileDriverSetPollMode"] = __cuFileDriverSetPollMode + + global __cuFileDriverSetMaxDirectIOSize + data["__cuFileDriverSetMaxDirectIOSize"] = __cuFileDriverSetMaxDirectIOSize + + global __cuFileDriverSetMaxCacheSize + data["__cuFileDriverSetMaxCacheSize"] = __cuFileDriverSetMaxCacheSize + + global __cuFileDriverSetMaxPinnedMemSize + data["__cuFileDriverSetMaxPinnedMemSize"] = __cuFileDriverSetMaxPinnedMemSize + + global __cuFileBatchIOSetUp + data["__cuFileBatchIOSetUp"] = __cuFileBatchIOSetUp + + global __cuFileBatchIOSubmit + data["__cuFileBatchIOSubmit"] = __cuFileBatchIOSubmit + + global __cuFileBatchIOGetStatus + data["__cuFileBatchIOGetStatus"] = __cuFileBatchIOGetStatus + + global __cuFileBatchIOCancel + data["__cuFileBatchIOCancel"] = __cuFileBatchIOCancel + + global __cuFileBatchIODestroy + data["__cuFileBatchIODestroy"] = __cuFileBatchIODestroy + + global __cuFileReadAsync + data["__cuFileReadAsync"] = __cuFileReadAsync + + global __cuFileWriteAsync + data["__cuFileWriteAsync"] = __cuFileWriteAsync + + global __cuFileStreamRegister + data["__cuFileStreamRegister"] = __cuFileStreamRegister + + global __cuFileStreamDeregister + data["__cuFileStreamDeregister"] = __cuFileStreamDeregister + + global __cuFileGetVersion + data["__cuFileGetVersion"] = __cuFileGetVersion + + global __cuFileGetParameterSizeT + data["__cuFileGetParameterSizeT"] = __cuFileGetParameterSizeT + + global __cuFileGetParameterBool + data["__cuFileGetParameterBool"] = __cuFileGetParameterBool + + global __cuFileGetParameterString + data["__cuFileGetParameterString"] = __cuFileGetParameterString + + global __cuFileSetParameterSizeT + data["__cuFileSetParameterSizeT"] = __cuFileSetParameterSizeT + + global __cuFileSetParameterBool + data["__cuFileSetParameterBool"] = __cuFileSetParameterBool + + global __cuFileSetParameterString + data["__cuFileSetParameterString"] = __cuFileSetParameterString + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint + return handle + + +############################################################################### +# Wrapper functions + +cdef CUfileError_t _cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil: + global __cuFileHandleRegister + _check_or_init_cufile() + if __cuFileHandleRegister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileHandleRegister is not found") + return (__cuFileHandleRegister)( + fh, descr) + + +@_cyb_cython.show_performance_hints(False) +cdef void _cuFileHandleDeregister(CUfileHandle_t fh) except* nogil: + global __cuFileHandleDeregister + _check_or_init_cufile() + if __cuFileHandleDeregister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileHandleDeregister is not found") + (__cuFileHandleDeregister)( + fh) + + +cdef CUfileError_t _cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBufRegister + _check_or_init_cufile() + if __cuFileBufRegister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBufRegister is not found") + return (__cuFileBufRegister)( + bufPtr_base, length, flags) + + +cdef CUfileError_t _cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBufDeregister + _check_or_init_cufile() + if __cuFileBufDeregister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBufDeregister is not found") + return (__cuFileBufDeregister)( + bufPtr_base) + + +cdef ssize_t _cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil: + global __cuFileRead + _check_or_init_cufile() + if __cuFileRead == NULL: + with gil: + raise FunctionNotFoundError("function cuFileRead is not found") + return (__cuFileRead)( + fh, bufPtr_base, size, file_offset, bufPtr_offset) + + +cdef ssize_t _cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil: + global __cuFileWrite + _check_or_init_cufile() + if __cuFileWrite == NULL: + with gil: + raise FunctionNotFoundError("function cuFileWrite is not found") + return (__cuFileWrite)( + fh, bufPtr_base, size, file_offset, bufPtr_offset) + + +cdef CUfileError_t _cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverOpen + _check_or_init_cufile() + if __cuFileDriverOpen == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverOpen is not found") + return (__cuFileDriverOpen)( + ) + + +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverClose + _check_or_init_cufile() + if __cuFileDriverClose == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverClose is not found") + return (__cuFileDriverClose)( + ) + + +cdef CUfileError_t _cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverClose_v2 + _check_or_init_cufile() + if __cuFileDriverClose_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverClose_v2 is not found") + return (__cuFileDriverClose_v2)( + ) + + +cdef long _cuFileUseCount() except* nogil: + global __cuFileUseCount + _check_or_init_cufile() + if __cuFileUseCount == NULL: + with gil: + raise FunctionNotFoundError("function cuFileUseCount is not found") + return (__cuFileUseCount)( + ) + + +cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverGetProperties + _check_or_init_cufile() + if __cuFileDriverGetProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverGetProperties is not found") + return (__cuFileDriverGetProperties)( + props) + + +cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverSetPollMode + _check_or_init_cufile() + if __cuFileDriverSetPollMode == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverSetPollMode is not found") + return (__cuFileDriverSetPollMode)( + poll, poll_threshold_size) + + +cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverSetMaxDirectIOSize + _check_or_init_cufile() + if __cuFileDriverSetMaxDirectIOSize == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverSetMaxDirectIOSize is not found") + return (__cuFileDriverSetMaxDirectIOSize)( + max_direct_io_size) + + +cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverSetMaxCacheSize + _check_or_init_cufile() + if __cuFileDriverSetMaxCacheSize == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverSetMaxCacheSize is not found") + return (__cuFileDriverSetMaxCacheSize)( + max_cache_size) + + +cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverSetMaxPinnedMemSize + _check_or_init_cufile() + if __cuFileDriverSetMaxPinnedMemSize == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverSetMaxPinnedMemSize is not found") + return (__cuFileDriverSetMaxPinnedMemSize)( + max_pinned_size) + + +cdef CUfileError_t _cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBatchIOSetUp + _check_or_init_cufile() + if __cuFileBatchIOSetUp == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBatchIOSetUp is not found") + return (__cuFileBatchIOSetUp)( + batch_idp, nr) + + +cdef CUfileError_t _cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBatchIOSubmit + _check_or_init_cufile() + if __cuFileBatchIOSubmit == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBatchIOSubmit is not found") + return (__cuFileBatchIOSubmit)( + batch_idp, nr, iocbp, flags) + + +cdef CUfileError_t _cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBatchIOGetStatus + _check_or_init_cufile() + if __cuFileBatchIOGetStatus == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBatchIOGetStatus is not found") + return (__cuFileBatchIOGetStatus)( + batch_idp, min_nr, nr, iocbp, timeout) + + +cdef CUfileError_t _cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil: + global __cuFileBatchIOCancel + _check_or_init_cufile() + if __cuFileBatchIOCancel == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBatchIOCancel is not found") + return (__cuFileBatchIOCancel)( + batch_idp) + + +@_cyb_cython.show_performance_hints(False) +cdef void _cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil: + global __cuFileBatchIODestroy + _check_or_init_cufile() + if __cuFileBatchIODestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuFileBatchIODestroy is not found") + (__cuFileBatchIODestroy)( + batch_idp) + + +cdef CUfileError_t _cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil: + global __cuFileReadAsync + _check_or_init_cufile() + if __cuFileReadAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuFileReadAsync is not found") + return (__cuFileReadAsync)( + fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_read_p, stream) + + +cdef CUfileError_t _cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil: + global __cuFileWriteAsync + _check_or_init_cufile() + if __cuFileWriteAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuFileWriteAsync is not found") + return (__cuFileWriteAsync)( + fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_written_p, stream) + + +cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil: + global __cuFileStreamRegister + _check_or_init_cufile() + if __cuFileStreamRegister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileStreamRegister is not found") + return (__cuFileStreamRegister)( + stream, flags) + + +cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil: + global __cuFileStreamDeregister + _check_or_init_cufile() + if __cuFileStreamDeregister == NULL: + with gil: + raise FunctionNotFoundError("function cuFileStreamDeregister is not found") + return (__cuFileStreamDeregister)( + stream) + + +cdef CUfileError_t _cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetVersion + _check_or_init_cufile() + if __cuFileGetVersion == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetVersion is not found") + return (__cuFileGetVersion)( + version) + + +cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetParameterSizeT + _check_or_init_cufile() + if __cuFileGetParameterSizeT == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetParameterSizeT is not found") + return (__cuFileGetParameterSizeT)( + param, value) + + +cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetParameterBool + _check_or_init_cufile() + if __cuFileGetParameterBool == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetParameterBool is not found") + return (__cuFileGetParameterBool)( + param, value) + + +cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil: + global __cuFileGetParameterString + _check_or_init_cufile() + if __cuFileGetParameterString == NULL: + with gil: + raise FunctionNotFoundError("function cuFileGetParameterString is not found") + return (__cuFileGetParameterString)( + param, desc_str, len) + + +cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil: + global __cuFileSetParameterSizeT + _check_or_init_cufile() + if __cuFileSetParameterSizeT == NULL: + with gil: + raise FunctionNotFoundError("function cuFileSetParameterSizeT is not found") + return (__cuFileSetParameterSizeT)( + param, value) + + +cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil: + global __cuFileSetParameterBool + _check_or_init_cufile() + if __cuFileSetParameterBool == NULL: + with gil: + raise FunctionNotFoundError("function cuFileSetParameterBool is not found") + return (__cuFileSetParameterBool)( + param, value) + + +cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil: + global __cuFileSetParameterString + _check_or_init_cufile() + if __cuFileSetParameterString == NULL: + with gil: + raise FunctionNotFoundError("function cuFileSetParameterString is not found") + return (__cuFileSetParameterString)( + param, desc_str) diff --git a/cuda_bindings_12/cuda/bindings/_internal/driver.pxd b/cuda_bindings_12/cuda/bindings/_internal/driver.pxd new file mode 100644 index 00000000000..6efac7bc551 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/driver.pxd @@ -0,0 +1,497 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=395f93ae98b3b074267a9275aa19aff34b001e2b982b686301aace8270e40ea1 +from ..cydriver cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceTotalMem_v2(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remaining, unsigned int useFlags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx new file mode 100644 index 00000000000..34c448c5cc5 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx @@ -0,0 +1,8336 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4957d188c7c3258823fd50e2eb0cba162810911af7294ab726f1e49769642c8 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + +from libc.stdint cimport intptr_t + +from os import getenv as _cyb_getenv +import threading as _cyb_threading + +ctypedef int (*_cyb_cuGetProcAddress_v2_T)(const char *, void **, int, cuuint64_t, CUdriverProcAddressQueryResult *)except?CUDA_ERROR_NOT_FOUND nogil + +cdef int _cyb___py_driver_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + + +cdef void* __cuGetErrorString = NULL +cdef void* __cuGetErrorName = NULL +cdef void* __cuInit = NULL +cdef void* __cuDriverGetVersion = NULL +cdef void* __cuDeviceGet = NULL +cdef void* __cuDeviceGetCount = NULL +cdef void* __cuDeviceGetName = NULL +cdef void* __cuDeviceGetUuid = NULL +cdef void* __cuDeviceGetUuid_v2 = NULL +cdef void* __cuDeviceGetLuid = NULL +cdef void* __cuDeviceTotalMem_v2 = NULL +cdef void* __cuDeviceGetTexture1DLinearMaxWidth = NULL +cdef void* __cuDeviceGetAttribute = NULL +cdef void* __cuDeviceGetNvSciSyncAttributes = NULL +cdef void* __cuDeviceSetMemPool = NULL +cdef void* __cuDeviceGetMemPool = NULL +cdef void* __cuDeviceGetDefaultMemPool = NULL +cdef void* __cuDeviceGetExecAffinitySupport = NULL +cdef void* __cuFlushGPUDirectRDMAWrites = NULL +cdef void* __cuDeviceGetProperties = NULL +cdef void* __cuDeviceComputeCapability = NULL +cdef void* __cuDevicePrimaryCtxRetain = NULL +cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL +cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL +cdef void* __cuDevicePrimaryCtxGetState = NULL +cdef void* __cuDevicePrimaryCtxReset_v2 = NULL +cdef void* __cuCtxCreate_v2 = NULL +cdef void* __cuCtxCreate_v3 = NULL +cdef void* __cuCtxCreate_v4 = NULL +cdef void* __cuCtxDestroy_v2 = NULL +cdef void* __cuCtxPushCurrent_v2 = NULL +cdef void* __cuCtxPopCurrent_v2 = NULL +cdef void* __cuCtxSetCurrent = NULL +cdef void* __cuCtxGetCurrent = NULL +cdef void* __cuCtxGetDevice = NULL +cdef void* __cuCtxGetFlags = NULL +cdef void* __cuCtxSetFlags = NULL +cdef void* __cuCtxGetId = NULL +cdef void* __cuCtxSynchronize = NULL +cdef void* __cuCtxSetLimit = NULL +cdef void* __cuCtxGetLimit = NULL +cdef void* __cuCtxGetCacheConfig = NULL +cdef void* __cuCtxSetCacheConfig = NULL +cdef void* __cuCtxGetApiVersion = NULL +cdef void* __cuCtxGetStreamPriorityRange = NULL +cdef void* __cuCtxResetPersistingL2Cache = NULL +cdef void* __cuCtxGetExecAffinity = NULL +cdef void* __cuCtxRecordEvent = NULL +cdef void* __cuCtxWaitEvent = NULL +cdef void* __cuCtxAttach = NULL +cdef void* __cuCtxDetach = NULL +cdef void* __cuCtxGetSharedMemConfig = NULL +cdef void* __cuCtxSetSharedMemConfig = NULL +cdef void* __cuModuleLoad = NULL +cdef void* __cuModuleLoadData = NULL +cdef void* __cuModuleLoadDataEx = NULL +cdef void* __cuModuleLoadFatBinary = NULL +cdef void* __cuModuleUnload = NULL +cdef void* __cuModuleGetLoadingMode = NULL +cdef void* __cuModuleGetFunction = NULL +cdef void* __cuModuleGetFunctionCount = NULL +cdef void* __cuModuleEnumerateFunctions = NULL +cdef void* __cuModuleGetGlobal_v2 = NULL +cdef void* __cuLinkCreate_v2 = NULL +cdef void* __cuLinkAddData_v2 = NULL +cdef void* __cuLinkAddFile_v2 = NULL +cdef void* __cuLinkComplete = NULL +cdef void* __cuLinkDestroy = NULL +cdef void* __cuModuleGetTexRef = NULL +cdef void* __cuModuleGetSurfRef = NULL +cdef void* __cuLibraryLoadData = NULL +cdef void* __cuLibraryLoadFromFile = NULL +cdef void* __cuLibraryUnload = NULL +cdef void* __cuLibraryGetKernel = NULL +cdef void* __cuLibraryGetKernelCount = NULL +cdef void* __cuLibraryEnumerateKernels = NULL +cdef void* __cuLibraryGetModule = NULL +cdef void* __cuKernelGetFunction = NULL +cdef void* __cuKernelGetLibrary = NULL +cdef void* __cuLibraryGetGlobal = NULL +cdef void* __cuLibraryGetManaged = NULL +cdef void* __cuLibraryGetUnifiedFunction = NULL +cdef void* __cuKernelGetAttribute = NULL +cdef void* __cuKernelSetAttribute = NULL +cdef void* __cuKernelSetCacheConfig = NULL +cdef void* __cuKernelGetName = NULL +cdef void* __cuKernelGetParamInfo = NULL +cdef void* __cuMemGetInfo_v2 = NULL +cdef void* __cuMemAlloc_v2 = NULL +cdef void* __cuMemAllocPitch_v2 = NULL +cdef void* __cuMemFree_v2 = NULL +cdef void* __cuMemGetAddressRange_v2 = NULL +cdef void* __cuMemAllocHost_v2 = NULL +cdef void* __cuMemFreeHost = NULL +cdef void* __cuMemHostAlloc = NULL +cdef void* __cuMemHostGetDevicePointer_v2 = NULL +cdef void* __cuMemHostGetFlags = NULL +cdef void* __cuMemAllocManaged = NULL +cdef void* __cuDeviceRegisterAsyncNotification = NULL +cdef void* __cuDeviceUnregisterAsyncNotification = NULL +cdef void* __cuDeviceGetByPCIBusId = NULL +cdef void* __cuDeviceGetPCIBusId = NULL +cdef void* __cuIpcGetEventHandle = NULL +cdef void* __cuIpcOpenEventHandle = NULL +cdef void* __cuIpcGetMemHandle = NULL +cdef void* __cuIpcOpenMemHandle_v2 = NULL +cdef void* __cuIpcCloseMemHandle = NULL +cdef void* __cuMemHostRegister_v2 = NULL +cdef void* __cuMemHostUnregister = NULL +cdef void* __cuMemcpy = NULL +cdef void* __cuMemcpyPeer = NULL +cdef void* __cuMemcpyHtoD_v2 = NULL +cdef void* __cuMemcpyDtoH_v2 = NULL +cdef void* __cuMemcpyDtoD_v2 = NULL +cdef void* __cuMemcpyDtoA_v2 = NULL +cdef void* __cuMemcpyAtoD_v2 = NULL +cdef void* __cuMemcpyHtoA_v2 = NULL +cdef void* __cuMemcpyAtoH_v2 = NULL +cdef void* __cuMemcpyAtoA_v2 = NULL +cdef void* __cuMemcpy2D_v2 = NULL +cdef void* __cuMemcpy2DUnaligned_v2 = NULL +cdef void* __cuMemcpy3D_v2 = NULL +cdef void* __cuMemcpy3DPeer = NULL +cdef void* __cuMemcpyAsync = NULL +cdef void* __cuMemcpyPeerAsync = NULL +cdef void* __cuMemcpyHtoDAsync_v2 = NULL +cdef void* __cuMemcpyDtoHAsync_v2 = NULL +cdef void* __cuMemcpyDtoDAsync_v2 = NULL +cdef void* __cuMemcpyHtoAAsync_v2 = NULL +cdef void* __cuMemcpyAtoHAsync_v2 = NULL +cdef void* __cuMemcpy2DAsync_v2 = NULL +cdef void* __cuMemcpy3DAsync_v2 = NULL +cdef void* __cuMemcpy3DPeerAsync = NULL +cdef void* __cuMemcpyBatchAsync = NULL +cdef void* __cuMemcpy3DBatchAsync = NULL +cdef void* __cuMemsetD8_v2 = NULL +cdef void* __cuMemsetD16_v2 = NULL +cdef void* __cuMemsetD32_v2 = NULL +cdef void* __cuMemsetD2D8_v2 = NULL +cdef void* __cuMemsetD2D16_v2 = NULL +cdef void* __cuMemsetD2D32_v2 = NULL +cdef void* __cuMemsetD8Async = NULL +cdef void* __cuMemsetD16Async = NULL +cdef void* __cuMemsetD32Async = NULL +cdef void* __cuMemsetD2D8Async = NULL +cdef void* __cuMemsetD2D16Async = NULL +cdef void* __cuMemsetD2D32Async = NULL +cdef void* __cuArrayCreate_v2 = NULL +cdef void* __cuArrayGetDescriptor_v2 = NULL +cdef void* __cuArrayGetSparseProperties = NULL +cdef void* __cuMipmappedArrayGetSparseProperties = NULL +cdef void* __cuArrayGetMemoryRequirements = NULL +cdef void* __cuMipmappedArrayGetMemoryRequirements = NULL +cdef void* __cuArrayGetPlane = NULL +cdef void* __cuArrayDestroy = NULL +cdef void* __cuArray3DCreate_v2 = NULL +cdef void* __cuArray3DGetDescriptor_v2 = NULL +cdef void* __cuMipmappedArrayCreate = NULL +cdef void* __cuMipmappedArrayGetLevel = NULL +cdef void* __cuMipmappedArrayDestroy = NULL +cdef void* __cuMemGetHandleForAddressRange = NULL +cdef void* __cuMemBatchDecompressAsync = NULL +cdef void* __cuMemAddressReserve = NULL +cdef void* __cuMemAddressFree = NULL +cdef void* __cuMemCreate = NULL +cdef void* __cuMemRelease = NULL +cdef void* __cuMemMap = NULL +cdef void* __cuMemMapArrayAsync = NULL +cdef void* __cuMemUnmap = NULL +cdef void* __cuMemSetAccess = NULL +cdef void* __cuMemGetAccess = NULL +cdef void* __cuMemExportToShareableHandle = NULL +cdef void* __cuMemImportFromShareableHandle = NULL +cdef void* __cuMemGetAllocationGranularity = NULL +cdef void* __cuMemGetAllocationPropertiesFromHandle = NULL +cdef void* __cuMemRetainAllocationHandle = NULL +cdef void* __cuMemFreeAsync = NULL +cdef void* __cuMemAllocAsync = NULL +cdef void* __cuMemPoolTrimTo = NULL +cdef void* __cuMemPoolSetAttribute = NULL +cdef void* __cuMemPoolGetAttribute = NULL +cdef void* __cuMemPoolSetAccess = NULL +cdef void* __cuMemPoolGetAccess = NULL +cdef void* __cuMemPoolCreate = NULL +cdef void* __cuMemPoolDestroy = NULL +cdef void* __cuMemAllocFromPoolAsync = NULL +cdef void* __cuMemPoolExportToShareableHandle = NULL +cdef void* __cuMemPoolImportFromShareableHandle = NULL +cdef void* __cuMemPoolExportPointer = NULL +cdef void* __cuMemPoolImportPointer = NULL +cdef void* __cuMulticastCreate = NULL +cdef void* __cuMulticastAddDevice = NULL +cdef void* __cuMulticastBindMem = NULL +cdef void* __cuMulticastBindAddr = NULL +cdef void* __cuMulticastUnbind = NULL +cdef void* __cuMulticastGetGranularity = NULL +cdef void* __cuPointerGetAttribute = NULL +cdef void* __cuMemPrefetchAsync = NULL +cdef void* __cuMemPrefetchAsync_v2 = NULL +cdef void* __cuMemAdvise = NULL +cdef void* __cuMemAdvise_v2 = NULL +cdef void* __cuMemRangeGetAttribute = NULL +cdef void* __cuMemRangeGetAttributes = NULL +cdef void* __cuPointerSetAttribute = NULL +cdef void* __cuPointerGetAttributes = NULL +cdef void* __cuStreamCreate = NULL +cdef void* __cuStreamCreateWithPriority = NULL +cdef void* __cuStreamGetPriority = NULL +cdef void* __cuStreamGetDevice = NULL +cdef void* __cuStreamGetFlags = NULL +cdef void* __cuStreamGetId = NULL +cdef void* __cuStreamGetCtx = NULL +cdef void* __cuStreamGetCtx_v2 = NULL +cdef void* __cuStreamWaitEvent = NULL +cdef void* __cuStreamAddCallback = NULL +cdef void* __cuStreamBeginCapture_v2 = NULL +cdef void* __cuStreamBeginCaptureToGraph = NULL +cdef void* __cuThreadExchangeStreamCaptureMode = NULL +cdef void* __cuStreamEndCapture = NULL +cdef void* __cuStreamIsCapturing = NULL +cdef void* __cuStreamGetCaptureInfo_v2 = NULL +cdef void* __cuStreamGetCaptureInfo_v3 = NULL +cdef void* __cuStreamUpdateCaptureDependencies = NULL +cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL +cdef void* __cuStreamAttachMemAsync = NULL +cdef void* __cuStreamQuery = NULL +cdef void* __cuStreamSynchronize = NULL +cdef void* __cuStreamDestroy_v2 = NULL +cdef void* __cuStreamCopyAttributes = NULL +cdef void* __cuStreamGetAttribute = NULL +cdef void* __cuStreamSetAttribute = NULL +cdef void* __cuEventCreate = NULL +cdef void* __cuEventRecord = NULL +cdef void* __cuEventRecordWithFlags = NULL +cdef void* __cuEventQuery = NULL +cdef void* __cuEventSynchronize = NULL +cdef void* __cuEventDestroy_v2 = NULL +cdef void* __cuEventElapsedTime = NULL +cdef void* __cuEventElapsedTime_v2 = NULL +cdef void* __cuImportExternalMemory = NULL +cdef void* __cuExternalMemoryGetMappedBuffer = NULL +cdef void* __cuExternalMemoryGetMappedMipmappedArray = NULL +cdef void* __cuDestroyExternalMemory = NULL +cdef void* __cuImportExternalSemaphore = NULL +cdef void* __cuSignalExternalSemaphoresAsync = NULL +cdef void* __cuWaitExternalSemaphoresAsync = NULL +cdef void* __cuDestroyExternalSemaphore = NULL +cdef void* __cuStreamWaitValue32_v2 = NULL +cdef void* __cuStreamWaitValue64_v2 = NULL +cdef void* __cuStreamWriteValue32_v2 = NULL +cdef void* __cuStreamWriteValue64_v2 = NULL +cdef void* __cuStreamBatchMemOp_v2 = NULL +cdef void* __cuFuncGetAttribute = NULL +cdef void* __cuFuncSetAttribute = NULL +cdef void* __cuFuncSetCacheConfig = NULL +cdef void* __cuFuncGetModule = NULL +cdef void* __cuFuncGetName = NULL +cdef void* __cuFuncGetParamInfo = NULL +cdef void* __cuFuncIsLoaded = NULL +cdef void* __cuFuncLoad = NULL +cdef void* __cuLaunchKernel = NULL +cdef void* __cuLaunchKernelEx = NULL +cdef void* __cuLaunchCooperativeKernel = NULL +cdef void* __cuLaunchCooperativeKernelMultiDevice = NULL +cdef void* __cuLaunchHostFunc = NULL +cdef void* __cuFuncSetBlockShape = NULL +cdef void* __cuFuncSetSharedSize = NULL +cdef void* __cuParamSetSize = NULL +cdef void* __cuParamSeti = NULL +cdef void* __cuParamSetf = NULL +cdef void* __cuParamSetv = NULL +cdef void* __cuLaunch = NULL +cdef void* __cuLaunchGrid = NULL +cdef void* __cuLaunchGridAsync = NULL +cdef void* __cuParamSetTexRef = NULL +cdef void* __cuFuncSetSharedMemConfig = NULL +cdef void* __cuGraphCreate = NULL +cdef void* __cuGraphAddKernelNode_v2 = NULL +cdef void* __cuGraphKernelNodeGetParams_v2 = NULL +cdef void* __cuGraphKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphAddMemcpyNode = NULL +cdef void* __cuGraphMemcpyNodeGetParams = NULL +cdef void* __cuGraphMemcpyNodeSetParams = NULL +cdef void* __cuGraphAddMemsetNode = NULL +cdef void* __cuGraphMemsetNodeGetParams = NULL +cdef void* __cuGraphMemsetNodeSetParams = NULL +cdef void* __cuGraphAddHostNode = NULL +cdef void* __cuGraphHostNodeGetParams = NULL +cdef void* __cuGraphHostNodeSetParams = NULL +cdef void* __cuGraphAddChildGraphNode = NULL +cdef void* __cuGraphChildGraphNodeGetGraph = NULL +cdef void* __cuGraphAddEmptyNode = NULL +cdef void* __cuGraphAddEventRecordNode = NULL +cdef void* __cuGraphEventRecordNodeGetEvent = NULL +cdef void* __cuGraphEventRecordNodeSetEvent = NULL +cdef void* __cuGraphAddEventWaitNode = NULL +cdef void* __cuGraphEventWaitNodeGetEvent = NULL +cdef void* __cuGraphEventWaitNodeSetEvent = NULL +cdef void* __cuGraphAddExternalSemaphoresSignalNode = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphAddExternalSemaphoresWaitNode = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphAddBatchMemOpNode = NULL +cdef void* __cuGraphBatchMemOpNodeGetParams = NULL +cdef void* __cuGraphBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphExecBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphAddMemAllocNode = NULL +cdef void* __cuGraphMemAllocNodeGetParams = NULL +cdef void* __cuGraphAddMemFreeNode = NULL +cdef void* __cuGraphMemFreeNodeGetParams = NULL +cdef void* __cuDeviceGraphMemTrim = NULL +cdef void* __cuDeviceGetGraphMemAttribute = NULL +cdef void* __cuDeviceSetGraphMemAttribute = NULL +cdef void* __cuGraphClone = NULL +cdef void* __cuGraphNodeFindInClone = NULL +cdef void* __cuGraphNodeGetType = NULL +cdef void* __cuGraphGetNodes = NULL +cdef void* __cuGraphGetRootNodes = NULL +cdef void* __cuGraphGetEdges = NULL +cdef void* __cuGraphGetEdges_v2 = NULL +cdef void* __cuGraphNodeGetDependencies = NULL +cdef void* __cuGraphNodeGetDependencies_v2 = NULL +cdef void* __cuGraphNodeGetDependentNodes = NULL +cdef void* __cuGraphNodeGetDependentNodes_v2 = NULL +cdef void* __cuGraphAddDependencies = NULL +cdef void* __cuGraphAddDependencies_v2 = NULL +cdef void* __cuGraphRemoveDependencies = NULL +cdef void* __cuGraphRemoveDependencies_v2 = NULL +cdef void* __cuGraphDestroyNode = NULL +cdef void* __cuGraphInstantiateWithFlags = NULL +cdef void* __cuGraphInstantiateWithParams = NULL +cdef void* __cuGraphExecGetFlags = NULL +cdef void* __cuGraphExecKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphExecMemcpyNodeSetParams = NULL +cdef void* __cuGraphExecMemsetNodeSetParams = NULL +cdef void* __cuGraphExecHostNodeSetParams = NULL +cdef void* __cuGraphExecChildGraphNodeSetParams = NULL +cdef void* __cuGraphExecEventRecordNodeSetEvent = NULL +cdef void* __cuGraphExecEventWaitNodeSetEvent = NULL +cdef void* __cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphNodeSetEnabled = NULL +cdef void* __cuGraphNodeGetEnabled = NULL +cdef void* __cuGraphUpload = NULL +cdef void* __cuGraphLaunch = NULL +cdef void* __cuGraphExecDestroy = NULL +cdef void* __cuGraphDestroy = NULL +cdef void* __cuGraphExecUpdate_v2 = NULL +cdef void* __cuGraphKernelNodeCopyAttributes = NULL +cdef void* __cuGraphKernelNodeGetAttribute = NULL +cdef void* __cuGraphKernelNodeSetAttribute = NULL +cdef void* __cuGraphDebugDotPrint = NULL +cdef void* __cuUserObjectCreate = NULL +cdef void* __cuUserObjectRetain = NULL +cdef void* __cuUserObjectRelease = NULL +cdef void* __cuGraphRetainUserObject = NULL +cdef void* __cuGraphReleaseUserObject = NULL +cdef void* __cuGraphAddNode = NULL +cdef void* __cuGraphAddNode_v2 = NULL +cdef void* __cuGraphNodeSetParams = NULL +cdef void* __cuGraphExecNodeSetParams = NULL +cdef void* __cuGraphConditionalHandleCreate = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL +cdef void* __cuOccupancyMaxPotentialBlockSize = NULL +cdef void* __cuOccupancyMaxPotentialBlockSizeWithFlags = NULL +cdef void* __cuOccupancyAvailableDynamicSMemPerBlock = NULL +cdef void* __cuOccupancyMaxPotentialClusterSize = NULL +cdef void* __cuOccupancyMaxActiveClusters = NULL +cdef void* __cuTexRefSetArray = NULL +cdef void* __cuTexRefSetMipmappedArray = NULL +cdef void* __cuTexRefSetAddress_v2 = NULL +cdef void* __cuTexRefSetAddress2D_v3 = NULL +cdef void* __cuTexRefSetFormat = NULL +cdef void* __cuTexRefSetAddressMode = NULL +cdef void* __cuTexRefSetFilterMode = NULL +cdef void* __cuTexRefSetMipmapFilterMode = NULL +cdef void* __cuTexRefSetMipmapLevelBias = NULL +cdef void* __cuTexRefSetMipmapLevelClamp = NULL +cdef void* __cuTexRefSetMaxAnisotropy = NULL +cdef void* __cuTexRefSetBorderColor = NULL +cdef void* __cuTexRefSetFlags = NULL +cdef void* __cuTexRefGetAddress_v2 = NULL +cdef void* __cuTexRefGetArray = NULL +cdef void* __cuTexRefGetMipmappedArray = NULL +cdef void* __cuTexRefGetAddressMode = NULL +cdef void* __cuTexRefGetFilterMode = NULL +cdef void* __cuTexRefGetFormat = NULL +cdef void* __cuTexRefGetMipmapFilterMode = NULL +cdef void* __cuTexRefGetMipmapLevelBias = NULL +cdef void* __cuTexRefGetMipmapLevelClamp = NULL +cdef void* __cuTexRefGetMaxAnisotropy = NULL +cdef void* __cuTexRefGetBorderColor = NULL +cdef void* __cuTexRefGetFlags = NULL +cdef void* __cuTexRefCreate = NULL +cdef void* __cuTexRefDestroy = NULL +cdef void* __cuSurfRefSetArray = NULL +cdef void* __cuSurfRefGetArray = NULL +cdef void* __cuTexObjectCreate = NULL +cdef void* __cuTexObjectDestroy = NULL +cdef void* __cuTexObjectGetResourceDesc = NULL +cdef void* __cuTexObjectGetTextureDesc = NULL +cdef void* __cuTexObjectGetResourceViewDesc = NULL +cdef void* __cuSurfObjectCreate = NULL +cdef void* __cuSurfObjectDestroy = NULL +cdef void* __cuSurfObjectGetResourceDesc = NULL +cdef void* __cuTensorMapEncodeTiled = NULL +cdef void* __cuTensorMapEncodeIm2col = NULL +cdef void* __cuTensorMapEncodeIm2colWide = NULL +cdef void* __cuTensorMapReplaceAddress = NULL +cdef void* __cuDeviceCanAccessPeer = NULL +cdef void* __cuCtxEnablePeerAccess = NULL +cdef void* __cuCtxDisablePeerAccess = NULL +cdef void* __cuDeviceGetP2PAttribute = NULL +cdef void* __cuGraphicsUnregisterResource = NULL +cdef void* __cuGraphicsSubResourceGetMappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedMipmappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedPointer_v2 = NULL +cdef void* __cuGraphicsResourceSetMapFlags_v2 = NULL +cdef void* __cuGraphicsMapResources = NULL +cdef void* __cuGraphicsUnmapResources = NULL +cdef void* __cuGetProcAddress_v2 = NULL +cdef void* __cuCoredumpGetAttribute = NULL +cdef void* __cuCoredumpGetAttributeGlobal = NULL +cdef void* __cuCoredumpSetAttribute = NULL +cdef void* __cuCoredumpSetAttributeGlobal = NULL +cdef void* __cuGetExportTable = NULL +cdef void* __cuGreenCtxCreate = NULL +cdef void* __cuGreenCtxDestroy = NULL +cdef void* __cuCtxFromGreenCtx = NULL +cdef void* __cuDeviceGetDevResource = NULL +cdef void* __cuCtxGetDevResource = NULL +cdef void* __cuGreenCtxGetDevResource = NULL +cdef void* __cuDevSmResourceSplitByCount = NULL +cdef void* __cuDevResourceGenerateDesc = NULL +cdef void* __cuGreenCtxRecordEvent = NULL +cdef void* __cuGreenCtxWaitEvent = NULL +cdef void* __cuStreamGetGreenCtx = NULL +cdef void* __cuGreenCtxStreamCreate = NULL +cdef void* __cuLogsRegisterCallback = NULL +cdef void* __cuLogsUnregisterCallback = NULL +cdef void* __cuLogsCurrent = NULL +cdef void* __cuLogsDumpToFile = NULL +cdef void* __cuLogsDumpToMemory = NULL +cdef void* __cuCheckpointProcessGetRestoreThreadId = NULL +cdef void* __cuCheckpointProcessGetState = NULL +cdef void* __cuCheckpointProcessLock = NULL +cdef void* __cuCheckpointProcessCheckpoint = NULL +cdef void* __cuCheckpointProcessRestore = NULL +cdef void* __cuCheckpointProcessUnlock = NULL +cdef void* __cuGraphicsEGLRegisterImage = NULL +cdef void* __cuEGLStreamConsumerConnect = NULL +cdef void* __cuEGLStreamConsumerConnectWithFlags = NULL +cdef void* __cuEGLStreamConsumerDisconnect = NULL +cdef void* __cuEGLStreamConsumerAcquireFrame = NULL +cdef void* __cuEGLStreamConsumerReleaseFrame = NULL +cdef void* __cuEGLStreamProducerConnect = NULL +cdef void* __cuEGLStreamProducerDisconnect = NULL +cdef void* __cuEGLStreamProducerPresentFrame = NULL +cdef void* __cuEGLStreamProducerReturnFrame = NULL +cdef void* __cuGraphicsResourceGetMappedEglFrame = NULL +cdef void* __cuEventCreateFromEGLSync = NULL +cdef void* __cuGraphicsGLRegisterBuffer = NULL +cdef void* __cuGraphicsGLRegisterImage = NULL +cdef void* __cuGLGetDevices_v2 = NULL +cdef void* __cuGLCtxCreate_v2 = NULL +cdef void* __cuGLInit = NULL +cdef void* __cuGLRegisterBufferObject = NULL +cdef void* __cuGLMapBufferObject_v2 = NULL +cdef void* __cuGLUnmapBufferObject = NULL +cdef void* __cuGLUnregisterBufferObject = NULL +cdef void* __cuGLSetBufferObjectMapFlags = NULL +cdef void* __cuGLMapBufferObjectAsync_v2 = NULL +cdef void* __cuGLUnmapBufferObjectAsync = NULL +cdef void* __cuProfilerInitialize = NULL +cdef void* __cuProfilerStart = NULL +cdef void* __cuProfilerStop = NULL +cdef void* __cuVDPAUGetDevice = NULL +cdef void* __cuVDPAUCtxCreate_v2 = NULL +cdef void* __cuGraphicsVDPAURegisterVideoSurface = NULL +cdef void* __cuGraphicsVDPAURegisterOutputSurface = NULL + +cdef int _init_driver() except -1 nogil: + global _cyb___py_driver_init + cdef void* handle = NULL + cdef int ptds_mode + cdef _cyb_cuGetProcAddress_v2_T cuGetProcAddress_v2 + with gil, _cyb_symbol_lock: + if _cyb___py_driver_init: return 0 + + handle = load_library() + if handle == NULL: + raise RuntimeError('Failed to open cuda') + # Get latest cuGetProcAddress_v2 + cuGetProcAddress_v2 = <_cyb_cuGetProcAddress_v2_T>_cyb_dlsym(handle, 'cuGetProcAddress_v2') + if cuGetProcAddress_v2 == NULL: + raise RuntimeError("Failed to get cuGetProcAddress_v2") + if bool(int(_cyb_getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))): + ptds_mode = CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + else: + ptds_mode = CU_GET_PROC_ADDRESS_DEFAULT + global __cuGetErrorString + cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, ptds_mode, NULL) + + global __cuGetErrorName + cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, ptds_mode, NULL) + + global __cuInit + cuGetProcAddress_v2('cuInit', &__cuInit, 2000, ptds_mode, NULL) + + global __cuDriverGetVersion + cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, ptds_mode, NULL) + + global __cuDeviceGet + cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, ptds_mode, NULL) + + global __cuDeviceGetCount + cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, ptds_mode, NULL) + + global __cuDeviceGetName + cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, ptds_mode, NULL) + + global __cuDeviceGetUuid + cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, ptds_mode, NULL) + + global __cuDeviceGetUuid_v2 + cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, ptds_mode, NULL) + + global __cuDeviceGetLuid + cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, ptds_mode, NULL) + + global __cuDeviceTotalMem_v2 + cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, ptds_mode, NULL) + + global __cuDeviceGetTexture1DLinearMaxWidth + cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, ptds_mode, NULL) + + global __cuDeviceGetAttribute + cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, ptds_mode, NULL) + + global __cuDeviceGetNvSciSyncAttributes + cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, ptds_mode, NULL) + + global __cuDeviceSetMemPool + cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetMemPool + cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetDefaultMemPool + cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetExecAffinitySupport + cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, ptds_mode, NULL) + + global __cuFlushGPUDirectRDMAWrites + cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, ptds_mode, NULL) + + global __cuDeviceGetProperties + cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, ptds_mode, NULL) + + global __cuDeviceComputeCapability + cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRetain + cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRelease_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxSetFlags_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxGetState + cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxReset_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL) + + global __cuCtxCreate_v2 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuCtxCreate_v3 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, ptds_mode, NULL) + + global __cuCtxCreate_v4 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, ptds_mode, NULL) + + global __cuCtxDestroy_v2 + cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, ptds_mode, NULL) + + global __cuCtxPushCurrent_v2 + cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxPopCurrent_v2 + cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxSetCurrent + cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetCurrent + cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetDevice + cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, ptds_mode, NULL) + + global __cuCtxGetFlags + cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, ptds_mode, NULL) + + global __cuCtxSetFlags + cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, ptds_mode, NULL) + + global __cuCtxGetId + cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, ptds_mode, NULL) + + global __cuCtxSynchronize + cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, ptds_mode, NULL) + + global __cuCtxSetLimit + cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetLimit + cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetCacheConfig + cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxSetCacheConfig + cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxGetApiVersion + cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, ptds_mode, NULL) + + global __cuCtxGetStreamPriorityRange + cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, ptds_mode, NULL) + + global __cuCtxResetPersistingL2Cache + cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, ptds_mode, NULL) + + global __cuCtxGetExecAffinity + cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, ptds_mode, NULL) + + global __cuCtxRecordEvent + cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, ptds_mode, NULL) + + global __cuCtxWaitEvent + cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, ptds_mode, NULL) + + global __cuCtxAttach + cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, ptds_mode, NULL) + + global __cuCtxDetach + cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, ptds_mode, NULL) + + global __cuCtxGetSharedMemConfig + cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuCtxSetSharedMemConfig + cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuModuleLoad + cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, ptds_mode, NULL) + + global __cuModuleLoadData + cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, ptds_mode, NULL) + + global __cuModuleLoadDataEx + cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, ptds_mode, NULL) + + global __cuModuleLoadFatBinary + cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, ptds_mode, NULL) + + global __cuModuleUnload + cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, ptds_mode, NULL) + + global __cuModuleGetLoadingMode + cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, ptds_mode, NULL) + + global __cuModuleGetFunction + cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, ptds_mode, NULL) + + global __cuModuleGetFunctionCount + cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, ptds_mode, NULL) + + global __cuModuleEnumerateFunctions + cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, ptds_mode, NULL) + + global __cuModuleGetGlobal_v2 + cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, ptds_mode, NULL) + + global __cuLinkCreate_v2 + cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddData_v2 + cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddFile_v2 + cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, ptds_mode, NULL) + + global __cuLinkComplete + cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, ptds_mode, NULL) + + global __cuLinkDestroy + cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, ptds_mode, NULL) + + global __cuModuleGetTexRef + cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, ptds_mode, NULL) + + global __cuModuleGetSurfRef + cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, ptds_mode, NULL) + + global __cuLibraryLoadData + cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, ptds_mode, NULL) + + global __cuLibraryLoadFromFile + cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, ptds_mode, NULL) + + global __cuLibraryUnload + cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernel + cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernelCount + cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, ptds_mode, NULL) + + global __cuLibraryEnumerateKernels + cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, ptds_mode, NULL) + + global __cuLibraryGetModule + cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, ptds_mode, NULL) + + global __cuKernelGetFunction + cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetLibrary + cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, ptds_mode, NULL) + + global __cuLibraryGetGlobal + cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, ptds_mode, NULL) + + global __cuLibraryGetManaged + cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, ptds_mode, NULL) + + global __cuLibraryGetUnifiedFunction + cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetAttribute + cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetAttribute + cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetCacheConfig + cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, ptds_mode, NULL) + + global __cuKernelGetName + cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, ptds_mode, NULL) + + global __cuKernelGetParamInfo + cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, ptds_mode, NULL) + + global __cuMemGetInfo_v2 + cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, ptds_mode, NULL) + + global __cuMemAlloc_v2 + cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocPitch_v2 + cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, ptds_mode, NULL) + + global __cuMemFree_v2 + cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, ptds_mode, NULL) + + global __cuMemGetAddressRange_v2 + cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocHost_v2 + cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, ptds_mode, NULL) + + global __cuMemFreeHost + cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, ptds_mode, NULL) + + global __cuMemHostAlloc + cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, ptds_mode, NULL) + + global __cuMemHostGetDevicePointer_v2 + cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, ptds_mode, NULL) + + global __cuMemHostGetFlags + cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, ptds_mode, NULL) + + global __cuMemAllocManaged + cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, ptds_mode, NULL) + + global __cuDeviceRegisterAsyncNotification + cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceUnregisterAsyncNotification + cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceGetByPCIBusId + cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, ptds_mode, NULL) + + global __cuDeviceGetPCIBusId + cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, ptds_mode, NULL) + + global __cuIpcGetEventHandle + cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenEventHandle + cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcGetMemHandle + cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenMemHandle_v2 + cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, ptds_mode, NULL) + + global __cuIpcCloseMemHandle + cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, ptds_mode, NULL) + + global __cuMemHostRegister_v2 + cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, ptds_mode, NULL) + + global __cuMemHostUnregister + cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, ptds_mode, NULL) + + global __cuMemcpy + cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeer + cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoD_v2 + cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoH_v2 + cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoD_v2 + cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoA_v2 + cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoD_v2 + cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoA_v2 + cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoH_v2 + cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoA_v2 + cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2D_v2 + cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DUnaligned_v2 + cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3D_v2 + cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeer + cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyAsync + cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeerAsync + cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoDAsync_v2 + cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoHAsync_v2 + 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 + 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 + 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 + 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 + 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 + cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeerAsync + cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyBatchAsync + cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, ptds_mode, NULL) + + global __cuMemcpy3DBatchAsync + cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, ptds_mode, NULL) + + global __cuMemsetD8_v2 + 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 + 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 + 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 + 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 + 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 + cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD8Async + cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16Async + cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32Async + cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8Async + cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16Async + cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32Async + cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuArrayCreate_v2 + cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetDescriptor_v2 + cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetSparseProperties + cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuMipmappedArrayGetSparseProperties + cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuArrayGetMemoryRequirements + cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuMipmappedArrayGetMemoryRequirements + cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuArrayGetPlane + cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, ptds_mode, NULL) + + global __cuArrayDestroy + cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, ptds_mode, NULL) + + global __cuArray3DCreate_v2 + cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, ptds_mode, NULL) + + global __cuArray3DGetDescriptor_v2 + cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuMipmappedArrayCreate + cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayGetLevel + cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayDestroy + cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, ptds_mode, NULL) + + global __cuMemGetHandleForAddressRange + cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, ptds_mode, NULL) + + global __cuMemBatchDecompressAsync + cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, ptds_mode, NULL) + + global __cuMemAddressReserve + cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, ptds_mode, NULL) + + global __cuMemAddressFree + cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, ptds_mode, NULL) + + global __cuMemCreate + cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, ptds_mode, NULL) + + global __cuMemRelease + cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, ptds_mode, NULL) + + global __cuMemMap + cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, ptds_mode, NULL) + + global __cuMemMapArrayAsync + cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, ptds_mode, NULL) + + global __cuMemUnmap + cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, ptds_mode, NULL) + + global __cuMemSetAccess + cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, ptds_mode, NULL) + + global __cuMemGetAccess + cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, ptds_mode, NULL) + + global __cuMemExportToShareableHandle + cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemImportFromShareableHandle + cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationGranularity + cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationPropertiesFromHandle + cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, ptds_mode, NULL) + + global __cuMemRetainAllocationHandle + cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, ptds_mode, NULL) + + global __cuMemFreeAsync + cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, ptds_mode, NULL) + + global __cuMemAllocAsync + cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolTrimTo + cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAttribute + cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAttribute + cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAccess + cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAccess + cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolCreate + cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, ptds_mode, NULL) + + global __cuMemPoolDestroy + cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, ptds_mode, NULL) + + global __cuMemAllocFromPoolAsync + cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolExportToShareableHandle + cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolImportFromShareableHandle + cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolExportPointer + cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, ptds_mode, NULL) + + global __cuMemPoolImportPointer + cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, ptds_mode, NULL) + + global __cuMulticastCreate + cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, ptds_mode, NULL) + + global __cuMulticastAddDevice + cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, ptds_mode, NULL) + + global __cuMulticastBindMem + cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, ptds_mode, NULL) + + global __cuMulticastBindAddr + cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, ptds_mode, NULL) + + global __cuMulticastUnbind + cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, ptds_mode, NULL) + + global __cuMulticastGetGranularity + cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, ptds_mode, NULL) + + global __cuPointerGetAttribute + cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, ptds_mode, NULL) + + global __cuMemPrefetchAsync + cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, ptds_mode, NULL) + + global __cuMemPrefetchAsync_v2 + cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, ptds_mode, NULL) + + global __cuMemAdvise + cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise, 8000, ptds_mode, NULL) + + global __cuMemAdvise_v2 + cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, ptds_mode, NULL) + + global __cuMemRangeGetAttribute + cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, ptds_mode, NULL) + + global __cuMemRangeGetAttributes + cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, ptds_mode, NULL) + + global __cuPointerSetAttribute + cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, ptds_mode, NULL) + + global __cuPointerGetAttributes + cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, ptds_mode, NULL) + + global __cuStreamCreate + cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, ptds_mode, NULL) + + global __cuStreamCreateWithPriority + cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, ptds_mode, NULL) + + global __cuStreamGetPriority + cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetDevice + cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, ptds_mode, NULL) + + global __cuStreamGetFlags + cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetId + cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, ptds_mode, NULL) + + global __cuStreamGetCtx + cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, ptds_mode, NULL) + + global __cuStreamGetCtx_v2 + cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, ptds_mode, NULL) + + global __cuStreamWaitEvent + cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuStreamAddCallback + cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5000, ptds_mode, NULL) + + global __cuStreamBeginCapture_v2 + cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, ptds_mode, NULL) + + global __cuStreamBeginCaptureToGraph + cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, ptds_mode, NULL) + + global __cuThreadExchangeStreamCaptureMode + cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, ptds_mode, NULL) + + global __cuStreamEndCapture + cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, ptds_mode, NULL) + + global __cuStreamIsCapturing + cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v2 + cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v3 + cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies + cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies_v2 + cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, ptds_mode, NULL) + + global __cuStreamAttachMemAsync + cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 6000, ptds_mode, NULL) + + global __cuStreamQuery + cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamSynchronize + cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamDestroy_v2 + cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, ptds_mode, NULL) + + global __cuStreamCopyAttributes + cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, ptds_mode, NULL) + + global __cuStreamGetAttribute + cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, ptds_mode, NULL) + + global __cuStreamSetAttribute + cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, ptds_mode, NULL) + + global __cuEventCreate + cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, ptds_mode, NULL) + + global __cuEventRecord + cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuEventRecordWithFlags + cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, ptds_mode, NULL) + + global __cuEventQuery + cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, ptds_mode, NULL) + + global __cuEventSynchronize + cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, ptds_mode, NULL) + + global __cuEventDestroy_v2 + cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, ptds_mode, NULL) + + global __cuEventElapsedTime + cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime, 2000, ptds_mode, NULL) + + global __cuEventElapsedTime_v2 + cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, ptds_mode, NULL) + + global __cuImportExternalMemory + cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedBuffer + cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedMipmappedArray + cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, ptds_mode, NULL) + + global __cuDestroyExternalMemory + cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, ptds_mode, NULL) + + global __cuImportExternalSemaphore + cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuSignalExternalSemaphoresAsync + cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuWaitExternalSemaphoresAsync + cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuDestroyExternalSemaphore + cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuStreamWaitValue32_v2 + cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWaitValue64_v2 + cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue32_v2 + cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue64_v2 + cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamBatchMemOp_v2 + cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, ptds_mode, NULL) + + global __cuFuncGetAttribute + cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, ptds_mode, NULL) + + global __cuFuncSetAttribute + cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, ptds_mode, NULL) + + global __cuFuncSetCacheConfig + cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, ptds_mode, NULL) + + global __cuFuncGetModule + cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, ptds_mode, NULL) + + global __cuFuncGetName + cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, ptds_mode, NULL) + + global __cuFuncGetParamInfo + cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, ptds_mode, NULL) + + global __cuFuncIsLoaded + cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, ptds_mode, NULL) + + global __cuFuncLoad + cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, ptds_mode, NULL) + + global __cuLaunchKernel + cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuLaunchKernelEx + cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, ptds_mode, NULL) + + global __cuLaunchCooperativeKernel + cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, ptds_mode, NULL) + + global __cuLaunchCooperativeKernelMultiDevice + cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, ptds_mode, NULL) + + global __cuLaunchHostFunc + cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, ptds_mode, NULL) + + global __cuFuncSetBlockShape + cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedSize + cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, ptds_mode, NULL) + + global __cuParamSetSize + cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, ptds_mode, NULL) + + global __cuParamSeti + cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, ptds_mode, NULL) + + global __cuParamSetf + cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, ptds_mode, NULL) + + global __cuParamSetv + cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, ptds_mode, NULL) + + global __cuLaunch + cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, ptds_mode, NULL) + + global __cuLaunchGrid + cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, ptds_mode, NULL) + + global __cuLaunchGridAsync + cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, ptds_mode, NULL) + + global __cuParamSetTexRef + cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedMemConfig + cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuGraphCreate + cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, ptds_mode, NULL) + + global __cuGraphAddKernelNode_v2 + cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetParams_v2 + cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphAddMemcpyNode + cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeGetParams + cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeSetParams + cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddMemsetNode + cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeGetParams + cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeSetParams + cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddHostNode + cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeGetParams + cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeSetParams + cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddChildGraphNode + cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, ptds_mode, NULL) + + global __cuGraphChildGraphNodeGetGraph + cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, ptds_mode, NULL) + + global __cuGraphAddEmptyNode + cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, ptds_mode, NULL) + + global __cuGraphAddEventRecordNode + cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeGetEvent + cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeSetEvent + cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddEventWaitNode + cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeGetEvent + cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeSetEvent + cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresSignalNode + cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeGetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeSetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresWaitNode + cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeGetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeSetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddBatchMemOpNode + cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeGetParams + cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeSetParams + cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphExecBatchMemOpNodeSetParams + cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphAddMemAllocNode + cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, ptds_mode, NULL) + + global __cuGraphMemAllocNodeGetParams + cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, ptds_mode, NULL) + + global __cuGraphAddMemFreeNode + cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, ptds_mode, NULL) + + global __cuGraphMemFreeNodeGetParams + cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, ptds_mode, NULL) + + global __cuDeviceGraphMemTrim + cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, ptds_mode, NULL) + + global __cuDeviceGetGraphMemAttribute + cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuDeviceSetGraphMemAttribute + cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuGraphClone + cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeFindInClone + cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetType + cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, ptds_mode, NULL) + + global __cuGraphGetNodes + cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetRootNodes + cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges + cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges_v2 + cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies + cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies_v2 + cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes + cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes_v2 + cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, ptds_mode, NULL) + + global __cuGraphAddDependencies + cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, ptds_mode, NULL) + + global __cuGraphAddDependencies_v2 + cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphRemoveDependencies + cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, ptds_mode, NULL) + + global __cuGraphRemoveDependencies_v2 + cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphDestroyNode + cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, ptds_mode, NULL) + + global __cuGraphInstantiateWithFlags + cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, ptds_mode, NULL) + + global __cuGraphInstantiateWithParams + cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, ptds_mode, NULL) + + global __cuGraphExecGetFlags + cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, ptds_mode, NULL) + + global __cuGraphExecKernelNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphExecMemcpyNodeSetParams + cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecMemsetNodeSetParams + cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecHostNodeSetParams + cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecChildGraphNodeSetParams + cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, ptds_mode, NULL) + + global __cuGraphExecEventRecordNodeSetEvent + cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecEventWaitNodeSetEvent + cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphNodeSetEnabled + cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphNodeGetEnabled + cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphUpload + cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, ptds_mode, NULL) + + global __cuGraphLaunch + cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, ptds_mode, NULL) + + global __cuGraphExecDestroy + cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, ptds_mode, NULL) + + global __cuGraphDestroy + cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, ptds_mode, NULL) + + global __cuGraphExecUpdate_v2 + cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeCopyAttributes + cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetAttribute + cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetAttribute + cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphDebugDotPrint + cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, ptds_mode, NULL) + + global __cuUserObjectCreate + cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, ptds_mode, NULL) + + global __cuUserObjectRetain + cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, ptds_mode, NULL) + + global __cuUserObjectRelease + cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, ptds_mode, NULL) + + global __cuGraphRetainUserObject + cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, ptds_mode, NULL) + + global __cuGraphReleaseUserObject + cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, ptds_mode, NULL) + + global __cuGraphAddNode + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode, 12020, ptds_mode, NULL) + + global __cuGraphAddNode_v2 + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeSetParams + cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphExecNodeSetParams + cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphConditionalHandleCreate + cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSize + cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyAvailableDynamicSMemPerBlock + cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialClusterSize + cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, ptds_mode, NULL) + + global __cuOccupancyMaxActiveClusters + cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, ptds_mode, NULL) + + global __cuTexRefSetArray + cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmappedArray + cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefSetAddress_v2 + cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefSetAddress2D_v3 + cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, ptds_mode, NULL) + + global __cuTexRefSetFormat + cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefSetAddressMode + cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetFilterMode + cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmapFilterMode + cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelBias + cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelClamp + cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefSetMaxAnisotropy + cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefSetBorderColor + cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefSetFlags + cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefGetAddress_v2 + cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefGetArray + cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmappedArray + cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefGetAddressMode + cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFilterMode + cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFormat + cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmapFilterMode + cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelBias + cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelClamp + cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefGetMaxAnisotropy + cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefGetBorderColor + cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefGetFlags + cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefCreate + cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, ptds_mode, NULL) + + global __cuTexRefDestroy + cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, ptds_mode, NULL) + + global __cuSurfRefSetArray + cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, ptds_mode, NULL) + + global __cuSurfRefGetArray + cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, ptds_mode, NULL) + + global __cuTexObjectCreate + cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, ptds_mode, NULL) + + global __cuTexObjectDestroy + cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceDesc + cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetTextureDesc + cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceViewDesc + cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, ptds_mode, NULL) + + global __cuSurfObjectCreate + cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, ptds_mode, NULL) + + global __cuSurfObjectDestroy + cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, ptds_mode, NULL) + + global __cuSurfObjectGetResourceDesc + cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTensorMapEncodeTiled + cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2col + cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2colWide + cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, ptds_mode, NULL) + + global __cuTensorMapReplaceAddress + cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, ptds_mode, NULL) + + global __cuDeviceCanAccessPeer + cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, ptds_mode, NULL) + + global __cuCtxEnablePeerAccess + cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, ptds_mode, NULL) + + global __cuCtxDisablePeerAccess + cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, ptds_mode, NULL) + + global __cuDeviceGetP2PAttribute + cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, ptds_mode, NULL) + + global __cuGraphicsUnregisterResource + cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, ptds_mode, NULL) + + global __cuGraphicsSubResourceGetMappedArray + cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedMipmappedArray + cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedPointer_v2 + cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsResourceSetMapFlags_v2 + cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, ptds_mode, NULL) + + global __cuGraphicsMapResources + cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGraphicsUnmapResources + cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGetProcAddress_v2 + cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, ptds_mode, NULL) + + global __cuCoredumpGetAttribute + cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpGetAttributeGlobal + cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttribute + cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttributeGlobal + cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuGetExportTable + cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, ptds_mode, NULL) + + global __cuGreenCtxCreate + cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, ptds_mode, NULL) + + global __cuGreenCtxDestroy + cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, ptds_mode, NULL) + + global __cuCtxFromGreenCtx + cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, ptds_mode, NULL) + + global __cuDeviceGetDevResource + cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, ptds_mode, NULL) + + global __cuCtxGetDevResource + cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuGreenCtxGetDevResource + cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuDevSmResourceSplitByCount + cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, ptds_mode, NULL) + + global __cuDevResourceGenerateDesc + cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, ptds_mode, NULL) + + global __cuGreenCtxRecordEvent + cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, ptds_mode, NULL) + + global __cuGreenCtxWaitEvent + cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, ptds_mode, NULL) + + global __cuStreamGetGreenCtx + cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, ptds_mode, NULL) + + global __cuGreenCtxStreamCreate + cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, ptds_mode, NULL) + + global __cuLogsRegisterCallback + cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsUnregisterCallback + cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsCurrent + cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, ptds_mode, NULL) + + global __cuLogsDumpToFile + cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, ptds_mode, NULL) + + global __cuLogsDumpToMemory + cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetRestoreThreadId + cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetState + cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessLock + cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessCheckpoint + cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessRestore + cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessUnlock + cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, ptds_mode, NULL) + + global __cuGraphicsEGLRegisterImage + cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnect + cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnectWithFlags + cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, ptds_mode, NULL) + + global __cuEGLStreamConsumerDisconnect + cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerAcquireFrame + cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerReleaseFrame + cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerConnect + cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerDisconnect + cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerPresentFrame + cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerReturnFrame + cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedEglFrame + cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, ptds_mode, NULL) + + global __cuEventCreateFromEGLSync + cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterBuffer + cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterImage + cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, ptds_mode, NULL) + + global __cuGLGetDevices_v2 + cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, ptds_mode, NULL) + + global __cuGLCtxCreate_v2 + cuGetProcAddress_v2('cuGLCtxCreate', &__cuGLCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGLInit + cuGetProcAddress_v2('cuGLInit', &__cuGLInit, 2000, ptds_mode, NULL) + + global __cuGLRegisterBufferObject + cuGetProcAddress_v2('cuGLRegisterBufferObject', &__cuGLRegisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLMapBufferObject_v2 + cuGetProcAddress_v2('cuGLMapBufferObject', &__cuGLMapBufferObject_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObject + cuGetProcAddress_v2('cuGLUnmapBufferObject', &__cuGLUnmapBufferObject, 2000, ptds_mode, NULL) + + global __cuGLUnregisterBufferObject + cuGetProcAddress_v2('cuGLUnregisterBufferObject', &__cuGLUnregisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLSetBufferObjectMapFlags + cuGetProcAddress_v2('cuGLSetBufferObjectMapFlags', &__cuGLSetBufferObjectMapFlags, 2030, ptds_mode, NULL) + + global __cuGLMapBufferObjectAsync_v2 + cuGetProcAddress_v2('cuGLMapBufferObjectAsync', &__cuGLMapBufferObjectAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObjectAsync + cuGetProcAddress_v2('cuGLUnmapBufferObjectAsync', &__cuGLUnmapBufferObjectAsync, 2030, ptds_mode, NULL) + + global __cuProfilerInitialize + cuGetProcAddress_v2('cuProfilerInitialize', &__cuProfilerInitialize, 4000, ptds_mode, NULL) + + global __cuProfilerStart + cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, ptds_mode, NULL) + + global __cuProfilerStop + cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, ptds_mode, NULL) + + global __cuVDPAUGetDevice + cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, ptds_mode, NULL) + + global __cuVDPAUCtxCreate_v2 + cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterVideoSurface + cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterOutputSurface + cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, ptds_mode, NULL) + + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) + return 0 + +cdef inline int _check_or_init_driver() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_driver_init): + return 0 + + return _init_driver() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_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 + data["__cuDeviceGetUuid"] = __cuDeviceGetUuid + + 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 __cuMemcpyBatchAsync + data["__cuMemcpyBatchAsync"] = __cuMemcpyBatchAsync + + global __cuMemcpy3DBatchAsync + data["__cuMemcpy3DBatchAsync"] = __cuMemcpy3DBatchAsync + + 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 + data["__cuMemPrefetchAsync"] = __cuMemPrefetchAsync + + global __cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 + + global __cuMemAdvise + data["__cuMemAdvise"] = __cuMemAdvise + + 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 + data["__cuStreamUpdateCaptureDependencies"] = __cuStreamUpdateCaptureDependencies + + 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 + data["__cuEventElapsedTime"] = __cuEventElapsedTime + + 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 + data["__cuGraphGetEdges"] = __cuGraphGetEdges + + global __cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 + + global __cuGraphNodeGetDependencies + data["__cuGraphNodeGetDependencies"] = __cuGraphNodeGetDependencies + + global __cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 + + global __cuGraphNodeGetDependentNodes + data["__cuGraphNodeGetDependentNodes"] = __cuGraphNodeGetDependentNodes + + global __cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 + + global __cuGraphAddDependencies + data["__cuGraphAddDependencies"] = __cuGraphAddDependencies + + global __cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 + + global __cuGraphRemoveDependencies + data["__cuGraphRemoveDependencies"] = __cuGraphRemoveDependencies + + 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 + data["__cuGraphAddNode"] = __cuGraphAddNode + + 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 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cuda")._handle_uint + return handle + + +############################################################################### +# 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(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetUuid + _check_or_init_driver() + if __cuDeviceGetUuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetUuid is not found") + return (__cuDeviceGetUuid)( + uuid, 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 _cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyBatchAsync + _check_or_init_driver() + if __cuMemcpyBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyBatchAsync is not found") + return (__cuMemcpyBatchAsync)( + dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream) + + +cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DBatchAsync + _check_or_init_driver() + if __cuMemcpy3DBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DBatchAsync is not found") + return (__cuMemcpy3DBatchAsync)( + numOps, opList, failIdx, flags, 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(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPrefetchAsync + _check_or_init_driver() + if __cuMemPrefetchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchAsync is not found") + return (__cuMemPrefetchAsync)( + devPtr, count, dstDevice, hStream) + + +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(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAdvise + _check_or_init_driver() + if __cuMemAdvise == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAdvise is not found") + return (__cuMemAdvise)( + devPtr, count, advice, device) + + +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(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamUpdateCaptureDependencies + _check_or_init_driver() + if __cuStreamUpdateCaptureDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamUpdateCaptureDependencies is not found") + return (__cuStreamUpdateCaptureDependencies)( + hStream, dependencies, numDependencies, flags) + + +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(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventElapsedTime + _check_or_init_driver() + if __cuEventElapsedTime == NULL: + with gil: + raise FunctionNotFoundError("function cuEventElapsedTime is not found") + return (__cuEventElapsedTime)( + pMilliseconds, hStart, hEnd) + + +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(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetEdges + _check_or_init_driver() + if __cuGraphGetEdges == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetEdges is not found") + return (__cuGraphGetEdges)( + hGraph, from_, to, numEdges) + + +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(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependencies + _check_or_init_driver() + if __cuGraphNodeGetDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependencies is not found") + return (__cuGraphNodeGetDependencies)( + hNode, dependencies, numDependencies) + + +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(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependentNodes + _check_or_init_driver() + if __cuGraphNodeGetDependentNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependentNodes is not found") + return (__cuGraphNodeGetDependentNodes)( + hNode, dependentNodes, numDependentNodes) + + +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(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddDependencies + _check_or_init_driver() + if __cuGraphAddDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddDependencies is not found") + return (__cuGraphAddDependencies)( + hGraph, from_, to, numDependencies) + + +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(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRemoveDependencies + _check_or_init_driver() + if __cuGraphRemoveDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRemoveDependencies is not found") + return (__cuGraphRemoveDependencies)( + hGraph, from_, to, 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(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddNode + _check_or_init_driver() + if __cuGraphAddNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode is not found") + return (__cuGraphAddNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +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* remaining, unsigned int useFlags, 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, remaining, useFlags, 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) diff --git a/cuda_bindings_12/cuda/bindings/_internal/driver_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/driver_windows.pyx new file mode 100644 index 00000000000..02669fc2bc7 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/driver_windows.pyx @@ -0,0 +1,8339 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d36a59b7d4c8939f88b07a4600cbd4251a2ed69571b425bb6009a626cfd4dc3e + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport intptr_t + +from os import getenv as _cyb_getenv +import threading as _cyb_threading + +ctypedef int (*_cyb_cuGetProcAddress_v2_T)(const char *, void **, int, cuuint64_t, CUdriverProcAddressQueryResult *)except?CUDA_ERROR_NOT_FOUND nogil + +cdef int _cyb___py_driver_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + + +cdef void* __cuGetErrorString = NULL +cdef void* __cuGetErrorName = NULL +cdef void* __cuInit = NULL +cdef void* __cuDriverGetVersion = NULL +cdef void* __cuDeviceGet = NULL +cdef void* __cuDeviceGetCount = NULL +cdef void* __cuDeviceGetName = NULL +cdef void* __cuDeviceGetUuid = NULL +cdef void* __cuDeviceGetUuid_v2 = NULL +cdef void* __cuDeviceGetLuid = NULL +cdef void* __cuDeviceTotalMem_v2 = NULL +cdef void* __cuDeviceGetTexture1DLinearMaxWidth = NULL +cdef void* __cuDeviceGetAttribute = NULL +cdef void* __cuDeviceGetNvSciSyncAttributes = NULL +cdef void* __cuDeviceSetMemPool = NULL +cdef void* __cuDeviceGetMemPool = NULL +cdef void* __cuDeviceGetDefaultMemPool = NULL +cdef void* __cuDeviceGetExecAffinitySupport = NULL +cdef void* __cuFlushGPUDirectRDMAWrites = NULL +cdef void* __cuDeviceGetProperties = NULL +cdef void* __cuDeviceComputeCapability = NULL +cdef void* __cuDevicePrimaryCtxRetain = NULL +cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL +cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL +cdef void* __cuDevicePrimaryCtxGetState = NULL +cdef void* __cuDevicePrimaryCtxReset_v2 = NULL +cdef void* __cuCtxCreate_v2 = NULL +cdef void* __cuCtxCreate_v3 = NULL +cdef void* __cuCtxCreate_v4 = NULL +cdef void* __cuCtxDestroy_v2 = NULL +cdef void* __cuCtxPushCurrent_v2 = NULL +cdef void* __cuCtxPopCurrent_v2 = NULL +cdef void* __cuCtxSetCurrent = NULL +cdef void* __cuCtxGetCurrent = NULL +cdef void* __cuCtxGetDevice = NULL +cdef void* __cuCtxGetFlags = NULL +cdef void* __cuCtxSetFlags = NULL +cdef void* __cuCtxGetId = NULL +cdef void* __cuCtxSynchronize = NULL +cdef void* __cuCtxSetLimit = NULL +cdef void* __cuCtxGetLimit = NULL +cdef void* __cuCtxGetCacheConfig = NULL +cdef void* __cuCtxSetCacheConfig = NULL +cdef void* __cuCtxGetApiVersion = NULL +cdef void* __cuCtxGetStreamPriorityRange = NULL +cdef void* __cuCtxResetPersistingL2Cache = NULL +cdef void* __cuCtxGetExecAffinity = NULL +cdef void* __cuCtxRecordEvent = NULL +cdef void* __cuCtxWaitEvent = NULL +cdef void* __cuCtxAttach = NULL +cdef void* __cuCtxDetach = NULL +cdef void* __cuCtxGetSharedMemConfig = NULL +cdef void* __cuCtxSetSharedMemConfig = NULL +cdef void* __cuModuleLoad = NULL +cdef void* __cuModuleLoadData = NULL +cdef void* __cuModuleLoadDataEx = NULL +cdef void* __cuModuleLoadFatBinary = NULL +cdef void* __cuModuleUnload = NULL +cdef void* __cuModuleGetLoadingMode = NULL +cdef void* __cuModuleGetFunction = NULL +cdef void* __cuModuleGetFunctionCount = NULL +cdef void* __cuModuleEnumerateFunctions = NULL +cdef void* __cuModuleGetGlobal_v2 = NULL +cdef void* __cuLinkCreate_v2 = NULL +cdef void* __cuLinkAddData_v2 = NULL +cdef void* __cuLinkAddFile_v2 = NULL +cdef void* __cuLinkComplete = NULL +cdef void* __cuLinkDestroy = NULL +cdef void* __cuModuleGetTexRef = NULL +cdef void* __cuModuleGetSurfRef = NULL +cdef void* __cuLibraryLoadData = NULL +cdef void* __cuLibraryLoadFromFile = NULL +cdef void* __cuLibraryUnload = NULL +cdef void* __cuLibraryGetKernel = NULL +cdef void* __cuLibraryGetKernelCount = NULL +cdef void* __cuLibraryEnumerateKernels = NULL +cdef void* __cuLibraryGetModule = NULL +cdef void* __cuKernelGetFunction = NULL +cdef void* __cuKernelGetLibrary = NULL +cdef void* __cuLibraryGetGlobal = NULL +cdef void* __cuLibraryGetManaged = NULL +cdef void* __cuLibraryGetUnifiedFunction = NULL +cdef void* __cuKernelGetAttribute = NULL +cdef void* __cuKernelSetAttribute = NULL +cdef void* __cuKernelSetCacheConfig = NULL +cdef void* __cuKernelGetName = NULL +cdef void* __cuKernelGetParamInfo = NULL +cdef void* __cuMemGetInfo_v2 = NULL +cdef void* __cuMemAlloc_v2 = NULL +cdef void* __cuMemAllocPitch_v2 = NULL +cdef void* __cuMemFree_v2 = NULL +cdef void* __cuMemGetAddressRange_v2 = NULL +cdef void* __cuMemAllocHost_v2 = NULL +cdef void* __cuMemFreeHost = NULL +cdef void* __cuMemHostAlloc = NULL +cdef void* __cuMemHostGetDevicePointer_v2 = NULL +cdef void* __cuMemHostGetFlags = NULL +cdef void* __cuMemAllocManaged = NULL +cdef void* __cuDeviceRegisterAsyncNotification = NULL +cdef void* __cuDeviceUnregisterAsyncNotification = NULL +cdef void* __cuDeviceGetByPCIBusId = NULL +cdef void* __cuDeviceGetPCIBusId = NULL +cdef void* __cuIpcGetEventHandle = NULL +cdef void* __cuIpcOpenEventHandle = NULL +cdef void* __cuIpcGetMemHandle = NULL +cdef void* __cuIpcOpenMemHandle_v2 = NULL +cdef void* __cuIpcCloseMemHandle = NULL +cdef void* __cuMemHostRegister_v2 = NULL +cdef void* __cuMemHostUnregister = NULL +cdef void* __cuMemcpy = NULL +cdef void* __cuMemcpyPeer = NULL +cdef void* __cuMemcpyHtoD_v2 = NULL +cdef void* __cuMemcpyDtoH_v2 = NULL +cdef void* __cuMemcpyDtoD_v2 = NULL +cdef void* __cuMemcpyDtoA_v2 = NULL +cdef void* __cuMemcpyAtoD_v2 = NULL +cdef void* __cuMemcpyHtoA_v2 = NULL +cdef void* __cuMemcpyAtoH_v2 = NULL +cdef void* __cuMemcpyAtoA_v2 = NULL +cdef void* __cuMemcpy2D_v2 = NULL +cdef void* __cuMemcpy2DUnaligned_v2 = NULL +cdef void* __cuMemcpy3D_v2 = NULL +cdef void* __cuMemcpy3DPeer = NULL +cdef void* __cuMemcpyAsync = NULL +cdef void* __cuMemcpyPeerAsync = NULL +cdef void* __cuMemcpyHtoDAsync_v2 = NULL +cdef void* __cuMemcpyDtoHAsync_v2 = NULL +cdef void* __cuMemcpyDtoDAsync_v2 = NULL +cdef void* __cuMemcpyHtoAAsync_v2 = NULL +cdef void* __cuMemcpyAtoHAsync_v2 = NULL +cdef void* __cuMemcpy2DAsync_v2 = NULL +cdef void* __cuMemcpy3DAsync_v2 = NULL +cdef void* __cuMemcpy3DPeerAsync = NULL +cdef void* __cuMemcpyBatchAsync = NULL +cdef void* __cuMemcpy3DBatchAsync = NULL +cdef void* __cuMemsetD8_v2 = NULL +cdef void* __cuMemsetD16_v2 = NULL +cdef void* __cuMemsetD32_v2 = NULL +cdef void* __cuMemsetD2D8_v2 = NULL +cdef void* __cuMemsetD2D16_v2 = NULL +cdef void* __cuMemsetD2D32_v2 = NULL +cdef void* __cuMemsetD8Async = NULL +cdef void* __cuMemsetD16Async = NULL +cdef void* __cuMemsetD32Async = NULL +cdef void* __cuMemsetD2D8Async = NULL +cdef void* __cuMemsetD2D16Async = NULL +cdef void* __cuMemsetD2D32Async = NULL +cdef void* __cuArrayCreate_v2 = NULL +cdef void* __cuArrayGetDescriptor_v2 = NULL +cdef void* __cuArrayGetSparseProperties = NULL +cdef void* __cuMipmappedArrayGetSparseProperties = NULL +cdef void* __cuArrayGetMemoryRequirements = NULL +cdef void* __cuMipmappedArrayGetMemoryRequirements = NULL +cdef void* __cuArrayGetPlane = NULL +cdef void* __cuArrayDestroy = NULL +cdef void* __cuArray3DCreate_v2 = NULL +cdef void* __cuArray3DGetDescriptor_v2 = NULL +cdef void* __cuMipmappedArrayCreate = NULL +cdef void* __cuMipmappedArrayGetLevel = NULL +cdef void* __cuMipmappedArrayDestroy = NULL +cdef void* __cuMemGetHandleForAddressRange = NULL +cdef void* __cuMemBatchDecompressAsync = NULL +cdef void* __cuMemAddressReserve = NULL +cdef void* __cuMemAddressFree = NULL +cdef void* __cuMemCreate = NULL +cdef void* __cuMemRelease = NULL +cdef void* __cuMemMap = NULL +cdef void* __cuMemMapArrayAsync = NULL +cdef void* __cuMemUnmap = NULL +cdef void* __cuMemSetAccess = NULL +cdef void* __cuMemGetAccess = NULL +cdef void* __cuMemExportToShareableHandle = NULL +cdef void* __cuMemImportFromShareableHandle = NULL +cdef void* __cuMemGetAllocationGranularity = NULL +cdef void* __cuMemGetAllocationPropertiesFromHandle = NULL +cdef void* __cuMemRetainAllocationHandle = NULL +cdef void* __cuMemFreeAsync = NULL +cdef void* __cuMemAllocAsync = NULL +cdef void* __cuMemPoolTrimTo = NULL +cdef void* __cuMemPoolSetAttribute = NULL +cdef void* __cuMemPoolGetAttribute = NULL +cdef void* __cuMemPoolSetAccess = NULL +cdef void* __cuMemPoolGetAccess = NULL +cdef void* __cuMemPoolCreate = NULL +cdef void* __cuMemPoolDestroy = NULL +cdef void* __cuMemAllocFromPoolAsync = NULL +cdef void* __cuMemPoolExportToShareableHandle = NULL +cdef void* __cuMemPoolImportFromShareableHandle = NULL +cdef void* __cuMemPoolExportPointer = NULL +cdef void* __cuMemPoolImportPointer = NULL +cdef void* __cuMulticastCreate = NULL +cdef void* __cuMulticastAddDevice = NULL +cdef void* __cuMulticastBindMem = NULL +cdef void* __cuMulticastBindAddr = NULL +cdef void* __cuMulticastUnbind = NULL +cdef void* __cuMulticastGetGranularity = NULL +cdef void* __cuPointerGetAttribute = NULL +cdef void* __cuMemPrefetchAsync = NULL +cdef void* __cuMemPrefetchAsync_v2 = NULL +cdef void* __cuMemAdvise = NULL +cdef void* __cuMemAdvise_v2 = NULL +cdef void* __cuMemRangeGetAttribute = NULL +cdef void* __cuMemRangeGetAttributes = NULL +cdef void* __cuPointerSetAttribute = NULL +cdef void* __cuPointerGetAttributes = NULL +cdef void* __cuStreamCreate = NULL +cdef void* __cuStreamCreateWithPriority = NULL +cdef void* __cuStreamGetPriority = NULL +cdef void* __cuStreamGetDevice = NULL +cdef void* __cuStreamGetFlags = NULL +cdef void* __cuStreamGetId = NULL +cdef void* __cuStreamGetCtx = NULL +cdef void* __cuStreamGetCtx_v2 = NULL +cdef void* __cuStreamWaitEvent = NULL +cdef void* __cuStreamAddCallback = NULL +cdef void* __cuStreamBeginCapture_v2 = NULL +cdef void* __cuStreamBeginCaptureToGraph = NULL +cdef void* __cuThreadExchangeStreamCaptureMode = NULL +cdef void* __cuStreamEndCapture = NULL +cdef void* __cuStreamIsCapturing = NULL +cdef void* __cuStreamGetCaptureInfo_v2 = NULL +cdef void* __cuStreamGetCaptureInfo_v3 = NULL +cdef void* __cuStreamUpdateCaptureDependencies = NULL +cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL +cdef void* __cuStreamAttachMemAsync = NULL +cdef void* __cuStreamQuery = NULL +cdef void* __cuStreamSynchronize = NULL +cdef void* __cuStreamDestroy_v2 = NULL +cdef void* __cuStreamCopyAttributes = NULL +cdef void* __cuStreamGetAttribute = NULL +cdef void* __cuStreamSetAttribute = NULL +cdef void* __cuEventCreate = NULL +cdef void* __cuEventRecord = NULL +cdef void* __cuEventRecordWithFlags = NULL +cdef void* __cuEventQuery = NULL +cdef void* __cuEventSynchronize = NULL +cdef void* __cuEventDestroy_v2 = NULL +cdef void* __cuEventElapsedTime = NULL +cdef void* __cuEventElapsedTime_v2 = NULL +cdef void* __cuImportExternalMemory = NULL +cdef void* __cuExternalMemoryGetMappedBuffer = NULL +cdef void* __cuExternalMemoryGetMappedMipmappedArray = NULL +cdef void* __cuDestroyExternalMemory = NULL +cdef void* __cuImportExternalSemaphore = NULL +cdef void* __cuSignalExternalSemaphoresAsync = NULL +cdef void* __cuWaitExternalSemaphoresAsync = NULL +cdef void* __cuDestroyExternalSemaphore = NULL +cdef void* __cuStreamWaitValue32_v2 = NULL +cdef void* __cuStreamWaitValue64_v2 = NULL +cdef void* __cuStreamWriteValue32_v2 = NULL +cdef void* __cuStreamWriteValue64_v2 = NULL +cdef void* __cuStreamBatchMemOp_v2 = NULL +cdef void* __cuFuncGetAttribute = NULL +cdef void* __cuFuncSetAttribute = NULL +cdef void* __cuFuncSetCacheConfig = NULL +cdef void* __cuFuncGetModule = NULL +cdef void* __cuFuncGetName = NULL +cdef void* __cuFuncGetParamInfo = NULL +cdef void* __cuFuncIsLoaded = NULL +cdef void* __cuFuncLoad = NULL +cdef void* __cuLaunchKernel = NULL +cdef void* __cuLaunchKernelEx = NULL +cdef void* __cuLaunchCooperativeKernel = NULL +cdef void* __cuLaunchCooperativeKernelMultiDevice = NULL +cdef void* __cuLaunchHostFunc = NULL +cdef void* __cuFuncSetBlockShape = NULL +cdef void* __cuFuncSetSharedSize = NULL +cdef void* __cuParamSetSize = NULL +cdef void* __cuParamSeti = NULL +cdef void* __cuParamSetf = NULL +cdef void* __cuParamSetv = NULL +cdef void* __cuLaunch = NULL +cdef void* __cuLaunchGrid = NULL +cdef void* __cuLaunchGridAsync = NULL +cdef void* __cuParamSetTexRef = NULL +cdef void* __cuFuncSetSharedMemConfig = NULL +cdef void* __cuGraphCreate = NULL +cdef void* __cuGraphAddKernelNode_v2 = NULL +cdef void* __cuGraphKernelNodeGetParams_v2 = NULL +cdef void* __cuGraphKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphAddMemcpyNode = NULL +cdef void* __cuGraphMemcpyNodeGetParams = NULL +cdef void* __cuGraphMemcpyNodeSetParams = NULL +cdef void* __cuGraphAddMemsetNode = NULL +cdef void* __cuGraphMemsetNodeGetParams = NULL +cdef void* __cuGraphMemsetNodeSetParams = NULL +cdef void* __cuGraphAddHostNode = NULL +cdef void* __cuGraphHostNodeGetParams = NULL +cdef void* __cuGraphHostNodeSetParams = NULL +cdef void* __cuGraphAddChildGraphNode = NULL +cdef void* __cuGraphChildGraphNodeGetGraph = NULL +cdef void* __cuGraphAddEmptyNode = NULL +cdef void* __cuGraphAddEventRecordNode = NULL +cdef void* __cuGraphEventRecordNodeGetEvent = NULL +cdef void* __cuGraphEventRecordNodeSetEvent = NULL +cdef void* __cuGraphAddEventWaitNode = NULL +cdef void* __cuGraphEventWaitNodeGetEvent = NULL +cdef void* __cuGraphEventWaitNodeSetEvent = NULL +cdef void* __cuGraphAddExternalSemaphoresSignalNode = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphAddExternalSemaphoresWaitNode = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphAddBatchMemOpNode = NULL +cdef void* __cuGraphBatchMemOpNodeGetParams = NULL +cdef void* __cuGraphBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphExecBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphAddMemAllocNode = NULL +cdef void* __cuGraphMemAllocNodeGetParams = NULL +cdef void* __cuGraphAddMemFreeNode = NULL +cdef void* __cuGraphMemFreeNodeGetParams = NULL +cdef void* __cuDeviceGraphMemTrim = NULL +cdef void* __cuDeviceGetGraphMemAttribute = NULL +cdef void* __cuDeviceSetGraphMemAttribute = NULL +cdef void* __cuGraphClone = NULL +cdef void* __cuGraphNodeFindInClone = NULL +cdef void* __cuGraphNodeGetType = NULL +cdef void* __cuGraphGetNodes = NULL +cdef void* __cuGraphGetRootNodes = NULL +cdef void* __cuGraphGetEdges = NULL +cdef void* __cuGraphGetEdges_v2 = NULL +cdef void* __cuGraphNodeGetDependencies = NULL +cdef void* __cuGraphNodeGetDependencies_v2 = NULL +cdef void* __cuGraphNodeGetDependentNodes = NULL +cdef void* __cuGraphNodeGetDependentNodes_v2 = NULL +cdef void* __cuGraphAddDependencies = NULL +cdef void* __cuGraphAddDependencies_v2 = NULL +cdef void* __cuGraphRemoveDependencies = NULL +cdef void* __cuGraphRemoveDependencies_v2 = NULL +cdef void* __cuGraphDestroyNode = NULL +cdef void* __cuGraphInstantiateWithFlags = NULL +cdef void* __cuGraphInstantiateWithParams = NULL +cdef void* __cuGraphExecGetFlags = NULL +cdef void* __cuGraphExecKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphExecMemcpyNodeSetParams = NULL +cdef void* __cuGraphExecMemsetNodeSetParams = NULL +cdef void* __cuGraphExecHostNodeSetParams = NULL +cdef void* __cuGraphExecChildGraphNodeSetParams = NULL +cdef void* __cuGraphExecEventRecordNodeSetEvent = NULL +cdef void* __cuGraphExecEventWaitNodeSetEvent = NULL +cdef void* __cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphNodeSetEnabled = NULL +cdef void* __cuGraphNodeGetEnabled = NULL +cdef void* __cuGraphUpload = NULL +cdef void* __cuGraphLaunch = NULL +cdef void* __cuGraphExecDestroy = NULL +cdef void* __cuGraphDestroy = NULL +cdef void* __cuGraphExecUpdate_v2 = NULL +cdef void* __cuGraphKernelNodeCopyAttributes = NULL +cdef void* __cuGraphKernelNodeGetAttribute = NULL +cdef void* __cuGraphKernelNodeSetAttribute = NULL +cdef void* __cuGraphDebugDotPrint = NULL +cdef void* __cuUserObjectCreate = NULL +cdef void* __cuUserObjectRetain = NULL +cdef void* __cuUserObjectRelease = NULL +cdef void* __cuGraphRetainUserObject = NULL +cdef void* __cuGraphReleaseUserObject = NULL +cdef void* __cuGraphAddNode = NULL +cdef void* __cuGraphAddNode_v2 = NULL +cdef void* __cuGraphNodeSetParams = NULL +cdef void* __cuGraphExecNodeSetParams = NULL +cdef void* __cuGraphConditionalHandleCreate = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL +cdef void* __cuOccupancyMaxPotentialBlockSize = NULL +cdef void* __cuOccupancyMaxPotentialBlockSizeWithFlags = NULL +cdef void* __cuOccupancyAvailableDynamicSMemPerBlock = NULL +cdef void* __cuOccupancyMaxPotentialClusterSize = NULL +cdef void* __cuOccupancyMaxActiveClusters = NULL +cdef void* __cuTexRefSetArray = NULL +cdef void* __cuTexRefSetMipmappedArray = NULL +cdef void* __cuTexRefSetAddress_v2 = NULL +cdef void* __cuTexRefSetAddress2D_v3 = NULL +cdef void* __cuTexRefSetFormat = NULL +cdef void* __cuTexRefSetAddressMode = NULL +cdef void* __cuTexRefSetFilterMode = NULL +cdef void* __cuTexRefSetMipmapFilterMode = NULL +cdef void* __cuTexRefSetMipmapLevelBias = NULL +cdef void* __cuTexRefSetMipmapLevelClamp = NULL +cdef void* __cuTexRefSetMaxAnisotropy = NULL +cdef void* __cuTexRefSetBorderColor = NULL +cdef void* __cuTexRefSetFlags = NULL +cdef void* __cuTexRefGetAddress_v2 = NULL +cdef void* __cuTexRefGetArray = NULL +cdef void* __cuTexRefGetMipmappedArray = NULL +cdef void* __cuTexRefGetAddressMode = NULL +cdef void* __cuTexRefGetFilterMode = NULL +cdef void* __cuTexRefGetFormat = NULL +cdef void* __cuTexRefGetMipmapFilterMode = NULL +cdef void* __cuTexRefGetMipmapLevelBias = NULL +cdef void* __cuTexRefGetMipmapLevelClamp = NULL +cdef void* __cuTexRefGetMaxAnisotropy = NULL +cdef void* __cuTexRefGetBorderColor = NULL +cdef void* __cuTexRefGetFlags = NULL +cdef void* __cuTexRefCreate = NULL +cdef void* __cuTexRefDestroy = NULL +cdef void* __cuSurfRefSetArray = NULL +cdef void* __cuSurfRefGetArray = NULL +cdef void* __cuTexObjectCreate = NULL +cdef void* __cuTexObjectDestroy = NULL +cdef void* __cuTexObjectGetResourceDesc = NULL +cdef void* __cuTexObjectGetTextureDesc = NULL +cdef void* __cuTexObjectGetResourceViewDesc = NULL +cdef void* __cuSurfObjectCreate = NULL +cdef void* __cuSurfObjectDestroy = NULL +cdef void* __cuSurfObjectGetResourceDesc = NULL +cdef void* __cuTensorMapEncodeTiled = NULL +cdef void* __cuTensorMapEncodeIm2col = NULL +cdef void* __cuTensorMapEncodeIm2colWide = NULL +cdef void* __cuTensorMapReplaceAddress = NULL +cdef void* __cuDeviceCanAccessPeer = NULL +cdef void* __cuCtxEnablePeerAccess = NULL +cdef void* __cuCtxDisablePeerAccess = NULL +cdef void* __cuDeviceGetP2PAttribute = NULL +cdef void* __cuGraphicsUnregisterResource = NULL +cdef void* __cuGraphicsSubResourceGetMappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedMipmappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedPointer_v2 = NULL +cdef void* __cuGraphicsResourceSetMapFlags_v2 = NULL +cdef void* __cuGraphicsMapResources = NULL +cdef void* __cuGraphicsUnmapResources = NULL +cdef void* __cuGetProcAddress_v2 = NULL +cdef void* __cuCoredumpGetAttribute = NULL +cdef void* __cuCoredumpGetAttributeGlobal = NULL +cdef void* __cuCoredumpSetAttribute = NULL +cdef void* __cuCoredumpSetAttributeGlobal = NULL +cdef void* __cuGetExportTable = NULL +cdef void* __cuGreenCtxCreate = NULL +cdef void* __cuGreenCtxDestroy = NULL +cdef void* __cuCtxFromGreenCtx = NULL +cdef void* __cuDeviceGetDevResource = NULL +cdef void* __cuCtxGetDevResource = NULL +cdef void* __cuGreenCtxGetDevResource = NULL +cdef void* __cuDevSmResourceSplitByCount = NULL +cdef void* __cuDevResourceGenerateDesc = NULL +cdef void* __cuGreenCtxRecordEvent = NULL +cdef void* __cuGreenCtxWaitEvent = NULL +cdef void* __cuStreamGetGreenCtx = NULL +cdef void* __cuGreenCtxStreamCreate = NULL +cdef void* __cuLogsRegisterCallback = NULL +cdef void* __cuLogsUnregisterCallback = NULL +cdef void* __cuLogsCurrent = NULL +cdef void* __cuLogsDumpToFile = NULL +cdef void* __cuLogsDumpToMemory = NULL +cdef void* __cuCheckpointProcessGetRestoreThreadId = NULL +cdef void* __cuCheckpointProcessGetState = NULL +cdef void* __cuCheckpointProcessLock = NULL +cdef void* __cuCheckpointProcessCheckpoint = NULL +cdef void* __cuCheckpointProcessRestore = NULL +cdef void* __cuCheckpointProcessUnlock = NULL +cdef void* __cuGraphicsEGLRegisterImage = NULL +cdef void* __cuEGLStreamConsumerConnect = NULL +cdef void* __cuEGLStreamConsumerConnectWithFlags = NULL +cdef void* __cuEGLStreamConsumerDisconnect = NULL +cdef void* __cuEGLStreamConsumerAcquireFrame = NULL +cdef void* __cuEGLStreamConsumerReleaseFrame = NULL +cdef void* __cuEGLStreamProducerConnect = NULL +cdef void* __cuEGLStreamProducerDisconnect = NULL +cdef void* __cuEGLStreamProducerPresentFrame = NULL +cdef void* __cuEGLStreamProducerReturnFrame = NULL +cdef void* __cuGraphicsResourceGetMappedEglFrame = NULL +cdef void* __cuEventCreateFromEGLSync = NULL +cdef void* __cuGraphicsGLRegisterBuffer = NULL +cdef void* __cuGraphicsGLRegisterImage = NULL +cdef void* __cuGLGetDevices_v2 = NULL +cdef void* __cuGLCtxCreate_v2 = NULL +cdef void* __cuGLInit = NULL +cdef void* __cuGLRegisterBufferObject = NULL +cdef void* __cuGLMapBufferObject_v2 = NULL +cdef void* __cuGLUnmapBufferObject = NULL +cdef void* __cuGLUnregisterBufferObject = NULL +cdef void* __cuGLSetBufferObjectMapFlags = NULL +cdef void* __cuGLMapBufferObjectAsync_v2 = NULL +cdef void* __cuGLUnmapBufferObjectAsync = NULL +cdef void* __cuProfilerInitialize = NULL +cdef void* __cuProfilerStart = NULL +cdef void* __cuProfilerStop = NULL +cdef void* __cuVDPAUGetDevice = NULL +cdef void* __cuVDPAUCtxCreate_v2 = NULL +cdef void* __cuGraphicsVDPAURegisterVideoSurface = NULL +cdef void* __cuGraphicsVDPAURegisterOutputSurface = NULL + +cdef int _init_driver() except -1 nogil: + global _cyb___py_driver_init + cdef uintptr_t handle = 0 + cdef int ptds_mode + cdef _cyb_cuGetProcAddress_v2_T cuGetProcAddress_v2 + with gil, _cyb_symbol_lock: + if _cyb___py_driver_init: return 0 + + handle = load_library() + if handle == 0: + raise RuntimeError('Failed to open cuda') + # Get latest __cuGetProcAddress_v2 + cuGetProcAddress_v2 = <_cyb_cuGetProcAddress_v2_T>_cyb_GetProcAddress( + handle, 'cuGetProcAddress_v2' + ) + if cuGetProcAddress_v2 == NULL: + raise RuntimeError("Failed to get cuGetProcAddress_v2") + if bool(int(_cyb_getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))): + ptds_mode = CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + else: + ptds_mode = CU_GET_PROC_ADDRESS_DEFAULT + global __cuGetErrorString + cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, ptds_mode, NULL) + + global __cuGetErrorName + cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, ptds_mode, NULL) + + global __cuInit + cuGetProcAddress_v2('cuInit', &__cuInit, 2000, ptds_mode, NULL) + + global __cuDriverGetVersion + cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, ptds_mode, NULL) + + global __cuDeviceGet + cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, ptds_mode, NULL) + + global __cuDeviceGetCount + cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, ptds_mode, NULL) + + global __cuDeviceGetName + cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, ptds_mode, NULL) + + global __cuDeviceGetUuid + cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, ptds_mode, NULL) + + global __cuDeviceGetUuid_v2 + cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, ptds_mode, NULL) + + global __cuDeviceGetLuid + cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, ptds_mode, NULL) + + global __cuDeviceTotalMem_v2 + cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, ptds_mode, NULL) + + global __cuDeviceGetTexture1DLinearMaxWidth + cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, ptds_mode, NULL) + + global __cuDeviceGetAttribute + cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, ptds_mode, NULL) + + global __cuDeviceGetNvSciSyncAttributes + cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, ptds_mode, NULL) + + global __cuDeviceSetMemPool + cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetMemPool + cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetDefaultMemPool + cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetExecAffinitySupport + cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, ptds_mode, NULL) + + global __cuFlushGPUDirectRDMAWrites + cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, ptds_mode, NULL) + + global __cuDeviceGetProperties + cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, ptds_mode, NULL) + + global __cuDeviceComputeCapability + cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRetain + cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRelease_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxSetFlags_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxGetState + cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxReset_v2 + cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL) + + global __cuCtxCreate_v2 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuCtxCreate_v3 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, ptds_mode, NULL) + + global __cuCtxCreate_v4 + cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, ptds_mode, NULL) + + global __cuCtxDestroy_v2 + cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, ptds_mode, NULL) + + global __cuCtxPushCurrent_v2 + cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxPopCurrent_v2 + cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxSetCurrent + cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetCurrent + cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetDevice + cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, ptds_mode, NULL) + + global __cuCtxGetFlags + cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, ptds_mode, NULL) + + global __cuCtxSetFlags + cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, ptds_mode, NULL) + + global __cuCtxGetId + cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, ptds_mode, NULL) + + global __cuCtxSynchronize + cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, ptds_mode, NULL) + + global __cuCtxSetLimit + cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetLimit + cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetCacheConfig + cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxSetCacheConfig + cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxGetApiVersion + cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, ptds_mode, NULL) + + global __cuCtxGetStreamPriorityRange + cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, ptds_mode, NULL) + + global __cuCtxResetPersistingL2Cache + cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, ptds_mode, NULL) + + global __cuCtxGetExecAffinity + cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, ptds_mode, NULL) + + global __cuCtxRecordEvent + cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, ptds_mode, NULL) + + global __cuCtxWaitEvent + cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, ptds_mode, NULL) + + global __cuCtxAttach + cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, ptds_mode, NULL) + + global __cuCtxDetach + cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, ptds_mode, NULL) + + global __cuCtxGetSharedMemConfig + cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuCtxSetSharedMemConfig + cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuModuleLoad + cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, ptds_mode, NULL) + + global __cuModuleLoadData + cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, ptds_mode, NULL) + + global __cuModuleLoadDataEx + cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, ptds_mode, NULL) + + global __cuModuleLoadFatBinary + cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, ptds_mode, NULL) + + global __cuModuleUnload + cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, ptds_mode, NULL) + + global __cuModuleGetLoadingMode + cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, ptds_mode, NULL) + + global __cuModuleGetFunction + cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, ptds_mode, NULL) + + global __cuModuleGetFunctionCount + cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, ptds_mode, NULL) + + global __cuModuleEnumerateFunctions + cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, ptds_mode, NULL) + + global __cuModuleGetGlobal_v2 + cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, ptds_mode, NULL) + + global __cuLinkCreate_v2 + cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddData_v2 + cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddFile_v2 + cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, ptds_mode, NULL) + + global __cuLinkComplete + cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, ptds_mode, NULL) + + global __cuLinkDestroy + cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, ptds_mode, NULL) + + global __cuModuleGetTexRef + cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, ptds_mode, NULL) + + global __cuModuleGetSurfRef + cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, ptds_mode, NULL) + + global __cuLibraryLoadData + cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, ptds_mode, NULL) + + global __cuLibraryLoadFromFile + cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, ptds_mode, NULL) + + global __cuLibraryUnload + cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernel + cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernelCount + cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, ptds_mode, NULL) + + global __cuLibraryEnumerateKernels + cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, ptds_mode, NULL) + + global __cuLibraryGetModule + cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, ptds_mode, NULL) + + global __cuKernelGetFunction + cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetLibrary + cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, ptds_mode, NULL) + + global __cuLibraryGetGlobal + cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, ptds_mode, NULL) + + global __cuLibraryGetManaged + cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, ptds_mode, NULL) + + global __cuLibraryGetUnifiedFunction + cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetAttribute + cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetAttribute + cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetCacheConfig + cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, ptds_mode, NULL) + + global __cuKernelGetName + cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, ptds_mode, NULL) + + global __cuKernelGetParamInfo + cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, ptds_mode, NULL) + + global __cuMemGetInfo_v2 + cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, ptds_mode, NULL) + + global __cuMemAlloc_v2 + cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocPitch_v2 + cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, ptds_mode, NULL) + + global __cuMemFree_v2 + cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, ptds_mode, NULL) + + global __cuMemGetAddressRange_v2 + cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocHost_v2 + cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, ptds_mode, NULL) + + global __cuMemFreeHost + cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, ptds_mode, NULL) + + global __cuMemHostAlloc + cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, ptds_mode, NULL) + + global __cuMemHostGetDevicePointer_v2 + cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, ptds_mode, NULL) + + global __cuMemHostGetFlags + cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, ptds_mode, NULL) + + global __cuMemAllocManaged + cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, ptds_mode, NULL) + + global __cuDeviceRegisterAsyncNotification + cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceUnregisterAsyncNotification + cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceGetByPCIBusId + cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, ptds_mode, NULL) + + global __cuDeviceGetPCIBusId + cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, ptds_mode, NULL) + + global __cuIpcGetEventHandle + cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenEventHandle + cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcGetMemHandle + cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenMemHandle_v2 + cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, ptds_mode, NULL) + + global __cuIpcCloseMemHandle + cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, ptds_mode, NULL) + + global __cuMemHostRegister_v2 + cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, ptds_mode, NULL) + + global __cuMemHostUnregister + cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, ptds_mode, NULL) + + global __cuMemcpy + cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeer + cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoD_v2 + cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoH_v2 + cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoD_v2 + cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoA_v2 + cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoD_v2 + cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoA_v2 + cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoH_v2 + cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoA_v2 + cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2D_v2 + cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DUnaligned_v2 + cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3D_v2 + cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeer + cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyAsync + cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeerAsync + cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoDAsync_v2 + cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoHAsync_v2 + 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 + 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 + 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 + 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 + 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 + cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeerAsync + cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyBatchAsync + cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, ptds_mode, NULL) + + global __cuMemcpy3DBatchAsync + cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, ptds_mode, NULL) + + global __cuMemsetD8_v2 + 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 + 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 + 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 + 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 + 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 + cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD8Async + cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16Async + cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32Async + cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8Async + cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16Async + cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32Async + cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuArrayCreate_v2 + cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetDescriptor_v2 + cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetSparseProperties + cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuMipmappedArrayGetSparseProperties + cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuArrayGetMemoryRequirements + cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuMipmappedArrayGetMemoryRequirements + cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuArrayGetPlane + cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, ptds_mode, NULL) + + global __cuArrayDestroy + cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, ptds_mode, NULL) + + global __cuArray3DCreate_v2 + cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, ptds_mode, NULL) + + global __cuArray3DGetDescriptor_v2 + cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuMipmappedArrayCreate + cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayGetLevel + cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayDestroy + cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, ptds_mode, NULL) + + global __cuMemGetHandleForAddressRange + cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, ptds_mode, NULL) + + global __cuMemBatchDecompressAsync + cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, ptds_mode, NULL) + + global __cuMemAddressReserve + cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, ptds_mode, NULL) + + global __cuMemAddressFree + cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, ptds_mode, NULL) + + global __cuMemCreate + cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, ptds_mode, NULL) + + global __cuMemRelease + cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, ptds_mode, NULL) + + global __cuMemMap + cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, ptds_mode, NULL) + + global __cuMemMapArrayAsync + cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, ptds_mode, NULL) + + global __cuMemUnmap + cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, ptds_mode, NULL) + + global __cuMemSetAccess + cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, ptds_mode, NULL) + + global __cuMemGetAccess + cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, ptds_mode, NULL) + + global __cuMemExportToShareableHandle + cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemImportFromShareableHandle + cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationGranularity + cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationPropertiesFromHandle + cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, ptds_mode, NULL) + + global __cuMemRetainAllocationHandle + cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, ptds_mode, NULL) + + global __cuMemFreeAsync + cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, ptds_mode, NULL) + + global __cuMemAllocAsync + cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolTrimTo + cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAttribute + cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAttribute + cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAccess + cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAccess + cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolCreate + cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, ptds_mode, NULL) + + global __cuMemPoolDestroy + cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, ptds_mode, NULL) + + global __cuMemAllocFromPoolAsync + cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolExportToShareableHandle + cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolImportFromShareableHandle + cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolExportPointer + cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, ptds_mode, NULL) + + global __cuMemPoolImportPointer + cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, ptds_mode, NULL) + + global __cuMulticastCreate + cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, ptds_mode, NULL) + + global __cuMulticastAddDevice + cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, ptds_mode, NULL) + + global __cuMulticastBindMem + cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, ptds_mode, NULL) + + global __cuMulticastBindAddr + cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, ptds_mode, NULL) + + global __cuMulticastUnbind + cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, ptds_mode, NULL) + + global __cuMulticastGetGranularity + cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, ptds_mode, NULL) + + global __cuPointerGetAttribute + cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, ptds_mode, NULL) + + global __cuMemPrefetchAsync + cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, ptds_mode, NULL) + + global __cuMemPrefetchAsync_v2 + cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, ptds_mode, NULL) + + global __cuMemAdvise + cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise, 8000, ptds_mode, NULL) + + global __cuMemAdvise_v2 + cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, ptds_mode, NULL) + + global __cuMemRangeGetAttribute + cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, ptds_mode, NULL) + + global __cuMemRangeGetAttributes + cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, ptds_mode, NULL) + + global __cuPointerSetAttribute + cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, ptds_mode, NULL) + + global __cuPointerGetAttributes + cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, ptds_mode, NULL) + + global __cuStreamCreate + cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, ptds_mode, NULL) + + global __cuStreamCreateWithPriority + cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, ptds_mode, NULL) + + global __cuStreamGetPriority + cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetDevice + cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, ptds_mode, NULL) + + global __cuStreamGetFlags + cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetId + cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, ptds_mode, NULL) + + global __cuStreamGetCtx + cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, ptds_mode, NULL) + + global __cuStreamGetCtx_v2 + cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, ptds_mode, NULL) + + global __cuStreamWaitEvent + cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuStreamAddCallback + cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5000, ptds_mode, NULL) + + global __cuStreamBeginCapture_v2 + cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, ptds_mode, NULL) + + global __cuStreamBeginCaptureToGraph + cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, ptds_mode, NULL) + + global __cuThreadExchangeStreamCaptureMode + cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, ptds_mode, NULL) + + global __cuStreamEndCapture + cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, ptds_mode, NULL) + + global __cuStreamIsCapturing + cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v2 + cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v3 + cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies + cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies_v2 + cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, ptds_mode, NULL) + + global __cuStreamAttachMemAsync + cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 6000, ptds_mode, NULL) + + global __cuStreamQuery + cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamSynchronize + cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamDestroy_v2 + cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, ptds_mode, NULL) + + global __cuStreamCopyAttributes + cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, ptds_mode, NULL) + + global __cuStreamGetAttribute + cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, ptds_mode, NULL) + + global __cuStreamSetAttribute + cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, ptds_mode, NULL) + + global __cuEventCreate + cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, ptds_mode, NULL) + + global __cuEventRecord + cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuEventRecordWithFlags + cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, ptds_mode, NULL) + + global __cuEventQuery + cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, ptds_mode, NULL) + + global __cuEventSynchronize + cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, ptds_mode, NULL) + + global __cuEventDestroy_v2 + cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, ptds_mode, NULL) + + global __cuEventElapsedTime + cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime, 2000, ptds_mode, NULL) + + global __cuEventElapsedTime_v2 + cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, ptds_mode, NULL) + + global __cuImportExternalMemory + cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedBuffer + cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedMipmappedArray + cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, ptds_mode, NULL) + + global __cuDestroyExternalMemory + cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, ptds_mode, NULL) + + global __cuImportExternalSemaphore + cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuSignalExternalSemaphoresAsync + cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuWaitExternalSemaphoresAsync + cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuDestroyExternalSemaphore + cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuStreamWaitValue32_v2 + cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWaitValue64_v2 + cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue32_v2 + cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue64_v2 + cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamBatchMemOp_v2 + cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, ptds_mode, NULL) + + global __cuFuncGetAttribute + cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, ptds_mode, NULL) + + global __cuFuncSetAttribute + cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, ptds_mode, NULL) + + global __cuFuncSetCacheConfig + cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, ptds_mode, NULL) + + global __cuFuncGetModule + cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, ptds_mode, NULL) + + global __cuFuncGetName + cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, ptds_mode, NULL) + + global __cuFuncGetParamInfo + cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, ptds_mode, NULL) + + global __cuFuncIsLoaded + cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, ptds_mode, NULL) + + global __cuFuncLoad + cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, ptds_mode, NULL) + + global __cuLaunchKernel + cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuLaunchKernelEx + cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, ptds_mode, NULL) + + global __cuLaunchCooperativeKernel + cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, ptds_mode, NULL) + + global __cuLaunchCooperativeKernelMultiDevice + cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, ptds_mode, NULL) + + global __cuLaunchHostFunc + cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, ptds_mode, NULL) + + global __cuFuncSetBlockShape + cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedSize + cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, ptds_mode, NULL) + + global __cuParamSetSize + cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, ptds_mode, NULL) + + global __cuParamSeti + cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, ptds_mode, NULL) + + global __cuParamSetf + cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, ptds_mode, NULL) + + global __cuParamSetv + cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, ptds_mode, NULL) + + global __cuLaunch + cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, ptds_mode, NULL) + + global __cuLaunchGrid + cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, ptds_mode, NULL) + + global __cuLaunchGridAsync + cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, ptds_mode, NULL) + + global __cuParamSetTexRef + cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedMemConfig + cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuGraphCreate + cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, ptds_mode, NULL) + + global __cuGraphAddKernelNode_v2 + cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetParams_v2 + cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphAddMemcpyNode + cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeGetParams + cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeSetParams + cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddMemsetNode + cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeGetParams + cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeSetParams + cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddHostNode + cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeGetParams + cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeSetParams + cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddChildGraphNode + cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, ptds_mode, NULL) + + global __cuGraphChildGraphNodeGetGraph + cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, ptds_mode, NULL) + + global __cuGraphAddEmptyNode + cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, ptds_mode, NULL) + + global __cuGraphAddEventRecordNode + cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeGetEvent + cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeSetEvent + cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddEventWaitNode + cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeGetEvent + cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeSetEvent + cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresSignalNode + cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeGetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeSetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresWaitNode + cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeGetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeSetParams + cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddBatchMemOpNode + cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeGetParams + cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeSetParams + cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphExecBatchMemOpNodeSetParams + cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphAddMemAllocNode + cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, ptds_mode, NULL) + + global __cuGraphMemAllocNodeGetParams + cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, ptds_mode, NULL) + + global __cuGraphAddMemFreeNode + cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, ptds_mode, NULL) + + global __cuGraphMemFreeNodeGetParams + cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, ptds_mode, NULL) + + global __cuDeviceGraphMemTrim + cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, ptds_mode, NULL) + + global __cuDeviceGetGraphMemAttribute + cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuDeviceSetGraphMemAttribute + cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuGraphClone + cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeFindInClone + cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetType + cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, ptds_mode, NULL) + + global __cuGraphGetNodes + cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetRootNodes + cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges + cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges_v2 + cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies + cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies_v2 + cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes + cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes_v2 + cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, ptds_mode, NULL) + + global __cuGraphAddDependencies + cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, ptds_mode, NULL) + + global __cuGraphAddDependencies_v2 + cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphRemoveDependencies + cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, ptds_mode, NULL) + + global __cuGraphRemoveDependencies_v2 + cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphDestroyNode + cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, ptds_mode, NULL) + + global __cuGraphInstantiateWithFlags + cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, ptds_mode, NULL) + + global __cuGraphInstantiateWithParams + cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, ptds_mode, NULL) + + global __cuGraphExecGetFlags + cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, ptds_mode, NULL) + + global __cuGraphExecKernelNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphExecMemcpyNodeSetParams + cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecMemsetNodeSetParams + cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecHostNodeSetParams + cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecChildGraphNodeSetParams + cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, ptds_mode, NULL) + + global __cuGraphExecEventRecordNodeSetEvent + cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecEventWaitNodeSetEvent + cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphNodeSetEnabled + cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphNodeGetEnabled + cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphUpload + cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, ptds_mode, NULL) + + global __cuGraphLaunch + cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, ptds_mode, NULL) + + global __cuGraphExecDestroy + cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, ptds_mode, NULL) + + global __cuGraphDestroy + cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, ptds_mode, NULL) + + global __cuGraphExecUpdate_v2 + cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeCopyAttributes + cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetAttribute + cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetAttribute + cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphDebugDotPrint + cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, ptds_mode, NULL) + + global __cuUserObjectCreate + cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, ptds_mode, NULL) + + global __cuUserObjectRetain + cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, ptds_mode, NULL) + + global __cuUserObjectRelease + cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, ptds_mode, NULL) + + global __cuGraphRetainUserObject + cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, ptds_mode, NULL) + + global __cuGraphReleaseUserObject + cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, ptds_mode, NULL) + + global __cuGraphAddNode + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode, 12020, ptds_mode, NULL) + + global __cuGraphAddNode_v2 + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeSetParams + cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphExecNodeSetParams + cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphConditionalHandleCreate + cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSize + cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyAvailableDynamicSMemPerBlock + cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialClusterSize + cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, ptds_mode, NULL) + + global __cuOccupancyMaxActiveClusters + cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, ptds_mode, NULL) + + global __cuTexRefSetArray + cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmappedArray + cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefSetAddress_v2 + cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefSetAddress2D_v3 + cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, ptds_mode, NULL) + + global __cuTexRefSetFormat + cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefSetAddressMode + cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetFilterMode + cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmapFilterMode + cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelBias + cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelClamp + cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefSetMaxAnisotropy + cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefSetBorderColor + cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefSetFlags + cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefGetAddress_v2 + cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefGetArray + cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmappedArray + cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefGetAddressMode + cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFilterMode + cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFormat + cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmapFilterMode + cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelBias + cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelClamp + cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefGetMaxAnisotropy + cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefGetBorderColor + cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefGetFlags + cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefCreate + cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, ptds_mode, NULL) + + global __cuTexRefDestroy + cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, ptds_mode, NULL) + + global __cuSurfRefSetArray + cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, ptds_mode, NULL) + + global __cuSurfRefGetArray + cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, ptds_mode, NULL) + + global __cuTexObjectCreate + cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, ptds_mode, NULL) + + global __cuTexObjectDestroy + cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceDesc + cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetTextureDesc + cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceViewDesc + cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, ptds_mode, NULL) + + global __cuSurfObjectCreate + cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, ptds_mode, NULL) + + global __cuSurfObjectDestroy + cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, ptds_mode, NULL) + + global __cuSurfObjectGetResourceDesc + cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTensorMapEncodeTiled + cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2col + cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2colWide + cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, ptds_mode, NULL) + + global __cuTensorMapReplaceAddress + cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, ptds_mode, NULL) + + global __cuDeviceCanAccessPeer + cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, ptds_mode, NULL) + + global __cuCtxEnablePeerAccess + cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, ptds_mode, NULL) + + global __cuCtxDisablePeerAccess + cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, ptds_mode, NULL) + + global __cuDeviceGetP2PAttribute + cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, ptds_mode, NULL) + + global __cuGraphicsUnregisterResource + cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, ptds_mode, NULL) + + global __cuGraphicsSubResourceGetMappedArray + cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedMipmappedArray + cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedPointer_v2 + cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsResourceSetMapFlags_v2 + cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, ptds_mode, NULL) + + global __cuGraphicsMapResources + cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGraphicsUnmapResources + cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGetProcAddress_v2 + cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, ptds_mode, NULL) + + global __cuCoredumpGetAttribute + cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpGetAttributeGlobal + cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttribute + cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttributeGlobal + cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuGetExportTable + cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, ptds_mode, NULL) + + global __cuGreenCtxCreate + cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, ptds_mode, NULL) + + global __cuGreenCtxDestroy + cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, ptds_mode, NULL) + + global __cuCtxFromGreenCtx + cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, ptds_mode, NULL) + + global __cuDeviceGetDevResource + cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, ptds_mode, NULL) + + global __cuCtxGetDevResource + cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuGreenCtxGetDevResource + cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuDevSmResourceSplitByCount + cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, ptds_mode, NULL) + + global __cuDevResourceGenerateDesc + cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, ptds_mode, NULL) + + global __cuGreenCtxRecordEvent + cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, ptds_mode, NULL) + + global __cuGreenCtxWaitEvent + cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, ptds_mode, NULL) + + global __cuStreamGetGreenCtx + cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, ptds_mode, NULL) + + global __cuGreenCtxStreamCreate + cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, ptds_mode, NULL) + + global __cuLogsRegisterCallback + cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsUnregisterCallback + cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsCurrent + cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, ptds_mode, NULL) + + global __cuLogsDumpToFile + cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, ptds_mode, NULL) + + global __cuLogsDumpToMemory + cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetRestoreThreadId + cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetState + cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessLock + cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessCheckpoint + cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessRestore + cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessUnlock + cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, ptds_mode, NULL) + + global __cuGraphicsEGLRegisterImage + cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnect + cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnectWithFlags + cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, ptds_mode, NULL) + + global __cuEGLStreamConsumerDisconnect + cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerAcquireFrame + cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerReleaseFrame + cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerConnect + cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerDisconnect + cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerPresentFrame + cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerReturnFrame + cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedEglFrame + cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, ptds_mode, NULL) + + global __cuEventCreateFromEGLSync + cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterBuffer + cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterImage + cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, ptds_mode, NULL) + + global __cuGLGetDevices_v2 + cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, ptds_mode, NULL) + + global __cuGLCtxCreate_v2 + cuGetProcAddress_v2('cuGLCtxCreate', &__cuGLCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGLInit + cuGetProcAddress_v2('cuGLInit', &__cuGLInit, 2000, ptds_mode, NULL) + + global __cuGLRegisterBufferObject + cuGetProcAddress_v2('cuGLRegisterBufferObject', &__cuGLRegisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLMapBufferObject_v2 + cuGetProcAddress_v2('cuGLMapBufferObject', &__cuGLMapBufferObject_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObject + cuGetProcAddress_v2('cuGLUnmapBufferObject', &__cuGLUnmapBufferObject, 2000, ptds_mode, NULL) + + global __cuGLUnregisterBufferObject + cuGetProcAddress_v2('cuGLUnregisterBufferObject', &__cuGLUnregisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLSetBufferObjectMapFlags + cuGetProcAddress_v2('cuGLSetBufferObjectMapFlags', &__cuGLSetBufferObjectMapFlags, 2030, ptds_mode, NULL) + + global __cuGLMapBufferObjectAsync_v2 + cuGetProcAddress_v2('cuGLMapBufferObjectAsync', &__cuGLMapBufferObjectAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObjectAsync + cuGetProcAddress_v2('cuGLUnmapBufferObjectAsync', &__cuGLUnmapBufferObjectAsync, 2030, ptds_mode, NULL) + + global __cuProfilerInitialize + cuGetProcAddress_v2('cuProfilerInitialize', &__cuProfilerInitialize, 4000, ptds_mode, NULL) + + global __cuProfilerStart + cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, ptds_mode, NULL) + + global __cuProfilerStop + cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, ptds_mode, NULL) + + global __cuVDPAUGetDevice + cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, ptds_mode, NULL) + + global __cuVDPAUCtxCreate_v2 + cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterVideoSurface + cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterOutputSurface + cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, ptds_mode, NULL) + + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) + return 0 + +cdef inline int _check_or_init_driver() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_driver_init): + return 0 + + return _init_driver() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_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 + data["__cuDeviceGetUuid"] = __cuDeviceGetUuid + + 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 __cuMemcpyBatchAsync + data["__cuMemcpyBatchAsync"] = __cuMemcpyBatchAsync + + global __cuMemcpy3DBatchAsync + data["__cuMemcpy3DBatchAsync"] = __cuMemcpy3DBatchAsync + + 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 + data["__cuMemPrefetchAsync"] = __cuMemPrefetchAsync + + global __cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 + + global __cuMemAdvise + data["__cuMemAdvise"] = __cuMemAdvise + + 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 + data["__cuStreamUpdateCaptureDependencies"] = __cuStreamUpdateCaptureDependencies + + 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 + data["__cuEventElapsedTime"] = __cuEventElapsedTime + + 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 + data["__cuGraphGetEdges"] = __cuGraphGetEdges + + global __cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 + + global __cuGraphNodeGetDependencies + data["__cuGraphNodeGetDependencies"] = __cuGraphNodeGetDependencies + + global __cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 + + global __cuGraphNodeGetDependentNodes + data["__cuGraphNodeGetDependentNodes"] = __cuGraphNodeGetDependentNodes + + global __cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 + + global __cuGraphAddDependencies + data["__cuGraphAddDependencies"] = __cuGraphAddDependencies + + global __cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 + + global __cuGraphRemoveDependencies + data["__cuGraphRemoveDependencies"] = __cuGraphRemoveDependencies + + 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 + data["__cuGraphAddNode"] = __cuGraphAddNode + + 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 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cuda")._handle_uint + return handle + + +############################################################################### +# 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(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetUuid + _check_or_init_driver() + if __cuDeviceGetUuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetUuid is not found") + return (__cuDeviceGetUuid)( + uuid, 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 _cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyBatchAsync + _check_or_init_driver() + if __cuMemcpyBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyBatchAsync is not found") + return (__cuMemcpyBatchAsync)( + dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream) + + +cdef CUresult _cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DBatchAsync + _check_or_init_driver() + if __cuMemcpy3DBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DBatchAsync is not found") + return (__cuMemcpy3DBatchAsync)( + numOps, opList, failIdx, flags, 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(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPrefetchAsync + _check_or_init_driver() + if __cuMemPrefetchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchAsync is not found") + return (__cuMemPrefetchAsync)( + devPtr, count, dstDevice, hStream) + + +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(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAdvise + _check_or_init_driver() + if __cuMemAdvise == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAdvise is not found") + return (__cuMemAdvise)( + devPtr, count, advice, device) + + +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(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamUpdateCaptureDependencies + _check_or_init_driver() + if __cuStreamUpdateCaptureDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamUpdateCaptureDependencies is not found") + return (__cuStreamUpdateCaptureDependencies)( + hStream, dependencies, numDependencies, flags) + + +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(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventElapsedTime + _check_or_init_driver() + if __cuEventElapsedTime == NULL: + with gil: + raise FunctionNotFoundError("function cuEventElapsedTime is not found") + return (__cuEventElapsedTime)( + pMilliseconds, hStart, hEnd) + + +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(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetEdges + _check_or_init_driver() + if __cuGraphGetEdges == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetEdges is not found") + return (__cuGraphGetEdges)( + hGraph, from_, to, numEdges) + + +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(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependencies + _check_or_init_driver() + if __cuGraphNodeGetDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependencies is not found") + return (__cuGraphNodeGetDependencies)( + hNode, dependencies, numDependencies) + + +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(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependentNodes + _check_or_init_driver() + if __cuGraphNodeGetDependentNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependentNodes is not found") + return (__cuGraphNodeGetDependentNodes)( + hNode, dependentNodes, numDependentNodes) + + +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(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddDependencies + _check_or_init_driver() + if __cuGraphAddDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddDependencies is not found") + return (__cuGraphAddDependencies)( + hGraph, from_, to, numDependencies) + + +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(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRemoveDependencies + _check_or_init_driver() + if __cuGraphRemoveDependencies == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRemoveDependencies is not found") + return (__cuGraphRemoveDependencies)( + hGraph, from_, to, 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(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddNode + _check_or_init_driver() + if __cuGraphAddNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode is not found") + return (__cuGraphAddNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +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* remaining, unsigned int useFlags, 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, remaining, useFlags, 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) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin.pxd new file mode 100644 index 00000000000..b712a3087b8 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin.pxd @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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 * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil +cdef nvFatbinResult _nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin_linux.pyx new file mode 100644 index 00000000000..d4c54124e52 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin_linux.pyx @@ -0,0 +1,361 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=7d6e928f56af8543c123889e5337a34f9270cbd554c699a8e013f720362988c1 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +from libc.stdint cimport intptr_t + +import threading as _cyb_threading + +cdef int _cyb___py_nvfatbin_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvFatbinGetErrorString = NULL +cdef void* __nvFatbinCreate = NULL +cdef void* __nvFatbinDestroy = NULL +cdef void* __nvFatbinAddPTX = NULL +cdef void* __nvFatbinAddCubin = NULL +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 + +cdef int _init_nvfatbin() except -1 nogil: + global _cyb___py_nvfatbin_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_nvfatbin_init: return 0 + + global __nvFatbinGetErrorString + __nvFatbinGetErrorString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinGetErrorString') + if __nvFatbinGetErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinGetErrorString = _cyb_dlsym(handle, 'nvFatbinGetErrorString') + + global __nvFatbinCreate + __nvFatbinCreate = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinCreate') + if __nvFatbinCreate == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinCreate = _cyb_dlsym(handle, 'nvFatbinCreate') + + global __nvFatbinDestroy + __nvFatbinDestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinDestroy') + if __nvFatbinDestroy == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinDestroy = _cyb_dlsym(handle, 'nvFatbinDestroy') + + global __nvFatbinAddPTX + __nvFatbinAddPTX = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddPTX') + if __nvFatbinAddPTX == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddPTX = _cyb_dlsym(handle, 'nvFatbinAddPTX') + + global __nvFatbinAddCubin + __nvFatbinAddCubin = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddCubin') + if __nvFatbinAddCubin == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddCubin = _cyb_dlsym(handle, 'nvFatbinAddCubin') + + global __nvFatbinAddLTOIR + __nvFatbinAddLTOIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddLTOIR') + if __nvFatbinAddLTOIR == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddLTOIR = _cyb_dlsym(handle, 'nvFatbinAddLTOIR') + + global __nvFatbinSize + __nvFatbinSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinSize') + if __nvFatbinSize == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinSize = _cyb_dlsym(handle, 'nvFatbinSize') + + global __nvFatbinGet + __nvFatbinGet = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinGet') + if __nvFatbinGet == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinGet = _cyb_dlsym(handle, 'nvFatbinGet') + + global __nvFatbinVersion + __nvFatbinVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinVersion') + if __nvFatbinVersion == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinVersion = _cyb_dlsym(handle, 'nvFatbinVersion') + + global __nvFatbinAddIndex + __nvFatbinAddIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddIndex') + if __nvFatbinAddIndex == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddIndex = _cyb_dlsym(handle, 'nvFatbinAddIndex') + + global __nvFatbinAddReloc + __nvFatbinAddReloc = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddReloc') + if __nvFatbinAddReloc == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddReloc = _cyb_dlsym(handle, 'nvFatbinAddReloc') + + global __nvFatbinAddTileIR + __nvFatbinAddTileIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvFatbinAddTileIR') + if __nvFatbinAddTileIR == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddTileIR = _cyb_dlsym(handle, 'nvFatbinAddTileIR') + + _cyb_atomic_int_store(&_cyb___py_nvfatbin_init, 1) + return 0 + +cdef inline int _check_or_init_nvfatbin() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvfatbin_init): + return 0 + + return _init_nvfatbin() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvfatbin() + cdef dict data = {} + global __nvFatbinGetErrorString + data["__nvFatbinGetErrorString"] = __nvFatbinGetErrorString + + global __nvFatbinCreate + data["__nvFatbinCreate"] = __nvFatbinCreate + + global __nvFatbinDestroy + data["__nvFatbinDestroy"] = __nvFatbinDestroy + + global __nvFatbinAddPTX + data["__nvFatbinAddPTX"] = __nvFatbinAddPTX + + global __nvFatbinAddCubin + data["__nvFatbinAddCubin"] = __nvFatbinAddCubin + + global __nvFatbinAddLTOIR + data["__nvFatbinAddLTOIR"] = __nvFatbinAddLTOIR + + global __nvFatbinSize + data["__nvFatbinSize"] = __nvFatbinSize + + global __nvFatbinGet + data["__nvFatbinGet"] = __nvFatbinGet + + global __nvFatbinVersion + data["__nvFatbinVersion"] = __nvFatbinVersion + + global __nvFatbinAddIndex + data["__nvFatbinAddIndex"] = __nvFatbinAddIndex + + global __nvFatbinAddReloc + data["__nvFatbinAddReloc"] = __nvFatbinAddReloc + + global __nvFatbinAddTileIR + data["__nvFatbinAddTileIR"] = __nvFatbinAddTileIR + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvfatbin")._handle_uint + return handle + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil: + global __nvFatbinGetErrorString + _check_or_init_nvfatbin() + if __nvFatbinGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinGetErrorString is not found") + return (__nvFatbinGetErrorString)( + result) + + +cdef nvFatbinResult _nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinCreate + _check_or_init_nvfatbin() + if __nvFatbinCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinCreate is not found") + return (__nvFatbinCreate)( + handle_indirect, options, optionsCount) + + +cdef nvFatbinResult _nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinDestroy + _check_or_init_nvfatbin() + if __nvFatbinDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinDestroy is not found") + return (__nvFatbinDestroy)( + handle_indirect) + + +cdef nvFatbinResult _nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddPTX + _check_or_init_nvfatbin() + if __nvFatbinAddPTX == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddPTX is not found") + return (__nvFatbinAddPTX)( + handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult _nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddCubin + _check_or_init_nvfatbin() + if __nvFatbinAddCubin == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddCubin is not found") + return (__nvFatbinAddCubin)( + handle, code, size, arch, identifier) + + +cdef nvFatbinResult _nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddLTOIR + _check_or_init_nvfatbin() + if __nvFatbinAddLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddLTOIR is not found") + return (__nvFatbinAddLTOIR)( + handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult _nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinSize + _check_or_init_nvfatbin() + if __nvFatbinSize == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinSize is not found") + return (__nvFatbinSize)( + handle, size) + + +cdef nvFatbinResult _nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinGet + _check_or_init_nvfatbin() + if __nvFatbinGet == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinGet is not found") + return (__nvFatbinGet)( + handle, buffer) + + +cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinVersion + _check_or_init_nvfatbin() + if __nvFatbinVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinVersion is not found") + return (__nvFatbinVersion)( + 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() + if __nvFatbinAddReloc == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddReloc is not found") + return (__nvFatbinAddReloc)( + handle, code, size) + + +cdef nvFatbinResult _nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddTileIR + _check_or_init_nvfatbin() + if __nvFatbinAddTileIR == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddTileIR is not found") + return (__nvFatbinAddTileIR)( + handle, code, size, identifier, optionsCmdLine) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin_windows.pyx new file mode 100644 index 00000000000..272cc3b0fbf --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvfatbin_windows.pyx @@ -0,0 +1,315 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=5af6a32f057cc5814e89a97c876285101fa636ac38928e7d11b7ada35db98a91 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvfatbin_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from .utils import FunctionNotFoundError, NotSupportedError +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvFatbinGetErrorString = NULL +cdef void* __nvFatbinCreate = NULL +cdef void* __nvFatbinDestroy = NULL +cdef void* __nvFatbinAddPTX = NULL +cdef void* __nvFatbinAddCubin = NULL +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 + +cdef int _init_nvfatbin() except -1 nogil: + global _cyb___py_nvfatbin_init + + cdef int err + cdef uintptr_t handle + with gil, _cyb_symbol_lock: + if _cyb___py_nvfatbin_init: return 0 + + handle = load_library() + global __nvFatbinGetErrorString + __nvFatbinGetErrorString = _cyb_GetProcAddress(handle, 'nvFatbinGetErrorString') + + global __nvFatbinCreate + __nvFatbinCreate = _cyb_GetProcAddress(handle, 'nvFatbinCreate') + + global __nvFatbinDestroy + __nvFatbinDestroy = _cyb_GetProcAddress(handle, 'nvFatbinDestroy') + + global __nvFatbinAddPTX + __nvFatbinAddPTX = _cyb_GetProcAddress(handle, 'nvFatbinAddPTX') + + global __nvFatbinAddCubin + __nvFatbinAddCubin = _cyb_GetProcAddress(handle, 'nvFatbinAddCubin') + + global __nvFatbinAddLTOIR + __nvFatbinAddLTOIR = _cyb_GetProcAddress(handle, 'nvFatbinAddLTOIR') + + global __nvFatbinSize + __nvFatbinSize = _cyb_GetProcAddress(handle, 'nvFatbinSize') + + global __nvFatbinGet + __nvFatbinGet = _cyb_GetProcAddress(handle, 'nvFatbinGet') + + global __nvFatbinVersion + __nvFatbinVersion = _cyb_GetProcAddress(handle, 'nvFatbinVersion') + + global __nvFatbinAddIndex + __nvFatbinAddIndex = _cyb_GetProcAddress(handle, 'nvFatbinAddIndex') + + global __nvFatbinAddReloc + __nvFatbinAddReloc = _cyb_GetProcAddress(handle, 'nvFatbinAddReloc') + + global __nvFatbinAddTileIR + __nvFatbinAddTileIR = _cyb_GetProcAddress(handle, 'nvFatbinAddTileIR') + + _cyb_atomic_int_store(&_cyb___py_nvfatbin_init, 1) + return 0 + +cdef inline int _check_or_init_nvfatbin() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvfatbin_init): + return 0 + + return _init_nvfatbin() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvfatbin() + cdef dict data = {} + global __nvFatbinGetErrorString + data["__nvFatbinGetErrorString"] = __nvFatbinGetErrorString + + global __nvFatbinCreate + data["__nvFatbinCreate"] = __nvFatbinCreate + + global __nvFatbinDestroy + data["__nvFatbinDestroy"] = __nvFatbinDestroy + + global __nvFatbinAddPTX + data["__nvFatbinAddPTX"] = __nvFatbinAddPTX + + global __nvFatbinAddCubin + data["__nvFatbinAddCubin"] = __nvFatbinAddCubin + + global __nvFatbinAddLTOIR + data["__nvFatbinAddLTOIR"] = __nvFatbinAddLTOIR + + global __nvFatbinSize + data["__nvFatbinSize"] = __nvFatbinSize + + global __nvFatbinGet + data["__nvFatbinGet"] = __nvFatbinGet + + global __nvFatbinVersion + data["__nvFatbinVersion"] = __nvFatbinVersion + + global __nvFatbinAddIndex + data["__nvFatbinAddIndex"] = __nvFatbinAddIndex + + global __nvFatbinAddReloc + data["__nvFatbinAddReloc"] = __nvFatbinAddReloc + + global __nvFatbinAddTileIR + data["__nvFatbinAddTileIR"] = __nvFatbinAddTileIR + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + return load_nvidia_dynamic_lib("nvfatbin")._handle_uint + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil: + global __nvFatbinGetErrorString + _check_or_init_nvfatbin() + if __nvFatbinGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinGetErrorString is not found") + return (__nvFatbinGetErrorString)( + result) + + +cdef nvFatbinResult _nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinCreate + _check_or_init_nvfatbin() + if __nvFatbinCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinCreate is not found") + return (__nvFatbinCreate)( + handle_indirect, options, optionsCount) + + +cdef nvFatbinResult _nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinDestroy + _check_or_init_nvfatbin() + if __nvFatbinDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinDestroy is not found") + return (__nvFatbinDestroy)( + handle_indirect) + + +cdef nvFatbinResult _nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddPTX + _check_or_init_nvfatbin() + if __nvFatbinAddPTX == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddPTX is not found") + return (__nvFatbinAddPTX)( + handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult _nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddCubin + _check_or_init_nvfatbin() + if __nvFatbinAddCubin == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddCubin is not found") + return (__nvFatbinAddCubin)( + handle, code, size, arch, identifier) + + +cdef nvFatbinResult _nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddLTOIR + _check_or_init_nvfatbin() + if __nvFatbinAddLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddLTOIR is not found") + return (__nvFatbinAddLTOIR)( + handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult _nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinSize + _check_or_init_nvfatbin() + if __nvFatbinSize == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinSize is not found") + return (__nvFatbinSize)( + handle, size) + + +cdef nvFatbinResult _nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinGet + _check_or_init_nvfatbin() + if __nvFatbinGet == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinGet is not found") + return (__nvFatbinGet)( + handle, buffer) + + +cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinVersion + _check_or_init_nvfatbin() + if __nvFatbinVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinVersion is not found") + return (__nvFatbinVersion)( + 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() + if __nvFatbinAddReloc == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddReloc is not found") + return (__nvFatbinAddReloc)( + handle, code, size) + + +cdef nvFatbinResult _nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddTileIR + _check_or_init_nvfatbin() + if __nvFatbinAddTileIR == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddTileIR is not found") + return (__nvFatbinAddTileIR)( + handle, code, size, identifier, optionsCmdLine) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink.pxd new file mode 100644 index 00000000000..4a391792fd0 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink.pxd @@ -0,0 +1,38 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8bcbd5ba3e12e16d974e141ec43ddce440ac7c84e5aaa746607daa43557f54fb + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from ..cynvjitlink cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvJitLinkResult _nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink_linux.pyx new file mode 100644 index 00000000000..1469d9ea9e9 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -0,0 +1,448 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3088e90760487963484f2cb5230ddc1177d3a1b6d89213f9f368e8eec4a57eb8 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +from libc.stdint cimport ( + intptr_t, + uint32_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvjitlink_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvJitLinkCreate = NULL +cdef void* __nvJitLinkDestroy = NULL +cdef void* __nvJitLinkAddData = NULL +cdef void* __nvJitLinkAddFile = NULL +cdef void* __nvJitLinkComplete = NULL +cdef void* __nvJitLinkGetLinkedCubinSize = NULL +cdef void* __nvJitLinkGetLinkedCubin = NULL +cdef void* __nvJitLinkGetLinkedPtxSize = NULL +cdef void* __nvJitLinkGetLinkedPtx = NULL +cdef void* __nvJitLinkGetErrorLogSize = NULL +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: + global _cyb___py_nvjitlink_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_nvjitlink_init: return 0 + + global __nvJitLinkCreate + __nvJitLinkCreate = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkCreate') + if __nvJitLinkCreate == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkCreate = _cyb_dlsym(handle, 'nvJitLinkCreate') + + global __nvJitLinkDestroy + __nvJitLinkDestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkDestroy') + if __nvJitLinkDestroy == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkDestroy = _cyb_dlsym(handle, 'nvJitLinkDestroy') + + global __nvJitLinkAddData + __nvJitLinkAddData = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkAddData') + if __nvJitLinkAddData == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkAddData = _cyb_dlsym(handle, 'nvJitLinkAddData') + + global __nvJitLinkAddFile + __nvJitLinkAddFile = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkAddFile') + if __nvJitLinkAddFile == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkAddFile = _cyb_dlsym(handle, 'nvJitLinkAddFile') + + global __nvJitLinkComplete + __nvJitLinkComplete = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkComplete') + if __nvJitLinkComplete == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkComplete = _cyb_dlsym(handle, 'nvJitLinkComplete') + + global __nvJitLinkGetLinkedCubinSize + __nvJitLinkGetLinkedCubinSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') + if __nvJitLinkGetLinkedCubinSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedCubinSize = _cyb_dlsym(handle, 'nvJitLinkGetLinkedCubinSize') + + global __nvJitLinkGetLinkedCubin + __nvJitLinkGetLinkedCubin = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') + if __nvJitLinkGetLinkedCubin == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedCubin = _cyb_dlsym(handle, 'nvJitLinkGetLinkedCubin') + + global __nvJitLinkGetLinkedPtxSize + __nvJitLinkGetLinkedPtxSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') + if __nvJitLinkGetLinkedPtxSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedPtxSize = _cyb_dlsym(handle, 'nvJitLinkGetLinkedPtxSize') + + global __nvJitLinkGetLinkedPtx + __nvJitLinkGetLinkedPtx = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') + if __nvJitLinkGetLinkedPtx == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedPtx = _cyb_dlsym(handle, 'nvJitLinkGetLinkedPtx') + + global __nvJitLinkGetErrorLogSize + __nvJitLinkGetErrorLogSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') + if __nvJitLinkGetErrorLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetErrorLogSize = _cyb_dlsym(handle, 'nvJitLinkGetErrorLogSize') + + global __nvJitLinkGetErrorLog + __nvJitLinkGetErrorLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetErrorLog') + if __nvJitLinkGetErrorLog == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetErrorLog = _cyb_dlsym(handle, 'nvJitLinkGetErrorLog') + + global __nvJitLinkGetInfoLogSize + __nvJitLinkGetInfoLogSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') + if __nvJitLinkGetInfoLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetInfoLogSize = _cyb_dlsym(handle, 'nvJitLinkGetInfoLogSize') + + global __nvJitLinkGetInfoLog + __nvJitLinkGetInfoLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetInfoLog') + if __nvJitLinkGetInfoLog == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetInfoLog = _cyb_dlsym(handle, 'nvJitLinkGetInfoLog') + + global __nvJitLinkVersion + __nvJitLinkVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkVersion') + if __nvJitLinkVersion == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkVersion = _cyb_dlsym(handle, 'nvJitLinkVersion') + + global __nvJitLinkGetLinkedLTOIRSize + __nvJitLinkGetLinkedLTOIRSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedLTOIRSize') + if __nvJitLinkGetLinkedLTOIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedLTOIRSize = _cyb_dlsym(handle, 'nvJitLinkGetLinkedLTOIRSize') + + global __nvJitLinkGetLinkedLTOIR + __nvJitLinkGetLinkedLTOIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvJitLinkGetLinkedLTOIR') + if __nvJitLinkGetLinkedLTOIR == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedLTOIR = _cyb_dlsym(handle, 'nvJitLinkGetLinkedLTOIR') + + _cyb_atomic_int_store(&_cyb___py_nvjitlink_init, 1) + return 0 + +cdef inline int _check_or_init_nvjitlink() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvjitlink_init): + return 0 + + return _init_nvjitlink() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvjitlink() + cdef dict data = {} + global __nvJitLinkCreate + data["__nvJitLinkCreate"] = __nvJitLinkCreate + + global __nvJitLinkDestroy + data["__nvJitLinkDestroy"] = __nvJitLinkDestroy + + global __nvJitLinkAddData + data["__nvJitLinkAddData"] = __nvJitLinkAddData + + global __nvJitLinkAddFile + data["__nvJitLinkAddFile"] = __nvJitLinkAddFile + + global __nvJitLinkComplete + data["__nvJitLinkComplete"] = __nvJitLinkComplete + + global __nvJitLinkGetLinkedCubinSize + data["__nvJitLinkGetLinkedCubinSize"] = __nvJitLinkGetLinkedCubinSize + + global __nvJitLinkGetLinkedCubin + data["__nvJitLinkGetLinkedCubin"] = __nvJitLinkGetLinkedCubin + + global __nvJitLinkGetLinkedPtxSize + data["__nvJitLinkGetLinkedPtxSize"] = __nvJitLinkGetLinkedPtxSize + + global __nvJitLinkGetLinkedPtx + data["__nvJitLinkGetLinkedPtx"] = __nvJitLinkGetLinkedPtx + + global __nvJitLinkGetErrorLogSize + data["__nvJitLinkGetErrorLogSize"] = __nvJitLinkGetErrorLogSize + + global __nvJitLinkGetErrorLog + data["__nvJitLinkGetErrorLog"] = __nvJitLinkGetErrorLog + + global __nvJitLinkGetInfoLogSize + data["__nvJitLinkGetInfoLogSize"] = __nvJitLinkGetInfoLogSize + + global __nvJitLinkGetInfoLog + data["__nvJitLinkGetInfoLog"] = __nvJitLinkGetInfoLog + + global __nvJitLinkVersion + data["__nvJitLinkVersion"] = __nvJitLinkVersion + + global __nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = __nvJitLinkGetLinkedLTOIRSize + + global __nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = __nvJitLinkGetLinkedLTOIR + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint + return handle + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvJitLinkResult _nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkCreate + _check_or_init_nvjitlink() + if __nvJitLinkCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkCreate is not found") + return (__nvJitLinkCreate)( + handle, numOptions, options) + + +cdef nvJitLinkResult _nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkDestroy + _check_or_init_nvjitlink() + if __nvJitLinkDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkDestroy is not found") + return (__nvJitLinkDestroy)( + handle) + + +cdef nvJitLinkResult _nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkAddData + _check_or_init_nvjitlink() + if __nvJitLinkAddData == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkAddData is not found") + return (__nvJitLinkAddData)( + handle, inputType, data, size, name) + + +cdef nvJitLinkResult _nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkAddFile + _check_or_init_nvjitlink() + if __nvJitLinkAddFile == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkAddFile is not found") + return (__nvJitLinkAddFile)( + handle, inputType, fileName) + + +cdef nvJitLinkResult _nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkComplete + _check_or_init_nvjitlink() + if __nvJitLinkComplete == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkComplete is not found") + return (__nvJitLinkComplete)( + handle) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedCubinSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedCubinSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedCubinSize is not found") + return (__nvJitLinkGetLinkedCubinSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedCubin + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedCubin == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedCubin is not found") + return (__nvJitLinkGetLinkedCubin)( + handle, cubin) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedPtxSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedPtxSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedPtxSize is not found") + return (__nvJitLinkGetLinkedPtxSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedPtx + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedPtx == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedPtx is not found") + return (__nvJitLinkGetLinkedPtx)( + handle, ptx) + + +cdef nvJitLinkResult _nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetErrorLogSize + _check_or_init_nvjitlink() + if __nvJitLinkGetErrorLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetErrorLogSize is not found") + return (__nvJitLinkGetErrorLogSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetErrorLog + _check_or_init_nvjitlink() + if __nvJitLinkGetErrorLog == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetErrorLog is not found") + return (__nvJitLinkGetErrorLog)( + handle, log) + + +cdef nvJitLinkResult _nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetInfoLogSize + _check_or_init_nvjitlink() + if __nvJitLinkGetInfoLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetInfoLogSize is not found") + return (__nvJitLinkGetInfoLogSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetInfoLog + _check_or_init_nvjitlink() + if __nvJitLinkGetInfoLog == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetInfoLog is not found") + return (__nvJitLinkGetInfoLog)( + handle, log) + + +cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkVersion + _check_or_init_nvjitlink() + if __nvJitLinkVersion == NULL: + with gil: + 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_12/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink_windows.pyx new file mode 100644 index 00000000000..f6eb942a5dd --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -0,0 +1,384 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=50c5a9ae5e2cdd364766f02b98517d019e582ea862643113d20416393e76dfe6 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport ( + intptr_t, + uint32_t, + uintptr_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvjitlink_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from .utils import FunctionNotFoundError, NotSupportedError +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvJitLinkCreate = NULL +cdef void* __nvJitLinkDestroy = NULL +cdef void* __nvJitLinkAddData = NULL +cdef void* __nvJitLinkAddFile = NULL +cdef void* __nvJitLinkComplete = NULL +cdef void* __nvJitLinkGetLinkedCubinSize = NULL +cdef void* __nvJitLinkGetLinkedCubin = NULL +cdef void* __nvJitLinkGetLinkedPtxSize = NULL +cdef void* __nvJitLinkGetLinkedPtx = NULL +cdef void* __nvJitLinkGetErrorLogSize = NULL +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: + global _cyb___py_nvjitlink_init + + cdef int err + cdef uintptr_t handle + with gil, _cyb_symbol_lock: + if _cyb___py_nvjitlink_init: return 0 + + handle = load_library() + global __nvJitLinkCreate + __nvJitLinkCreate = _cyb_GetProcAddress(handle, 'nvJitLinkCreate') + + global __nvJitLinkDestroy + __nvJitLinkDestroy = _cyb_GetProcAddress(handle, 'nvJitLinkDestroy') + + global __nvJitLinkAddData + __nvJitLinkAddData = _cyb_GetProcAddress(handle, 'nvJitLinkAddData') + + global __nvJitLinkAddFile + __nvJitLinkAddFile = _cyb_GetProcAddress(handle, 'nvJitLinkAddFile') + + global __nvJitLinkComplete + __nvJitLinkComplete = _cyb_GetProcAddress(handle, 'nvJitLinkComplete') + + global __nvJitLinkGetLinkedCubinSize + __nvJitLinkGetLinkedCubinSize = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedCubinSize') + + global __nvJitLinkGetLinkedCubin + __nvJitLinkGetLinkedCubin = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedCubin') + + global __nvJitLinkGetLinkedPtxSize + __nvJitLinkGetLinkedPtxSize = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedPtxSize') + + global __nvJitLinkGetLinkedPtx + __nvJitLinkGetLinkedPtx = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedPtx') + + global __nvJitLinkGetErrorLogSize + __nvJitLinkGetErrorLogSize = _cyb_GetProcAddress(handle, 'nvJitLinkGetErrorLogSize') + + global __nvJitLinkGetErrorLog + __nvJitLinkGetErrorLog = _cyb_GetProcAddress(handle, 'nvJitLinkGetErrorLog') + + global __nvJitLinkGetInfoLogSize + __nvJitLinkGetInfoLogSize = _cyb_GetProcAddress(handle, 'nvJitLinkGetInfoLogSize') + + global __nvJitLinkGetInfoLog + __nvJitLinkGetInfoLog = _cyb_GetProcAddress(handle, 'nvJitLinkGetInfoLog') + + global __nvJitLinkVersion + __nvJitLinkVersion = _cyb_GetProcAddress(handle, 'nvJitLinkVersion') + + global __nvJitLinkGetLinkedLTOIRSize + __nvJitLinkGetLinkedLTOIRSize = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedLTOIRSize') + + global __nvJitLinkGetLinkedLTOIR + __nvJitLinkGetLinkedLTOIR = _cyb_GetProcAddress(handle, 'nvJitLinkGetLinkedLTOIR') + + _cyb_atomic_int_store(&_cyb___py_nvjitlink_init, 1) + return 0 + +cdef inline int _check_or_init_nvjitlink() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvjitlink_init): + return 0 + + return _init_nvjitlink() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvjitlink() + cdef dict data = {} + global __nvJitLinkCreate + data["__nvJitLinkCreate"] = __nvJitLinkCreate + + global __nvJitLinkDestroy + data["__nvJitLinkDestroy"] = __nvJitLinkDestroy + + global __nvJitLinkAddData + data["__nvJitLinkAddData"] = __nvJitLinkAddData + + global __nvJitLinkAddFile + data["__nvJitLinkAddFile"] = __nvJitLinkAddFile + + global __nvJitLinkComplete + data["__nvJitLinkComplete"] = __nvJitLinkComplete + + global __nvJitLinkGetLinkedCubinSize + data["__nvJitLinkGetLinkedCubinSize"] = __nvJitLinkGetLinkedCubinSize + + global __nvJitLinkGetLinkedCubin + data["__nvJitLinkGetLinkedCubin"] = __nvJitLinkGetLinkedCubin + + global __nvJitLinkGetLinkedPtxSize + data["__nvJitLinkGetLinkedPtxSize"] = __nvJitLinkGetLinkedPtxSize + + global __nvJitLinkGetLinkedPtx + data["__nvJitLinkGetLinkedPtx"] = __nvJitLinkGetLinkedPtx + + global __nvJitLinkGetErrorLogSize + data["__nvJitLinkGetErrorLogSize"] = __nvJitLinkGetErrorLogSize + + global __nvJitLinkGetErrorLog + data["__nvJitLinkGetErrorLog"] = __nvJitLinkGetErrorLog + + global __nvJitLinkGetInfoLogSize + data["__nvJitLinkGetInfoLogSize"] = __nvJitLinkGetInfoLogSize + + global __nvJitLinkGetInfoLog + data["__nvJitLinkGetInfoLog"] = __nvJitLinkGetInfoLog + + global __nvJitLinkVersion + data["__nvJitLinkVersion"] = __nvJitLinkVersion + + global __nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = __nvJitLinkGetLinkedLTOIRSize + + global __nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = __nvJitLinkGetLinkedLTOIR + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + return load_nvidia_dynamic_lib("nvJitLink")._handle_uint + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvJitLinkResult _nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkCreate + _check_or_init_nvjitlink() + if __nvJitLinkCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkCreate is not found") + return (__nvJitLinkCreate)( + handle, numOptions, options) + + +cdef nvJitLinkResult _nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkDestroy + _check_or_init_nvjitlink() + if __nvJitLinkDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkDestroy is not found") + return (__nvJitLinkDestroy)( + handle) + + +cdef nvJitLinkResult _nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkAddData + _check_or_init_nvjitlink() + if __nvJitLinkAddData == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkAddData is not found") + return (__nvJitLinkAddData)( + handle, inputType, data, size, name) + + +cdef nvJitLinkResult _nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkAddFile + _check_or_init_nvjitlink() + if __nvJitLinkAddFile == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkAddFile is not found") + return (__nvJitLinkAddFile)( + handle, inputType, fileName) + + +cdef nvJitLinkResult _nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkComplete + _check_or_init_nvjitlink() + if __nvJitLinkComplete == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkComplete is not found") + return (__nvJitLinkComplete)( + handle) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedCubinSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedCubinSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedCubinSize is not found") + return (__nvJitLinkGetLinkedCubinSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedCubin + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedCubin == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedCubin is not found") + return (__nvJitLinkGetLinkedCubin)( + handle, cubin) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedPtxSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedPtxSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedPtxSize is not found") + return (__nvJitLinkGetLinkedPtxSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedPtx + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedPtx == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedPtx is not found") + return (__nvJitLinkGetLinkedPtx)( + handle, ptx) + + +cdef nvJitLinkResult _nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetErrorLogSize + _check_or_init_nvjitlink() + if __nvJitLinkGetErrorLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetErrorLogSize is not found") + return (__nvJitLinkGetErrorLogSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetErrorLog + _check_or_init_nvjitlink() + if __nvJitLinkGetErrorLog == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetErrorLog is not found") + return (__nvJitLinkGetErrorLog)( + handle, log) + + +cdef nvJitLinkResult _nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetInfoLogSize + _check_or_init_nvjitlink() + if __nvJitLinkGetInfoLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetInfoLogSize is not found") + return (__nvJitLinkGetInfoLogSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetInfoLog + _check_or_init_nvjitlink() + if __nvJitLinkGetInfoLog == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetInfoLog is not found") + return (__nvJitLinkGetInfoLog)( + handle, log) + + +cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkVersion + _check_or_init_nvjitlink() + if __nvJitLinkVersion == NULL: + with gil: + 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_12/cuda/bindings/_internal/nvml.pxd b/cuda_bindings_12/cuda/bindings/_internal/nvml.pxd new file mode 100644 index 00000000000..272a77d24db --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvml.pxd @@ -0,0 +1,369 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=c2cc3cd086b5aeea5fad7ca17600d0102691a3cb354b916f5c086c383d77df19 +from ..cynvml cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvmlReturn_t _nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef const char* _nvmlErrorString(nvmlReturn_t result) except?NULL nogil +cdef nvmlReturn_t _nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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 +cdef nvmlReturn_t _nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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 +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvml_linux.pyx new file mode 100644 index 00000000000..3ac1218e8c3 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvml_linux.pyx @@ -0,0 +1,7564 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=0f1c15a761a6c0fbd8dd543ce35fa436cc64eadee9d7018f9eca3869d2ead415 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +from libc.stdint cimport intptr_t + +import threading as _cyb_threading + +cdef int _cyb___py_nvml_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvmlInit_v2 = NULL +cdef void* __nvmlInitWithFlags = NULL +cdef void* __nvmlShutdown = NULL +cdef void* __nvmlErrorString = NULL +cdef void* __nvmlSystemGetDriverVersion = NULL +cdef void* __nvmlSystemGetNVMLVersion = NULL +cdef void* __nvmlSystemGetCudaDriverVersion = NULL +cdef void* __nvmlSystemGetCudaDriverVersion_v2 = NULL +cdef void* __nvmlSystemGetProcessName = NULL +cdef void* __nvmlSystemGetHicVersion = NULL +cdef void* __nvmlSystemGetTopologyGpuSet = NULL +cdef void* __nvmlSystemGetDriverBranch = NULL +cdef void* __nvmlUnitGetCount = NULL +cdef void* __nvmlUnitGetHandleByIndex = NULL +cdef void* __nvmlUnitGetUnitInfo = NULL +cdef void* __nvmlUnitGetLedState = NULL +cdef void* __nvmlUnitGetPsuInfo = NULL +cdef void* __nvmlUnitGetTemperature = NULL +cdef void* __nvmlUnitGetFanSpeedInfo = NULL +cdef void* __nvmlUnitGetDevices = NULL +cdef void* __nvmlDeviceGetCount_v2 = NULL +cdef void* __nvmlDeviceGetAttributes_v2 = NULL +cdef void* __nvmlDeviceGetHandleByIndex_v2 = NULL +cdef void* __nvmlDeviceGetHandleBySerial = NULL +cdef void* __nvmlDeviceGetHandleByUUID = NULL +cdef void* __nvmlDeviceGetHandleByUUIDV = NULL +cdef void* __nvmlDeviceGetHandleByPciBusId_v2 = NULL +cdef void* __nvmlDeviceGetName = NULL +cdef void* __nvmlDeviceGetBrand = NULL +cdef void* __nvmlDeviceGetIndex = NULL +cdef void* __nvmlDeviceGetSerial = NULL +cdef void* __nvmlDeviceGetModuleId = NULL +cdef void* __nvmlDeviceGetC2cModeInfoV = NULL +cdef void* __nvmlDeviceGetMemoryAffinity = NULL +cdef void* __nvmlDeviceGetCpuAffinityWithinScope = NULL +cdef void* __nvmlDeviceGetCpuAffinity = NULL +cdef void* __nvmlDeviceSetCpuAffinity = NULL +cdef void* __nvmlDeviceClearCpuAffinity = NULL +cdef void* __nvmlDeviceGetNumaNodeId = NULL +cdef void* __nvmlDeviceGetTopologyCommonAncestor = NULL +cdef void* __nvmlDeviceGetTopologyNearestGpus = NULL +cdef void* __nvmlDeviceGetP2PStatus = NULL +cdef void* __nvmlDeviceGetUUID = NULL +cdef void* __nvmlDeviceGetMinorNumber = NULL +cdef void* __nvmlDeviceGetBoardPartNumber = NULL +cdef void* __nvmlDeviceGetInforomVersion = NULL +cdef void* __nvmlDeviceGetInforomImageVersion = NULL +cdef void* __nvmlDeviceGetInforomConfigurationChecksum = NULL +cdef void* __nvmlDeviceValidateInforom = NULL +cdef void* __nvmlDeviceGetLastBBXFlushTime = NULL +cdef void* __nvmlDeviceGetDisplayMode = NULL +cdef void* __nvmlDeviceGetDisplayActive = NULL +cdef void* __nvmlDeviceGetPersistenceMode = NULL +cdef void* __nvmlDeviceGetPciInfoExt = NULL +cdef void* __nvmlDeviceGetPciInfo_v3 = NULL +cdef void* __nvmlDeviceGetMaxPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetGpuMaxPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetMaxPcieLinkWidth = NULL +cdef void* __nvmlDeviceGetCurrPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetCurrPcieLinkWidth = NULL +cdef void* __nvmlDeviceGetPcieThroughput = NULL +cdef void* __nvmlDeviceGetPcieReplayCounter = NULL +cdef void* __nvmlDeviceGetClockInfo = NULL +cdef void* __nvmlDeviceGetMaxClockInfo = NULL +cdef void* __nvmlDeviceGetGpcClkVfOffset = NULL +cdef void* __nvmlDeviceGetClock = NULL +cdef void* __nvmlDeviceGetMaxCustomerBoostClock = NULL +cdef void* __nvmlDeviceGetSupportedMemoryClocks = NULL +cdef void* __nvmlDeviceGetSupportedGraphicsClocks = NULL +cdef void* __nvmlDeviceGetAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceGetFanSpeed = NULL +cdef void* __nvmlDeviceGetFanSpeed_v2 = NULL +cdef void* __nvmlDeviceGetFanSpeedRPM = NULL +cdef void* __nvmlDeviceGetTargetFanSpeed = NULL +cdef void* __nvmlDeviceGetMinMaxFanSpeed = NULL +cdef void* __nvmlDeviceGetFanControlPolicy_v2 = NULL +cdef void* __nvmlDeviceGetNumFans = NULL +cdef void* __nvmlDeviceGetCoolerInfo = NULL +cdef void* __nvmlDeviceGetTemperatureV = NULL +cdef void* __nvmlDeviceGetTemperatureThreshold = NULL +cdef void* __nvmlDeviceGetMarginTemperature = NULL +cdef void* __nvmlDeviceGetThermalSettings = NULL +cdef void* __nvmlDeviceGetPerformanceState = NULL +cdef void* __nvmlDeviceGetCurrentClocksEventReasons = NULL +cdef void* __nvmlDeviceGetSupportedClocksEventReasons = NULL +cdef void* __nvmlDeviceGetPowerState = NULL +cdef void* __nvmlDeviceGetDynamicPstatesInfo = NULL +cdef void* __nvmlDeviceGetMemClkVfOffset = NULL +cdef void* __nvmlDeviceGetMinMaxClockOfPState = NULL +cdef void* __nvmlDeviceGetSupportedPerformanceStates = NULL +cdef void* __nvmlDeviceGetGpcClkMinMaxVfOffset = NULL +cdef void* __nvmlDeviceGetMemClkMinMaxVfOffset = NULL +cdef void* __nvmlDeviceGetClockOffsets = NULL +cdef void* __nvmlDeviceSetClockOffsets = NULL +cdef void* __nvmlDeviceGetPerformanceModes = NULL +cdef void* __nvmlDeviceGetCurrentClockFreqs = NULL +cdef void* __nvmlDeviceGetPowerManagementLimit = NULL +cdef void* __nvmlDeviceGetPowerManagementLimitConstraints = NULL +cdef void* __nvmlDeviceGetPowerManagementDefaultLimit = NULL +cdef void* __nvmlDeviceGetPowerUsage = NULL +cdef void* __nvmlDeviceGetTotalEnergyConsumption = NULL +cdef void* __nvmlDeviceGetEnforcedPowerLimit = NULL +cdef void* __nvmlDeviceGetGpuOperationMode = NULL +cdef void* __nvmlDeviceGetMemoryInfo_v2 = NULL +cdef void* __nvmlDeviceGetComputeMode = NULL +cdef void* __nvmlDeviceGetCudaComputeCapability = NULL +cdef void* __nvmlDeviceGetDramEncryptionMode = NULL +cdef void* __nvmlDeviceSetDramEncryptionMode = NULL +cdef void* __nvmlDeviceGetEccMode = NULL +cdef void* __nvmlDeviceGetDefaultEccMode = NULL +cdef void* __nvmlDeviceGetBoardId = NULL +cdef void* __nvmlDeviceGetMultiGpuBoard = NULL +cdef void* __nvmlDeviceGetTotalEccErrors = NULL +cdef void* __nvmlDeviceGetMemoryErrorCounter = NULL +cdef void* __nvmlDeviceGetUtilizationRates = NULL +cdef void* __nvmlDeviceGetEncoderUtilization = NULL +cdef void* __nvmlDeviceGetEncoderCapacity = NULL +cdef void* __nvmlDeviceGetEncoderStats = NULL +cdef void* __nvmlDeviceGetEncoderSessions = NULL +cdef void* __nvmlDeviceGetDecoderUtilization = NULL +cdef void* __nvmlDeviceGetJpgUtilization = NULL +cdef void* __nvmlDeviceGetOfaUtilization = NULL +cdef void* __nvmlDeviceGetFBCStats = NULL +cdef void* __nvmlDeviceGetFBCSessions = NULL +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 +cdef void* __nvmlDeviceGetAPIRestriction = NULL +cdef void* __nvmlDeviceGetSamples = NULL +cdef void* __nvmlDeviceGetBAR1MemoryInfo = NULL +cdef void* __nvmlDeviceGetIrqNum = NULL +cdef void* __nvmlDeviceGetNumGpuCores = NULL +cdef void* __nvmlDeviceGetPowerSource = NULL +cdef void* __nvmlDeviceGetMemoryBusWidth = NULL +cdef void* __nvmlDeviceGetPcieLinkMaxSpeed = NULL +cdef void* __nvmlDeviceGetPcieSpeed = NULL +cdef void* __nvmlDeviceGetAdaptiveClockInfoStatus = NULL +cdef void* __nvmlDeviceGetBusType = NULL +cdef void* __nvmlDeviceGetGpuFabricInfoV = NULL +cdef void* __nvmlSystemGetConfComputeCapabilities = NULL +cdef void* __nvmlSystemGetConfComputeState = NULL +cdef void* __nvmlDeviceGetConfComputeMemSizeInfo = NULL +cdef void* __nvmlSystemGetConfComputeGpusReadyState = NULL +cdef void* __nvmlDeviceGetConfComputeProtectedMemoryUsage = NULL +cdef void* __nvmlDeviceGetConfComputeGpuCertificate = NULL +cdef void* __nvmlDeviceGetConfComputeGpuAttestationReport = NULL +cdef void* __nvmlSystemGetConfComputeKeyRotationThresholdInfo = NULL +cdef void* __nvmlDeviceSetConfComputeUnprotectedMemSize = NULL +cdef void* __nvmlSystemSetConfComputeGpusReadyState = NULL +cdef void* __nvmlSystemSetConfComputeKeyRotationThresholdInfo = NULL +cdef void* __nvmlSystemGetConfComputeSettings = NULL +cdef void* __nvmlDeviceGetGspFirmwareVersion = NULL +cdef void* __nvmlDeviceGetGspFirmwareMode = NULL +cdef void* __nvmlDeviceGetSramEccErrorStatus = NULL +cdef void* __nvmlDeviceGetAccountingMode = NULL +cdef void* __nvmlDeviceGetAccountingStats = NULL +cdef void* __nvmlDeviceGetAccountingPids = NULL +cdef void* __nvmlDeviceGetAccountingBufferSize = NULL +cdef void* __nvmlDeviceGetRetiredPages = NULL +cdef void* __nvmlDeviceGetRetiredPages_v2 = NULL +cdef void* __nvmlDeviceGetRetiredPagesPendingStatus = NULL +cdef void* __nvmlDeviceGetRemappedRows = NULL +cdef void* __nvmlDeviceGetRowRemapperHistogram = NULL +cdef void* __nvmlDeviceGetArchitecture = NULL +cdef void* __nvmlDeviceGetClkMonStatus = NULL +cdef void* __nvmlDeviceGetProcessUtilization = NULL +cdef void* __nvmlDeviceGetProcessesUtilizationInfo = NULL +cdef void* __nvmlDeviceGetPlatformInfo = NULL +cdef void* __nvmlUnitSetLedState = NULL +cdef void* __nvmlDeviceSetPersistenceMode = NULL +cdef void* __nvmlDeviceSetComputeMode = NULL +cdef void* __nvmlDeviceSetEccMode = NULL +cdef void* __nvmlDeviceClearEccErrorCounts = NULL +cdef void* __nvmlDeviceSetDriverModel = NULL +cdef void* __nvmlDeviceSetGpuLockedClocks = NULL +cdef void* __nvmlDeviceResetGpuLockedClocks = NULL +cdef void* __nvmlDeviceSetMemoryLockedClocks = NULL +cdef void* __nvmlDeviceResetMemoryLockedClocks = NULL +cdef void* __nvmlDeviceSetAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceSetDefaultFanSpeed_v2 = NULL +cdef void* __nvmlDeviceSetFanControlPolicy = NULL +cdef void* __nvmlDeviceSetTemperatureThreshold = NULL +cdef void* __nvmlDeviceSetGpuOperationMode = NULL +cdef void* __nvmlDeviceSetAPIRestriction = NULL +cdef void* __nvmlDeviceSetFanSpeed_v2 = NULL +cdef void* __nvmlDeviceSetAccountingMode = NULL +cdef void* __nvmlDeviceClearAccountingPids = NULL +cdef void* __nvmlDeviceSetPowerManagementLimit_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkState = NULL +cdef void* __nvmlDeviceGetNvLinkVersion = NULL +cdef void* __nvmlDeviceGetNvLinkCapability = NULL +cdef void* __nvmlDeviceGetNvLinkRemotePciInfo_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkErrorCounter = NULL +cdef void* __nvmlDeviceResetNvLinkErrorCounters = NULL +cdef void* __nvmlDeviceGetNvLinkRemoteDeviceType = NULL +cdef void* __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = NULL +cdef void* __nvmlSystemSetNvlinkBwMode = NULL +cdef void* __nvmlSystemGetNvlinkBwMode = NULL +cdef void* __nvmlDeviceGetNvlinkSupportedBwModes = NULL +cdef void* __nvmlDeviceGetNvlinkBwMode = NULL +cdef void* __nvmlDeviceSetNvlinkBwMode = NULL +cdef void* __nvmlEventSetCreate = NULL +cdef void* __nvmlDeviceRegisterEvents = NULL +cdef void* __nvmlDeviceGetSupportedEventTypes = NULL +cdef void* __nvmlEventSetWait_v2 = NULL +cdef void* __nvmlEventSetFree = NULL +cdef void* __nvmlSystemEventSetCreate = NULL +cdef void* __nvmlSystemEventSetFree = NULL +cdef void* __nvmlSystemRegisterEvents = NULL +cdef void* __nvmlSystemEventSetWait = NULL +cdef void* __nvmlDeviceModifyDrainState = NULL +cdef void* __nvmlDeviceQueryDrainState = NULL +cdef void* __nvmlDeviceRemoveGpu_v2 = NULL +cdef void* __nvmlDeviceDiscoverGpus = NULL +cdef void* __nvmlDeviceGetFieldValues = NULL +cdef void* __nvmlDeviceClearFieldValues = NULL +cdef void* __nvmlDeviceGetVirtualizationMode = NULL +cdef void* __nvmlDeviceGetHostVgpuMode = NULL +cdef void* __nvmlDeviceSetVirtualizationMode = NULL +cdef void* __nvmlDeviceGetVgpuHeterogeneousMode = NULL +cdef void* __nvmlDeviceSetVgpuHeterogeneousMode = NULL +cdef void* __nvmlVgpuInstanceGetPlacementId = NULL +cdef void* __nvmlDeviceGetVgpuTypeSupportedPlacements = NULL +cdef void* __nvmlDeviceGetVgpuTypeCreatablePlacements = NULL +cdef void* __nvmlVgpuTypeGetGspHeapSize = NULL +cdef void* __nvmlVgpuTypeGetFbReservation = NULL +cdef void* __nvmlVgpuInstanceGetRuntimeStateSize = NULL +cdef void* __nvmlDeviceSetVgpuCapabilities = NULL +cdef void* __nvmlDeviceGetGridLicensableFeatures_v4 = NULL +cdef void* __nvmlGetVgpuDriverCapabilities = NULL +cdef void* __nvmlDeviceGetVgpuCapabilities = NULL +cdef void* __nvmlDeviceGetSupportedVgpus = NULL +cdef void* __nvmlDeviceGetCreatableVgpus = NULL +cdef void* __nvmlVgpuTypeGetClass = NULL +cdef void* __nvmlVgpuTypeGetName = NULL +cdef void* __nvmlVgpuTypeGetGpuInstanceProfileId = NULL +cdef void* __nvmlVgpuTypeGetDeviceID = NULL +cdef void* __nvmlVgpuTypeGetFramebufferSize = NULL +cdef void* __nvmlVgpuTypeGetNumDisplayHeads = NULL +cdef void* __nvmlVgpuTypeGetResolution = NULL +cdef void* __nvmlVgpuTypeGetLicense = NULL +cdef void* __nvmlVgpuTypeGetFrameRateLimit = NULL +cdef void* __nvmlVgpuTypeGetMaxInstances = NULL +cdef void* __nvmlVgpuTypeGetMaxInstancesPerVm = NULL +cdef void* __nvmlVgpuTypeGetBAR1Info = NULL +cdef void* __nvmlDeviceGetActiveVgpus = NULL +cdef void* __nvmlVgpuInstanceGetVmID = NULL +cdef void* __nvmlVgpuInstanceGetUUID = NULL +cdef void* __nvmlVgpuInstanceGetVmDriverVersion = NULL +cdef void* __nvmlVgpuInstanceGetFbUsage = NULL +cdef void* __nvmlVgpuInstanceGetLicenseStatus = NULL +cdef void* __nvmlVgpuInstanceGetType = NULL +cdef void* __nvmlVgpuInstanceGetFrameRateLimit = NULL +cdef void* __nvmlVgpuInstanceGetEccMode = NULL +cdef void* __nvmlVgpuInstanceGetEncoderCapacity = NULL +cdef void* __nvmlVgpuInstanceSetEncoderCapacity = NULL +cdef void* __nvmlVgpuInstanceGetEncoderStats = NULL +cdef void* __nvmlVgpuInstanceGetEncoderSessions = NULL +cdef void* __nvmlVgpuInstanceGetFBCStats = NULL +cdef void* __nvmlVgpuInstanceGetFBCSessions = NULL +cdef void* __nvmlVgpuInstanceGetGpuInstanceId = NULL +cdef void* __nvmlVgpuInstanceGetGpuPciId = NULL +cdef void* __nvmlVgpuTypeGetCapabilities = NULL +cdef void* __nvmlVgpuInstanceGetMdevUUID = NULL +cdef void* __nvmlGpuInstanceGetCreatableVgpus = NULL +cdef void* __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = NULL +cdef void* __nvmlGpuInstanceGetActiveVgpus = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog = NULL +cdef void* __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = NULL +cdef void* __nvmlGpuInstanceGetVgpuHeterogeneousMode = NULL +cdef void* __nvmlGpuInstanceSetVgpuHeterogeneousMode = NULL +cdef void* __nvmlVgpuInstanceGetMetadata = NULL +cdef void* __nvmlDeviceGetVgpuMetadata = NULL +cdef void* __nvmlGetVgpuCompatibility = NULL +cdef void* __nvmlDeviceGetPgpuMetadataString = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerCapabilities = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState = NULL +cdef void* __nvmlGetVgpuVersion = NULL +cdef void* __nvmlSetVgpuVersion = NULL +cdef void* __nvmlDeviceGetVgpuUtilization = NULL +cdef void* __nvmlDeviceGetVgpuInstancesUtilizationInfo = NULL +cdef void* __nvmlDeviceGetVgpuProcessUtilization = NULL +cdef void* __nvmlDeviceGetVgpuProcessesUtilizationInfo = NULL +cdef void* __nvmlVgpuInstanceGetAccountingMode = NULL +cdef void* __nvmlVgpuInstanceGetAccountingPids = NULL +cdef void* __nvmlVgpuInstanceGetAccountingStats = NULL +cdef void* __nvmlVgpuInstanceClearAccountingPids = NULL +cdef void* __nvmlVgpuInstanceGetLicenseInfo_v2 = NULL +cdef void* __nvmlGetExcludedDeviceCount = NULL +cdef void* __nvmlGetExcludedDeviceInfoByIndex = NULL +cdef void* __nvmlDeviceSetMigMode = NULL +cdef void* __nvmlDeviceGetMigMode = NULL +cdef void* __nvmlDeviceGetGpuInstanceProfileInfoV = NULL +cdef void* __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = NULL +cdef void* __nvmlDeviceGetGpuInstanceRemainingCapacity = NULL +cdef void* __nvmlDeviceCreateGpuInstance = NULL +cdef void* __nvmlDeviceCreateGpuInstanceWithPlacement = NULL +cdef void* __nvmlGpuInstanceDestroy = NULL +cdef void* __nvmlDeviceGetGpuInstances = NULL +cdef void* __nvmlDeviceGetGpuInstanceById = NULL +cdef void* __nvmlGpuInstanceGetInfo = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceProfileInfoV = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = NULL +cdef void* __nvmlGpuInstanceGetComputeInstancePossiblePlacements = NULL +cdef void* __nvmlGpuInstanceCreateComputeInstance = NULL +cdef void* __nvmlGpuInstanceCreateComputeInstanceWithPlacement = NULL +cdef void* __nvmlComputeInstanceDestroy = NULL +cdef void* __nvmlGpuInstanceGetComputeInstances = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceById = NULL +cdef void* __nvmlComputeInstanceGetInfo_v2 = NULL +cdef void* __nvmlDeviceIsMigDeviceHandle = NULL +cdef void* __nvmlDeviceGetGpuInstanceId = NULL +cdef void* __nvmlDeviceGetComputeInstanceId = NULL +cdef void* __nvmlDeviceGetMaxMigDeviceCount = NULL +cdef void* __nvmlDeviceGetMigDeviceHandleByIndex = NULL +cdef void* __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = NULL +cdef void* __nvmlDeviceGetCapabilities = NULL +cdef void* __nvmlDevicePowerSmoothingActivatePresetProfile = NULL +cdef void* __nvmlDevicePowerSmoothingUpdatePresetProfileParam = NULL +cdef void* __nvmlDevicePowerSmoothingSetState = NULL +cdef void* __nvmlDeviceGetAddressingMode = NULL +cdef void* __nvmlDeviceGetRepairStatus = NULL +cdef void* __nvmlDeviceGetPowerMizerMode_v1 = NULL +cdef void* __nvmlDeviceSetPowerMizerMode_v1 = NULL +cdef void* __nvmlDeviceGetPdi = NULL +cdef void* __nvmlDeviceSetHostname_v1 = NULL +cdef void* __nvmlDeviceGetHostname_v1 = NULL +cdef void* __nvmlDeviceGetNvLinkInfo = NULL +cdef void* __nvmlDeviceReadWritePRM_v1 = NULL +cdef void* __nvmlDeviceGetGpuInstanceProfileInfoByIdV = NULL +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* __nvmlSystemGetCPER_v1 = NULL +cdef void* __nvmlDeviceGetBBXTimeData_v1 = NULL +cdef void* __nvmlDeviceGetAccountingStats_v2 = NULL +cdef void* __nvmlDeviceGetRemappedRows_v2 = NULL + +cdef int _init_nvml() except -1 nogil: + global _cyb___py_nvml_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_nvml_init: return 0 + + global __nvmlInit_v2 + __nvmlInit_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlInit_v2') + if __nvmlInit_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlInit_v2 = _cyb_dlsym(handle, 'nvmlInit_v2') + + global __nvmlInitWithFlags + __nvmlInitWithFlags = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlInitWithFlags') + if __nvmlInitWithFlags == NULL: + if handle == NULL: + handle = load_library() + __nvmlInitWithFlags = _cyb_dlsym(handle, 'nvmlInitWithFlags') + + global __nvmlShutdown + __nvmlShutdown = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlShutdown') + if __nvmlShutdown == NULL: + if handle == NULL: + handle = load_library() + __nvmlShutdown = _cyb_dlsym(handle, 'nvmlShutdown') + + global __nvmlErrorString + __nvmlErrorString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlErrorString') + if __nvmlErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvmlErrorString = _cyb_dlsym(handle, 'nvmlErrorString') + + global __nvmlSystemGetDriverVersion + __nvmlSystemGetDriverVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetDriverVersion') + if __nvmlSystemGetDriverVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetDriverVersion = _cyb_dlsym(handle, 'nvmlSystemGetDriverVersion') + + global __nvmlSystemGetNVMLVersion + __nvmlSystemGetNVMLVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetNVMLVersion') + if __nvmlSystemGetNVMLVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetNVMLVersion = _cyb_dlsym(handle, 'nvmlSystemGetNVMLVersion') + + global __nvmlSystemGetCudaDriverVersion + __nvmlSystemGetCudaDriverVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion') + if __nvmlSystemGetCudaDriverVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetCudaDriverVersion = _cyb_dlsym(handle, 'nvmlSystemGetCudaDriverVersion') + + global __nvmlSystemGetCudaDriverVersion_v2 + __nvmlSystemGetCudaDriverVersion_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion_v2') + if __nvmlSystemGetCudaDriverVersion_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetCudaDriverVersion_v2 = _cyb_dlsym(handle, 'nvmlSystemGetCudaDriverVersion_v2') + + global __nvmlSystemGetProcessName + __nvmlSystemGetProcessName = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetProcessName') + if __nvmlSystemGetProcessName == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetProcessName = _cyb_dlsym(handle, 'nvmlSystemGetProcessName') + + global __nvmlSystemGetHicVersion + __nvmlSystemGetHicVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetHicVersion') + if __nvmlSystemGetHicVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetHicVersion = _cyb_dlsym(handle, 'nvmlSystemGetHicVersion') + + global __nvmlSystemGetTopologyGpuSet + __nvmlSystemGetTopologyGpuSet = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetTopologyGpuSet') + if __nvmlSystemGetTopologyGpuSet == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetTopologyGpuSet = _cyb_dlsym(handle, 'nvmlSystemGetTopologyGpuSet') + + global __nvmlSystemGetDriverBranch + __nvmlSystemGetDriverBranch = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetDriverBranch') + if __nvmlSystemGetDriverBranch == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetDriverBranch = _cyb_dlsym(handle, 'nvmlSystemGetDriverBranch') + + global __nvmlUnitGetCount + __nvmlUnitGetCount = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetCount') + if __nvmlUnitGetCount == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetCount = _cyb_dlsym(handle, 'nvmlUnitGetCount') + + global __nvmlUnitGetHandleByIndex + __nvmlUnitGetHandleByIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetHandleByIndex') + if __nvmlUnitGetHandleByIndex == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetHandleByIndex = _cyb_dlsym(handle, 'nvmlUnitGetHandleByIndex') + + global __nvmlUnitGetUnitInfo + __nvmlUnitGetUnitInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetUnitInfo') + if __nvmlUnitGetUnitInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetUnitInfo = _cyb_dlsym(handle, 'nvmlUnitGetUnitInfo') + + global __nvmlUnitGetLedState + __nvmlUnitGetLedState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetLedState') + if __nvmlUnitGetLedState == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetLedState = _cyb_dlsym(handle, 'nvmlUnitGetLedState') + + global __nvmlUnitGetPsuInfo + __nvmlUnitGetPsuInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetPsuInfo') + if __nvmlUnitGetPsuInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetPsuInfo = _cyb_dlsym(handle, 'nvmlUnitGetPsuInfo') + + global __nvmlUnitGetTemperature + __nvmlUnitGetTemperature = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetTemperature') + if __nvmlUnitGetTemperature == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetTemperature = _cyb_dlsym(handle, 'nvmlUnitGetTemperature') + + global __nvmlUnitGetFanSpeedInfo + __nvmlUnitGetFanSpeedInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetFanSpeedInfo') + if __nvmlUnitGetFanSpeedInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetFanSpeedInfo = _cyb_dlsym(handle, 'nvmlUnitGetFanSpeedInfo') + + global __nvmlUnitGetDevices + __nvmlUnitGetDevices = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitGetDevices') + if __nvmlUnitGetDevices == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitGetDevices = _cyb_dlsym(handle, 'nvmlUnitGetDevices') + + global __nvmlDeviceGetCount_v2 + __nvmlDeviceGetCount_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCount_v2') + if __nvmlDeviceGetCount_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCount_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetCount_v2') + + global __nvmlDeviceGetAttributes_v2 + __nvmlDeviceGetAttributes_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAttributes_v2') + if __nvmlDeviceGetAttributes_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAttributes_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetAttributes_v2') + + global __nvmlDeviceGetHandleByIndex_v2 + __nvmlDeviceGetHandleByIndex_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHandleByIndex_v2') + if __nvmlDeviceGetHandleByIndex_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHandleByIndex_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetHandleByIndex_v2') + + global __nvmlDeviceGetHandleBySerial + __nvmlDeviceGetHandleBySerial = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHandleBySerial') + if __nvmlDeviceGetHandleBySerial == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHandleBySerial = _cyb_dlsym(handle, 'nvmlDeviceGetHandleBySerial') + + global __nvmlDeviceGetHandleByUUID + __nvmlDeviceGetHandleByUUID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUID') + if __nvmlDeviceGetHandleByUUID == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHandleByUUID = _cyb_dlsym(handle, 'nvmlDeviceGetHandleByUUID') + + global __nvmlDeviceGetHandleByUUIDV + __nvmlDeviceGetHandleByUUIDV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUIDV') + if __nvmlDeviceGetHandleByUUIDV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHandleByUUIDV = _cyb_dlsym(handle, 'nvmlDeviceGetHandleByUUIDV') + + global __nvmlDeviceGetHandleByPciBusId_v2 + __nvmlDeviceGetHandleByPciBusId_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHandleByPciBusId_v2') + if __nvmlDeviceGetHandleByPciBusId_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHandleByPciBusId_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetHandleByPciBusId_v2') + + global __nvmlDeviceGetName + __nvmlDeviceGetName = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetName') + if __nvmlDeviceGetName == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetName = _cyb_dlsym(handle, 'nvmlDeviceGetName') + + global __nvmlDeviceGetBrand + __nvmlDeviceGetBrand = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBrand') + if __nvmlDeviceGetBrand == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBrand = _cyb_dlsym(handle, 'nvmlDeviceGetBrand') + + global __nvmlDeviceGetIndex + __nvmlDeviceGetIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetIndex') + if __nvmlDeviceGetIndex == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetIndex = _cyb_dlsym(handle, 'nvmlDeviceGetIndex') + + global __nvmlDeviceGetSerial + __nvmlDeviceGetSerial = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSerial') + if __nvmlDeviceGetSerial == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSerial = _cyb_dlsym(handle, 'nvmlDeviceGetSerial') + + global __nvmlDeviceGetModuleId + __nvmlDeviceGetModuleId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetModuleId') + if __nvmlDeviceGetModuleId == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetModuleId = _cyb_dlsym(handle, 'nvmlDeviceGetModuleId') + + global __nvmlDeviceGetC2cModeInfoV + __nvmlDeviceGetC2cModeInfoV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetC2cModeInfoV') + if __nvmlDeviceGetC2cModeInfoV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetC2cModeInfoV = _cyb_dlsym(handle, 'nvmlDeviceGetC2cModeInfoV') + + global __nvmlDeviceGetMemoryAffinity + __nvmlDeviceGetMemoryAffinity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemoryAffinity') + if __nvmlDeviceGetMemoryAffinity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemoryAffinity = _cyb_dlsym(handle, 'nvmlDeviceGetMemoryAffinity') + + global __nvmlDeviceGetCpuAffinityWithinScope + __nvmlDeviceGetCpuAffinityWithinScope = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinityWithinScope') + if __nvmlDeviceGetCpuAffinityWithinScope == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCpuAffinityWithinScope = _cyb_dlsym(handle, 'nvmlDeviceGetCpuAffinityWithinScope') + + global __nvmlDeviceGetCpuAffinity + __nvmlDeviceGetCpuAffinity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinity') + if __nvmlDeviceGetCpuAffinity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCpuAffinity = _cyb_dlsym(handle, 'nvmlDeviceGetCpuAffinity') + + global __nvmlDeviceSetCpuAffinity + __nvmlDeviceSetCpuAffinity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetCpuAffinity') + if __nvmlDeviceSetCpuAffinity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetCpuAffinity = _cyb_dlsym(handle, 'nvmlDeviceSetCpuAffinity') + + global __nvmlDeviceClearCpuAffinity + __nvmlDeviceClearCpuAffinity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceClearCpuAffinity') + if __nvmlDeviceClearCpuAffinity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceClearCpuAffinity = _cyb_dlsym(handle, 'nvmlDeviceClearCpuAffinity') + + global __nvmlDeviceGetNumaNodeId + __nvmlDeviceGetNumaNodeId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNumaNodeId') + if __nvmlDeviceGetNumaNodeId == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNumaNodeId = _cyb_dlsym(handle, 'nvmlDeviceGetNumaNodeId') + + global __nvmlDeviceGetTopologyCommonAncestor + __nvmlDeviceGetTopologyCommonAncestor = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTopologyCommonAncestor') + if __nvmlDeviceGetTopologyCommonAncestor == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTopologyCommonAncestor = _cyb_dlsym(handle, 'nvmlDeviceGetTopologyCommonAncestor') + + global __nvmlDeviceGetTopologyNearestGpus + __nvmlDeviceGetTopologyNearestGpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTopologyNearestGpus') + if __nvmlDeviceGetTopologyNearestGpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTopologyNearestGpus = _cyb_dlsym(handle, 'nvmlDeviceGetTopologyNearestGpus') + + global __nvmlDeviceGetP2PStatus + __nvmlDeviceGetP2PStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetP2PStatus') + if __nvmlDeviceGetP2PStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetP2PStatus = _cyb_dlsym(handle, 'nvmlDeviceGetP2PStatus') + + global __nvmlDeviceGetUUID + __nvmlDeviceGetUUID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetUUID') + if __nvmlDeviceGetUUID == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetUUID = _cyb_dlsym(handle, 'nvmlDeviceGetUUID') + + global __nvmlDeviceGetMinorNumber + __nvmlDeviceGetMinorNumber = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMinorNumber') + if __nvmlDeviceGetMinorNumber == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMinorNumber = _cyb_dlsym(handle, 'nvmlDeviceGetMinorNumber') + + global __nvmlDeviceGetBoardPartNumber + __nvmlDeviceGetBoardPartNumber = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBoardPartNumber') + if __nvmlDeviceGetBoardPartNumber == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBoardPartNumber = _cyb_dlsym(handle, 'nvmlDeviceGetBoardPartNumber') + + global __nvmlDeviceGetInforomVersion + __nvmlDeviceGetInforomVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetInforomVersion') + if __nvmlDeviceGetInforomVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetInforomVersion = _cyb_dlsym(handle, 'nvmlDeviceGetInforomVersion') + + global __nvmlDeviceGetInforomImageVersion + __nvmlDeviceGetInforomImageVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetInforomImageVersion') + if __nvmlDeviceGetInforomImageVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetInforomImageVersion = _cyb_dlsym(handle, 'nvmlDeviceGetInforomImageVersion') + + global __nvmlDeviceGetInforomConfigurationChecksum + __nvmlDeviceGetInforomConfigurationChecksum = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetInforomConfigurationChecksum') + if __nvmlDeviceGetInforomConfigurationChecksum == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetInforomConfigurationChecksum = _cyb_dlsym(handle, 'nvmlDeviceGetInforomConfigurationChecksum') + + global __nvmlDeviceValidateInforom + __nvmlDeviceValidateInforom = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceValidateInforom') + if __nvmlDeviceValidateInforom == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceValidateInforom = _cyb_dlsym(handle, 'nvmlDeviceValidateInforom') + + global __nvmlDeviceGetLastBBXFlushTime + __nvmlDeviceGetLastBBXFlushTime = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetLastBBXFlushTime') + if __nvmlDeviceGetLastBBXFlushTime == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetLastBBXFlushTime = _cyb_dlsym(handle, 'nvmlDeviceGetLastBBXFlushTime') + + global __nvmlDeviceGetDisplayMode + __nvmlDeviceGetDisplayMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDisplayMode') + if __nvmlDeviceGetDisplayMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDisplayMode = _cyb_dlsym(handle, 'nvmlDeviceGetDisplayMode') + + global __nvmlDeviceGetDisplayActive + __nvmlDeviceGetDisplayActive = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDisplayActive') + if __nvmlDeviceGetDisplayActive == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDisplayActive = _cyb_dlsym(handle, 'nvmlDeviceGetDisplayActive') + + global __nvmlDeviceGetPersistenceMode + __nvmlDeviceGetPersistenceMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPersistenceMode') + if __nvmlDeviceGetPersistenceMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPersistenceMode = _cyb_dlsym(handle, 'nvmlDeviceGetPersistenceMode') + + global __nvmlDeviceGetPciInfoExt + __nvmlDeviceGetPciInfoExt = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPciInfoExt') + if __nvmlDeviceGetPciInfoExt == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPciInfoExt = _cyb_dlsym(handle, 'nvmlDeviceGetPciInfoExt') + + global __nvmlDeviceGetPciInfo_v3 + __nvmlDeviceGetPciInfo_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPciInfo_v3') + if __nvmlDeviceGetPciInfo_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPciInfo_v3 = _cyb_dlsym(handle, 'nvmlDeviceGetPciInfo_v3') + + global __nvmlDeviceGetMaxPcieLinkGeneration + __nvmlDeviceGetMaxPcieLinkGeneration = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkGeneration') + if __nvmlDeviceGetMaxPcieLinkGeneration == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMaxPcieLinkGeneration = _cyb_dlsym(handle, 'nvmlDeviceGetMaxPcieLinkGeneration') + + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + __nvmlDeviceGetGpuMaxPcieLinkGeneration = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuMaxPcieLinkGeneration') + if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuMaxPcieLinkGeneration = _cyb_dlsym(handle, 'nvmlDeviceGetGpuMaxPcieLinkGeneration') + + global __nvmlDeviceGetMaxPcieLinkWidth + __nvmlDeviceGetMaxPcieLinkWidth = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkWidth') + if __nvmlDeviceGetMaxPcieLinkWidth == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMaxPcieLinkWidth = _cyb_dlsym(handle, 'nvmlDeviceGetMaxPcieLinkWidth') + + global __nvmlDeviceGetCurrPcieLinkGeneration + __nvmlDeviceGetCurrPcieLinkGeneration = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkGeneration') + if __nvmlDeviceGetCurrPcieLinkGeneration == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCurrPcieLinkGeneration = _cyb_dlsym(handle, 'nvmlDeviceGetCurrPcieLinkGeneration') + + global __nvmlDeviceGetCurrPcieLinkWidth + __nvmlDeviceGetCurrPcieLinkWidth = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkWidth') + if __nvmlDeviceGetCurrPcieLinkWidth == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCurrPcieLinkWidth = _cyb_dlsym(handle, 'nvmlDeviceGetCurrPcieLinkWidth') + + global __nvmlDeviceGetPcieThroughput + __nvmlDeviceGetPcieThroughput = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPcieThroughput') + if __nvmlDeviceGetPcieThroughput == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPcieThroughput = _cyb_dlsym(handle, 'nvmlDeviceGetPcieThroughput') + + global __nvmlDeviceGetPcieReplayCounter + __nvmlDeviceGetPcieReplayCounter = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPcieReplayCounter') + if __nvmlDeviceGetPcieReplayCounter == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPcieReplayCounter = _cyb_dlsym(handle, 'nvmlDeviceGetPcieReplayCounter') + + global __nvmlDeviceGetClockInfo + __nvmlDeviceGetClockInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetClockInfo') + if __nvmlDeviceGetClockInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetClockInfo = _cyb_dlsym(handle, 'nvmlDeviceGetClockInfo') + + global __nvmlDeviceGetMaxClockInfo + __nvmlDeviceGetMaxClockInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMaxClockInfo') + if __nvmlDeviceGetMaxClockInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMaxClockInfo = _cyb_dlsym(handle, 'nvmlDeviceGetMaxClockInfo') + + global __nvmlDeviceGetGpcClkVfOffset + __nvmlDeviceGetGpcClkVfOffset = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpcClkVfOffset') + if __nvmlDeviceGetGpcClkVfOffset == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpcClkVfOffset = _cyb_dlsym(handle, 'nvmlDeviceGetGpcClkVfOffset') + + global __nvmlDeviceGetClock + __nvmlDeviceGetClock = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetClock') + if __nvmlDeviceGetClock == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetClock = _cyb_dlsym(handle, 'nvmlDeviceGetClock') + + global __nvmlDeviceGetMaxCustomerBoostClock + __nvmlDeviceGetMaxCustomerBoostClock = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMaxCustomerBoostClock') + if __nvmlDeviceGetMaxCustomerBoostClock == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMaxCustomerBoostClock = _cyb_dlsym(handle, 'nvmlDeviceGetMaxCustomerBoostClock') + + global __nvmlDeviceGetSupportedMemoryClocks + __nvmlDeviceGetSupportedMemoryClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedMemoryClocks') + if __nvmlDeviceGetSupportedMemoryClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedMemoryClocks = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedMemoryClocks') + + global __nvmlDeviceGetSupportedGraphicsClocks + __nvmlDeviceGetSupportedGraphicsClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedGraphicsClocks') + if __nvmlDeviceGetSupportedGraphicsClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedGraphicsClocks = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedGraphicsClocks') + + global __nvmlDeviceGetAutoBoostedClocksEnabled + __nvmlDeviceGetAutoBoostedClocksEnabled = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAutoBoostedClocksEnabled') + if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAutoBoostedClocksEnabled = _cyb_dlsym(handle, 'nvmlDeviceGetAutoBoostedClocksEnabled') + + global __nvmlDeviceGetFanSpeed + __nvmlDeviceGetFanSpeed = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed') + if __nvmlDeviceGetFanSpeed == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFanSpeed = _cyb_dlsym(handle, 'nvmlDeviceGetFanSpeed') + + global __nvmlDeviceGetFanSpeed_v2 + __nvmlDeviceGetFanSpeed_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed_v2') + if __nvmlDeviceGetFanSpeed_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFanSpeed_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetFanSpeed_v2') + + global __nvmlDeviceGetFanSpeedRPM + __nvmlDeviceGetFanSpeedRPM = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFanSpeedRPM') + if __nvmlDeviceGetFanSpeedRPM == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFanSpeedRPM = _cyb_dlsym(handle, 'nvmlDeviceGetFanSpeedRPM') + + global __nvmlDeviceGetTargetFanSpeed + __nvmlDeviceGetTargetFanSpeed = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTargetFanSpeed') + if __nvmlDeviceGetTargetFanSpeed == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTargetFanSpeed = _cyb_dlsym(handle, 'nvmlDeviceGetTargetFanSpeed') + + global __nvmlDeviceGetMinMaxFanSpeed + __nvmlDeviceGetMinMaxFanSpeed = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMinMaxFanSpeed') + if __nvmlDeviceGetMinMaxFanSpeed == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMinMaxFanSpeed = _cyb_dlsym(handle, 'nvmlDeviceGetMinMaxFanSpeed') + + global __nvmlDeviceGetFanControlPolicy_v2 + __nvmlDeviceGetFanControlPolicy_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFanControlPolicy_v2') + if __nvmlDeviceGetFanControlPolicy_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFanControlPolicy_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetFanControlPolicy_v2') + + global __nvmlDeviceGetNumFans + __nvmlDeviceGetNumFans = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNumFans') + if __nvmlDeviceGetNumFans == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNumFans = _cyb_dlsym(handle, 'nvmlDeviceGetNumFans') + + global __nvmlDeviceGetCoolerInfo + __nvmlDeviceGetCoolerInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCoolerInfo') + if __nvmlDeviceGetCoolerInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCoolerInfo = _cyb_dlsym(handle, 'nvmlDeviceGetCoolerInfo') + + global __nvmlDeviceGetTemperatureV + __nvmlDeviceGetTemperatureV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTemperatureV') + if __nvmlDeviceGetTemperatureV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTemperatureV = _cyb_dlsym(handle, 'nvmlDeviceGetTemperatureV') + + global __nvmlDeviceGetTemperatureThreshold + __nvmlDeviceGetTemperatureThreshold = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTemperatureThreshold') + if __nvmlDeviceGetTemperatureThreshold == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTemperatureThreshold = _cyb_dlsym(handle, 'nvmlDeviceGetTemperatureThreshold') + + global __nvmlDeviceGetMarginTemperature + __nvmlDeviceGetMarginTemperature = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMarginTemperature') + if __nvmlDeviceGetMarginTemperature == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMarginTemperature = _cyb_dlsym(handle, 'nvmlDeviceGetMarginTemperature') + + global __nvmlDeviceGetThermalSettings + __nvmlDeviceGetThermalSettings = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetThermalSettings') + if __nvmlDeviceGetThermalSettings == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetThermalSettings = _cyb_dlsym(handle, 'nvmlDeviceGetThermalSettings') + + global __nvmlDeviceGetPerformanceState + __nvmlDeviceGetPerformanceState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPerformanceState') + if __nvmlDeviceGetPerformanceState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPerformanceState = _cyb_dlsym(handle, 'nvmlDeviceGetPerformanceState') + + global __nvmlDeviceGetCurrentClocksEventReasons + __nvmlDeviceGetCurrentClocksEventReasons = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCurrentClocksEventReasons') + if __nvmlDeviceGetCurrentClocksEventReasons == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCurrentClocksEventReasons = _cyb_dlsym(handle, 'nvmlDeviceGetCurrentClocksEventReasons') + + global __nvmlDeviceGetSupportedClocksEventReasons + __nvmlDeviceGetSupportedClocksEventReasons = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedClocksEventReasons') + if __nvmlDeviceGetSupportedClocksEventReasons == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedClocksEventReasons = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedClocksEventReasons') + + global __nvmlDeviceGetPowerState + __nvmlDeviceGetPowerState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerState') + if __nvmlDeviceGetPowerState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerState = _cyb_dlsym(handle, 'nvmlDeviceGetPowerState') + + global __nvmlDeviceGetDynamicPstatesInfo + __nvmlDeviceGetDynamicPstatesInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDynamicPstatesInfo') + if __nvmlDeviceGetDynamicPstatesInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDynamicPstatesInfo = _cyb_dlsym(handle, 'nvmlDeviceGetDynamicPstatesInfo') + + global __nvmlDeviceGetMemClkVfOffset + __nvmlDeviceGetMemClkVfOffset = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemClkVfOffset') + if __nvmlDeviceGetMemClkVfOffset == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemClkVfOffset = _cyb_dlsym(handle, 'nvmlDeviceGetMemClkVfOffset') + + global __nvmlDeviceGetMinMaxClockOfPState + __nvmlDeviceGetMinMaxClockOfPState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMinMaxClockOfPState') + if __nvmlDeviceGetMinMaxClockOfPState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMinMaxClockOfPState = _cyb_dlsym(handle, 'nvmlDeviceGetMinMaxClockOfPState') + + global __nvmlDeviceGetSupportedPerformanceStates + __nvmlDeviceGetSupportedPerformanceStates = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedPerformanceStates') + if __nvmlDeviceGetSupportedPerformanceStates == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedPerformanceStates = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedPerformanceStates') + + global __nvmlDeviceGetGpcClkMinMaxVfOffset + __nvmlDeviceGetGpcClkMinMaxVfOffset = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpcClkMinMaxVfOffset') + if __nvmlDeviceGetGpcClkMinMaxVfOffset == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpcClkMinMaxVfOffset = _cyb_dlsym(handle, 'nvmlDeviceGetGpcClkMinMaxVfOffset') + + global __nvmlDeviceGetMemClkMinMaxVfOffset + __nvmlDeviceGetMemClkMinMaxVfOffset = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemClkMinMaxVfOffset') + if __nvmlDeviceGetMemClkMinMaxVfOffset == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemClkMinMaxVfOffset = _cyb_dlsym(handle, 'nvmlDeviceGetMemClkMinMaxVfOffset') + + global __nvmlDeviceGetClockOffsets + __nvmlDeviceGetClockOffsets = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetClockOffsets') + if __nvmlDeviceGetClockOffsets == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetClockOffsets = _cyb_dlsym(handle, 'nvmlDeviceGetClockOffsets') + + global __nvmlDeviceSetClockOffsets + __nvmlDeviceSetClockOffsets = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetClockOffsets') + if __nvmlDeviceSetClockOffsets == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetClockOffsets = _cyb_dlsym(handle, 'nvmlDeviceSetClockOffsets') + + global __nvmlDeviceGetPerformanceModes + __nvmlDeviceGetPerformanceModes = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPerformanceModes') + if __nvmlDeviceGetPerformanceModes == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPerformanceModes = _cyb_dlsym(handle, 'nvmlDeviceGetPerformanceModes') + + global __nvmlDeviceGetCurrentClockFreqs + __nvmlDeviceGetCurrentClockFreqs = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCurrentClockFreqs') + if __nvmlDeviceGetCurrentClockFreqs == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCurrentClockFreqs = _cyb_dlsym(handle, 'nvmlDeviceGetCurrentClockFreqs') + + global __nvmlDeviceGetPowerManagementLimit + __nvmlDeviceGetPowerManagementLimit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementLimit') + if __nvmlDeviceGetPowerManagementLimit == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerManagementLimit = _cyb_dlsym(handle, 'nvmlDeviceGetPowerManagementLimit') + + global __nvmlDeviceGetPowerManagementLimitConstraints + __nvmlDeviceGetPowerManagementLimitConstraints = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementLimitConstraints') + if __nvmlDeviceGetPowerManagementLimitConstraints == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerManagementLimitConstraints = _cyb_dlsym(handle, 'nvmlDeviceGetPowerManagementLimitConstraints') + + global __nvmlDeviceGetPowerManagementDefaultLimit + __nvmlDeviceGetPowerManagementDefaultLimit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementDefaultLimit') + if __nvmlDeviceGetPowerManagementDefaultLimit == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerManagementDefaultLimit = _cyb_dlsym(handle, 'nvmlDeviceGetPowerManagementDefaultLimit') + + global __nvmlDeviceGetPowerUsage + __nvmlDeviceGetPowerUsage = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerUsage') + if __nvmlDeviceGetPowerUsage == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerUsage = _cyb_dlsym(handle, 'nvmlDeviceGetPowerUsage') + + global __nvmlDeviceGetTotalEnergyConsumption + __nvmlDeviceGetTotalEnergyConsumption = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTotalEnergyConsumption') + if __nvmlDeviceGetTotalEnergyConsumption == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTotalEnergyConsumption = _cyb_dlsym(handle, 'nvmlDeviceGetTotalEnergyConsumption') + + global __nvmlDeviceGetEnforcedPowerLimit + __nvmlDeviceGetEnforcedPowerLimit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEnforcedPowerLimit') + if __nvmlDeviceGetEnforcedPowerLimit == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEnforcedPowerLimit = _cyb_dlsym(handle, 'nvmlDeviceGetEnforcedPowerLimit') + + global __nvmlDeviceGetGpuOperationMode + __nvmlDeviceGetGpuOperationMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuOperationMode') + if __nvmlDeviceGetGpuOperationMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuOperationMode = _cyb_dlsym(handle, 'nvmlDeviceGetGpuOperationMode') + + global __nvmlDeviceGetMemoryInfo_v2 + __nvmlDeviceGetMemoryInfo_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemoryInfo_v2') + if __nvmlDeviceGetMemoryInfo_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemoryInfo_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetMemoryInfo_v2') + + global __nvmlDeviceGetComputeMode + __nvmlDeviceGetComputeMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetComputeMode') + if __nvmlDeviceGetComputeMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetComputeMode = _cyb_dlsym(handle, 'nvmlDeviceGetComputeMode') + + global __nvmlDeviceGetCudaComputeCapability + __nvmlDeviceGetCudaComputeCapability = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCudaComputeCapability') + if __nvmlDeviceGetCudaComputeCapability == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCudaComputeCapability = _cyb_dlsym(handle, 'nvmlDeviceGetCudaComputeCapability') + + global __nvmlDeviceGetDramEncryptionMode + __nvmlDeviceGetDramEncryptionMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDramEncryptionMode') + if __nvmlDeviceGetDramEncryptionMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDramEncryptionMode = _cyb_dlsym(handle, 'nvmlDeviceGetDramEncryptionMode') + + global __nvmlDeviceSetDramEncryptionMode + __nvmlDeviceSetDramEncryptionMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetDramEncryptionMode') + if __nvmlDeviceSetDramEncryptionMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetDramEncryptionMode = _cyb_dlsym(handle, 'nvmlDeviceSetDramEncryptionMode') + + global __nvmlDeviceGetEccMode + __nvmlDeviceGetEccMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEccMode') + if __nvmlDeviceGetEccMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEccMode = _cyb_dlsym(handle, 'nvmlDeviceGetEccMode') + + global __nvmlDeviceGetDefaultEccMode + __nvmlDeviceGetDefaultEccMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDefaultEccMode') + if __nvmlDeviceGetDefaultEccMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDefaultEccMode = _cyb_dlsym(handle, 'nvmlDeviceGetDefaultEccMode') + + global __nvmlDeviceGetBoardId + __nvmlDeviceGetBoardId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBoardId') + if __nvmlDeviceGetBoardId == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBoardId = _cyb_dlsym(handle, 'nvmlDeviceGetBoardId') + + global __nvmlDeviceGetMultiGpuBoard + __nvmlDeviceGetMultiGpuBoard = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMultiGpuBoard') + if __nvmlDeviceGetMultiGpuBoard == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMultiGpuBoard = _cyb_dlsym(handle, 'nvmlDeviceGetMultiGpuBoard') + + global __nvmlDeviceGetTotalEccErrors + __nvmlDeviceGetTotalEccErrors = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetTotalEccErrors') + if __nvmlDeviceGetTotalEccErrors == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetTotalEccErrors = _cyb_dlsym(handle, 'nvmlDeviceGetTotalEccErrors') + + global __nvmlDeviceGetMemoryErrorCounter + __nvmlDeviceGetMemoryErrorCounter = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemoryErrorCounter') + if __nvmlDeviceGetMemoryErrorCounter == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemoryErrorCounter = _cyb_dlsym(handle, 'nvmlDeviceGetMemoryErrorCounter') + + global __nvmlDeviceGetUtilizationRates + __nvmlDeviceGetUtilizationRates = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetUtilizationRates') + if __nvmlDeviceGetUtilizationRates == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetUtilizationRates = _cyb_dlsym(handle, 'nvmlDeviceGetUtilizationRates') + + global __nvmlDeviceGetEncoderUtilization + __nvmlDeviceGetEncoderUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEncoderUtilization') + if __nvmlDeviceGetEncoderUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEncoderUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetEncoderUtilization') + + global __nvmlDeviceGetEncoderCapacity + __nvmlDeviceGetEncoderCapacity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEncoderCapacity') + if __nvmlDeviceGetEncoderCapacity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEncoderCapacity = _cyb_dlsym(handle, 'nvmlDeviceGetEncoderCapacity') + + global __nvmlDeviceGetEncoderStats + __nvmlDeviceGetEncoderStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEncoderStats') + if __nvmlDeviceGetEncoderStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEncoderStats = _cyb_dlsym(handle, 'nvmlDeviceGetEncoderStats') + + global __nvmlDeviceGetEncoderSessions + __nvmlDeviceGetEncoderSessions = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetEncoderSessions') + if __nvmlDeviceGetEncoderSessions == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetEncoderSessions = _cyb_dlsym(handle, 'nvmlDeviceGetEncoderSessions') + + global __nvmlDeviceGetDecoderUtilization + __nvmlDeviceGetDecoderUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDecoderUtilization') + if __nvmlDeviceGetDecoderUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDecoderUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetDecoderUtilization') + + global __nvmlDeviceGetJpgUtilization + __nvmlDeviceGetJpgUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetJpgUtilization') + if __nvmlDeviceGetJpgUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetJpgUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetJpgUtilization') + + global __nvmlDeviceGetOfaUtilization + __nvmlDeviceGetOfaUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetOfaUtilization') + if __nvmlDeviceGetOfaUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetOfaUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetOfaUtilization') + + global __nvmlDeviceGetFBCStats + __nvmlDeviceGetFBCStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFBCStats') + if __nvmlDeviceGetFBCStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFBCStats = _cyb_dlsym(handle, 'nvmlDeviceGetFBCStats') + + global __nvmlDeviceGetFBCSessions + __nvmlDeviceGetFBCSessions = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFBCSessions') + if __nvmlDeviceGetFBCSessions == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFBCSessions = _cyb_dlsym(handle, 'nvmlDeviceGetFBCSessions') + + global __nvmlDeviceGetDriverModel_v2 + __nvmlDeviceGetDriverModel_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDriverModel_v2') + if __nvmlDeviceGetDriverModel_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDriverModel_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetDriverModel_v2') + + global __nvmlDeviceGetVbiosVersion + __nvmlDeviceGetVbiosVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVbiosVersion') + if __nvmlDeviceGetVbiosVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVbiosVersion = _cyb_dlsym(handle, 'nvmlDeviceGetVbiosVersion') + + global __nvmlDeviceGetBridgeChipInfo + __nvmlDeviceGetBridgeChipInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBridgeChipInfo') + if __nvmlDeviceGetBridgeChipInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBridgeChipInfo = _cyb_dlsym(handle, 'nvmlDeviceGetBridgeChipInfo') + + global __nvmlDeviceGetComputeRunningProcesses_v3 + __nvmlDeviceGetComputeRunningProcesses_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetComputeRunningProcesses_v3') + if __nvmlDeviceGetComputeRunningProcesses_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetComputeRunningProcesses_v3 = _cyb_dlsym(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGraphicsRunningProcesses_v3 = _cyb_dlsym(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 + __nvmlDeviceGetMPSComputeRunningProcesses_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') + if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMPSComputeRunningProcesses_v3 = _cyb_dlsym(handle, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') + + global __nvmlDeviceGetRunningProcessDetailList + __nvmlDeviceGetRunningProcessDetailList = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRunningProcessDetailList') + if __nvmlDeviceGetRunningProcessDetailList == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRunningProcessDetailList = _cyb_dlsym(handle, 'nvmlDeviceGetRunningProcessDetailList') + + global __nvmlDeviceOnSameBoard + __nvmlDeviceOnSameBoard = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceOnSameBoard') + if __nvmlDeviceOnSameBoard == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceOnSameBoard = _cyb_dlsym(handle, 'nvmlDeviceOnSameBoard') + + global __nvmlDeviceGetAPIRestriction + __nvmlDeviceGetAPIRestriction = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAPIRestriction') + if __nvmlDeviceGetAPIRestriction == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAPIRestriction = _cyb_dlsym(handle, 'nvmlDeviceGetAPIRestriction') + + global __nvmlDeviceGetSamples + __nvmlDeviceGetSamples = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSamples') + if __nvmlDeviceGetSamples == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSamples = _cyb_dlsym(handle, 'nvmlDeviceGetSamples') + + global __nvmlDeviceGetBAR1MemoryInfo + __nvmlDeviceGetBAR1MemoryInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBAR1MemoryInfo') + if __nvmlDeviceGetBAR1MemoryInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBAR1MemoryInfo = _cyb_dlsym(handle, 'nvmlDeviceGetBAR1MemoryInfo') + + global __nvmlDeviceGetIrqNum + __nvmlDeviceGetIrqNum = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetIrqNum') + if __nvmlDeviceGetIrqNum == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetIrqNum = _cyb_dlsym(handle, 'nvmlDeviceGetIrqNum') + + global __nvmlDeviceGetNumGpuCores + __nvmlDeviceGetNumGpuCores = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNumGpuCores') + if __nvmlDeviceGetNumGpuCores == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNumGpuCores = _cyb_dlsym(handle, 'nvmlDeviceGetNumGpuCores') + + global __nvmlDeviceGetPowerSource + __nvmlDeviceGetPowerSource = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerSource') + if __nvmlDeviceGetPowerSource == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerSource = _cyb_dlsym(handle, 'nvmlDeviceGetPowerSource') + + global __nvmlDeviceGetMemoryBusWidth + __nvmlDeviceGetMemoryBusWidth = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemoryBusWidth') + if __nvmlDeviceGetMemoryBusWidth == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemoryBusWidth = _cyb_dlsym(handle, 'nvmlDeviceGetMemoryBusWidth') + + global __nvmlDeviceGetPcieLinkMaxSpeed + __nvmlDeviceGetPcieLinkMaxSpeed = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPcieLinkMaxSpeed') + if __nvmlDeviceGetPcieLinkMaxSpeed == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPcieLinkMaxSpeed = _cyb_dlsym(handle, 'nvmlDeviceGetPcieLinkMaxSpeed') + + global __nvmlDeviceGetPcieSpeed + __nvmlDeviceGetPcieSpeed = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPcieSpeed') + if __nvmlDeviceGetPcieSpeed == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPcieSpeed = _cyb_dlsym(handle, 'nvmlDeviceGetPcieSpeed') + + global __nvmlDeviceGetAdaptiveClockInfoStatus + __nvmlDeviceGetAdaptiveClockInfoStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAdaptiveClockInfoStatus') + if __nvmlDeviceGetAdaptiveClockInfoStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAdaptiveClockInfoStatus = _cyb_dlsym(handle, 'nvmlDeviceGetAdaptiveClockInfoStatus') + + global __nvmlDeviceGetBusType + __nvmlDeviceGetBusType = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBusType') + if __nvmlDeviceGetBusType == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBusType = _cyb_dlsym(handle, 'nvmlDeviceGetBusType') + + global __nvmlDeviceGetGpuFabricInfoV + __nvmlDeviceGetGpuFabricInfoV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuFabricInfoV') + if __nvmlDeviceGetGpuFabricInfoV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuFabricInfoV = _cyb_dlsym(handle, 'nvmlDeviceGetGpuFabricInfoV') + + global __nvmlSystemGetConfComputeCapabilities + __nvmlSystemGetConfComputeCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeCapabilities') + if __nvmlSystemGetConfComputeCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeCapabilities = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeCapabilities') + + global __nvmlSystemGetConfComputeState + __nvmlSystemGetConfComputeState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeState') + if __nvmlSystemGetConfComputeState == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeState = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeState') + + global __nvmlDeviceGetConfComputeMemSizeInfo + __nvmlDeviceGetConfComputeMemSizeInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetConfComputeMemSizeInfo') + if __nvmlDeviceGetConfComputeMemSizeInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetConfComputeMemSizeInfo = _cyb_dlsym(handle, 'nvmlDeviceGetConfComputeMemSizeInfo') + + global __nvmlSystemGetConfComputeGpusReadyState + __nvmlSystemGetConfComputeGpusReadyState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeGpusReadyState') + if __nvmlSystemGetConfComputeGpusReadyState == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeGpusReadyState = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeGpusReadyState') + + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + __nvmlDeviceGetConfComputeProtectedMemoryUsage = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetConfComputeProtectedMemoryUsage') + if __nvmlDeviceGetConfComputeProtectedMemoryUsage == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetConfComputeProtectedMemoryUsage = _cyb_dlsym(handle, 'nvmlDeviceGetConfComputeProtectedMemoryUsage') + + global __nvmlDeviceGetConfComputeGpuCertificate + __nvmlDeviceGetConfComputeGpuCertificate = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetConfComputeGpuCertificate') + if __nvmlDeviceGetConfComputeGpuCertificate == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetConfComputeGpuCertificate = _cyb_dlsym(handle, 'nvmlDeviceGetConfComputeGpuCertificate') + + global __nvmlDeviceGetConfComputeGpuAttestationReport + __nvmlDeviceGetConfComputeGpuAttestationReport = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetConfComputeGpuAttestationReport') + if __nvmlDeviceGetConfComputeGpuAttestationReport == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetConfComputeGpuAttestationReport = _cyb_dlsym(handle, 'nvmlDeviceGetConfComputeGpuAttestationReport') + + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + __nvmlSystemGetConfComputeKeyRotationThresholdInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeKeyRotationThresholdInfo') + if __nvmlSystemGetConfComputeKeyRotationThresholdInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeKeyRotationThresholdInfo = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeKeyRotationThresholdInfo') + + global __nvmlDeviceSetConfComputeUnprotectedMemSize + __nvmlDeviceSetConfComputeUnprotectedMemSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetConfComputeUnprotectedMemSize') + if __nvmlDeviceSetConfComputeUnprotectedMemSize == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetConfComputeUnprotectedMemSize = _cyb_dlsym(handle, 'nvmlDeviceSetConfComputeUnprotectedMemSize') + + global __nvmlSystemSetConfComputeGpusReadyState + __nvmlSystemSetConfComputeGpusReadyState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemSetConfComputeGpusReadyState') + if __nvmlSystemSetConfComputeGpusReadyState == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemSetConfComputeGpusReadyState = _cyb_dlsym(handle, 'nvmlSystemSetConfComputeGpusReadyState') + + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + __nvmlSystemSetConfComputeKeyRotationThresholdInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemSetConfComputeKeyRotationThresholdInfo') + if __nvmlSystemSetConfComputeKeyRotationThresholdInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemSetConfComputeKeyRotationThresholdInfo = _cyb_dlsym(handle, 'nvmlSystemSetConfComputeKeyRotationThresholdInfo') + + global __nvmlSystemGetConfComputeSettings + __nvmlSystemGetConfComputeSettings = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeSettings') + if __nvmlSystemGetConfComputeSettings == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeSettings = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeSettings') + + global __nvmlDeviceGetGspFirmwareVersion + __nvmlDeviceGetGspFirmwareVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGspFirmwareVersion') + if __nvmlDeviceGetGspFirmwareVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGspFirmwareVersion = _cyb_dlsym(handle, 'nvmlDeviceGetGspFirmwareVersion') + + global __nvmlDeviceGetGspFirmwareMode + __nvmlDeviceGetGspFirmwareMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGspFirmwareMode') + if __nvmlDeviceGetGspFirmwareMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGspFirmwareMode = _cyb_dlsym(handle, 'nvmlDeviceGetGspFirmwareMode') + + global __nvmlDeviceGetSramEccErrorStatus + __nvmlDeviceGetSramEccErrorStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSramEccErrorStatus') + if __nvmlDeviceGetSramEccErrorStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSramEccErrorStatus = _cyb_dlsym(handle, 'nvmlDeviceGetSramEccErrorStatus') + + global __nvmlDeviceGetAccountingMode + __nvmlDeviceGetAccountingMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingMode') + if __nvmlDeviceGetAccountingMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingMode = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingMode') + + global __nvmlDeviceGetAccountingStats + __nvmlDeviceGetAccountingStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingStats') + if __nvmlDeviceGetAccountingStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingStats = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingStats') + + global __nvmlDeviceGetAccountingPids + __nvmlDeviceGetAccountingPids = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingPids') + if __nvmlDeviceGetAccountingPids == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingPids = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingPids') + + global __nvmlDeviceGetAccountingBufferSize + __nvmlDeviceGetAccountingBufferSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingBufferSize') + if __nvmlDeviceGetAccountingBufferSize == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingBufferSize = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingBufferSize') + + global __nvmlDeviceGetRetiredPages + __nvmlDeviceGetRetiredPages = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRetiredPages') + if __nvmlDeviceGetRetiredPages == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRetiredPages = _cyb_dlsym(handle, 'nvmlDeviceGetRetiredPages') + + global __nvmlDeviceGetRetiredPages_v2 + __nvmlDeviceGetRetiredPages_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRetiredPages_v2') + if __nvmlDeviceGetRetiredPages_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRetiredPages_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetRetiredPages_v2') + + global __nvmlDeviceGetRetiredPagesPendingStatus + __nvmlDeviceGetRetiredPagesPendingStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRetiredPagesPendingStatus') + if __nvmlDeviceGetRetiredPagesPendingStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRetiredPagesPendingStatus = _cyb_dlsym(handle, 'nvmlDeviceGetRetiredPagesPendingStatus') + + global __nvmlDeviceGetRemappedRows + __nvmlDeviceGetRemappedRows = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRemappedRows') + if __nvmlDeviceGetRemappedRows == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRemappedRows = _cyb_dlsym(handle, 'nvmlDeviceGetRemappedRows') + + global __nvmlDeviceGetRowRemapperHistogram + __nvmlDeviceGetRowRemapperHistogram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRowRemapperHistogram') + if __nvmlDeviceGetRowRemapperHistogram == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRowRemapperHistogram = _cyb_dlsym(handle, 'nvmlDeviceGetRowRemapperHistogram') + + global __nvmlDeviceGetArchitecture + __nvmlDeviceGetArchitecture = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetArchitecture') + if __nvmlDeviceGetArchitecture == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetArchitecture = _cyb_dlsym(handle, 'nvmlDeviceGetArchitecture') + + global __nvmlDeviceGetClkMonStatus + __nvmlDeviceGetClkMonStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetClkMonStatus') + if __nvmlDeviceGetClkMonStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetClkMonStatus = _cyb_dlsym(handle, 'nvmlDeviceGetClkMonStatus') + + global __nvmlDeviceGetProcessUtilization + __nvmlDeviceGetProcessUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetProcessUtilization') + if __nvmlDeviceGetProcessUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetProcessUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetProcessUtilization') + + global __nvmlDeviceGetProcessesUtilizationInfo + __nvmlDeviceGetProcessesUtilizationInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetProcessesUtilizationInfo') + if __nvmlDeviceGetProcessesUtilizationInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetProcessesUtilizationInfo = _cyb_dlsym(handle, 'nvmlDeviceGetProcessesUtilizationInfo') + + global __nvmlDeviceGetPlatformInfo + __nvmlDeviceGetPlatformInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPlatformInfo') + if __nvmlDeviceGetPlatformInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPlatformInfo = _cyb_dlsym(handle, 'nvmlDeviceGetPlatformInfo') + + global __nvmlUnitSetLedState + __nvmlUnitSetLedState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlUnitSetLedState') + if __nvmlUnitSetLedState == NULL: + if handle == NULL: + handle = load_library() + __nvmlUnitSetLedState = _cyb_dlsym(handle, 'nvmlUnitSetLedState') + + global __nvmlDeviceSetPersistenceMode + __nvmlDeviceSetPersistenceMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetPersistenceMode') + if __nvmlDeviceSetPersistenceMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetPersistenceMode = _cyb_dlsym(handle, 'nvmlDeviceSetPersistenceMode') + + global __nvmlDeviceSetComputeMode + __nvmlDeviceSetComputeMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetComputeMode') + if __nvmlDeviceSetComputeMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetComputeMode = _cyb_dlsym(handle, 'nvmlDeviceSetComputeMode') + + global __nvmlDeviceSetEccMode + __nvmlDeviceSetEccMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetEccMode') + if __nvmlDeviceSetEccMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetEccMode = _cyb_dlsym(handle, 'nvmlDeviceSetEccMode') + + global __nvmlDeviceClearEccErrorCounts + __nvmlDeviceClearEccErrorCounts = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceClearEccErrorCounts') + if __nvmlDeviceClearEccErrorCounts == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceClearEccErrorCounts = _cyb_dlsym(handle, 'nvmlDeviceClearEccErrorCounts') + + global __nvmlDeviceSetDriverModel + __nvmlDeviceSetDriverModel = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetDriverModel') + if __nvmlDeviceSetDriverModel == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetDriverModel = _cyb_dlsym(handle, 'nvmlDeviceSetDriverModel') + + global __nvmlDeviceSetGpuLockedClocks + __nvmlDeviceSetGpuLockedClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetGpuLockedClocks') + if __nvmlDeviceSetGpuLockedClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetGpuLockedClocks = _cyb_dlsym(handle, 'nvmlDeviceSetGpuLockedClocks') + + global __nvmlDeviceResetGpuLockedClocks + __nvmlDeviceResetGpuLockedClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceResetGpuLockedClocks') + if __nvmlDeviceResetGpuLockedClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceResetGpuLockedClocks = _cyb_dlsym(handle, 'nvmlDeviceResetGpuLockedClocks') + + global __nvmlDeviceSetMemoryLockedClocks + __nvmlDeviceSetMemoryLockedClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetMemoryLockedClocks') + if __nvmlDeviceSetMemoryLockedClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetMemoryLockedClocks = _cyb_dlsym(handle, 'nvmlDeviceSetMemoryLockedClocks') + + global __nvmlDeviceResetMemoryLockedClocks + __nvmlDeviceResetMemoryLockedClocks = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceResetMemoryLockedClocks') + if __nvmlDeviceResetMemoryLockedClocks == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceResetMemoryLockedClocks = _cyb_dlsym(handle, 'nvmlDeviceResetMemoryLockedClocks') + + global __nvmlDeviceSetAutoBoostedClocksEnabled + __nvmlDeviceSetAutoBoostedClocksEnabled = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetAutoBoostedClocksEnabled') + if __nvmlDeviceSetAutoBoostedClocksEnabled == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetAutoBoostedClocksEnabled = _cyb_dlsym(handle, 'nvmlDeviceSetAutoBoostedClocksEnabled') + + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetDefaultAutoBoostedClocksEnabled') + if __nvmlDeviceSetDefaultAutoBoostedClocksEnabled == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = _cyb_dlsym(handle, 'nvmlDeviceSetDefaultAutoBoostedClocksEnabled') + + global __nvmlDeviceSetDefaultFanSpeed_v2 + __nvmlDeviceSetDefaultFanSpeed_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetDefaultFanSpeed_v2') + if __nvmlDeviceSetDefaultFanSpeed_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetDefaultFanSpeed_v2 = _cyb_dlsym(handle, 'nvmlDeviceSetDefaultFanSpeed_v2') + + global __nvmlDeviceSetFanControlPolicy + __nvmlDeviceSetFanControlPolicy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetFanControlPolicy') + if __nvmlDeviceSetFanControlPolicy == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetFanControlPolicy = _cyb_dlsym(handle, 'nvmlDeviceSetFanControlPolicy') + + global __nvmlDeviceSetTemperatureThreshold + __nvmlDeviceSetTemperatureThreshold = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetTemperatureThreshold') + if __nvmlDeviceSetTemperatureThreshold == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetTemperatureThreshold = _cyb_dlsym(handle, 'nvmlDeviceSetTemperatureThreshold') + + global __nvmlDeviceSetGpuOperationMode + __nvmlDeviceSetGpuOperationMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetGpuOperationMode') + if __nvmlDeviceSetGpuOperationMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetGpuOperationMode = _cyb_dlsym(handle, 'nvmlDeviceSetGpuOperationMode') + + global __nvmlDeviceSetAPIRestriction + __nvmlDeviceSetAPIRestriction = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetAPIRestriction') + if __nvmlDeviceSetAPIRestriction == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetAPIRestriction = _cyb_dlsym(handle, 'nvmlDeviceSetAPIRestriction') + + global __nvmlDeviceSetFanSpeed_v2 + __nvmlDeviceSetFanSpeed_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetFanSpeed_v2') + if __nvmlDeviceSetFanSpeed_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetFanSpeed_v2 = _cyb_dlsym(handle, 'nvmlDeviceSetFanSpeed_v2') + + global __nvmlDeviceSetAccountingMode + __nvmlDeviceSetAccountingMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetAccountingMode') + if __nvmlDeviceSetAccountingMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetAccountingMode = _cyb_dlsym(handle, 'nvmlDeviceSetAccountingMode') + + global __nvmlDeviceClearAccountingPids + __nvmlDeviceClearAccountingPids = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceClearAccountingPids') + if __nvmlDeviceClearAccountingPids == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceClearAccountingPids = _cyb_dlsym(handle, 'nvmlDeviceClearAccountingPids') + + global __nvmlDeviceSetPowerManagementLimit_v2 + __nvmlDeviceSetPowerManagementLimit_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetPowerManagementLimit_v2') + if __nvmlDeviceSetPowerManagementLimit_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetPowerManagementLimit_v2 = _cyb_dlsym(handle, 'nvmlDeviceSetPowerManagementLimit_v2') + + global __nvmlDeviceGetNvLinkState + __nvmlDeviceGetNvLinkState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkState') + if __nvmlDeviceGetNvLinkState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkState = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkState') + + global __nvmlDeviceGetNvLinkVersion + __nvmlDeviceGetNvLinkVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkVersion') + if __nvmlDeviceGetNvLinkVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkVersion = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkVersion') + + global __nvmlDeviceGetNvLinkCapability + __nvmlDeviceGetNvLinkCapability = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkCapability') + if __nvmlDeviceGetNvLinkCapability == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkCapability = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkCapability') + + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + __nvmlDeviceGetNvLinkRemotePciInfo_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkRemotePciInfo_v2') + if __nvmlDeviceGetNvLinkRemotePciInfo_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkRemotePciInfo_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkRemotePciInfo_v2') + + global __nvmlDeviceGetNvLinkErrorCounter + __nvmlDeviceGetNvLinkErrorCounter = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkErrorCounter') + if __nvmlDeviceGetNvLinkErrorCounter == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkErrorCounter = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkErrorCounter') + + global __nvmlDeviceResetNvLinkErrorCounters + __nvmlDeviceResetNvLinkErrorCounters = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceResetNvLinkErrorCounters') + if __nvmlDeviceResetNvLinkErrorCounters == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceResetNvLinkErrorCounters = _cyb_dlsym(handle, 'nvmlDeviceResetNvLinkErrorCounters') + + global __nvmlDeviceGetNvLinkRemoteDeviceType + __nvmlDeviceGetNvLinkRemoteDeviceType = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkRemoteDeviceType') + if __nvmlDeviceGetNvLinkRemoteDeviceType == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkRemoteDeviceType = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkRemoteDeviceType') + + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetNvLinkDeviceLowPowerThreshold') + if __nvmlDeviceSetNvLinkDeviceLowPowerThreshold == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = _cyb_dlsym(handle, 'nvmlDeviceSetNvLinkDeviceLowPowerThreshold') + + global __nvmlSystemSetNvlinkBwMode + __nvmlSystemSetNvlinkBwMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemSetNvlinkBwMode') + if __nvmlSystemSetNvlinkBwMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemSetNvlinkBwMode = _cyb_dlsym(handle, 'nvmlSystemSetNvlinkBwMode') + + global __nvmlSystemGetNvlinkBwMode + __nvmlSystemGetNvlinkBwMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetNvlinkBwMode') + if __nvmlSystemGetNvlinkBwMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetNvlinkBwMode = _cyb_dlsym(handle, 'nvmlSystemGetNvlinkBwMode') + + global __nvmlDeviceGetNvlinkSupportedBwModes + __nvmlDeviceGetNvlinkSupportedBwModes = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvlinkSupportedBwModes') + if __nvmlDeviceGetNvlinkSupportedBwModes == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvlinkSupportedBwModes = _cyb_dlsym(handle, 'nvmlDeviceGetNvlinkSupportedBwModes') + + global __nvmlDeviceGetNvlinkBwMode + __nvmlDeviceGetNvlinkBwMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvlinkBwMode') + if __nvmlDeviceGetNvlinkBwMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvlinkBwMode = _cyb_dlsym(handle, 'nvmlDeviceGetNvlinkBwMode') + + global __nvmlDeviceSetNvlinkBwMode + __nvmlDeviceSetNvlinkBwMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetNvlinkBwMode') + if __nvmlDeviceSetNvlinkBwMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetNvlinkBwMode = _cyb_dlsym(handle, 'nvmlDeviceSetNvlinkBwMode') + + global __nvmlEventSetCreate + __nvmlEventSetCreate = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetCreate') + if __nvmlEventSetCreate == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetCreate = _cyb_dlsym(handle, 'nvmlEventSetCreate') + + global __nvmlDeviceRegisterEvents + __nvmlDeviceRegisterEvents = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceRegisterEvents') + if __nvmlDeviceRegisterEvents == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceRegisterEvents = _cyb_dlsym(handle, 'nvmlDeviceRegisterEvents') + + global __nvmlDeviceGetSupportedEventTypes + __nvmlDeviceGetSupportedEventTypes = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedEventTypes') + if __nvmlDeviceGetSupportedEventTypes == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedEventTypes = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedEventTypes') + + global __nvmlEventSetWait_v2 + __nvmlEventSetWait_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetWait_v2') + if __nvmlEventSetWait_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetWait_v2 = _cyb_dlsym(handle, 'nvmlEventSetWait_v2') + + global __nvmlEventSetFree + __nvmlEventSetFree = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetFree') + if __nvmlEventSetFree == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetFree = _cyb_dlsym(handle, 'nvmlEventSetFree') + + global __nvmlSystemEventSetCreate + __nvmlSystemEventSetCreate = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemEventSetCreate') + if __nvmlSystemEventSetCreate == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemEventSetCreate = _cyb_dlsym(handle, 'nvmlSystemEventSetCreate') + + global __nvmlSystemEventSetFree + __nvmlSystemEventSetFree = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemEventSetFree') + if __nvmlSystemEventSetFree == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemEventSetFree = _cyb_dlsym(handle, 'nvmlSystemEventSetFree') + + global __nvmlSystemRegisterEvents + __nvmlSystemRegisterEvents = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemRegisterEvents') + if __nvmlSystemRegisterEvents == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemRegisterEvents = _cyb_dlsym(handle, 'nvmlSystemRegisterEvents') + + global __nvmlSystemEventSetWait + __nvmlSystemEventSetWait = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemEventSetWait') + if __nvmlSystemEventSetWait == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemEventSetWait = _cyb_dlsym(handle, 'nvmlSystemEventSetWait') + + global __nvmlDeviceModifyDrainState + __nvmlDeviceModifyDrainState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceModifyDrainState') + if __nvmlDeviceModifyDrainState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceModifyDrainState = _cyb_dlsym(handle, 'nvmlDeviceModifyDrainState') + + global __nvmlDeviceQueryDrainState + __nvmlDeviceQueryDrainState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceQueryDrainState') + if __nvmlDeviceQueryDrainState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceQueryDrainState = _cyb_dlsym(handle, 'nvmlDeviceQueryDrainState') + + global __nvmlDeviceRemoveGpu_v2 + __nvmlDeviceRemoveGpu_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceRemoveGpu_v2') + if __nvmlDeviceRemoveGpu_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceRemoveGpu_v2 = _cyb_dlsym(handle, 'nvmlDeviceRemoveGpu_v2') + + global __nvmlDeviceDiscoverGpus + __nvmlDeviceDiscoverGpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceDiscoverGpus') + if __nvmlDeviceDiscoverGpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceDiscoverGpus = _cyb_dlsym(handle, 'nvmlDeviceDiscoverGpus') + + global __nvmlDeviceGetFieldValues + __nvmlDeviceGetFieldValues = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetFieldValues') + if __nvmlDeviceGetFieldValues == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetFieldValues = _cyb_dlsym(handle, 'nvmlDeviceGetFieldValues') + + global __nvmlDeviceClearFieldValues + __nvmlDeviceClearFieldValues = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceClearFieldValues') + if __nvmlDeviceClearFieldValues == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceClearFieldValues = _cyb_dlsym(handle, 'nvmlDeviceClearFieldValues') + + global __nvmlDeviceGetVirtualizationMode + __nvmlDeviceGetVirtualizationMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVirtualizationMode') + if __nvmlDeviceGetVirtualizationMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVirtualizationMode = _cyb_dlsym(handle, 'nvmlDeviceGetVirtualizationMode') + + global __nvmlDeviceGetHostVgpuMode + __nvmlDeviceGetHostVgpuMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHostVgpuMode') + if __nvmlDeviceGetHostVgpuMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHostVgpuMode = _cyb_dlsym(handle, 'nvmlDeviceGetHostVgpuMode') + + global __nvmlDeviceSetVirtualizationMode + __nvmlDeviceSetVirtualizationMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetVirtualizationMode') + if __nvmlDeviceSetVirtualizationMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVirtualizationMode = _cyb_dlsym(handle, 'nvmlDeviceSetVirtualizationMode') + + global __nvmlDeviceGetVgpuHeterogeneousMode + __nvmlDeviceGetVgpuHeterogeneousMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuHeterogeneousMode') + if __nvmlDeviceGetVgpuHeterogeneousMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuHeterogeneousMode = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuHeterogeneousMode') + + global __nvmlDeviceSetVgpuHeterogeneousMode + __nvmlDeviceSetVgpuHeterogeneousMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetVgpuHeterogeneousMode') + if __nvmlDeviceSetVgpuHeterogeneousMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuHeterogeneousMode = _cyb_dlsym(handle, 'nvmlDeviceSetVgpuHeterogeneousMode') + + global __nvmlVgpuInstanceGetPlacementId + __nvmlVgpuInstanceGetPlacementId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetPlacementId') + if __nvmlVgpuInstanceGetPlacementId == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetPlacementId = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetPlacementId') + + global __nvmlDeviceGetVgpuTypeSupportedPlacements + __nvmlDeviceGetVgpuTypeSupportedPlacements = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuTypeSupportedPlacements') + if __nvmlDeviceGetVgpuTypeSupportedPlacements == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuTypeSupportedPlacements = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuTypeSupportedPlacements') + + global __nvmlDeviceGetVgpuTypeCreatablePlacements + __nvmlDeviceGetVgpuTypeCreatablePlacements = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuTypeCreatablePlacements') + if __nvmlDeviceGetVgpuTypeCreatablePlacements == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuTypeCreatablePlacements = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuTypeCreatablePlacements') + + global __nvmlVgpuTypeGetGspHeapSize + __nvmlVgpuTypeGetGspHeapSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetGspHeapSize') + if __nvmlVgpuTypeGetGspHeapSize == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetGspHeapSize = _cyb_dlsym(handle, 'nvmlVgpuTypeGetGspHeapSize') + + global __nvmlVgpuTypeGetFbReservation + __nvmlVgpuTypeGetFbReservation = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetFbReservation') + if __nvmlVgpuTypeGetFbReservation == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetFbReservation = _cyb_dlsym(handle, 'nvmlVgpuTypeGetFbReservation') + + global __nvmlVgpuInstanceGetRuntimeStateSize + __nvmlVgpuInstanceGetRuntimeStateSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetRuntimeStateSize') + if __nvmlVgpuInstanceGetRuntimeStateSize == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetRuntimeStateSize = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetRuntimeStateSize') + + global __nvmlDeviceSetVgpuCapabilities + __nvmlDeviceSetVgpuCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetVgpuCapabilities') + if __nvmlDeviceSetVgpuCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuCapabilities = _cyb_dlsym(handle, 'nvmlDeviceSetVgpuCapabilities') + + global __nvmlDeviceGetGridLicensableFeatures_v4 + __nvmlDeviceGetGridLicensableFeatures_v4 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGridLicensableFeatures_v4') + if __nvmlDeviceGetGridLicensableFeatures_v4 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGridLicensableFeatures_v4 = _cyb_dlsym(handle, 'nvmlDeviceGetGridLicensableFeatures_v4') + + global __nvmlGetVgpuDriverCapabilities + __nvmlGetVgpuDriverCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGetVgpuDriverCapabilities') + if __nvmlGetVgpuDriverCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlGetVgpuDriverCapabilities = _cyb_dlsym(handle, 'nvmlGetVgpuDriverCapabilities') + + global __nvmlDeviceGetVgpuCapabilities + __nvmlDeviceGetVgpuCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuCapabilities') + if __nvmlDeviceGetVgpuCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuCapabilities = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuCapabilities') + + global __nvmlDeviceGetSupportedVgpus + __nvmlDeviceGetSupportedVgpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSupportedVgpus') + if __nvmlDeviceGetSupportedVgpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSupportedVgpus = _cyb_dlsym(handle, 'nvmlDeviceGetSupportedVgpus') + + global __nvmlDeviceGetCreatableVgpus + __nvmlDeviceGetCreatableVgpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCreatableVgpus') + if __nvmlDeviceGetCreatableVgpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCreatableVgpus = _cyb_dlsym(handle, 'nvmlDeviceGetCreatableVgpus') + + global __nvmlVgpuTypeGetClass + __nvmlVgpuTypeGetClass = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetClass') + if __nvmlVgpuTypeGetClass == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetClass = _cyb_dlsym(handle, 'nvmlVgpuTypeGetClass') + + global __nvmlVgpuTypeGetName + __nvmlVgpuTypeGetName = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetName') + if __nvmlVgpuTypeGetName == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetName = _cyb_dlsym(handle, 'nvmlVgpuTypeGetName') + + global __nvmlVgpuTypeGetGpuInstanceProfileId + __nvmlVgpuTypeGetGpuInstanceProfileId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetGpuInstanceProfileId') + if __nvmlVgpuTypeGetGpuInstanceProfileId == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetGpuInstanceProfileId = _cyb_dlsym(handle, 'nvmlVgpuTypeGetGpuInstanceProfileId') + + global __nvmlVgpuTypeGetDeviceID + __nvmlVgpuTypeGetDeviceID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetDeviceID') + if __nvmlVgpuTypeGetDeviceID == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetDeviceID = _cyb_dlsym(handle, 'nvmlVgpuTypeGetDeviceID') + + global __nvmlVgpuTypeGetFramebufferSize + __nvmlVgpuTypeGetFramebufferSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetFramebufferSize') + if __nvmlVgpuTypeGetFramebufferSize == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetFramebufferSize = _cyb_dlsym(handle, 'nvmlVgpuTypeGetFramebufferSize') + + global __nvmlVgpuTypeGetNumDisplayHeads + __nvmlVgpuTypeGetNumDisplayHeads = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetNumDisplayHeads') + if __nvmlVgpuTypeGetNumDisplayHeads == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetNumDisplayHeads = _cyb_dlsym(handle, 'nvmlVgpuTypeGetNumDisplayHeads') + + global __nvmlVgpuTypeGetResolution + __nvmlVgpuTypeGetResolution = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetResolution') + if __nvmlVgpuTypeGetResolution == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetResolution = _cyb_dlsym(handle, 'nvmlVgpuTypeGetResolution') + + global __nvmlVgpuTypeGetLicense + __nvmlVgpuTypeGetLicense = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetLicense') + if __nvmlVgpuTypeGetLicense == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetLicense = _cyb_dlsym(handle, 'nvmlVgpuTypeGetLicense') + + global __nvmlVgpuTypeGetFrameRateLimit + __nvmlVgpuTypeGetFrameRateLimit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetFrameRateLimit') + if __nvmlVgpuTypeGetFrameRateLimit == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetFrameRateLimit = _cyb_dlsym(handle, 'nvmlVgpuTypeGetFrameRateLimit') + + global __nvmlVgpuTypeGetMaxInstances + __nvmlVgpuTypeGetMaxInstances = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstances') + if __nvmlVgpuTypeGetMaxInstances == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetMaxInstances = _cyb_dlsym(handle, 'nvmlVgpuTypeGetMaxInstances') + + global __nvmlVgpuTypeGetMaxInstancesPerVm + __nvmlVgpuTypeGetMaxInstancesPerVm = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstancesPerVm') + if __nvmlVgpuTypeGetMaxInstancesPerVm == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetMaxInstancesPerVm = _cyb_dlsym(handle, 'nvmlVgpuTypeGetMaxInstancesPerVm') + + global __nvmlVgpuTypeGetBAR1Info + __nvmlVgpuTypeGetBAR1Info = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetBAR1Info') + if __nvmlVgpuTypeGetBAR1Info == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetBAR1Info = _cyb_dlsym(handle, 'nvmlVgpuTypeGetBAR1Info') + + global __nvmlDeviceGetActiveVgpus + __nvmlDeviceGetActiveVgpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetActiveVgpus') + if __nvmlDeviceGetActiveVgpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetActiveVgpus = _cyb_dlsym(handle, 'nvmlDeviceGetActiveVgpus') + + global __nvmlVgpuInstanceGetVmID + __nvmlVgpuInstanceGetVmID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetVmID') + if __nvmlVgpuInstanceGetVmID == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetVmID = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetVmID') + + global __nvmlVgpuInstanceGetUUID + __nvmlVgpuInstanceGetUUID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetUUID') + if __nvmlVgpuInstanceGetUUID == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetUUID = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetUUID') + + global __nvmlVgpuInstanceGetVmDriverVersion + __nvmlVgpuInstanceGetVmDriverVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetVmDriverVersion') + if __nvmlVgpuInstanceGetVmDriverVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetVmDriverVersion = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetVmDriverVersion') + + global __nvmlVgpuInstanceGetFbUsage + __nvmlVgpuInstanceGetFbUsage = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetFbUsage') + if __nvmlVgpuInstanceGetFbUsage == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetFbUsage = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetFbUsage') + + global __nvmlVgpuInstanceGetLicenseStatus + __nvmlVgpuInstanceGetLicenseStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetLicenseStatus') + if __nvmlVgpuInstanceGetLicenseStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetLicenseStatus = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetLicenseStatus') + + global __nvmlVgpuInstanceGetType + __nvmlVgpuInstanceGetType = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetType') + if __nvmlVgpuInstanceGetType == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetType = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetType') + + global __nvmlVgpuInstanceGetFrameRateLimit + __nvmlVgpuInstanceGetFrameRateLimit = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetFrameRateLimit') + if __nvmlVgpuInstanceGetFrameRateLimit == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetFrameRateLimit = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetFrameRateLimit') + + global __nvmlVgpuInstanceGetEccMode + __nvmlVgpuInstanceGetEccMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetEccMode') + if __nvmlVgpuInstanceGetEccMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetEccMode = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetEccMode') + + global __nvmlVgpuInstanceGetEncoderCapacity + __nvmlVgpuInstanceGetEncoderCapacity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderCapacity') + if __nvmlVgpuInstanceGetEncoderCapacity == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetEncoderCapacity = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetEncoderCapacity') + + global __nvmlVgpuInstanceSetEncoderCapacity + __nvmlVgpuInstanceSetEncoderCapacity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceSetEncoderCapacity') + if __nvmlVgpuInstanceSetEncoderCapacity == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceSetEncoderCapacity = _cyb_dlsym(handle, 'nvmlVgpuInstanceSetEncoderCapacity') + + global __nvmlVgpuInstanceGetEncoderStats + __nvmlVgpuInstanceGetEncoderStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderStats') + if __nvmlVgpuInstanceGetEncoderStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetEncoderStats = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetEncoderStats') + + global __nvmlVgpuInstanceGetEncoderSessions + __nvmlVgpuInstanceGetEncoderSessions = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderSessions') + if __nvmlVgpuInstanceGetEncoderSessions == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetEncoderSessions = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetEncoderSessions') + + global __nvmlVgpuInstanceGetFBCStats + __nvmlVgpuInstanceGetFBCStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetFBCStats') + if __nvmlVgpuInstanceGetFBCStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetFBCStats = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetFBCStats') + + global __nvmlVgpuInstanceGetFBCSessions + __nvmlVgpuInstanceGetFBCSessions = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetFBCSessions') + if __nvmlVgpuInstanceGetFBCSessions == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetFBCSessions = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetFBCSessions') + + global __nvmlVgpuInstanceGetGpuInstanceId + __nvmlVgpuInstanceGetGpuInstanceId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetGpuInstanceId') + if __nvmlVgpuInstanceGetGpuInstanceId == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetGpuInstanceId = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetGpuInstanceId') + + global __nvmlVgpuInstanceGetGpuPciId + __nvmlVgpuInstanceGetGpuPciId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetGpuPciId') + if __nvmlVgpuInstanceGetGpuPciId == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetGpuPciId = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetGpuPciId') + + global __nvmlVgpuTypeGetCapabilities + __nvmlVgpuTypeGetCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetCapabilities') + if __nvmlVgpuTypeGetCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetCapabilities = _cyb_dlsym(handle, 'nvmlVgpuTypeGetCapabilities') + + global __nvmlVgpuInstanceGetMdevUUID + __nvmlVgpuInstanceGetMdevUUID = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetMdevUUID') + if __nvmlVgpuInstanceGetMdevUUID == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetMdevUUID = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetMdevUUID') + + global __nvmlGpuInstanceGetCreatableVgpus + __nvmlGpuInstanceGetCreatableVgpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetCreatableVgpus') + if __nvmlGpuInstanceGetCreatableVgpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetCreatableVgpus = _cyb_dlsym(handle, 'nvmlGpuInstanceGetCreatableVgpus') + + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstancesPerGpuInstance') + if __nvmlVgpuTypeGetMaxInstancesPerGpuInstance == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = _cyb_dlsym(handle, 'nvmlVgpuTypeGetMaxInstancesPerGpuInstance') + + global __nvmlGpuInstanceGetActiveVgpus + __nvmlGpuInstanceGetActiveVgpus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetActiveVgpus') + if __nvmlGpuInstanceGetActiveVgpus == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetActiveVgpus = _cyb_dlsym(handle, 'nvmlGpuInstanceGetActiveVgpus') + + global __nvmlGpuInstanceSetVgpuSchedulerState + __nvmlGpuInstanceSetVgpuSchedulerState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuSchedulerState') + if __nvmlGpuInstanceSetVgpuSchedulerState == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceSetVgpuSchedulerState = _cyb_dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState') + + global __nvmlGpuInstanceGetVgpuSchedulerState + __nvmlGpuInstanceGetVgpuSchedulerState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerState') + if __nvmlGpuInstanceGetVgpuSchedulerState == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerState = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerState') + + global __nvmlGpuInstanceGetVgpuSchedulerLog + __nvmlGpuInstanceGetVgpuSchedulerLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerLog') + if __nvmlGpuInstanceGetVgpuSchedulerLog == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerLog = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog') + + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuTypeCreatablePlacements') + if __nvmlGpuInstanceGetVgpuTypeCreatablePlacements == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuTypeCreatablePlacements') + + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + __nvmlGpuInstanceGetVgpuHeterogeneousMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuHeterogeneousMode') + if __nvmlGpuInstanceGetVgpuHeterogeneousMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuHeterogeneousMode = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuHeterogeneousMode') + + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + __nvmlGpuInstanceSetVgpuHeterogeneousMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuHeterogeneousMode') + if __nvmlGpuInstanceSetVgpuHeterogeneousMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceSetVgpuHeterogeneousMode = _cyb_dlsym(handle, 'nvmlGpuInstanceSetVgpuHeterogeneousMode') + + global __nvmlVgpuInstanceGetMetadata + __nvmlVgpuInstanceGetMetadata = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetMetadata') + if __nvmlVgpuInstanceGetMetadata == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetMetadata = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetMetadata') + + global __nvmlDeviceGetVgpuMetadata + __nvmlDeviceGetVgpuMetadata = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuMetadata') + if __nvmlDeviceGetVgpuMetadata == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuMetadata = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuMetadata') + + global __nvmlGetVgpuCompatibility + __nvmlGetVgpuCompatibility = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGetVgpuCompatibility') + if __nvmlGetVgpuCompatibility == NULL: + if handle == NULL: + handle = load_library() + __nvmlGetVgpuCompatibility = _cyb_dlsym(handle, 'nvmlGetVgpuCompatibility') + + global __nvmlDeviceGetPgpuMetadataString + __nvmlDeviceGetPgpuMetadataString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPgpuMetadataString') + if __nvmlDeviceGetPgpuMetadataString == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPgpuMetadataString = _cyb_dlsym(handle, 'nvmlDeviceGetPgpuMetadataString') + + global __nvmlDeviceGetVgpuSchedulerLog + __nvmlDeviceGetVgpuSchedulerLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerLog') + if __nvmlDeviceGetVgpuSchedulerLog == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerLog = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuSchedulerLog') + + global __nvmlDeviceGetVgpuSchedulerState + __nvmlDeviceGetVgpuSchedulerState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerState') + if __nvmlDeviceGetVgpuSchedulerState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerState = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuSchedulerState') + + global __nvmlDeviceGetVgpuSchedulerCapabilities + __nvmlDeviceGetVgpuSchedulerCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerCapabilities') + if __nvmlDeviceGetVgpuSchedulerCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerCapabilities = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuSchedulerCapabilities') + + global __nvmlDeviceSetVgpuSchedulerState + __nvmlDeviceSetVgpuSchedulerState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetVgpuSchedulerState') + if __nvmlDeviceSetVgpuSchedulerState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuSchedulerState = _cyb_dlsym(handle, 'nvmlDeviceSetVgpuSchedulerState') + + global __nvmlGetVgpuVersion + __nvmlGetVgpuVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGetVgpuVersion') + if __nvmlGetVgpuVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlGetVgpuVersion = _cyb_dlsym(handle, 'nvmlGetVgpuVersion') + + global __nvmlSetVgpuVersion + __nvmlSetVgpuVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSetVgpuVersion') + if __nvmlSetVgpuVersion == NULL: + if handle == NULL: + handle = load_library() + __nvmlSetVgpuVersion = _cyb_dlsym(handle, 'nvmlSetVgpuVersion') + + global __nvmlDeviceGetVgpuUtilization + __nvmlDeviceGetVgpuUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuUtilization') + if __nvmlDeviceGetVgpuUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuUtilization') + + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + __nvmlDeviceGetVgpuInstancesUtilizationInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuInstancesUtilizationInfo') + if __nvmlDeviceGetVgpuInstancesUtilizationInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuInstancesUtilizationInfo = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuInstancesUtilizationInfo') + + global __nvmlDeviceGetVgpuProcessUtilization + __nvmlDeviceGetVgpuProcessUtilization = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuProcessUtilization') + if __nvmlDeviceGetVgpuProcessUtilization == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuProcessUtilization = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuProcessUtilization') + + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + __nvmlDeviceGetVgpuProcessesUtilizationInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuProcessesUtilizationInfo') + if __nvmlDeviceGetVgpuProcessesUtilizationInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuProcessesUtilizationInfo = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuProcessesUtilizationInfo') + + global __nvmlVgpuInstanceGetAccountingMode + __nvmlVgpuInstanceGetAccountingMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingMode') + if __nvmlVgpuInstanceGetAccountingMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetAccountingMode = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetAccountingMode') + + global __nvmlVgpuInstanceGetAccountingPids + __nvmlVgpuInstanceGetAccountingPids = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingPids') + if __nvmlVgpuInstanceGetAccountingPids == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetAccountingPids = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetAccountingPids') + + global __nvmlVgpuInstanceGetAccountingStats + __nvmlVgpuInstanceGetAccountingStats = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingStats') + if __nvmlVgpuInstanceGetAccountingStats == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetAccountingStats = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetAccountingStats') + + global __nvmlVgpuInstanceClearAccountingPids + __nvmlVgpuInstanceClearAccountingPids = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceClearAccountingPids') + if __nvmlVgpuInstanceClearAccountingPids == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceClearAccountingPids = _cyb_dlsym(handle, 'nvmlVgpuInstanceClearAccountingPids') + + global __nvmlVgpuInstanceGetLicenseInfo_v2 + __nvmlVgpuInstanceGetLicenseInfo_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlVgpuInstanceGetLicenseInfo_v2') + if __nvmlVgpuInstanceGetLicenseInfo_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlVgpuInstanceGetLicenseInfo_v2 = _cyb_dlsym(handle, 'nvmlVgpuInstanceGetLicenseInfo_v2') + + global __nvmlGetExcludedDeviceCount + __nvmlGetExcludedDeviceCount = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGetExcludedDeviceCount') + if __nvmlGetExcludedDeviceCount == NULL: + if handle == NULL: + handle = load_library() + __nvmlGetExcludedDeviceCount = _cyb_dlsym(handle, 'nvmlGetExcludedDeviceCount') + + global __nvmlGetExcludedDeviceInfoByIndex + __nvmlGetExcludedDeviceInfoByIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGetExcludedDeviceInfoByIndex') + if __nvmlGetExcludedDeviceInfoByIndex == NULL: + if handle == NULL: + handle = load_library() + __nvmlGetExcludedDeviceInfoByIndex = _cyb_dlsym(handle, 'nvmlGetExcludedDeviceInfoByIndex') + + global __nvmlDeviceSetMigMode + __nvmlDeviceSetMigMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetMigMode') + if __nvmlDeviceSetMigMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetMigMode = _cyb_dlsym(handle, 'nvmlDeviceSetMigMode') + + global __nvmlDeviceGetMigMode + __nvmlDeviceGetMigMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMigMode') + if __nvmlDeviceGetMigMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMigMode = _cyb_dlsym(handle, 'nvmlDeviceGetMigMode') + + global __nvmlDeviceGetGpuInstanceProfileInfoV + __nvmlDeviceGetGpuInstanceProfileInfoV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceProfileInfoV') + if __nvmlDeviceGetGpuInstanceProfileInfoV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstanceProfileInfoV = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstanceProfileInfoV') + + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstancePossiblePlacements_v2') + if __nvmlDeviceGetGpuInstancePossiblePlacements_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstancePossiblePlacements_v2') + + global __nvmlDeviceGetGpuInstanceRemainingCapacity + __nvmlDeviceGetGpuInstanceRemainingCapacity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceRemainingCapacity') + if __nvmlDeviceGetGpuInstanceRemainingCapacity == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstanceRemainingCapacity = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstanceRemainingCapacity') + + global __nvmlDeviceCreateGpuInstance + __nvmlDeviceCreateGpuInstance = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceCreateGpuInstance') + if __nvmlDeviceCreateGpuInstance == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceCreateGpuInstance = _cyb_dlsym(handle, 'nvmlDeviceCreateGpuInstance') + + global __nvmlDeviceCreateGpuInstanceWithPlacement + __nvmlDeviceCreateGpuInstanceWithPlacement = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceCreateGpuInstanceWithPlacement') + if __nvmlDeviceCreateGpuInstanceWithPlacement == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceCreateGpuInstanceWithPlacement = _cyb_dlsym(handle, 'nvmlDeviceCreateGpuInstanceWithPlacement') + + global __nvmlGpuInstanceDestroy + __nvmlGpuInstanceDestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceDestroy') + if __nvmlGpuInstanceDestroy == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceDestroy = _cyb_dlsym(handle, 'nvmlGpuInstanceDestroy') + + global __nvmlDeviceGetGpuInstances + __nvmlDeviceGetGpuInstances = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstances') + if __nvmlDeviceGetGpuInstances == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstances = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstances') + + global __nvmlDeviceGetGpuInstanceById + __nvmlDeviceGetGpuInstanceById = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceById') + if __nvmlDeviceGetGpuInstanceById == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstanceById = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstanceById') + + global __nvmlGpuInstanceGetInfo + __nvmlGpuInstanceGetInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetInfo') + if __nvmlGpuInstanceGetInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetInfo = _cyb_dlsym(handle, 'nvmlGpuInstanceGetInfo') + + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + __nvmlGpuInstanceGetComputeInstanceProfileInfoV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceProfileInfoV') + if __nvmlGpuInstanceGetComputeInstanceProfileInfoV == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetComputeInstanceProfileInfoV = _cyb_dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceProfileInfoV') + + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceRemainingCapacity') + if __nvmlGpuInstanceGetComputeInstanceRemainingCapacity == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = _cyb_dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceRemainingCapacity') + + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + __nvmlGpuInstanceGetComputeInstancePossiblePlacements = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstancePossiblePlacements') + if __nvmlGpuInstanceGetComputeInstancePossiblePlacements == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetComputeInstancePossiblePlacements = _cyb_dlsym(handle, 'nvmlGpuInstanceGetComputeInstancePossiblePlacements') + + global __nvmlGpuInstanceCreateComputeInstance + __nvmlGpuInstanceCreateComputeInstance = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceCreateComputeInstance') + if __nvmlGpuInstanceCreateComputeInstance == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceCreateComputeInstance = _cyb_dlsym(handle, 'nvmlGpuInstanceCreateComputeInstance') + + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + __nvmlGpuInstanceCreateComputeInstanceWithPlacement = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceCreateComputeInstanceWithPlacement') + if __nvmlGpuInstanceCreateComputeInstanceWithPlacement == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceCreateComputeInstanceWithPlacement = _cyb_dlsym(handle, 'nvmlGpuInstanceCreateComputeInstanceWithPlacement') + + global __nvmlComputeInstanceDestroy + __nvmlComputeInstanceDestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlComputeInstanceDestroy') + if __nvmlComputeInstanceDestroy == NULL: + if handle == NULL: + handle = load_library() + __nvmlComputeInstanceDestroy = _cyb_dlsym(handle, 'nvmlComputeInstanceDestroy') + + global __nvmlGpuInstanceGetComputeInstances + __nvmlGpuInstanceGetComputeInstances = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstances') + if __nvmlGpuInstanceGetComputeInstances == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetComputeInstances = _cyb_dlsym(handle, 'nvmlGpuInstanceGetComputeInstances') + + global __nvmlGpuInstanceGetComputeInstanceById + __nvmlGpuInstanceGetComputeInstanceById = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceById') + if __nvmlGpuInstanceGetComputeInstanceById == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetComputeInstanceById = _cyb_dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceById') + + global __nvmlComputeInstanceGetInfo_v2 + __nvmlComputeInstanceGetInfo_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlComputeInstanceGetInfo_v2') + if __nvmlComputeInstanceGetInfo_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlComputeInstanceGetInfo_v2 = _cyb_dlsym(handle, 'nvmlComputeInstanceGetInfo_v2') + + global __nvmlDeviceIsMigDeviceHandle + __nvmlDeviceIsMigDeviceHandle = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceIsMigDeviceHandle') + if __nvmlDeviceIsMigDeviceHandle == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceIsMigDeviceHandle = _cyb_dlsym(handle, 'nvmlDeviceIsMigDeviceHandle') + + global __nvmlDeviceGetGpuInstanceId + __nvmlDeviceGetGpuInstanceId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceId') + if __nvmlDeviceGetGpuInstanceId == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstanceId = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstanceId') + + global __nvmlDeviceGetComputeInstanceId + __nvmlDeviceGetComputeInstanceId = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetComputeInstanceId') + if __nvmlDeviceGetComputeInstanceId == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetComputeInstanceId = _cyb_dlsym(handle, 'nvmlDeviceGetComputeInstanceId') + + global __nvmlDeviceGetMaxMigDeviceCount + __nvmlDeviceGetMaxMigDeviceCount = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMaxMigDeviceCount') + if __nvmlDeviceGetMaxMigDeviceCount == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMaxMigDeviceCount = _cyb_dlsym(handle, 'nvmlDeviceGetMaxMigDeviceCount') + + global __nvmlDeviceGetMigDeviceHandleByIndex + __nvmlDeviceGetMigDeviceHandleByIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMigDeviceHandleByIndex') + if __nvmlDeviceGetMigDeviceHandleByIndex == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMigDeviceHandleByIndex = _cyb_dlsym(handle, 'nvmlDeviceGetMigDeviceHandleByIndex') + + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetDeviceHandleFromMigDeviceHandle') + if __nvmlDeviceGetDeviceHandleFromMigDeviceHandle == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = _cyb_dlsym(handle, 'nvmlDeviceGetDeviceHandleFromMigDeviceHandle') + + global __nvmlDeviceGetCapabilities + __nvmlDeviceGetCapabilities = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetCapabilities') + if __nvmlDeviceGetCapabilities == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetCapabilities = _cyb_dlsym(handle, 'nvmlDeviceGetCapabilities') + + global __nvmlDevicePowerSmoothingActivatePresetProfile + __nvmlDevicePowerSmoothingActivatePresetProfile = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDevicePowerSmoothingActivatePresetProfile') + if __nvmlDevicePowerSmoothingActivatePresetProfile == NULL: + if handle == NULL: + handle = load_library() + __nvmlDevicePowerSmoothingActivatePresetProfile = _cyb_dlsym(handle, 'nvmlDevicePowerSmoothingActivatePresetProfile') + + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + __nvmlDevicePowerSmoothingUpdatePresetProfileParam = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDevicePowerSmoothingUpdatePresetProfileParam') + if __nvmlDevicePowerSmoothingUpdatePresetProfileParam == NULL: + if handle == NULL: + handle = load_library() + __nvmlDevicePowerSmoothingUpdatePresetProfileParam = _cyb_dlsym(handle, 'nvmlDevicePowerSmoothingUpdatePresetProfileParam') + + global __nvmlDevicePowerSmoothingSetState + __nvmlDevicePowerSmoothingSetState = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDevicePowerSmoothingSetState') + if __nvmlDevicePowerSmoothingSetState == NULL: + if handle == NULL: + handle = load_library() + __nvmlDevicePowerSmoothingSetState = _cyb_dlsym(handle, 'nvmlDevicePowerSmoothingSetState') + + global __nvmlDeviceGetAddressingMode + __nvmlDeviceGetAddressingMode = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAddressingMode') + if __nvmlDeviceGetAddressingMode == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAddressingMode = _cyb_dlsym(handle, 'nvmlDeviceGetAddressingMode') + + global __nvmlDeviceGetRepairStatus + __nvmlDeviceGetRepairStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRepairStatus') + if __nvmlDeviceGetRepairStatus == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRepairStatus = _cyb_dlsym(handle, 'nvmlDeviceGetRepairStatus') + + global __nvmlDeviceGetPowerMizerMode_v1 + __nvmlDeviceGetPowerMizerMode_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPowerMizerMode_v1') + if __nvmlDeviceGetPowerMizerMode_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPowerMizerMode_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetPowerMizerMode_v1') + + global __nvmlDeviceSetPowerMizerMode_v1 + __nvmlDeviceSetPowerMizerMode_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetPowerMizerMode_v1') + if __nvmlDeviceSetPowerMizerMode_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetPowerMizerMode_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetPowerMizerMode_v1') + + global __nvmlDeviceGetPdi + __nvmlDeviceGetPdi = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetPdi') + if __nvmlDeviceGetPdi == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetPdi = _cyb_dlsym(handle, 'nvmlDeviceGetPdi') + + global __nvmlDeviceSetHostname_v1 + __nvmlDeviceSetHostname_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetHostname_v1') + if __nvmlDeviceSetHostname_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetHostname_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetHostname_v1') + + global __nvmlDeviceGetHostname_v1 + __nvmlDeviceGetHostname_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetHostname_v1') + if __nvmlDeviceGetHostname_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetHostname_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetHostname_v1') + + global __nvmlDeviceGetNvLinkInfo + __nvmlDeviceGetNvLinkInfo = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkInfo') + if __nvmlDeviceGetNvLinkInfo == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkInfo = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkInfo') + + global __nvmlDeviceReadWritePRM_v1 + __nvmlDeviceReadWritePRM_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceReadWritePRM_v1') + if __nvmlDeviceReadWritePRM_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceReadWritePRM_v1 = _cyb_dlsym(handle, 'nvmlDeviceReadWritePRM_v1') + + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + __nvmlDeviceGetGpuInstanceProfileInfoByIdV = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceProfileInfoByIdV') + if __nvmlDeviceGetGpuInstanceProfileInfoByIdV == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuInstanceProfileInfoByIdV = _cyb_dlsym(handle, 'nvmlDeviceGetGpuInstanceProfileInfoByIdV') + + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts') + if __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = _cyb_dlsym(handle, 'nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts') + + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + __nvmlDeviceGetUnrepairableMemoryFlag_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetUnrepairableMemoryFlag_v1') + if __nvmlDeviceGetUnrepairableMemoryFlag_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetUnrepairableMemoryFlag_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetUnrepairableMemoryFlag_v1') + + global __nvmlDeviceReadPRMCounters_v1 + __nvmlDeviceReadPRMCounters_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceReadPRMCounters_v1') + if __nvmlDeviceReadPRMCounters_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceReadPRMCounters_v1 = _cyb_dlsym(handle, 'nvmlDeviceReadPRMCounters_v1') + + global __nvmlDeviceSetRusdSettings_v1 + __nvmlDeviceSetRusdSettings_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetRusdSettings_v1') + if __nvmlDeviceSetRusdSettings_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetRusdSettings_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetRusdSettings_v1') + + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceVgpuForceGspUnload') + if __nvmlDeviceVgpuForceGspUnload == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceVgpuForceGspUnload = _cyb_dlsym(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerState_v2') + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerState_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerLog_v2') + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerLog_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = _cyb_dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetVgpuSchedulerState_v2') + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuSchedulerState_v2 = _cyb_dlsym(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = _cyb_dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + + global __nvmlSystemGetCPER_v1 + __nvmlSystemGetCPER_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetCPER_v1') + if __nvmlSystemGetCPER_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetCPER_v1 = _cyb_dlsym(handle, 'nvmlSystemGetCPER_v1') + + global __nvmlDeviceGetBBXTimeData_v1 + __nvmlDeviceGetBBXTimeData_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBBXTimeData_v1') + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBBXTimeData_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetBBXTimeData_v1') + + global __nvmlDeviceGetAccountingStats_v2 + __nvmlDeviceGetAccountingStats_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingStats_v2') + if __nvmlDeviceGetAccountingStats_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingStats_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingStats_v2') + + global __nvmlDeviceGetRemappedRows_v2 + __nvmlDeviceGetRemappedRows_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRemappedRows_v2') + if __nvmlDeviceGetRemappedRows_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetRemappedRows_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetRemappedRows_v2') + + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) + return 0 + +cdef inline int _check_or_init_nvml() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvml_init): + return 0 + + return _init_nvml() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvml() + cdef dict data = {} + global __nvmlInit_v2 + data["__nvmlInit_v2"] = __nvmlInit_v2 + + global __nvmlInitWithFlags + data["__nvmlInitWithFlags"] = __nvmlInitWithFlags + + global __nvmlShutdown + data["__nvmlShutdown"] = __nvmlShutdown + + global __nvmlErrorString + data["__nvmlErrorString"] = __nvmlErrorString + + global __nvmlSystemGetDriverVersion + data["__nvmlSystemGetDriverVersion"] = __nvmlSystemGetDriverVersion + + global __nvmlSystemGetNVMLVersion + data["__nvmlSystemGetNVMLVersion"] = __nvmlSystemGetNVMLVersion + + global __nvmlSystemGetCudaDriverVersion + data["__nvmlSystemGetCudaDriverVersion"] = __nvmlSystemGetCudaDriverVersion + + global __nvmlSystemGetCudaDriverVersion_v2 + data["__nvmlSystemGetCudaDriverVersion_v2"] = __nvmlSystemGetCudaDriverVersion_v2 + + global __nvmlSystemGetProcessName + data["__nvmlSystemGetProcessName"] = __nvmlSystemGetProcessName + + global __nvmlSystemGetHicVersion + data["__nvmlSystemGetHicVersion"] = __nvmlSystemGetHicVersion + + global __nvmlSystemGetTopologyGpuSet + data["__nvmlSystemGetTopologyGpuSet"] = __nvmlSystemGetTopologyGpuSet + + global __nvmlSystemGetDriverBranch + data["__nvmlSystemGetDriverBranch"] = __nvmlSystemGetDriverBranch + + global __nvmlUnitGetCount + data["__nvmlUnitGetCount"] = __nvmlUnitGetCount + + global __nvmlUnitGetHandleByIndex + data["__nvmlUnitGetHandleByIndex"] = __nvmlUnitGetHandleByIndex + + global __nvmlUnitGetUnitInfo + data["__nvmlUnitGetUnitInfo"] = __nvmlUnitGetUnitInfo + + global __nvmlUnitGetLedState + data["__nvmlUnitGetLedState"] = __nvmlUnitGetLedState + + global __nvmlUnitGetPsuInfo + data["__nvmlUnitGetPsuInfo"] = __nvmlUnitGetPsuInfo + + global __nvmlUnitGetTemperature + data["__nvmlUnitGetTemperature"] = __nvmlUnitGetTemperature + + global __nvmlUnitGetFanSpeedInfo + data["__nvmlUnitGetFanSpeedInfo"] = __nvmlUnitGetFanSpeedInfo + + global __nvmlUnitGetDevices + data["__nvmlUnitGetDevices"] = __nvmlUnitGetDevices + + global __nvmlDeviceGetCount_v2 + data["__nvmlDeviceGetCount_v2"] = __nvmlDeviceGetCount_v2 + + global __nvmlDeviceGetAttributes_v2 + data["__nvmlDeviceGetAttributes_v2"] = __nvmlDeviceGetAttributes_v2 + + global __nvmlDeviceGetHandleByIndex_v2 + data["__nvmlDeviceGetHandleByIndex_v2"] = __nvmlDeviceGetHandleByIndex_v2 + + global __nvmlDeviceGetHandleBySerial + data["__nvmlDeviceGetHandleBySerial"] = __nvmlDeviceGetHandleBySerial + + global __nvmlDeviceGetHandleByUUID + data["__nvmlDeviceGetHandleByUUID"] = __nvmlDeviceGetHandleByUUID + + global __nvmlDeviceGetHandleByUUIDV + data["__nvmlDeviceGetHandleByUUIDV"] = __nvmlDeviceGetHandleByUUIDV + + global __nvmlDeviceGetHandleByPciBusId_v2 + data["__nvmlDeviceGetHandleByPciBusId_v2"] = __nvmlDeviceGetHandleByPciBusId_v2 + + global __nvmlDeviceGetName + data["__nvmlDeviceGetName"] = __nvmlDeviceGetName + + global __nvmlDeviceGetBrand + data["__nvmlDeviceGetBrand"] = __nvmlDeviceGetBrand + + global __nvmlDeviceGetIndex + data["__nvmlDeviceGetIndex"] = __nvmlDeviceGetIndex + + global __nvmlDeviceGetSerial + data["__nvmlDeviceGetSerial"] = __nvmlDeviceGetSerial + + global __nvmlDeviceGetModuleId + data["__nvmlDeviceGetModuleId"] = __nvmlDeviceGetModuleId + + global __nvmlDeviceGetC2cModeInfoV + data["__nvmlDeviceGetC2cModeInfoV"] = __nvmlDeviceGetC2cModeInfoV + + global __nvmlDeviceGetMemoryAffinity + data["__nvmlDeviceGetMemoryAffinity"] = __nvmlDeviceGetMemoryAffinity + + global __nvmlDeviceGetCpuAffinityWithinScope + data["__nvmlDeviceGetCpuAffinityWithinScope"] = __nvmlDeviceGetCpuAffinityWithinScope + + global __nvmlDeviceGetCpuAffinity + data["__nvmlDeviceGetCpuAffinity"] = __nvmlDeviceGetCpuAffinity + + global __nvmlDeviceSetCpuAffinity + data["__nvmlDeviceSetCpuAffinity"] = __nvmlDeviceSetCpuAffinity + + global __nvmlDeviceClearCpuAffinity + data["__nvmlDeviceClearCpuAffinity"] = __nvmlDeviceClearCpuAffinity + + global __nvmlDeviceGetNumaNodeId + data["__nvmlDeviceGetNumaNodeId"] = __nvmlDeviceGetNumaNodeId + + global __nvmlDeviceGetTopologyCommonAncestor + data["__nvmlDeviceGetTopologyCommonAncestor"] = __nvmlDeviceGetTopologyCommonAncestor + + global __nvmlDeviceGetTopologyNearestGpus + data["__nvmlDeviceGetTopologyNearestGpus"] = __nvmlDeviceGetTopologyNearestGpus + + global __nvmlDeviceGetP2PStatus + data["__nvmlDeviceGetP2PStatus"] = __nvmlDeviceGetP2PStatus + + global __nvmlDeviceGetUUID + data["__nvmlDeviceGetUUID"] = __nvmlDeviceGetUUID + + global __nvmlDeviceGetMinorNumber + data["__nvmlDeviceGetMinorNumber"] = __nvmlDeviceGetMinorNumber + + global __nvmlDeviceGetBoardPartNumber + data["__nvmlDeviceGetBoardPartNumber"] = __nvmlDeviceGetBoardPartNumber + + global __nvmlDeviceGetInforomVersion + data["__nvmlDeviceGetInforomVersion"] = __nvmlDeviceGetInforomVersion + + global __nvmlDeviceGetInforomImageVersion + data["__nvmlDeviceGetInforomImageVersion"] = __nvmlDeviceGetInforomImageVersion + + global __nvmlDeviceGetInforomConfigurationChecksum + data["__nvmlDeviceGetInforomConfigurationChecksum"] = __nvmlDeviceGetInforomConfigurationChecksum + + global __nvmlDeviceValidateInforom + data["__nvmlDeviceValidateInforom"] = __nvmlDeviceValidateInforom + + global __nvmlDeviceGetLastBBXFlushTime + data["__nvmlDeviceGetLastBBXFlushTime"] = __nvmlDeviceGetLastBBXFlushTime + + global __nvmlDeviceGetDisplayMode + data["__nvmlDeviceGetDisplayMode"] = __nvmlDeviceGetDisplayMode + + global __nvmlDeviceGetDisplayActive + data["__nvmlDeviceGetDisplayActive"] = __nvmlDeviceGetDisplayActive + + global __nvmlDeviceGetPersistenceMode + data["__nvmlDeviceGetPersistenceMode"] = __nvmlDeviceGetPersistenceMode + + global __nvmlDeviceGetPciInfoExt + data["__nvmlDeviceGetPciInfoExt"] = __nvmlDeviceGetPciInfoExt + + global __nvmlDeviceGetPciInfo_v3 + data["__nvmlDeviceGetPciInfo_v3"] = __nvmlDeviceGetPciInfo_v3 + + global __nvmlDeviceGetMaxPcieLinkGeneration + data["__nvmlDeviceGetMaxPcieLinkGeneration"] = __nvmlDeviceGetMaxPcieLinkGeneration + + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = __nvmlDeviceGetGpuMaxPcieLinkGeneration + + global __nvmlDeviceGetMaxPcieLinkWidth + data["__nvmlDeviceGetMaxPcieLinkWidth"] = __nvmlDeviceGetMaxPcieLinkWidth + + global __nvmlDeviceGetCurrPcieLinkGeneration + data["__nvmlDeviceGetCurrPcieLinkGeneration"] = __nvmlDeviceGetCurrPcieLinkGeneration + + global __nvmlDeviceGetCurrPcieLinkWidth + data["__nvmlDeviceGetCurrPcieLinkWidth"] = __nvmlDeviceGetCurrPcieLinkWidth + + global __nvmlDeviceGetPcieThroughput + data["__nvmlDeviceGetPcieThroughput"] = __nvmlDeviceGetPcieThroughput + + global __nvmlDeviceGetPcieReplayCounter + data["__nvmlDeviceGetPcieReplayCounter"] = __nvmlDeviceGetPcieReplayCounter + + global __nvmlDeviceGetClockInfo + data["__nvmlDeviceGetClockInfo"] = __nvmlDeviceGetClockInfo + + global __nvmlDeviceGetMaxClockInfo + data["__nvmlDeviceGetMaxClockInfo"] = __nvmlDeviceGetMaxClockInfo + + global __nvmlDeviceGetGpcClkVfOffset + data["__nvmlDeviceGetGpcClkVfOffset"] = __nvmlDeviceGetGpcClkVfOffset + + global __nvmlDeviceGetClock + data["__nvmlDeviceGetClock"] = __nvmlDeviceGetClock + + global __nvmlDeviceGetMaxCustomerBoostClock + data["__nvmlDeviceGetMaxCustomerBoostClock"] = __nvmlDeviceGetMaxCustomerBoostClock + + global __nvmlDeviceGetSupportedMemoryClocks + data["__nvmlDeviceGetSupportedMemoryClocks"] = __nvmlDeviceGetSupportedMemoryClocks + + global __nvmlDeviceGetSupportedGraphicsClocks + data["__nvmlDeviceGetSupportedGraphicsClocks"] = __nvmlDeviceGetSupportedGraphicsClocks + + global __nvmlDeviceGetAutoBoostedClocksEnabled + data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = __nvmlDeviceGetAutoBoostedClocksEnabled + + global __nvmlDeviceGetFanSpeed + data["__nvmlDeviceGetFanSpeed"] = __nvmlDeviceGetFanSpeed + + global __nvmlDeviceGetFanSpeed_v2 + data["__nvmlDeviceGetFanSpeed_v2"] = __nvmlDeviceGetFanSpeed_v2 + + global __nvmlDeviceGetFanSpeedRPM + data["__nvmlDeviceGetFanSpeedRPM"] = __nvmlDeviceGetFanSpeedRPM + + global __nvmlDeviceGetTargetFanSpeed + data["__nvmlDeviceGetTargetFanSpeed"] = __nvmlDeviceGetTargetFanSpeed + + global __nvmlDeviceGetMinMaxFanSpeed + data["__nvmlDeviceGetMinMaxFanSpeed"] = __nvmlDeviceGetMinMaxFanSpeed + + global __nvmlDeviceGetFanControlPolicy_v2 + data["__nvmlDeviceGetFanControlPolicy_v2"] = __nvmlDeviceGetFanControlPolicy_v2 + + global __nvmlDeviceGetNumFans + data["__nvmlDeviceGetNumFans"] = __nvmlDeviceGetNumFans + + global __nvmlDeviceGetCoolerInfo + data["__nvmlDeviceGetCoolerInfo"] = __nvmlDeviceGetCoolerInfo + + global __nvmlDeviceGetTemperatureV + data["__nvmlDeviceGetTemperatureV"] = __nvmlDeviceGetTemperatureV + + global __nvmlDeviceGetTemperatureThreshold + data["__nvmlDeviceGetTemperatureThreshold"] = __nvmlDeviceGetTemperatureThreshold + + global __nvmlDeviceGetMarginTemperature + data["__nvmlDeviceGetMarginTemperature"] = __nvmlDeviceGetMarginTemperature + + global __nvmlDeviceGetThermalSettings + data["__nvmlDeviceGetThermalSettings"] = __nvmlDeviceGetThermalSettings + + global __nvmlDeviceGetPerformanceState + data["__nvmlDeviceGetPerformanceState"] = __nvmlDeviceGetPerformanceState + + global __nvmlDeviceGetCurrentClocksEventReasons + data["__nvmlDeviceGetCurrentClocksEventReasons"] = __nvmlDeviceGetCurrentClocksEventReasons + + global __nvmlDeviceGetSupportedClocksEventReasons + data["__nvmlDeviceGetSupportedClocksEventReasons"] = __nvmlDeviceGetSupportedClocksEventReasons + + global __nvmlDeviceGetPowerState + data["__nvmlDeviceGetPowerState"] = __nvmlDeviceGetPowerState + + global __nvmlDeviceGetDynamicPstatesInfo + data["__nvmlDeviceGetDynamicPstatesInfo"] = __nvmlDeviceGetDynamicPstatesInfo + + global __nvmlDeviceGetMemClkVfOffset + data["__nvmlDeviceGetMemClkVfOffset"] = __nvmlDeviceGetMemClkVfOffset + + global __nvmlDeviceGetMinMaxClockOfPState + data["__nvmlDeviceGetMinMaxClockOfPState"] = __nvmlDeviceGetMinMaxClockOfPState + + global __nvmlDeviceGetSupportedPerformanceStates + data["__nvmlDeviceGetSupportedPerformanceStates"] = __nvmlDeviceGetSupportedPerformanceStates + + global __nvmlDeviceGetGpcClkMinMaxVfOffset + data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = __nvmlDeviceGetGpcClkMinMaxVfOffset + + global __nvmlDeviceGetMemClkMinMaxVfOffset + data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = __nvmlDeviceGetMemClkMinMaxVfOffset + + global __nvmlDeviceGetClockOffsets + data["__nvmlDeviceGetClockOffsets"] = __nvmlDeviceGetClockOffsets + + global __nvmlDeviceSetClockOffsets + data["__nvmlDeviceSetClockOffsets"] = __nvmlDeviceSetClockOffsets + + global __nvmlDeviceGetPerformanceModes + data["__nvmlDeviceGetPerformanceModes"] = __nvmlDeviceGetPerformanceModes + + global __nvmlDeviceGetCurrentClockFreqs + data["__nvmlDeviceGetCurrentClockFreqs"] = __nvmlDeviceGetCurrentClockFreqs + + global __nvmlDeviceGetPowerManagementLimit + data["__nvmlDeviceGetPowerManagementLimit"] = __nvmlDeviceGetPowerManagementLimit + + global __nvmlDeviceGetPowerManagementLimitConstraints + data["__nvmlDeviceGetPowerManagementLimitConstraints"] = __nvmlDeviceGetPowerManagementLimitConstraints + + global __nvmlDeviceGetPowerManagementDefaultLimit + data["__nvmlDeviceGetPowerManagementDefaultLimit"] = __nvmlDeviceGetPowerManagementDefaultLimit + + global __nvmlDeviceGetPowerUsage + data["__nvmlDeviceGetPowerUsage"] = __nvmlDeviceGetPowerUsage + + global __nvmlDeviceGetTotalEnergyConsumption + data["__nvmlDeviceGetTotalEnergyConsumption"] = __nvmlDeviceGetTotalEnergyConsumption + + global __nvmlDeviceGetEnforcedPowerLimit + data["__nvmlDeviceGetEnforcedPowerLimit"] = __nvmlDeviceGetEnforcedPowerLimit + + global __nvmlDeviceGetGpuOperationMode + data["__nvmlDeviceGetGpuOperationMode"] = __nvmlDeviceGetGpuOperationMode + + global __nvmlDeviceGetMemoryInfo_v2 + data["__nvmlDeviceGetMemoryInfo_v2"] = __nvmlDeviceGetMemoryInfo_v2 + + global __nvmlDeviceGetComputeMode + data["__nvmlDeviceGetComputeMode"] = __nvmlDeviceGetComputeMode + + global __nvmlDeviceGetCudaComputeCapability + data["__nvmlDeviceGetCudaComputeCapability"] = __nvmlDeviceGetCudaComputeCapability + + global __nvmlDeviceGetDramEncryptionMode + data["__nvmlDeviceGetDramEncryptionMode"] = __nvmlDeviceGetDramEncryptionMode + + global __nvmlDeviceSetDramEncryptionMode + data["__nvmlDeviceSetDramEncryptionMode"] = __nvmlDeviceSetDramEncryptionMode + + global __nvmlDeviceGetEccMode + data["__nvmlDeviceGetEccMode"] = __nvmlDeviceGetEccMode + + global __nvmlDeviceGetDefaultEccMode + data["__nvmlDeviceGetDefaultEccMode"] = __nvmlDeviceGetDefaultEccMode + + global __nvmlDeviceGetBoardId + data["__nvmlDeviceGetBoardId"] = __nvmlDeviceGetBoardId + + global __nvmlDeviceGetMultiGpuBoard + data["__nvmlDeviceGetMultiGpuBoard"] = __nvmlDeviceGetMultiGpuBoard + + global __nvmlDeviceGetTotalEccErrors + data["__nvmlDeviceGetTotalEccErrors"] = __nvmlDeviceGetTotalEccErrors + + global __nvmlDeviceGetMemoryErrorCounter + data["__nvmlDeviceGetMemoryErrorCounter"] = __nvmlDeviceGetMemoryErrorCounter + + global __nvmlDeviceGetUtilizationRates + data["__nvmlDeviceGetUtilizationRates"] = __nvmlDeviceGetUtilizationRates + + global __nvmlDeviceGetEncoderUtilization + data["__nvmlDeviceGetEncoderUtilization"] = __nvmlDeviceGetEncoderUtilization + + global __nvmlDeviceGetEncoderCapacity + data["__nvmlDeviceGetEncoderCapacity"] = __nvmlDeviceGetEncoderCapacity + + global __nvmlDeviceGetEncoderStats + data["__nvmlDeviceGetEncoderStats"] = __nvmlDeviceGetEncoderStats + + global __nvmlDeviceGetEncoderSessions + data["__nvmlDeviceGetEncoderSessions"] = __nvmlDeviceGetEncoderSessions + + global __nvmlDeviceGetDecoderUtilization + data["__nvmlDeviceGetDecoderUtilization"] = __nvmlDeviceGetDecoderUtilization + + global __nvmlDeviceGetJpgUtilization + data["__nvmlDeviceGetJpgUtilization"] = __nvmlDeviceGetJpgUtilization + + global __nvmlDeviceGetOfaUtilization + data["__nvmlDeviceGetOfaUtilization"] = __nvmlDeviceGetOfaUtilization + + global __nvmlDeviceGetFBCStats + data["__nvmlDeviceGetFBCStats"] = __nvmlDeviceGetFBCStats + + global __nvmlDeviceGetFBCSessions + data["__nvmlDeviceGetFBCSessions"] = __nvmlDeviceGetFBCSessions + + global __nvmlDeviceGetDriverModel_v2 + data["__nvmlDeviceGetDriverModel_v2"] = __nvmlDeviceGetDriverModel_v2 + + global __nvmlDeviceGetVbiosVersion + data["__nvmlDeviceGetVbiosVersion"] = __nvmlDeviceGetVbiosVersion + + global __nvmlDeviceGetBridgeChipInfo + data["__nvmlDeviceGetBridgeChipInfo"] = __nvmlDeviceGetBridgeChipInfo + + global __nvmlDeviceGetComputeRunningProcesses_v3 + data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 + data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 + + global __nvmlDeviceGetRunningProcessDetailList + data["__nvmlDeviceGetRunningProcessDetailList"] = __nvmlDeviceGetRunningProcessDetailList + + global __nvmlDeviceOnSameBoard + data["__nvmlDeviceOnSameBoard"] = __nvmlDeviceOnSameBoard + + global __nvmlDeviceGetAPIRestriction + data["__nvmlDeviceGetAPIRestriction"] = __nvmlDeviceGetAPIRestriction + + global __nvmlDeviceGetSamples + data["__nvmlDeviceGetSamples"] = __nvmlDeviceGetSamples + + global __nvmlDeviceGetBAR1MemoryInfo + data["__nvmlDeviceGetBAR1MemoryInfo"] = __nvmlDeviceGetBAR1MemoryInfo + + global __nvmlDeviceGetIrqNum + data["__nvmlDeviceGetIrqNum"] = __nvmlDeviceGetIrqNum + + global __nvmlDeviceGetNumGpuCores + data["__nvmlDeviceGetNumGpuCores"] = __nvmlDeviceGetNumGpuCores + + global __nvmlDeviceGetPowerSource + data["__nvmlDeviceGetPowerSource"] = __nvmlDeviceGetPowerSource + + global __nvmlDeviceGetMemoryBusWidth + data["__nvmlDeviceGetMemoryBusWidth"] = __nvmlDeviceGetMemoryBusWidth + + global __nvmlDeviceGetPcieLinkMaxSpeed + data["__nvmlDeviceGetPcieLinkMaxSpeed"] = __nvmlDeviceGetPcieLinkMaxSpeed + + global __nvmlDeviceGetPcieSpeed + data["__nvmlDeviceGetPcieSpeed"] = __nvmlDeviceGetPcieSpeed + + global __nvmlDeviceGetAdaptiveClockInfoStatus + data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = __nvmlDeviceGetAdaptiveClockInfoStatus + + global __nvmlDeviceGetBusType + data["__nvmlDeviceGetBusType"] = __nvmlDeviceGetBusType + + global __nvmlDeviceGetGpuFabricInfoV + data["__nvmlDeviceGetGpuFabricInfoV"] = __nvmlDeviceGetGpuFabricInfoV + + global __nvmlSystemGetConfComputeCapabilities + data["__nvmlSystemGetConfComputeCapabilities"] = __nvmlSystemGetConfComputeCapabilities + + global __nvmlSystemGetConfComputeState + data["__nvmlSystemGetConfComputeState"] = __nvmlSystemGetConfComputeState + + global __nvmlDeviceGetConfComputeMemSizeInfo + data["__nvmlDeviceGetConfComputeMemSizeInfo"] = __nvmlDeviceGetConfComputeMemSizeInfo + + global __nvmlSystemGetConfComputeGpusReadyState + data["__nvmlSystemGetConfComputeGpusReadyState"] = __nvmlSystemGetConfComputeGpusReadyState + + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = __nvmlDeviceGetConfComputeProtectedMemoryUsage + + global __nvmlDeviceGetConfComputeGpuCertificate + data["__nvmlDeviceGetConfComputeGpuCertificate"] = __nvmlDeviceGetConfComputeGpuCertificate + + global __nvmlDeviceGetConfComputeGpuAttestationReport + data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = __nvmlDeviceGetConfComputeGpuAttestationReport + + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = __nvmlSystemGetConfComputeKeyRotationThresholdInfo + + global __nvmlDeviceSetConfComputeUnprotectedMemSize + data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = __nvmlDeviceSetConfComputeUnprotectedMemSize + + global __nvmlSystemSetConfComputeGpusReadyState + data["__nvmlSystemSetConfComputeGpusReadyState"] = __nvmlSystemSetConfComputeGpusReadyState + + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = __nvmlSystemSetConfComputeKeyRotationThresholdInfo + + global __nvmlSystemGetConfComputeSettings + data["__nvmlSystemGetConfComputeSettings"] = __nvmlSystemGetConfComputeSettings + + global __nvmlDeviceGetGspFirmwareVersion + data["__nvmlDeviceGetGspFirmwareVersion"] = __nvmlDeviceGetGspFirmwareVersion + + global __nvmlDeviceGetGspFirmwareMode + data["__nvmlDeviceGetGspFirmwareMode"] = __nvmlDeviceGetGspFirmwareMode + + global __nvmlDeviceGetSramEccErrorStatus + data["__nvmlDeviceGetSramEccErrorStatus"] = __nvmlDeviceGetSramEccErrorStatus + + global __nvmlDeviceGetAccountingMode + data["__nvmlDeviceGetAccountingMode"] = __nvmlDeviceGetAccountingMode + + global __nvmlDeviceGetAccountingStats + data["__nvmlDeviceGetAccountingStats"] = __nvmlDeviceGetAccountingStats + + global __nvmlDeviceGetAccountingPids + data["__nvmlDeviceGetAccountingPids"] = __nvmlDeviceGetAccountingPids + + global __nvmlDeviceGetAccountingBufferSize + data["__nvmlDeviceGetAccountingBufferSize"] = __nvmlDeviceGetAccountingBufferSize + + global __nvmlDeviceGetRetiredPages + data["__nvmlDeviceGetRetiredPages"] = __nvmlDeviceGetRetiredPages + + global __nvmlDeviceGetRetiredPages_v2 + data["__nvmlDeviceGetRetiredPages_v2"] = __nvmlDeviceGetRetiredPages_v2 + + global __nvmlDeviceGetRetiredPagesPendingStatus + data["__nvmlDeviceGetRetiredPagesPendingStatus"] = __nvmlDeviceGetRetiredPagesPendingStatus + + global __nvmlDeviceGetRemappedRows + data["__nvmlDeviceGetRemappedRows"] = __nvmlDeviceGetRemappedRows + + global __nvmlDeviceGetRowRemapperHistogram + data["__nvmlDeviceGetRowRemapperHistogram"] = __nvmlDeviceGetRowRemapperHistogram + + global __nvmlDeviceGetArchitecture + data["__nvmlDeviceGetArchitecture"] = __nvmlDeviceGetArchitecture + + global __nvmlDeviceGetClkMonStatus + data["__nvmlDeviceGetClkMonStatus"] = __nvmlDeviceGetClkMonStatus + + global __nvmlDeviceGetProcessUtilization + data["__nvmlDeviceGetProcessUtilization"] = __nvmlDeviceGetProcessUtilization + + global __nvmlDeviceGetProcessesUtilizationInfo + data["__nvmlDeviceGetProcessesUtilizationInfo"] = __nvmlDeviceGetProcessesUtilizationInfo + + global __nvmlDeviceGetPlatformInfo + data["__nvmlDeviceGetPlatformInfo"] = __nvmlDeviceGetPlatformInfo + + global __nvmlUnitSetLedState + data["__nvmlUnitSetLedState"] = __nvmlUnitSetLedState + + global __nvmlDeviceSetPersistenceMode + data["__nvmlDeviceSetPersistenceMode"] = __nvmlDeviceSetPersistenceMode + + global __nvmlDeviceSetComputeMode + data["__nvmlDeviceSetComputeMode"] = __nvmlDeviceSetComputeMode + + global __nvmlDeviceSetEccMode + data["__nvmlDeviceSetEccMode"] = __nvmlDeviceSetEccMode + + global __nvmlDeviceClearEccErrorCounts + data["__nvmlDeviceClearEccErrorCounts"] = __nvmlDeviceClearEccErrorCounts + + global __nvmlDeviceSetDriverModel + data["__nvmlDeviceSetDriverModel"] = __nvmlDeviceSetDriverModel + + global __nvmlDeviceSetGpuLockedClocks + data["__nvmlDeviceSetGpuLockedClocks"] = __nvmlDeviceSetGpuLockedClocks + + global __nvmlDeviceResetGpuLockedClocks + data["__nvmlDeviceResetGpuLockedClocks"] = __nvmlDeviceResetGpuLockedClocks + + global __nvmlDeviceSetMemoryLockedClocks + data["__nvmlDeviceSetMemoryLockedClocks"] = __nvmlDeviceSetMemoryLockedClocks + + global __nvmlDeviceResetMemoryLockedClocks + data["__nvmlDeviceResetMemoryLockedClocks"] = __nvmlDeviceResetMemoryLockedClocks + + global __nvmlDeviceSetAutoBoostedClocksEnabled + data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = __nvmlDeviceSetAutoBoostedClocksEnabled + + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + + global __nvmlDeviceSetDefaultFanSpeed_v2 + data["__nvmlDeviceSetDefaultFanSpeed_v2"] = __nvmlDeviceSetDefaultFanSpeed_v2 + + global __nvmlDeviceSetFanControlPolicy + data["__nvmlDeviceSetFanControlPolicy"] = __nvmlDeviceSetFanControlPolicy + + global __nvmlDeviceSetTemperatureThreshold + data["__nvmlDeviceSetTemperatureThreshold"] = __nvmlDeviceSetTemperatureThreshold + + global __nvmlDeviceSetGpuOperationMode + data["__nvmlDeviceSetGpuOperationMode"] = __nvmlDeviceSetGpuOperationMode + + global __nvmlDeviceSetAPIRestriction + data["__nvmlDeviceSetAPIRestriction"] = __nvmlDeviceSetAPIRestriction + + global __nvmlDeviceSetFanSpeed_v2 + data["__nvmlDeviceSetFanSpeed_v2"] = __nvmlDeviceSetFanSpeed_v2 + + global __nvmlDeviceSetAccountingMode + data["__nvmlDeviceSetAccountingMode"] = __nvmlDeviceSetAccountingMode + + global __nvmlDeviceClearAccountingPids + data["__nvmlDeviceClearAccountingPids"] = __nvmlDeviceClearAccountingPids + + global __nvmlDeviceSetPowerManagementLimit_v2 + data["__nvmlDeviceSetPowerManagementLimit_v2"] = __nvmlDeviceSetPowerManagementLimit_v2 + + global __nvmlDeviceGetNvLinkState + data["__nvmlDeviceGetNvLinkState"] = __nvmlDeviceGetNvLinkState + + global __nvmlDeviceGetNvLinkVersion + data["__nvmlDeviceGetNvLinkVersion"] = __nvmlDeviceGetNvLinkVersion + + global __nvmlDeviceGetNvLinkCapability + data["__nvmlDeviceGetNvLinkCapability"] = __nvmlDeviceGetNvLinkCapability + + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = __nvmlDeviceGetNvLinkRemotePciInfo_v2 + + global __nvmlDeviceGetNvLinkErrorCounter + data["__nvmlDeviceGetNvLinkErrorCounter"] = __nvmlDeviceGetNvLinkErrorCounter + + global __nvmlDeviceResetNvLinkErrorCounters + data["__nvmlDeviceResetNvLinkErrorCounters"] = __nvmlDeviceResetNvLinkErrorCounters + + global __nvmlDeviceGetNvLinkRemoteDeviceType + data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = __nvmlDeviceGetNvLinkRemoteDeviceType + + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + + global __nvmlSystemSetNvlinkBwMode + data["__nvmlSystemSetNvlinkBwMode"] = __nvmlSystemSetNvlinkBwMode + + global __nvmlSystemGetNvlinkBwMode + data["__nvmlSystemGetNvlinkBwMode"] = __nvmlSystemGetNvlinkBwMode + + global __nvmlDeviceGetNvlinkSupportedBwModes + data["__nvmlDeviceGetNvlinkSupportedBwModes"] = __nvmlDeviceGetNvlinkSupportedBwModes + + global __nvmlDeviceGetNvlinkBwMode + data["__nvmlDeviceGetNvlinkBwMode"] = __nvmlDeviceGetNvlinkBwMode + + global __nvmlDeviceSetNvlinkBwMode + data["__nvmlDeviceSetNvlinkBwMode"] = __nvmlDeviceSetNvlinkBwMode + + global __nvmlEventSetCreate + data["__nvmlEventSetCreate"] = __nvmlEventSetCreate + + global __nvmlDeviceRegisterEvents + data["__nvmlDeviceRegisterEvents"] = __nvmlDeviceRegisterEvents + + global __nvmlDeviceGetSupportedEventTypes + data["__nvmlDeviceGetSupportedEventTypes"] = __nvmlDeviceGetSupportedEventTypes + + global __nvmlEventSetWait_v2 + data["__nvmlEventSetWait_v2"] = __nvmlEventSetWait_v2 + + global __nvmlEventSetFree + data["__nvmlEventSetFree"] = __nvmlEventSetFree + + global __nvmlSystemEventSetCreate + data["__nvmlSystemEventSetCreate"] = __nvmlSystemEventSetCreate + + global __nvmlSystemEventSetFree + data["__nvmlSystemEventSetFree"] = __nvmlSystemEventSetFree + + global __nvmlSystemRegisterEvents + data["__nvmlSystemRegisterEvents"] = __nvmlSystemRegisterEvents + + global __nvmlSystemEventSetWait + data["__nvmlSystemEventSetWait"] = __nvmlSystemEventSetWait + + global __nvmlDeviceModifyDrainState + data["__nvmlDeviceModifyDrainState"] = __nvmlDeviceModifyDrainState + + global __nvmlDeviceQueryDrainState + data["__nvmlDeviceQueryDrainState"] = __nvmlDeviceQueryDrainState + + global __nvmlDeviceRemoveGpu_v2 + data["__nvmlDeviceRemoveGpu_v2"] = __nvmlDeviceRemoveGpu_v2 + + global __nvmlDeviceDiscoverGpus + data["__nvmlDeviceDiscoverGpus"] = __nvmlDeviceDiscoverGpus + + global __nvmlDeviceGetFieldValues + data["__nvmlDeviceGetFieldValues"] = __nvmlDeviceGetFieldValues + + global __nvmlDeviceClearFieldValues + data["__nvmlDeviceClearFieldValues"] = __nvmlDeviceClearFieldValues + + global __nvmlDeviceGetVirtualizationMode + data["__nvmlDeviceGetVirtualizationMode"] = __nvmlDeviceGetVirtualizationMode + + global __nvmlDeviceGetHostVgpuMode + data["__nvmlDeviceGetHostVgpuMode"] = __nvmlDeviceGetHostVgpuMode + + global __nvmlDeviceSetVirtualizationMode + data["__nvmlDeviceSetVirtualizationMode"] = __nvmlDeviceSetVirtualizationMode + + global __nvmlDeviceGetVgpuHeterogeneousMode + data["__nvmlDeviceGetVgpuHeterogeneousMode"] = __nvmlDeviceGetVgpuHeterogeneousMode + + global __nvmlDeviceSetVgpuHeterogeneousMode + data["__nvmlDeviceSetVgpuHeterogeneousMode"] = __nvmlDeviceSetVgpuHeterogeneousMode + + global __nvmlVgpuInstanceGetPlacementId + data["__nvmlVgpuInstanceGetPlacementId"] = __nvmlVgpuInstanceGetPlacementId + + global __nvmlDeviceGetVgpuTypeSupportedPlacements + data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = __nvmlDeviceGetVgpuTypeSupportedPlacements + + global __nvmlDeviceGetVgpuTypeCreatablePlacements + data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = __nvmlDeviceGetVgpuTypeCreatablePlacements + + global __nvmlVgpuTypeGetGspHeapSize + data["__nvmlVgpuTypeGetGspHeapSize"] = __nvmlVgpuTypeGetGspHeapSize + + global __nvmlVgpuTypeGetFbReservation + data["__nvmlVgpuTypeGetFbReservation"] = __nvmlVgpuTypeGetFbReservation + + global __nvmlVgpuInstanceGetRuntimeStateSize + data["__nvmlVgpuInstanceGetRuntimeStateSize"] = __nvmlVgpuInstanceGetRuntimeStateSize + + global __nvmlDeviceSetVgpuCapabilities + data["__nvmlDeviceSetVgpuCapabilities"] = __nvmlDeviceSetVgpuCapabilities + + global __nvmlDeviceGetGridLicensableFeatures_v4 + data["__nvmlDeviceGetGridLicensableFeatures_v4"] = __nvmlDeviceGetGridLicensableFeatures_v4 + + global __nvmlGetVgpuDriverCapabilities + data["__nvmlGetVgpuDriverCapabilities"] = __nvmlGetVgpuDriverCapabilities + + global __nvmlDeviceGetVgpuCapabilities + data["__nvmlDeviceGetVgpuCapabilities"] = __nvmlDeviceGetVgpuCapabilities + + global __nvmlDeviceGetSupportedVgpus + data["__nvmlDeviceGetSupportedVgpus"] = __nvmlDeviceGetSupportedVgpus + + global __nvmlDeviceGetCreatableVgpus + data["__nvmlDeviceGetCreatableVgpus"] = __nvmlDeviceGetCreatableVgpus + + global __nvmlVgpuTypeGetClass + data["__nvmlVgpuTypeGetClass"] = __nvmlVgpuTypeGetClass + + global __nvmlVgpuTypeGetName + data["__nvmlVgpuTypeGetName"] = __nvmlVgpuTypeGetName + + global __nvmlVgpuTypeGetGpuInstanceProfileId + data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = __nvmlVgpuTypeGetGpuInstanceProfileId + + global __nvmlVgpuTypeGetDeviceID + data["__nvmlVgpuTypeGetDeviceID"] = __nvmlVgpuTypeGetDeviceID + + global __nvmlVgpuTypeGetFramebufferSize + data["__nvmlVgpuTypeGetFramebufferSize"] = __nvmlVgpuTypeGetFramebufferSize + + global __nvmlVgpuTypeGetNumDisplayHeads + data["__nvmlVgpuTypeGetNumDisplayHeads"] = __nvmlVgpuTypeGetNumDisplayHeads + + global __nvmlVgpuTypeGetResolution + data["__nvmlVgpuTypeGetResolution"] = __nvmlVgpuTypeGetResolution + + global __nvmlVgpuTypeGetLicense + data["__nvmlVgpuTypeGetLicense"] = __nvmlVgpuTypeGetLicense + + global __nvmlVgpuTypeGetFrameRateLimit + data["__nvmlVgpuTypeGetFrameRateLimit"] = __nvmlVgpuTypeGetFrameRateLimit + + global __nvmlVgpuTypeGetMaxInstances + data["__nvmlVgpuTypeGetMaxInstances"] = __nvmlVgpuTypeGetMaxInstances + + global __nvmlVgpuTypeGetMaxInstancesPerVm + data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = __nvmlVgpuTypeGetMaxInstancesPerVm + + global __nvmlVgpuTypeGetBAR1Info + data["__nvmlVgpuTypeGetBAR1Info"] = __nvmlVgpuTypeGetBAR1Info + + global __nvmlDeviceGetActiveVgpus + data["__nvmlDeviceGetActiveVgpus"] = __nvmlDeviceGetActiveVgpus + + global __nvmlVgpuInstanceGetVmID + data["__nvmlVgpuInstanceGetVmID"] = __nvmlVgpuInstanceGetVmID + + global __nvmlVgpuInstanceGetUUID + data["__nvmlVgpuInstanceGetUUID"] = __nvmlVgpuInstanceGetUUID + + global __nvmlVgpuInstanceGetVmDriverVersion + data["__nvmlVgpuInstanceGetVmDriverVersion"] = __nvmlVgpuInstanceGetVmDriverVersion + + global __nvmlVgpuInstanceGetFbUsage + data["__nvmlVgpuInstanceGetFbUsage"] = __nvmlVgpuInstanceGetFbUsage + + global __nvmlVgpuInstanceGetLicenseStatus + data["__nvmlVgpuInstanceGetLicenseStatus"] = __nvmlVgpuInstanceGetLicenseStatus + + global __nvmlVgpuInstanceGetType + data["__nvmlVgpuInstanceGetType"] = __nvmlVgpuInstanceGetType + + global __nvmlVgpuInstanceGetFrameRateLimit + data["__nvmlVgpuInstanceGetFrameRateLimit"] = __nvmlVgpuInstanceGetFrameRateLimit + + global __nvmlVgpuInstanceGetEccMode + data["__nvmlVgpuInstanceGetEccMode"] = __nvmlVgpuInstanceGetEccMode + + global __nvmlVgpuInstanceGetEncoderCapacity + data["__nvmlVgpuInstanceGetEncoderCapacity"] = __nvmlVgpuInstanceGetEncoderCapacity + + global __nvmlVgpuInstanceSetEncoderCapacity + data["__nvmlVgpuInstanceSetEncoderCapacity"] = __nvmlVgpuInstanceSetEncoderCapacity + + global __nvmlVgpuInstanceGetEncoderStats + data["__nvmlVgpuInstanceGetEncoderStats"] = __nvmlVgpuInstanceGetEncoderStats + + global __nvmlVgpuInstanceGetEncoderSessions + data["__nvmlVgpuInstanceGetEncoderSessions"] = __nvmlVgpuInstanceGetEncoderSessions + + global __nvmlVgpuInstanceGetFBCStats + data["__nvmlVgpuInstanceGetFBCStats"] = __nvmlVgpuInstanceGetFBCStats + + global __nvmlVgpuInstanceGetFBCSessions + data["__nvmlVgpuInstanceGetFBCSessions"] = __nvmlVgpuInstanceGetFBCSessions + + global __nvmlVgpuInstanceGetGpuInstanceId + data["__nvmlVgpuInstanceGetGpuInstanceId"] = __nvmlVgpuInstanceGetGpuInstanceId + + global __nvmlVgpuInstanceGetGpuPciId + data["__nvmlVgpuInstanceGetGpuPciId"] = __nvmlVgpuInstanceGetGpuPciId + + global __nvmlVgpuTypeGetCapabilities + data["__nvmlVgpuTypeGetCapabilities"] = __nvmlVgpuTypeGetCapabilities + + global __nvmlVgpuInstanceGetMdevUUID + data["__nvmlVgpuInstanceGetMdevUUID"] = __nvmlVgpuInstanceGetMdevUUID + + global __nvmlGpuInstanceGetCreatableVgpus + data["__nvmlGpuInstanceGetCreatableVgpus"] = __nvmlGpuInstanceGetCreatableVgpus + + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + + global __nvmlGpuInstanceGetActiveVgpus + data["__nvmlGpuInstanceGetActiveVgpus"] = __nvmlGpuInstanceGetActiveVgpus + + global __nvmlGpuInstanceSetVgpuSchedulerState + data["__nvmlGpuInstanceSetVgpuSchedulerState"] = __nvmlGpuInstanceSetVgpuSchedulerState + + global __nvmlGpuInstanceGetVgpuSchedulerState + data["__nvmlGpuInstanceGetVgpuSchedulerState"] = __nvmlGpuInstanceGetVgpuSchedulerState + + global __nvmlGpuInstanceGetVgpuSchedulerLog + data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = __nvmlGpuInstanceGetVgpuSchedulerLog + + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = __nvmlGpuInstanceGetVgpuHeterogeneousMode + + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = __nvmlGpuInstanceSetVgpuHeterogeneousMode + + global __nvmlVgpuInstanceGetMetadata + data["__nvmlVgpuInstanceGetMetadata"] = __nvmlVgpuInstanceGetMetadata + + global __nvmlDeviceGetVgpuMetadata + data["__nvmlDeviceGetVgpuMetadata"] = __nvmlDeviceGetVgpuMetadata + + global __nvmlGetVgpuCompatibility + data["__nvmlGetVgpuCompatibility"] = __nvmlGetVgpuCompatibility + + global __nvmlDeviceGetPgpuMetadataString + data["__nvmlDeviceGetPgpuMetadataString"] = __nvmlDeviceGetPgpuMetadataString + + global __nvmlDeviceGetVgpuSchedulerLog + data["__nvmlDeviceGetVgpuSchedulerLog"] = __nvmlDeviceGetVgpuSchedulerLog + + global __nvmlDeviceGetVgpuSchedulerState + data["__nvmlDeviceGetVgpuSchedulerState"] = __nvmlDeviceGetVgpuSchedulerState + + global __nvmlDeviceGetVgpuSchedulerCapabilities + data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = __nvmlDeviceGetVgpuSchedulerCapabilities + + global __nvmlDeviceSetVgpuSchedulerState + data["__nvmlDeviceSetVgpuSchedulerState"] = __nvmlDeviceSetVgpuSchedulerState + + global __nvmlGetVgpuVersion + data["__nvmlGetVgpuVersion"] = __nvmlGetVgpuVersion + + global __nvmlSetVgpuVersion + data["__nvmlSetVgpuVersion"] = __nvmlSetVgpuVersion + + global __nvmlDeviceGetVgpuUtilization + data["__nvmlDeviceGetVgpuUtilization"] = __nvmlDeviceGetVgpuUtilization + + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = __nvmlDeviceGetVgpuInstancesUtilizationInfo + + global __nvmlDeviceGetVgpuProcessUtilization + data["__nvmlDeviceGetVgpuProcessUtilization"] = __nvmlDeviceGetVgpuProcessUtilization + + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = __nvmlDeviceGetVgpuProcessesUtilizationInfo + + global __nvmlVgpuInstanceGetAccountingMode + data["__nvmlVgpuInstanceGetAccountingMode"] = __nvmlVgpuInstanceGetAccountingMode + + global __nvmlVgpuInstanceGetAccountingPids + data["__nvmlVgpuInstanceGetAccountingPids"] = __nvmlVgpuInstanceGetAccountingPids + + global __nvmlVgpuInstanceGetAccountingStats + data["__nvmlVgpuInstanceGetAccountingStats"] = __nvmlVgpuInstanceGetAccountingStats + + global __nvmlVgpuInstanceClearAccountingPids + data["__nvmlVgpuInstanceClearAccountingPids"] = __nvmlVgpuInstanceClearAccountingPids + + global __nvmlVgpuInstanceGetLicenseInfo_v2 + data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = __nvmlVgpuInstanceGetLicenseInfo_v2 + + global __nvmlGetExcludedDeviceCount + data["__nvmlGetExcludedDeviceCount"] = __nvmlGetExcludedDeviceCount + + global __nvmlGetExcludedDeviceInfoByIndex + data["__nvmlGetExcludedDeviceInfoByIndex"] = __nvmlGetExcludedDeviceInfoByIndex + + global __nvmlDeviceSetMigMode + data["__nvmlDeviceSetMigMode"] = __nvmlDeviceSetMigMode + + global __nvmlDeviceGetMigMode + data["__nvmlDeviceGetMigMode"] = __nvmlDeviceGetMigMode + + global __nvmlDeviceGetGpuInstanceProfileInfoV + data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = __nvmlDeviceGetGpuInstanceProfileInfoV + + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + + global __nvmlDeviceGetGpuInstanceRemainingCapacity + data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = __nvmlDeviceGetGpuInstanceRemainingCapacity + + global __nvmlDeviceCreateGpuInstance + data["__nvmlDeviceCreateGpuInstance"] = __nvmlDeviceCreateGpuInstance + + global __nvmlDeviceCreateGpuInstanceWithPlacement + data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = __nvmlDeviceCreateGpuInstanceWithPlacement + + global __nvmlGpuInstanceDestroy + data["__nvmlGpuInstanceDestroy"] = __nvmlGpuInstanceDestroy + + global __nvmlDeviceGetGpuInstances + data["__nvmlDeviceGetGpuInstances"] = __nvmlDeviceGetGpuInstances + + global __nvmlDeviceGetGpuInstanceById + data["__nvmlDeviceGetGpuInstanceById"] = __nvmlDeviceGetGpuInstanceById + + global __nvmlGpuInstanceGetInfo + data["__nvmlGpuInstanceGetInfo"] = __nvmlGpuInstanceGetInfo + + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = __nvmlGpuInstanceGetComputeInstanceProfileInfoV + + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = __nvmlGpuInstanceGetComputeInstancePossiblePlacements + + global __nvmlGpuInstanceCreateComputeInstance + data["__nvmlGpuInstanceCreateComputeInstance"] = __nvmlGpuInstanceCreateComputeInstance + + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = __nvmlGpuInstanceCreateComputeInstanceWithPlacement + + global __nvmlComputeInstanceDestroy + data["__nvmlComputeInstanceDestroy"] = __nvmlComputeInstanceDestroy + + global __nvmlGpuInstanceGetComputeInstances + data["__nvmlGpuInstanceGetComputeInstances"] = __nvmlGpuInstanceGetComputeInstances + + global __nvmlGpuInstanceGetComputeInstanceById + data["__nvmlGpuInstanceGetComputeInstanceById"] = __nvmlGpuInstanceGetComputeInstanceById + + global __nvmlComputeInstanceGetInfo_v2 + data["__nvmlComputeInstanceGetInfo_v2"] = __nvmlComputeInstanceGetInfo_v2 + + global __nvmlDeviceIsMigDeviceHandle + data["__nvmlDeviceIsMigDeviceHandle"] = __nvmlDeviceIsMigDeviceHandle + + global __nvmlDeviceGetGpuInstanceId + data["__nvmlDeviceGetGpuInstanceId"] = __nvmlDeviceGetGpuInstanceId + + global __nvmlDeviceGetComputeInstanceId + data["__nvmlDeviceGetComputeInstanceId"] = __nvmlDeviceGetComputeInstanceId + + global __nvmlDeviceGetMaxMigDeviceCount + data["__nvmlDeviceGetMaxMigDeviceCount"] = __nvmlDeviceGetMaxMigDeviceCount + + global __nvmlDeviceGetMigDeviceHandleByIndex + data["__nvmlDeviceGetMigDeviceHandleByIndex"] = __nvmlDeviceGetMigDeviceHandleByIndex + + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + + global __nvmlDeviceGetCapabilities + data["__nvmlDeviceGetCapabilities"] = __nvmlDeviceGetCapabilities + + global __nvmlDevicePowerSmoothingActivatePresetProfile + data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = __nvmlDevicePowerSmoothingActivatePresetProfile + + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = __nvmlDevicePowerSmoothingUpdatePresetProfileParam + + global __nvmlDevicePowerSmoothingSetState + data["__nvmlDevicePowerSmoothingSetState"] = __nvmlDevicePowerSmoothingSetState + + global __nvmlDeviceGetAddressingMode + data["__nvmlDeviceGetAddressingMode"] = __nvmlDeviceGetAddressingMode + + global __nvmlDeviceGetRepairStatus + data["__nvmlDeviceGetRepairStatus"] = __nvmlDeviceGetRepairStatus + + global __nvmlDeviceGetPowerMizerMode_v1 + data["__nvmlDeviceGetPowerMizerMode_v1"] = __nvmlDeviceGetPowerMizerMode_v1 + + global __nvmlDeviceSetPowerMizerMode_v1 + data["__nvmlDeviceSetPowerMizerMode_v1"] = __nvmlDeviceSetPowerMizerMode_v1 + + global __nvmlDeviceGetPdi + data["__nvmlDeviceGetPdi"] = __nvmlDeviceGetPdi + + global __nvmlDeviceSetHostname_v1 + data["__nvmlDeviceSetHostname_v1"] = __nvmlDeviceSetHostname_v1 + + global __nvmlDeviceGetHostname_v1 + data["__nvmlDeviceGetHostname_v1"] = __nvmlDeviceGetHostname_v1 + + global __nvmlDeviceGetNvLinkInfo + data["__nvmlDeviceGetNvLinkInfo"] = __nvmlDeviceGetNvLinkInfo + + global __nvmlDeviceReadWritePRM_v1 + data["__nvmlDeviceReadWritePRM_v1"] = __nvmlDeviceReadWritePRM_v1 + + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = __nvmlDeviceGetGpuInstanceProfileInfoByIdV + + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = __nvmlDeviceGetUnrepairableMemoryFlag_v1 + + global __nvmlDeviceReadPRMCounters_v1 + data["__nvmlDeviceReadPRMCounters_v1"] = __nvmlDeviceReadPRMCounters_v1 + + 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 + + global __nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = __nvmlSystemGetCPER_v1 + + global __nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = __nvmlDeviceGetBBXTimeData_v1 + + global __nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = __nvmlDeviceGetAccountingStats_v2 + + global __nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = __nvmlDeviceGetRemappedRows_v2 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvml")._handle_uint + return handle + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvmlReturn_t _nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlInit_v2 + _check_or_init_nvml() + if __nvmlInit_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlInit_v2 is not found") + return (__nvmlInit_v2)( + ) + + +cdef nvmlReturn_t _nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlInitWithFlags + _check_or_init_nvml() + if __nvmlInitWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function nvmlInitWithFlags is not found") + return (__nvmlInitWithFlags)( + flags) + + +cdef nvmlReturn_t _nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlShutdown + _check_or_init_nvml() + if __nvmlShutdown == NULL: + with gil: + raise FunctionNotFoundError("function nvmlShutdown is not found") + return (__nvmlShutdown)( + ) + + +cdef const char* _nvmlErrorString(nvmlReturn_t result) except?NULL nogil: + global __nvmlErrorString + _check_or_init_nvml() + if __nvmlErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvmlErrorString is not found") + return (__nvmlErrorString)( + result) + + +cdef nvmlReturn_t _nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetDriverVersion + _check_or_init_nvml() + if __nvmlSystemGetDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetDriverVersion is not found") + return (__nvmlSystemGetDriverVersion)( + version, length) + + +cdef nvmlReturn_t _nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetNVMLVersion + _check_or_init_nvml() + if __nvmlSystemGetNVMLVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetNVMLVersion is not found") + return (__nvmlSystemGetNVMLVersion)( + version, length) + + +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCudaDriverVersion + _check_or_init_nvml() + if __nvmlSystemGetCudaDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion is not found") + return (__nvmlSystemGetCudaDriverVersion)( + cudaDriverVersion) + + +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCudaDriverVersion_v2 + _check_or_init_nvml() + if __nvmlSystemGetCudaDriverVersion_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion_v2 is not found") + return (__nvmlSystemGetCudaDriverVersion_v2)( + cudaDriverVersion) + + +cdef nvmlReturn_t _nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetProcessName + _check_or_init_nvml() + if __nvmlSystemGetProcessName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetProcessName is not found") + return (__nvmlSystemGetProcessName)( + pid, name, length) + + +cdef nvmlReturn_t _nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetHicVersion + _check_or_init_nvml() + if __nvmlSystemGetHicVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetHicVersion is not found") + return (__nvmlSystemGetHicVersion)( + hwbcCount, hwbcEntries) + + +cdef nvmlReturn_t _nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetTopologyGpuSet + _check_or_init_nvml() + if __nvmlSystemGetTopologyGpuSet == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetTopologyGpuSet is not found") + return (__nvmlSystemGetTopologyGpuSet)( + cpuNumber, count, deviceArray) + + +cdef nvmlReturn_t _nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetDriverBranch + _check_or_init_nvml() + if __nvmlSystemGetDriverBranch == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetDriverBranch is not found") + return (__nvmlSystemGetDriverBranch)( + branchInfo, length) + + +cdef nvmlReturn_t _nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetCount + _check_or_init_nvml() + if __nvmlUnitGetCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetCount is not found") + return (__nvmlUnitGetCount)( + unitCount) + + +cdef nvmlReturn_t _nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetHandleByIndex + _check_or_init_nvml() + if __nvmlUnitGetHandleByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetHandleByIndex is not found") + return (__nvmlUnitGetHandleByIndex)( + index, unit) + + +cdef nvmlReturn_t _nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetUnitInfo + _check_or_init_nvml() + if __nvmlUnitGetUnitInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetUnitInfo is not found") + return (__nvmlUnitGetUnitInfo)( + unit, info) + + +cdef nvmlReturn_t _nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetLedState + _check_or_init_nvml() + if __nvmlUnitGetLedState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetLedState is not found") + return (__nvmlUnitGetLedState)( + unit, state) + + +cdef nvmlReturn_t _nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetPsuInfo + _check_or_init_nvml() + if __nvmlUnitGetPsuInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetPsuInfo is not found") + return (__nvmlUnitGetPsuInfo)( + unit, psu) + + +cdef nvmlReturn_t _nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetTemperature + _check_or_init_nvml() + if __nvmlUnitGetTemperature == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetTemperature is not found") + return (__nvmlUnitGetTemperature)( + unit, type, temp) + + +cdef nvmlReturn_t _nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetFanSpeedInfo + _check_or_init_nvml() + if __nvmlUnitGetFanSpeedInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetFanSpeedInfo is not found") + return (__nvmlUnitGetFanSpeedInfo)( + unit, fanSpeeds) + + +cdef nvmlReturn_t _nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetDevices + _check_or_init_nvml() + if __nvmlUnitGetDevices == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetDevices is not found") + return (__nvmlUnitGetDevices)( + unit, deviceCount, devices) + + +cdef nvmlReturn_t _nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCount_v2 + _check_or_init_nvml() + if __nvmlDeviceGetCount_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCount_v2 is not found") + return (__nvmlDeviceGetCount_v2)( + deviceCount) + + +cdef nvmlReturn_t _nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAttributes_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAttributes_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAttributes_v2 is not found") + return (__nvmlDeviceGetAttributes_v2)( + device, attributes) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByIndex_v2 + _check_or_init_nvml() + if __nvmlDeviceGetHandleByIndex_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByIndex_v2 is not found") + return (__nvmlDeviceGetHandleByIndex_v2)( + index, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleBySerial + _check_or_init_nvml() + if __nvmlDeviceGetHandleBySerial == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleBySerial is not found") + return (__nvmlDeviceGetHandleBySerial)( + serial, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByUUID + _check_or_init_nvml() + if __nvmlDeviceGetHandleByUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUID is not found") + return (__nvmlDeviceGetHandleByUUID)( + uuid, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByUUIDV + _check_or_init_nvml() + if __nvmlDeviceGetHandleByUUIDV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUIDV is not found") + return (__nvmlDeviceGetHandleByUUIDV)( + uuid, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByPciBusId_v2 + _check_or_init_nvml() + if __nvmlDeviceGetHandleByPciBusId_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByPciBusId_v2 is not found") + return (__nvmlDeviceGetHandleByPciBusId_v2)( + pciBusId, device) + + +cdef nvmlReturn_t _nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetName + _check_or_init_nvml() + if __nvmlDeviceGetName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetName is not found") + return (__nvmlDeviceGetName)( + device, name, length) + + +cdef nvmlReturn_t _nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBrand + _check_or_init_nvml() + if __nvmlDeviceGetBrand == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBrand is not found") + return (__nvmlDeviceGetBrand)( + device, type) + + +cdef nvmlReturn_t _nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetIndex + _check_or_init_nvml() + if __nvmlDeviceGetIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetIndex is not found") + return (__nvmlDeviceGetIndex)( + device, index) + + +cdef nvmlReturn_t _nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSerial + _check_or_init_nvml() + if __nvmlDeviceGetSerial == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSerial is not found") + return (__nvmlDeviceGetSerial)( + device, serial, length) + + +cdef nvmlReturn_t _nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetModuleId + _check_or_init_nvml() + if __nvmlDeviceGetModuleId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetModuleId is not found") + return (__nvmlDeviceGetModuleId)( + device, moduleId) + + +cdef nvmlReturn_t _nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetC2cModeInfoV + _check_or_init_nvml() + if __nvmlDeviceGetC2cModeInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetC2cModeInfoV is not found") + return (__nvmlDeviceGetC2cModeInfoV)( + device, c2cModeInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryAffinity + _check_or_init_nvml() + if __nvmlDeviceGetMemoryAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryAffinity is not found") + return (__nvmlDeviceGetMemoryAffinity)( + device, nodeSetSize, nodeSet, scope) + + +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCpuAffinityWithinScope + _check_or_init_nvml() + if __nvmlDeviceGetCpuAffinityWithinScope == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinityWithinScope is not found") + return (__nvmlDeviceGetCpuAffinityWithinScope)( + device, cpuSetSize, cpuSet, scope) + + +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceGetCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinity is not found") + return (__nvmlDeviceGetCpuAffinity)( + device, cpuSetSize, cpuSet) + + +cdef nvmlReturn_t _nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceSetCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetCpuAffinity is not found") + return (__nvmlDeviceSetCpuAffinity)( + device) + + +cdef nvmlReturn_t _nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceClearCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearCpuAffinity is not found") + return (__nvmlDeviceClearCpuAffinity)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumaNodeId + _check_or_init_nvml() + if __nvmlDeviceGetNumaNodeId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumaNodeId is not found") + return (__nvmlDeviceGetNumaNodeId)( + device, node) + + +cdef nvmlReturn_t _nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTopologyCommonAncestor + _check_or_init_nvml() + if __nvmlDeviceGetTopologyCommonAncestor == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTopologyCommonAncestor is not found") + return (__nvmlDeviceGetTopologyCommonAncestor)( + device1, device2, pathInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTopologyNearestGpus + _check_or_init_nvml() + if __nvmlDeviceGetTopologyNearestGpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTopologyNearestGpus is not found") + return (__nvmlDeviceGetTopologyNearestGpus)( + device, level, count, deviceArray) + + +cdef nvmlReturn_t _nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetP2PStatus + _check_or_init_nvml() + if __nvmlDeviceGetP2PStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetP2PStatus is not found") + return (__nvmlDeviceGetP2PStatus)( + device1, device2, p2pIndex, p2pStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUUID + _check_or_init_nvml() + if __nvmlDeviceGetUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUUID is not found") + return (__nvmlDeviceGetUUID)( + device, uuid, length) + + +cdef nvmlReturn_t _nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinorNumber + _check_or_init_nvml() + if __nvmlDeviceGetMinorNumber == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinorNumber is not found") + return (__nvmlDeviceGetMinorNumber)( + device, minorNumber) + + +cdef nvmlReturn_t _nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBoardPartNumber + _check_or_init_nvml() + if __nvmlDeviceGetBoardPartNumber == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBoardPartNumber is not found") + return (__nvmlDeviceGetBoardPartNumber)( + device, partNumber, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomVersion + _check_or_init_nvml() + if __nvmlDeviceGetInforomVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomVersion is not found") + return (__nvmlDeviceGetInforomVersion)( + device, object, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomImageVersion + _check_or_init_nvml() + if __nvmlDeviceGetInforomImageVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomImageVersion is not found") + return (__nvmlDeviceGetInforomImageVersion)( + device, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomConfigurationChecksum + _check_or_init_nvml() + if __nvmlDeviceGetInforomConfigurationChecksum == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomConfigurationChecksum is not found") + return (__nvmlDeviceGetInforomConfigurationChecksum)( + device, checksum) + + +cdef nvmlReturn_t _nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceValidateInforom + _check_or_init_nvml() + if __nvmlDeviceValidateInforom == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceValidateInforom is not found") + return (__nvmlDeviceValidateInforom)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetLastBBXFlushTime + _check_or_init_nvml() + if __nvmlDeviceGetLastBBXFlushTime == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetLastBBXFlushTime is not found") + return (__nvmlDeviceGetLastBBXFlushTime)( + device, timestamp, durationUs) + + +cdef nvmlReturn_t _nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDisplayMode + _check_or_init_nvml() + if __nvmlDeviceGetDisplayMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDisplayMode is not found") + return (__nvmlDeviceGetDisplayMode)( + device, display) + + +cdef nvmlReturn_t _nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDisplayActive + _check_or_init_nvml() + if __nvmlDeviceGetDisplayActive == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDisplayActive is not found") + return (__nvmlDeviceGetDisplayActive)( + device, isActive) + + +cdef nvmlReturn_t _nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPersistenceMode + _check_or_init_nvml() + if __nvmlDeviceGetPersistenceMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPersistenceMode is not found") + return (__nvmlDeviceGetPersistenceMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPciInfoExt + _check_or_init_nvml() + if __nvmlDeviceGetPciInfoExt == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPciInfoExt is not found") + return (__nvmlDeviceGetPciInfoExt)( + device, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPciInfo_v3 + _check_or_init_nvml() + if __nvmlDeviceGetPciInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPciInfo_v3 is not found") + return (__nvmlDeviceGetPciInfo_v3)( + device, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetMaxPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkGeneration is not found") + return (__nvmlDeviceGetMaxPcieLinkGeneration)( + device, maxLinkGen) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuMaxPcieLinkGeneration is not found") + return (__nvmlDeviceGetGpuMaxPcieLinkGeneration)( + device, maxLinkGenDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxPcieLinkWidth + _check_or_init_nvml() + if __nvmlDeviceGetMaxPcieLinkWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkWidth is not found") + return (__nvmlDeviceGetMaxPcieLinkWidth)( + device, maxLinkWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetCurrPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkGeneration is not found") + return (__nvmlDeviceGetCurrPcieLinkGeneration)( + device, currLinkGen) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrPcieLinkWidth + _check_or_init_nvml() + if __nvmlDeviceGetCurrPcieLinkWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkWidth is not found") + return (__nvmlDeviceGetCurrPcieLinkWidth)( + device, currLinkWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieThroughput + _check_or_init_nvml() + if __nvmlDeviceGetPcieThroughput == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieThroughput is not found") + return (__nvmlDeviceGetPcieThroughput)( + device, counter, value) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieReplayCounter + _check_or_init_nvml() + if __nvmlDeviceGetPcieReplayCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieReplayCounter is not found") + return (__nvmlDeviceGetPcieReplayCounter)( + device, value) + + +cdef nvmlReturn_t _nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClockInfo + _check_or_init_nvml() + if __nvmlDeviceGetClockInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClockInfo is not found") + return (__nvmlDeviceGetClockInfo)( + device, type, clock) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxClockInfo + _check_or_init_nvml() + if __nvmlDeviceGetMaxClockInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxClockInfo is not found") + return (__nvmlDeviceGetMaxClockInfo)( + device, type, clock) + + +cdef nvmlReturn_t _nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpcClkVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetGpcClkVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpcClkVfOffset is not found") + return (__nvmlDeviceGetGpcClkVfOffset)( + device, offset) + + +cdef nvmlReturn_t _nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClock + _check_or_init_nvml() + if __nvmlDeviceGetClock == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClock is not found") + return (__nvmlDeviceGetClock)( + device, clockType, clockId, clockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxCustomerBoostClock + _check_or_init_nvml() + if __nvmlDeviceGetMaxCustomerBoostClock == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxCustomerBoostClock is not found") + return (__nvmlDeviceGetMaxCustomerBoostClock)( + device, clockType, clockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedMemoryClocks + _check_or_init_nvml() + if __nvmlDeviceGetSupportedMemoryClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedMemoryClocks is not found") + return (__nvmlDeviceGetSupportedMemoryClocks)( + device, count, clocksMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedGraphicsClocks + _check_or_init_nvml() + if __nvmlDeviceGetSupportedGraphicsClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedGraphicsClocks is not found") + return (__nvmlDeviceGetSupportedGraphicsClocks)( + device, memoryClockMHz, count, clocksMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceGetAutoBoostedClocksEnabled)( + device, isEnabled, defaultIsEnabled) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed is not found") + return (__nvmlDeviceGetFanSpeed)( + device, speed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed_v2 is not found") + return (__nvmlDeviceGetFanSpeed_v2)( + device, fan, speed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeedRPM + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeedRPM == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeedRPM is not found") + return (__nvmlDeviceGetFanSpeedRPM)( + device, fanSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTargetFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetTargetFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTargetFanSpeed is not found") + return (__nvmlDeviceGetTargetFanSpeed)( + device, fan, targetSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinMaxFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetMinMaxFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinMaxFanSpeed is not found") + return (__nvmlDeviceGetMinMaxFanSpeed)( + device, minSpeed, maxSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanControlPolicy_v2 + _check_or_init_nvml() + if __nvmlDeviceGetFanControlPolicy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanControlPolicy_v2 is not found") + return (__nvmlDeviceGetFanControlPolicy_v2)( + device, fan, policy) + + +cdef nvmlReturn_t _nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumFans + _check_or_init_nvml() + if __nvmlDeviceGetNumFans == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumFans is not found") + return (__nvmlDeviceGetNumFans)( + device, numFans) + + +cdef nvmlReturn_t _nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCoolerInfo + _check_or_init_nvml() + if __nvmlDeviceGetCoolerInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCoolerInfo is not found") + return (__nvmlDeviceGetCoolerInfo)( + device, coolerInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTemperatureV + _check_or_init_nvml() + if __nvmlDeviceGetTemperatureV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTemperatureV is not found") + return (__nvmlDeviceGetTemperatureV)( + device, temperature) + + +cdef nvmlReturn_t _nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTemperatureThreshold + _check_or_init_nvml() + if __nvmlDeviceGetTemperatureThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTemperatureThreshold is not found") + return (__nvmlDeviceGetTemperatureThreshold)( + device, thresholdType, temp) + + +cdef nvmlReturn_t _nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMarginTemperature + _check_or_init_nvml() + if __nvmlDeviceGetMarginTemperature == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMarginTemperature is not found") + return (__nvmlDeviceGetMarginTemperature)( + device, marginTempInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetThermalSettings + _check_or_init_nvml() + if __nvmlDeviceGetThermalSettings == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetThermalSettings is not found") + return (__nvmlDeviceGetThermalSettings)( + device, sensorIndex, pThermalSettings) + + +cdef nvmlReturn_t _nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPerformanceState + _check_or_init_nvml() + if __nvmlDeviceGetPerformanceState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPerformanceState is not found") + return (__nvmlDeviceGetPerformanceState)( + device, pState) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrentClocksEventReasons + _check_or_init_nvml() + if __nvmlDeviceGetCurrentClocksEventReasons == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrentClocksEventReasons is not found") + return (__nvmlDeviceGetCurrentClocksEventReasons)( + device, clocksEventReasons) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedClocksEventReasons + _check_or_init_nvml() + if __nvmlDeviceGetSupportedClocksEventReasons == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedClocksEventReasons is not found") + return (__nvmlDeviceGetSupportedClocksEventReasons)( + device, supportedClocksEventReasons) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerState + _check_or_init_nvml() + if __nvmlDeviceGetPowerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerState is not found") + return (__nvmlDeviceGetPowerState)( + device, pState) + + +cdef nvmlReturn_t _nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDynamicPstatesInfo + _check_or_init_nvml() + if __nvmlDeviceGetDynamicPstatesInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDynamicPstatesInfo is not found") + return (__nvmlDeviceGetDynamicPstatesInfo)( + device, pDynamicPstatesInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemClkVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetMemClkVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemClkVfOffset is not found") + return (__nvmlDeviceGetMemClkVfOffset)( + device, offset) + + +cdef nvmlReturn_t _nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinMaxClockOfPState + _check_or_init_nvml() + if __nvmlDeviceGetMinMaxClockOfPState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinMaxClockOfPState is not found") + return (__nvmlDeviceGetMinMaxClockOfPState)( + device, type, pstate, minClockMHz, maxClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedPerformanceStates + _check_or_init_nvml() + if __nvmlDeviceGetSupportedPerformanceStates == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedPerformanceStates is not found") + return (__nvmlDeviceGetSupportedPerformanceStates)( + device, pstates, size) + + +cdef nvmlReturn_t _nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpcClkMinMaxVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetGpcClkMinMaxVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpcClkMinMaxVfOffset is not found") + return (__nvmlDeviceGetGpcClkMinMaxVfOffset)( + device, minOffset, maxOffset) + + +cdef nvmlReturn_t _nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemClkMinMaxVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetMemClkMinMaxVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemClkMinMaxVfOffset is not found") + return (__nvmlDeviceGetMemClkMinMaxVfOffset)( + device, minOffset, maxOffset) + + +cdef nvmlReturn_t _nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClockOffsets + _check_or_init_nvml() + if __nvmlDeviceGetClockOffsets == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClockOffsets is not found") + return (__nvmlDeviceGetClockOffsets)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetClockOffsets + _check_or_init_nvml() + if __nvmlDeviceSetClockOffsets == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetClockOffsets is not found") + return (__nvmlDeviceSetClockOffsets)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPerformanceModes + _check_or_init_nvml() + if __nvmlDeviceGetPerformanceModes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPerformanceModes is not found") + return (__nvmlDeviceGetPerformanceModes)( + device, perfModes) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrentClockFreqs + _check_or_init_nvml() + if __nvmlDeviceGetCurrentClockFreqs == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrentClockFreqs is not found") + return (__nvmlDeviceGetCurrentClockFreqs)( + device, currentClockFreqs) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementLimit + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimit is not found") + return (__nvmlDeviceGetPowerManagementLimit)( + device, limit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementLimitConstraints + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementLimitConstraints == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimitConstraints is not found") + return (__nvmlDeviceGetPowerManagementLimitConstraints)( + device, minLimit, maxLimit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementDefaultLimit + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementDefaultLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementDefaultLimit is not found") + return (__nvmlDeviceGetPowerManagementDefaultLimit)( + device, defaultLimit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerUsage + _check_or_init_nvml() + if __nvmlDeviceGetPowerUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerUsage is not found") + return (__nvmlDeviceGetPowerUsage)( + device, power) + + +cdef nvmlReturn_t _nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTotalEnergyConsumption + _check_or_init_nvml() + if __nvmlDeviceGetTotalEnergyConsumption == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTotalEnergyConsumption is not found") + return (__nvmlDeviceGetTotalEnergyConsumption)( + device, energy) + + +cdef nvmlReturn_t _nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEnforcedPowerLimit + _check_or_init_nvml() + if __nvmlDeviceGetEnforcedPowerLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEnforcedPowerLimit is not found") + return (__nvmlDeviceGetEnforcedPowerLimit)( + device, limit) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuOperationMode + _check_or_init_nvml() + if __nvmlDeviceGetGpuOperationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuOperationMode is not found") + return (__nvmlDeviceGetGpuOperationMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryInfo_v2 + _check_or_init_nvml() + if __nvmlDeviceGetMemoryInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryInfo_v2 is not found") + return (__nvmlDeviceGetMemoryInfo_v2)( + device, memory) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeMode + _check_or_init_nvml() + if __nvmlDeviceGetComputeMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeMode is not found") + return (__nvmlDeviceGetComputeMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCudaComputeCapability + _check_or_init_nvml() + if __nvmlDeviceGetCudaComputeCapability == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCudaComputeCapability is not found") + return (__nvmlDeviceGetCudaComputeCapability)( + device, major, minor) + + +cdef nvmlReturn_t _nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDramEncryptionMode + _check_or_init_nvml() + if __nvmlDeviceGetDramEncryptionMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDramEncryptionMode is not found") + return (__nvmlDeviceGetDramEncryptionMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDramEncryptionMode + _check_or_init_nvml() + if __nvmlDeviceSetDramEncryptionMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDramEncryptionMode is not found") + return (__nvmlDeviceSetDramEncryptionMode)( + device, dramEncryption) + + +cdef nvmlReturn_t _nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEccMode + _check_or_init_nvml() + if __nvmlDeviceGetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEccMode is not found") + return (__nvmlDeviceGetEccMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDefaultEccMode + _check_or_init_nvml() + if __nvmlDeviceGetDefaultEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDefaultEccMode is not found") + return (__nvmlDeviceGetDefaultEccMode)( + device, defaultMode) + + +cdef nvmlReturn_t _nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBoardId + _check_or_init_nvml() + if __nvmlDeviceGetBoardId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBoardId is not found") + return (__nvmlDeviceGetBoardId)( + device, boardId) + + +cdef nvmlReturn_t _nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMultiGpuBoard + _check_or_init_nvml() + if __nvmlDeviceGetMultiGpuBoard == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMultiGpuBoard is not found") + return (__nvmlDeviceGetMultiGpuBoard)( + device, multiGpuBool) + + +cdef nvmlReturn_t _nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTotalEccErrors + _check_or_init_nvml() + if __nvmlDeviceGetTotalEccErrors == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTotalEccErrors is not found") + return (__nvmlDeviceGetTotalEccErrors)( + device, errorType, counterType, eccCounts) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryErrorCounter + _check_or_init_nvml() + if __nvmlDeviceGetMemoryErrorCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryErrorCounter is not found") + return (__nvmlDeviceGetMemoryErrorCounter)( + device, errorType, counterType, locationType, count) + + +cdef nvmlReturn_t _nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUtilizationRates + _check_or_init_nvml() + if __nvmlDeviceGetUtilizationRates == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUtilizationRates is not found") + return (__nvmlDeviceGetUtilizationRates)( + device, utilization) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderUtilization + _check_or_init_nvml() + if __nvmlDeviceGetEncoderUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderUtilization is not found") + return (__nvmlDeviceGetEncoderUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderCapacity + _check_or_init_nvml() + if __nvmlDeviceGetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderCapacity is not found") + return (__nvmlDeviceGetEncoderCapacity)( + device, encoderQueryType, encoderCapacity) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderStats + _check_or_init_nvml() + if __nvmlDeviceGetEncoderStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderStats is not found") + return (__nvmlDeviceGetEncoderStats)( + device, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderSessions + _check_or_init_nvml() + if __nvmlDeviceGetEncoderSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderSessions is not found") + return (__nvmlDeviceGetEncoderSessions)( + device, sessionCount, sessionInfos) + + +cdef nvmlReturn_t _nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDecoderUtilization + _check_or_init_nvml() + if __nvmlDeviceGetDecoderUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDecoderUtilization is not found") + return (__nvmlDeviceGetDecoderUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetJpgUtilization + _check_or_init_nvml() + if __nvmlDeviceGetJpgUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetJpgUtilization is not found") + return (__nvmlDeviceGetJpgUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetOfaUtilization + _check_or_init_nvml() + if __nvmlDeviceGetOfaUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetOfaUtilization is not found") + return (__nvmlDeviceGetOfaUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFBCStats + _check_or_init_nvml() + if __nvmlDeviceGetFBCStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFBCStats is not found") + return (__nvmlDeviceGetFBCStats)( + device, fbcStats) + + +cdef nvmlReturn_t _nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFBCSessions + _check_or_init_nvml() + if __nvmlDeviceGetFBCSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFBCSessions is not found") + return (__nvmlDeviceGetFBCSessions)( + device, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDriverModel_v2 + _check_or_init_nvml() + if __nvmlDeviceGetDriverModel_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDriverModel_v2 is not found") + return (__nvmlDeviceGetDriverModel_v2)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVbiosVersion + _check_or_init_nvml() + if __nvmlDeviceGetVbiosVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVbiosVersion is not found") + return (__nvmlDeviceGetVbiosVersion)( + device, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBridgeChipInfo + _check_or_init_nvml() + if __nvmlDeviceGetBridgeChipInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBridgeChipInfo is not found") + return (__nvmlDeviceGetBridgeChipInfo)( + device, bridgeHierarchy) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetComputeRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeRunningProcesses_v3 is not found") + return (__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: + 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() + if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMPSComputeRunningProcesses_v3 is not found") + return (__nvmlDeviceGetMPSComputeRunningProcesses_v3)( + device, infoCount, infos) + + +cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRunningProcessDetailList + _check_or_init_nvml() + if __nvmlDeviceGetRunningProcessDetailList == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRunningProcessDetailList is not found") + return (__nvmlDeviceGetRunningProcessDetailList)( + device, plist) + + +cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceOnSameBoard + _check_or_init_nvml() + if __nvmlDeviceOnSameBoard == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceOnSameBoard is not found") + return (__nvmlDeviceOnSameBoard)( + device1, device2, onSameBoard) + + +cdef nvmlReturn_t _nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAPIRestriction + _check_or_init_nvml() + if __nvmlDeviceGetAPIRestriction == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAPIRestriction is not found") + return (__nvmlDeviceGetAPIRestriction)( + device, apiType, isRestricted) + + +cdef nvmlReturn_t _nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSamples + _check_or_init_nvml() + if __nvmlDeviceGetSamples == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSamples is not found") + return (__nvmlDeviceGetSamples)( + device, type, lastSeenTimeStamp, sampleValType, sampleCount, samples) + + +cdef nvmlReturn_t _nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBAR1MemoryInfo + _check_or_init_nvml() + if __nvmlDeviceGetBAR1MemoryInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBAR1MemoryInfo is not found") + return (__nvmlDeviceGetBAR1MemoryInfo)( + device, bar1Memory) + + +cdef nvmlReturn_t _nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetIrqNum + _check_or_init_nvml() + if __nvmlDeviceGetIrqNum == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetIrqNum is not found") + return (__nvmlDeviceGetIrqNum)( + device, irqNum) + + +cdef nvmlReturn_t _nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumGpuCores + _check_or_init_nvml() + if __nvmlDeviceGetNumGpuCores == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumGpuCores is not found") + return (__nvmlDeviceGetNumGpuCores)( + device, numCores) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerSource + _check_or_init_nvml() + if __nvmlDeviceGetPowerSource == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerSource is not found") + return (__nvmlDeviceGetPowerSource)( + device, powerSource) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryBusWidth + _check_or_init_nvml() + if __nvmlDeviceGetMemoryBusWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryBusWidth is not found") + return (__nvmlDeviceGetMemoryBusWidth)( + device, busWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieLinkMaxSpeed + _check_or_init_nvml() + if __nvmlDeviceGetPcieLinkMaxSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieLinkMaxSpeed is not found") + return (__nvmlDeviceGetPcieLinkMaxSpeed)( + device, maxSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieSpeed + _check_or_init_nvml() + if __nvmlDeviceGetPcieSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieSpeed is not found") + return (__nvmlDeviceGetPcieSpeed)( + device, pcieSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAdaptiveClockInfoStatus + _check_or_init_nvml() + if __nvmlDeviceGetAdaptiveClockInfoStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAdaptiveClockInfoStatus is not found") + return (__nvmlDeviceGetAdaptiveClockInfoStatus)( + device, adaptiveClockStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBusType + _check_or_init_nvml() + if __nvmlDeviceGetBusType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBusType is not found") + return (__nvmlDeviceGetBusType)( + device, type) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuFabricInfoV + _check_or_init_nvml() + if __nvmlDeviceGetGpuFabricInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuFabricInfoV is not found") + return (__nvmlDeviceGetGpuFabricInfoV)( + device, gpuFabricInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeCapabilities + _check_or_init_nvml() + if __nvmlSystemGetConfComputeCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeCapabilities is not found") + return (__nvmlSystemGetConfComputeCapabilities)( + capabilities) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeState + _check_or_init_nvml() + if __nvmlSystemGetConfComputeState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeState is not found") + return (__nvmlSystemGetConfComputeState)( + state) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeMemSizeInfo + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeMemSizeInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeMemSizeInfo is not found") + return (__nvmlDeviceGetConfComputeMemSizeInfo)( + device, memInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeGpusReadyState + _check_or_init_nvml() + if __nvmlSystemGetConfComputeGpusReadyState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeGpusReadyState is not found") + return (__nvmlSystemGetConfComputeGpusReadyState)( + isAcceptingWork) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeProtectedMemoryUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeProtectedMemoryUsage is not found") + return (__nvmlDeviceGetConfComputeProtectedMemoryUsage)( + device, memory) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeGpuCertificate + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeGpuCertificate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuCertificate is not found") + return (__nvmlDeviceGetConfComputeGpuCertificate)( + device, gpuCert) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeGpuAttestationReport + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeGpuAttestationReport == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuAttestationReport is not found") + return (__nvmlDeviceGetConfComputeGpuAttestationReport)( + device, gpuAtstReport) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + _check_or_init_nvml() + if __nvmlSystemGetConfComputeKeyRotationThresholdInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeKeyRotationThresholdInfo is not found") + return (__nvmlSystemGetConfComputeKeyRotationThresholdInfo)( + pKeyRotationThrInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetConfComputeUnprotectedMemSize + _check_or_init_nvml() + if __nvmlDeviceSetConfComputeUnprotectedMemSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetConfComputeUnprotectedMemSize is not found") + return (__nvmlDeviceSetConfComputeUnprotectedMemSize)( + device, sizeKiB) + + +cdef nvmlReturn_t _nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetConfComputeGpusReadyState + _check_or_init_nvml() + if __nvmlSystemSetConfComputeGpusReadyState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetConfComputeGpusReadyState is not found") + return (__nvmlSystemSetConfComputeGpusReadyState)( + isAcceptingWork) + + +cdef nvmlReturn_t _nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + _check_or_init_nvml() + if __nvmlSystemSetConfComputeKeyRotationThresholdInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetConfComputeKeyRotationThresholdInfo is not found") + return (__nvmlSystemSetConfComputeKeyRotationThresholdInfo)( + pKeyRotationThrInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeSettings + _check_or_init_nvml() + if __nvmlSystemGetConfComputeSettings == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeSettings is not found") + return (__nvmlSystemGetConfComputeSettings)( + settings) + + +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGspFirmwareVersion + _check_or_init_nvml() + if __nvmlDeviceGetGspFirmwareVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareVersion is not found") + return (__nvmlDeviceGetGspFirmwareVersion)( + device, version) + + +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGspFirmwareMode + _check_or_init_nvml() + if __nvmlDeviceGetGspFirmwareMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareMode is not found") + return (__nvmlDeviceGetGspFirmwareMode)( + device, isEnabled, defaultMode) + + +cdef nvmlReturn_t _nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSramEccErrorStatus + _check_or_init_nvml() + if __nvmlDeviceGetSramEccErrorStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSramEccErrorStatus is not found") + return (__nvmlDeviceGetSramEccErrorStatus)( + device, status) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingMode + _check_or_init_nvml() + if __nvmlDeviceGetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingMode is not found") + return (__nvmlDeviceGetAccountingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats is not found") + return (__nvmlDeviceGetAccountingStats)( + device, pid, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingPids + _check_or_init_nvml() + if __nvmlDeviceGetAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingPids is not found") + return (__nvmlDeviceGetAccountingPids)( + device, count, pids) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingBufferSize + _check_or_init_nvml() + if __nvmlDeviceGetAccountingBufferSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingBufferSize is not found") + return (__nvmlDeviceGetAccountingBufferSize)( + device, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPages + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPages == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages is not found") + return (__nvmlDeviceGetRetiredPages)( + device, cause, pageCount, addresses) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPages_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPages_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages_v2 is not found") + return (__nvmlDeviceGetRetiredPages_v2)( + device, cause, pageCount, addresses, timestamps) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPagesPendingStatus + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPagesPendingStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPagesPendingStatus is not found") + return (__nvmlDeviceGetRetiredPagesPendingStatus)( + device, isPending) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows is not found") + return (__nvmlDeviceGetRemappedRows)( + device, corrRows, uncRows, isPending, failureOccurred) + + +cdef nvmlReturn_t _nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRowRemapperHistogram + _check_or_init_nvml() + if __nvmlDeviceGetRowRemapperHistogram == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRowRemapperHistogram is not found") + return (__nvmlDeviceGetRowRemapperHistogram)( + device, values) + + +cdef nvmlReturn_t _nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetArchitecture + _check_or_init_nvml() + if __nvmlDeviceGetArchitecture == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetArchitecture is not found") + return (__nvmlDeviceGetArchitecture)( + device, arch) + + +cdef nvmlReturn_t _nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClkMonStatus + _check_or_init_nvml() + if __nvmlDeviceGetClkMonStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClkMonStatus is not found") + return (__nvmlDeviceGetClkMonStatus)( + device, status) + + +cdef nvmlReturn_t _nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetProcessUtilization + _check_or_init_nvml() + if __nvmlDeviceGetProcessUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetProcessUtilization is not found") + return (__nvmlDeviceGetProcessUtilization)( + device, utilization, processSamplesCount, lastSeenTimeStamp) + + +cdef nvmlReturn_t _nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetProcessesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetProcessesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetProcessesUtilizationInfo is not found") + return (__nvmlDeviceGetProcessesUtilizationInfo)( + device, procesesUtilInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPlatformInfo + _check_or_init_nvml() + if __nvmlDeviceGetPlatformInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPlatformInfo is not found") + return (__nvmlDeviceGetPlatformInfo)( + device, platformInfo) + + +cdef nvmlReturn_t _nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitSetLedState + _check_or_init_nvml() + if __nvmlUnitSetLedState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitSetLedState is not found") + return (__nvmlUnitSetLedState)( + unit, color) + + +cdef nvmlReturn_t _nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPersistenceMode + _check_or_init_nvml() + if __nvmlDeviceSetPersistenceMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPersistenceMode is not found") + return (__nvmlDeviceSetPersistenceMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetComputeMode + _check_or_init_nvml() + if __nvmlDeviceSetComputeMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetComputeMode is not found") + return (__nvmlDeviceSetComputeMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetEccMode + _check_or_init_nvml() + if __nvmlDeviceSetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetEccMode is not found") + return (__nvmlDeviceSetEccMode)( + device, ecc) + + +cdef nvmlReturn_t _nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearEccErrorCounts + _check_or_init_nvml() + if __nvmlDeviceClearEccErrorCounts == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearEccErrorCounts is not found") + return (__nvmlDeviceClearEccErrorCounts)( + device, counterType) + + +cdef nvmlReturn_t _nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDriverModel + _check_or_init_nvml() + if __nvmlDeviceSetDriverModel == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDriverModel is not found") + return (__nvmlDeviceSetDriverModel)( + device, driverModel, flags) + + +cdef nvmlReturn_t _nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetGpuLockedClocks + _check_or_init_nvml() + if __nvmlDeviceSetGpuLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetGpuLockedClocks is not found") + return (__nvmlDeviceSetGpuLockedClocks)( + device, minGpuClockMHz, maxGpuClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetGpuLockedClocks + _check_or_init_nvml() + if __nvmlDeviceResetGpuLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetGpuLockedClocks is not found") + return (__nvmlDeviceResetGpuLockedClocks)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMemoryLockedClocks + _check_or_init_nvml() + if __nvmlDeviceSetMemoryLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMemoryLockedClocks is not found") + return (__nvmlDeviceSetMemoryLockedClocks)( + device, minMemClockMHz, maxMemClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetMemoryLockedClocks + _check_or_init_nvml() + if __nvmlDeviceResetMemoryLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetMemoryLockedClocks is not found") + return (__nvmlDeviceResetMemoryLockedClocks)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceSetAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceSetAutoBoostedClocksEnabled)( + device, enabled) + + +cdef nvmlReturn_t _nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceSetDefaultAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDefaultAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceSetDefaultAutoBoostedClocksEnabled)( + device, enabled, flags) + + +cdef nvmlReturn_t _nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDefaultFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceSetDefaultFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDefaultFanSpeed_v2 is not found") + return (__nvmlDeviceSetDefaultFanSpeed_v2)( + device, fan) + + +cdef nvmlReturn_t _nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetFanControlPolicy + _check_or_init_nvml() + if __nvmlDeviceSetFanControlPolicy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetFanControlPolicy is not found") + return (__nvmlDeviceSetFanControlPolicy)( + device, fan, policy) + + +cdef nvmlReturn_t _nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetTemperatureThreshold + _check_or_init_nvml() + if __nvmlDeviceSetTemperatureThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetTemperatureThreshold is not found") + return (__nvmlDeviceSetTemperatureThreshold)( + device, thresholdType, temp) + + +cdef nvmlReturn_t _nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetGpuOperationMode + _check_or_init_nvml() + if __nvmlDeviceSetGpuOperationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetGpuOperationMode is not found") + return (__nvmlDeviceSetGpuOperationMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAPIRestriction + _check_or_init_nvml() + if __nvmlDeviceSetAPIRestriction == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAPIRestriction is not found") + return (__nvmlDeviceSetAPIRestriction)( + device, apiType, isRestricted) + + +cdef nvmlReturn_t _nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceSetFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetFanSpeed_v2 is not found") + return (__nvmlDeviceSetFanSpeed_v2)( + device, fan, speed) + + +cdef nvmlReturn_t _nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAccountingMode + _check_or_init_nvml() + if __nvmlDeviceSetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAccountingMode is not found") + return (__nvmlDeviceSetAccountingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearAccountingPids + _check_or_init_nvml() + if __nvmlDeviceClearAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearAccountingPids is not found") + return (__nvmlDeviceClearAccountingPids)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPowerManagementLimit_v2 + _check_or_init_nvml() + if __nvmlDeviceSetPowerManagementLimit_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPowerManagementLimit_v2 is not found") + return (__nvmlDeviceSetPowerManagementLimit_v2)( + device, powerValue) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkState + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkState is not found") + return (__nvmlDeviceGetNvLinkState)( + device, link, isActive) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkVersion + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkVersion is not found") + return (__nvmlDeviceGetNvLinkVersion)( + device, link, version) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkCapability + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkCapability == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkCapability is not found") + return (__nvmlDeviceGetNvLinkCapability)( + device, link, capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkRemotePciInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemotePciInfo_v2 is not found") + return (__nvmlDeviceGetNvLinkRemotePciInfo_v2)( + device, link, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkErrorCounter + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkErrorCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkErrorCounter is not found") + return (__nvmlDeviceGetNvLinkErrorCounter)( + device, link, counter, counterValue) + + +cdef nvmlReturn_t _nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetNvLinkErrorCounters + _check_or_init_nvml() + if __nvmlDeviceResetNvLinkErrorCounters == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetNvLinkErrorCounters is not found") + return (__nvmlDeviceResetNvLinkErrorCounters)( + device, link) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkRemoteDeviceType + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkRemoteDeviceType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemoteDeviceType is not found") + return (__nvmlDeviceGetNvLinkRemoteDeviceType)( + device, link, pNvLinkDeviceType) + + +cdef nvmlReturn_t _nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + _check_or_init_nvml() + if __nvmlDeviceSetNvLinkDeviceLowPowerThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvLinkDeviceLowPowerThreshold is not found") + return (__nvmlDeviceSetNvLinkDeviceLowPowerThreshold)( + device, info) + + +cdef nvmlReturn_t _nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetNvlinkBwMode + _check_or_init_nvml() + if __nvmlSystemSetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetNvlinkBwMode is not found") + return (__nvmlSystemSetNvlinkBwMode)( + nvlinkBwMode) + + +cdef nvmlReturn_t _nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetNvlinkBwMode + _check_or_init_nvml() + if __nvmlSystemGetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetNvlinkBwMode is not found") + return (__nvmlSystemGetNvlinkBwMode)( + nvlinkBwMode) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkSupportedBwModes + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkSupportedBwModes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkSupportedBwModes is not found") + return (__nvmlDeviceGetNvlinkSupportedBwModes)( + device, supportedBwMode) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkBwMode + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkBwMode is not found") + return (__nvmlDeviceGetNvlinkBwMode)( + device, getBwMode) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkBwMode + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkBwMode is not found") + return (__nvmlDeviceSetNvlinkBwMode)( + device, setBwMode) + + +cdef nvmlReturn_t _nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetCreate + _check_or_init_nvml() + if __nvmlEventSetCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetCreate is not found") + return (__nvmlEventSetCreate)( + set) + + +cdef nvmlReturn_t _nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceRegisterEvents + _check_or_init_nvml() + if __nvmlDeviceRegisterEvents == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceRegisterEvents is not found") + return (__nvmlDeviceRegisterEvents)( + device, eventTypes, set) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedEventTypes + _check_or_init_nvml() + if __nvmlDeviceGetSupportedEventTypes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedEventTypes is not found") + return (__nvmlDeviceGetSupportedEventTypes)( + device, eventTypes) + + +cdef nvmlReturn_t _nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetWait_v2 + _check_or_init_nvml() + if __nvmlEventSetWait_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetWait_v2 is not found") + return (__nvmlEventSetWait_v2)( + set, data, timeoutms) + + +cdef nvmlReturn_t _nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetFree + _check_or_init_nvml() + if __nvmlEventSetFree == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetFree is not found") + return (__nvmlEventSetFree)( + set) + + +cdef nvmlReturn_t _nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetCreate + _check_or_init_nvml() + if __nvmlSystemEventSetCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetCreate is not found") + return (__nvmlSystemEventSetCreate)( + request) + + +cdef nvmlReturn_t _nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetFree + _check_or_init_nvml() + if __nvmlSystemEventSetFree == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetFree is not found") + return (__nvmlSystemEventSetFree)( + request) + + +cdef nvmlReturn_t _nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemRegisterEvents + _check_or_init_nvml() + if __nvmlSystemRegisterEvents == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemRegisterEvents is not found") + return (__nvmlSystemRegisterEvents)( + request) + + +cdef nvmlReturn_t _nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetWait + _check_or_init_nvml() + if __nvmlSystemEventSetWait == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetWait is not found") + return (__nvmlSystemEventSetWait)( + request) + + +cdef nvmlReturn_t _nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceModifyDrainState + _check_or_init_nvml() + if __nvmlDeviceModifyDrainState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceModifyDrainState is not found") + return (__nvmlDeviceModifyDrainState)( + pciInfo, newState) + + +cdef nvmlReturn_t _nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceQueryDrainState + _check_or_init_nvml() + if __nvmlDeviceQueryDrainState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceQueryDrainState is not found") + return (__nvmlDeviceQueryDrainState)( + pciInfo, currentState) + + +cdef nvmlReturn_t _nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceRemoveGpu_v2 + _check_or_init_nvml() + if __nvmlDeviceRemoveGpu_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceRemoveGpu_v2 is not found") + return (__nvmlDeviceRemoveGpu_v2)( + pciInfo, gpuState, linkState) + + +cdef nvmlReturn_t _nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceDiscoverGpus + _check_or_init_nvml() + if __nvmlDeviceDiscoverGpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceDiscoverGpus is not found") + return (__nvmlDeviceDiscoverGpus)( + pciInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFieldValues + _check_or_init_nvml() + if __nvmlDeviceGetFieldValues == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFieldValues is not found") + return (__nvmlDeviceGetFieldValues)( + device, valuesCount, values) + + +cdef nvmlReturn_t _nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearFieldValues + _check_or_init_nvml() + if __nvmlDeviceClearFieldValues == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearFieldValues is not found") + return (__nvmlDeviceClearFieldValues)( + device, valuesCount, values) + + +cdef nvmlReturn_t _nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVirtualizationMode + _check_or_init_nvml() + if __nvmlDeviceGetVirtualizationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVirtualizationMode is not found") + return (__nvmlDeviceGetVirtualizationMode)( + device, pVirtualMode) + + +cdef nvmlReturn_t _nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHostVgpuMode + _check_or_init_nvml() + if __nvmlDeviceGetHostVgpuMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHostVgpuMode is not found") + return (__nvmlDeviceGetHostVgpuMode)( + device, pHostVgpuMode) + + +cdef nvmlReturn_t _nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVirtualizationMode + _check_or_init_nvml() + if __nvmlDeviceSetVirtualizationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVirtualizationMode is not found") + return (__nvmlDeviceSetVirtualizationMode)( + device, virtualMode) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlDeviceGetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuHeterogeneousMode is not found") + return (__nvmlDeviceGetVgpuHeterogeneousMode)( + device, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlDeviceSetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuHeterogeneousMode is not found") + return (__nvmlDeviceSetVgpuHeterogeneousMode)( + device, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetPlacementId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetPlacementId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetPlacementId is not found") + return (__nvmlVgpuInstanceGetPlacementId)( + vgpuInstance, pPlacement) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuTypeSupportedPlacements + _check_or_init_nvml() + if __nvmlDeviceGetVgpuTypeSupportedPlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeSupportedPlacements is not found") + return (__nvmlDeviceGetVgpuTypeSupportedPlacements)( + device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuTypeCreatablePlacements + _check_or_init_nvml() + if __nvmlDeviceGetVgpuTypeCreatablePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeCreatablePlacements is not found") + return (__nvmlDeviceGetVgpuTypeCreatablePlacements)( + device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetGspHeapSize + _check_or_init_nvml() + if __nvmlVgpuTypeGetGspHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetGspHeapSize is not found") + return (__nvmlVgpuTypeGetGspHeapSize)( + vgpuTypeId, gspHeapSize) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFbReservation + _check_or_init_nvml() + if __nvmlVgpuTypeGetFbReservation == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFbReservation is not found") + return (__nvmlVgpuTypeGetFbReservation)( + vgpuTypeId, fbReservation) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetRuntimeStateSize + _check_or_init_nvml() + if __nvmlVgpuInstanceGetRuntimeStateSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetRuntimeStateSize is not found") + return (__nvmlVgpuInstanceGetRuntimeStateSize)( + vgpuInstance, pState) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuCapabilities + _check_or_init_nvml() + if __nvmlDeviceSetVgpuCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuCapabilities is not found") + return (__nvmlDeviceSetVgpuCapabilities)( + device, capability, state) + + +cdef nvmlReturn_t _nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGridLicensableFeatures_v4 + _check_or_init_nvml() + if __nvmlDeviceGetGridLicensableFeatures_v4 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGridLicensableFeatures_v4 is not found") + return (__nvmlDeviceGetGridLicensableFeatures_v4)( + device, pGridLicensableFeatures) + + +cdef nvmlReturn_t _nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuDriverCapabilities + _check_or_init_nvml() + if __nvmlGetVgpuDriverCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuDriverCapabilities is not found") + return (__nvmlGetVgpuDriverCapabilities)( + capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetVgpuCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuCapabilities is not found") + return (__nvmlDeviceGetVgpuCapabilities)( + device, capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedVgpus + _check_or_init_nvml() + if __nvmlDeviceGetSupportedVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedVgpus is not found") + return (__nvmlDeviceGetSupportedVgpus)( + device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t _nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCreatableVgpus + _check_or_init_nvml() + if __nvmlDeviceGetCreatableVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCreatableVgpus is not found") + return (__nvmlDeviceGetCreatableVgpus)( + device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetClass + _check_or_init_nvml() + if __nvmlVgpuTypeGetClass == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetClass is not found") + return (__nvmlVgpuTypeGetClass)( + vgpuTypeId, vgpuTypeClass, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetName + _check_or_init_nvml() + if __nvmlVgpuTypeGetName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetName is not found") + return (__nvmlVgpuTypeGetName)( + vgpuTypeId, vgpuTypeName, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetGpuInstanceProfileId + _check_or_init_nvml() + if __nvmlVgpuTypeGetGpuInstanceProfileId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetGpuInstanceProfileId is not found") + return (__nvmlVgpuTypeGetGpuInstanceProfileId)( + vgpuTypeId, gpuInstanceProfileId) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetDeviceID + _check_or_init_nvml() + if __nvmlVgpuTypeGetDeviceID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetDeviceID is not found") + return (__nvmlVgpuTypeGetDeviceID)( + vgpuTypeId, deviceID, subsystemID) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFramebufferSize + _check_or_init_nvml() + if __nvmlVgpuTypeGetFramebufferSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFramebufferSize is not found") + return (__nvmlVgpuTypeGetFramebufferSize)( + vgpuTypeId, fbSize) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetNumDisplayHeads + _check_or_init_nvml() + if __nvmlVgpuTypeGetNumDisplayHeads == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetNumDisplayHeads is not found") + return (__nvmlVgpuTypeGetNumDisplayHeads)( + vgpuTypeId, numDisplayHeads) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetResolution + _check_or_init_nvml() + if __nvmlVgpuTypeGetResolution == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetResolution is not found") + return (__nvmlVgpuTypeGetResolution)( + vgpuTypeId, displayIndex, xdim, ydim) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetLicense + _check_or_init_nvml() + if __nvmlVgpuTypeGetLicense == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetLicense is not found") + return (__nvmlVgpuTypeGetLicense)( + vgpuTypeId, vgpuTypeLicenseString, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFrameRateLimit + _check_or_init_nvml() + if __nvmlVgpuTypeGetFrameRateLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFrameRateLimit is not found") + return (__nvmlVgpuTypeGetFrameRateLimit)( + vgpuTypeId, frameRateLimit) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstances + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstances is not found") + return (__nvmlVgpuTypeGetMaxInstances)( + device, vgpuTypeId, vgpuInstanceCount) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstancesPerVm + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstancesPerVm == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerVm is not found") + return (__nvmlVgpuTypeGetMaxInstancesPerVm)( + vgpuTypeId, vgpuInstanceCountPerVm) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetBAR1Info + _check_or_init_nvml() + if __nvmlVgpuTypeGetBAR1Info == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetBAR1Info is not found") + return (__nvmlVgpuTypeGetBAR1Info)( + vgpuTypeId, bar1Info) + + +cdef nvmlReturn_t _nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetActiveVgpus + _check_or_init_nvml() + if __nvmlDeviceGetActiveVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetActiveVgpus is not found") + return (__nvmlDeviceGetActiveVgpus)( + device, vgpuCount, vgpuInstances) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetVmID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetVmID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmID is not found") + return (__nvmlVgpuInstanceGetVmID)( + vgpuInstance, vmId, size, vmIdType) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetUUID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetUUID is not found") + return (__nvmlVgpuInstanceGetUUID)( + vgpuInstance, uuid, size) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetVmDriverVersion + _check_or_init_nvml() + if __nvmlVgpuInstanceGetVmDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmDriverVersion is not found") + return (__nvmlVgpuInstanceGetVmDriverVersion)( + vgpuInstance, version, length) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFbUsage + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFbUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFbUsage is not found") + return (__nvmlVgpuInstanceGetFbUsage)( + vgpuInstance, fbUsage) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetLicenseStatus + _check_or_init_nvml() + if __nvmlVgpuInstanceGetLicenseStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseStatus is not found") + return (__nvmlVgpuInstanceGetLicenseStatus)( + vgpuInstance, licensed) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetType + _check_or_init_nvml() + if __nvmlVgpuInstanceGetType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetType is not found") + return (__nvmlVgpuInstanceGetType)( + vgpuInstance, vgpuTypeId) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFrameRateLimit + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFrameRateLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFrameRateLimit is not found") + return (__nvmlVgpuInstanceGetFrameRateLimit)( + vgpuInstance, frameRateLimit) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEccMode + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEccMode is not found") + return (__nvmlVgpuInstanceGetEccMode)( + vgpuInstance, eccMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderCapacity + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderCapacity is not found") + return (__nvmlVgpuInstanceGetEncoderCapacity)( + vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t _nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceSetEncoderCapacity + _check_or_init_nvml() + if __nvmlVgpuInstanceSetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceSetEncoderCapacity is not found") + return (__nvmlVgpuInstanceSetEncoderCapacity)( + vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderStats is not found") + return (__nvmlVgpuInstanceGetEncoderStats)( + vgpuInstance, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderSessions + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderSessions is not found") + return (__nvmlVgpuInstanceGetEncoderSessions)( + vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFBCStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFBCStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCStats is not found") + return (__nvmlVgpuInstanceGetFBCStats)( + vgpuInstance, fbcStats) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFBCSessions + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFBCSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCSessions is not found") + return (__nvmlVgpuInstanceGetFBCSessions)( + vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetGpuInstanceId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetGpuInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuInstanceId is not found") + return (__nvmlVgpuInstanceGetGpuInstanceId)( + vgpuInstance, gpuInstanceId) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetGpuPciId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetGpuPciId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuPciId is not found") + return (__nvmlVgpuInstanceGetGpuPciId)( + vgpuInstance, vgpuPciId, length) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetCapabilities + _check_or_init_nvml() + if __nvmlVgpuTypeGetCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetCapabilities is not found") + return (__nvmlVgpuTypeGetCapabilities)( + vgpuTypeId, capability, capResult) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetMdevUUID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetMdevUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetMdevUUID is not found") + return (__nvmlVgpuInstanceGetMdevUUID)( + vgpuInstance, mdevUuid, size) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetCreatableVgpus + _check_or_init_nvml() + if __nvmlGpuInstanceGetCreatableVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetCreatableVgpus is not found") + return (__nvmlGpuInstanceGetCreatableVgpus)( + gpuInstance, pVgpus) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstancesPerGpuInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerGpuInstance is not found") + return (__nvmlVgpuTypeGetMaxInstancesPerGpuInstance)( + pMaxInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetActiveVgpus + _check_or_init_nvml() + if __nvmlGpuInstanceGetActiveVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetActiveVgpus is not found") + return (__nvmlGpuInstanceGetActiveVgpus)( + gpuInstance, pVgpuInstanceInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState)( + gpuInstance, pScheduler) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuTypeCreatablePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuTypeCreatablePlacements is not found") + return (__nvmlGpuInstanceGetVgpuTypeCreatablePlacements)( + gpuInstance, pCreatablePlacementInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuHeterogeneousMode is not found") + return (__nvmlGpuInstanceGetVgpuHeterogeneousMode)( + gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuHeterogeneousMode is not found") + return (__nvmlGpuInstanceSetVgpuHeterogeneousMode)( + gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetMetadata + _check_or_init_nvml() + if __nvmlVgpuInstanceGetMetadata == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetMetadata is not found") + return (__nvmlVgpuInstanceGetMetadata)( + vgpuInstance, vgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuMetadata + _check_or_init_nvml() + if __nvmlDeviceGetVgpuMetadata == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuMetadata is not found") + return (__nvmlDeviceGetVgpuMetadata)( + device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuCompatibility + _check_or_init_nvml() + if __nvmlGetVgpuCompatibility == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuCompatibility is not found") + return (__nvmlGetVgpuCompatibility)( + vgpuMetadata, pgpuMetadata, compatibilityInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPgpuMetadataString + _check_or_init_nvml() + if __nvmlDeviceGetPgpuMetadataString == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPgpuMetadataString is not found") + return (__nvmlDeviceGetPgpuMetadataString)( + device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog is not found") + return (__nvmlDeviceGetVgpuSchedulerLog)( + device, pSchedulerLog) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState is not found") + return (__nvmlDeviceGetVgpuSchedulerState)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerCapabilities is not found") + return (__nvmlDeviceGetVgpuSchedulerCapabilities)( + device, pCapabilities) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState is not found") + return (__nvmlDeviceSetVgpuSchedulerState)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuVersion + _check_or_init_nvml() + if __nvmlGetVgpuVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuVersion is not found") + return (__nvmlGetVgpuVersion)( + supported, current) + + +cdef nvmlReturn_t _nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSetVgpuVersion + _check_or_init_nvml() + if __nvmlSetVgpuVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSetVgpuVersion is not found") + return (__nvmlSetVgpuVersion)( + vgpuVersion) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuUtilization + _check_or_init_nvml() + if __nvmlDeviceGetVgpuUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuUtilization is not found") + return (__nvmlDeviceGetVgpuUtilization)( + device, lastSeenTimeStamp, sampleValType, vgpuInstanceSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetVgpuInstancesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuInstancesUtilizationInfo is not found") + return (__nvmlDeviceGetVgpuInstancesUtilizationInfo)( + device, vgpuUtilInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuProcessUtilization + _check_or_init_nvml() + if __nvmlDeviceGetVgpuProcessUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessUtilization is not found") + return (__nvmlDeviceGetVgpuProcessUtilization)( + device, lastSeenTimeStamp, vgpuProcessSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetVgpuProcessesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessesUtilizationInfo is not found") + return (__nvmlDeviceGetVgpuProcessesUtilizationInfo)( + device, vgpuProcUtilInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingMode + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingMode is not found") + return (__nvmlVgpuInstanceGetAccountingMode)( + vgpuInstance, mode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingPids + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingPids is not found") + return (__nvmlVgpuInstanceGetAccountingPids)( + vgpuInstance, count, pids) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingStats is not found") + return (__nvmlVgpuInstanceGetAccountingStats)( + vgpuInstance, pid, stats) + + +cdef nvmlReturn_t _nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceClearAccountingPids + _check_or_init_nvml() + if __nvmlVgpuInstanceClearAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceClearAccountingPids is not found") + return (__nvmlVgpuInstanceClearAccountingPids)( + vgpuInstance) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetLicenseInfo_v2 + _check_or_init_nvml() + if __nvmlVgpuInstanceGetLicenseInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseInfo_v2 is not found") + return (__nvmlVgpuInstanceGetLicenseInfo_v2)( + vgpuInstance, licenseInfo) + + +cdef nvmlReturn_t _nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetExcludedDeviceCount + _check_or_init_nvml() + if __nvmlGetExcludedDeviceCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetExcludedDeviceCount is not found") + return (__nvmlGetExcludedDeviceCount)( + deviceCount) + + +cdef nvmlReturn_t _nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetExcludedDeviceInfoByIndex + _check_or_init_nvml() + if __nvmlGetExcludedDeviceInfoByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetExcludedDeviceInfoByIndex is not found") + return (__nvmlGetExcludedDeviceInfoByIndex)( + index, info) + + +cdef nvmlReturn_t _nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMigMode + _check_or_init_nvml() + if __nvmlDeviceSetMigMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMigMode is not found") + return (__nvmlDeviceSetMigMode)( + device, mode, activationStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMigMode + _check_or_init_nvml() + if __nvmlDeviceGetMigMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMigMode is not found") + return (__nvmlDeviceGetMigMode)( + device, currentMode, pendingMode) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceProfileInfoV + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceProfileInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoV is not found") + return (__nvmlDeviceGetGpuInstanceProfileInfoV)( + device, profile, info) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstancePossiblePlacements_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstancePossiblePlacements_v2 is not found") + return (__nvmlDeviceGetGpuInstancePossiblePlacements_v2)( + device, profileId, placements, count) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceRemainingCapacity + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceRemainingCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceRemainingCapacity is not found") + return (__nvmlDeviceGetGpuInstanceRemainingCapacity)( + device, profileId, count) + + +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceCreateGpuInstance + _check_or_init_nvml() + if __nvmlDeviceCreateGpuInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstance is not found") + return (__nvmlDeviceCreateGpuInstance)( + device, profileId, gpuInstance) + + +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceCreateGpuInstanceWithPlacement + _check_or_init_nvml() + if __nvmlDeviceCreateGpuInstanceWithPlacement == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstanceWithPlacement is not found") + return (__nvmlDeviceCreateGpuInstanceWithPlacement)( + device, profileId, placement, gpuInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceDestroy + _check_or_init_nvml() + if __nvmlGpuInstanceDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceDestroy is not found") + return (__nvmlGpuInstanceDestroy)( + gpuInstance) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstances + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstances is not found") + return (__nvmlDeviceGetGpuInstances)( + device, profileId, gpuInstances, count) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceById + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceById == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceById is not found") + return (__nvmlDeviceGetGpuInstanceById)( + device, id, gpuInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetInfo + _check_or_init_nvml() + if __nvmlGpuInstanceGetInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetInfo is not found") + return (__nvmlGpuInstanceGetInfo)( + gpuInstance, info) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceProfileInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceProfileInfoV is not found") + return (__nvmlGpuInstanceGetComputeInstanceProfileInfoV)( + gpuInstance, profile, engProfile, info) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceRemainingCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceRemainingCapacity is not found") + return (__nvmlGpuInstanceGetComputeInstanceRemainingCapacity)( + gpuInstance, profileId, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstancePossiblePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstancePossiblePlacements is not found") + return (__nvmlGpuInstanceGetComputeInstancePossiblePlacements)( + gpuInstance, profileId, placements, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceCreateComputeInstance + _check_or_init_nvml() + if __nvmlGpuInstanceCreateComputeInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstance is not found") + return (__nvmlGpuInstanceCreateComputeInstance)( + gpuInstance, profileId, computeInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + _check_or_init_nvml() + if __nvmlGpuInstanceCreateComputeInstanceWithPlacement == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstanceWithPlacement is not found") + return (__nvmlGpuInstanceCreateComputeInstanceWithPlacement)( + gpuInstance, profileId, placement, computeInstance) + + +cdef nvmlReturn_t _nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlComputeInstanceDestroy + _check_or_init_nvml() + if __nvmlComputeInstanceDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlComputeInstanceDestroy is not found") + return (__nvmlComputeInstanceDestroy)( + computeInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstances + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstances is not found") + return (__nvmlGpuInstanceGetComputeInstances)( + gpuInstance, profileId, computeInstances, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceById + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceById == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceById is not found") + return (__nvmlGpuInstanceGetComputeInstanceById)( + gpuInstance, id, computeInstance) + + +cdef nvmlReturn_t _nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlComputeInstanceGetInfo_v2 + _check_or_init_nvml() + if __nvmlComputeInstanceGetInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlComputeInstanceGetInfo_v2 is not found") + return (__nvmlComputeInstanceGetInfo_v2)( + computeInstance, info) + + +cdef nvmlReturn_t _nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceIsMigDeviceHandle + _check_or_init_nvml() + if __nvmlDeviceIsMigDeviceHandle == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceIsMigDeviceHandle is not found") + return (__nvmlDeviceIsMigDeviceHandle)( + device, isMigDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceId + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceId is not found") + return (__nvmlDeviceGetGpuInstanceId)( + device, id) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeInstanceId + _check_or_init_nvml() + if __nvmlDeviceGetComputeInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeInstanceId is not found") + return (__nvmlDeviceGetComputeInstanceId)( + device, id) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxMigDeviceCount + _check_or_init_nvml() + if __nvmlDeviceGetMaxMigDeviceCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxMigDeviceCount is not found") + return (__nvmlDeviceGetMaxMigDeviceCount)( + device, count) + + +cdef nvmlReturn_t _nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMigDeviceHandleByIndex + _check_or_init_nvml() + if __nvmlDeviceGetMigDeviceHandleByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMigDeviceHandleByIndex is not found") + return (__nvmlDeviceGetMigDeviceHandleByIndex)( + device, index, migDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + _check_or_init_nvml() + if __nvmlDeviceGetDeviceHandleFromMigDeviceHandle == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDeviceHandleFromMigDeviceHandle is not found") + return (__nvmlDeviceGetDeviceHandleFromMigDeviceHandle)( + migDevice, device) + + +cdef nvmlReturn_t _nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCapabilities is not found") + return (__nvmlDeviceGetCapabilities)( + device, caps) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingActivatePresetProfile + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingActivatePresetProfile == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingActivatePresetProfile is not found") + return (__nvmlDevicePowerSmoothingActivatePresetProfile)( + device, profile) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingUpdatePresetProfileParam == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingUpdatePresetProfileParam is not found") + return (__nvmlDevicePowerSmoothingUpdatePresetProfileParam)( + device, profile) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingSetState + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingSetState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingSetState is not found") + return (__nvmlDevicePowerSmoothingSetState)( + device, state) + + +cdef nvmlReturn_t _nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAddressingMode + _check_or_init_nvml() + if __nvmlDeviceGetAddressingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAddressingMode is not found") + return (__nvmlDeviceGetAddressingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRepairStatus + _check_or_init_nvml() + if __nvmlDeviceGetRepairStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRepairStatus is not found") + return (__nvmlDeviceGetRepairStatus)( + device, repairStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerMizerMode_v1 + _check_or_init_nvml() + if __nvmlDeviceGetPowerMizerMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerMizerMode_v1 is not found") + return (__nvmlDeviceGetPowerMizerMode_v1)( + device, powerMizerMode) + + +cdef nvmlReturn_t _nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPowerMizerMode_v1 + _check_or_init_nvml() + if __nvmlDeviceSetPowerMizerMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPowerMizerMode_v1 is not found") + return (__nvmlDeviceSetPowerMizerMode_v1)( + device, powerMizerMode) + + +cdef nvmlReturn_t _nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPdi + _check_or_init_nvml() + if __nvmlDeviceGetPdi == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPdi is not found") + return (__nvmlDeviceGetPdi)( + device, pdi) + + +cdef nvmlReturn_t _nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetHostname_v1 + _check_or_init_nvml() + if __nvmlDeviceSetHostname_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetHostname_v1 is not found") + return (__nvmlDeviceSetHostname_v1)( + device, hostname) + + +cdef nvmlReturn_t _nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHostname_v1 + _check_or_init_nvml() + if __nvmlDeviceGetHostname_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHostname_v1 is not found") + return (__nvmlDeviceGetHostname_v1)( + device, hostname) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkInfo + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkInfo is not found") + return (__nvmlDeviceGetNvLinkInfo)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceReadWritePRM_v1 + _check_or_init_nvml() + if __nvmlDeviceReadWritePRM_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceReadWritePRM_v1 is not found") + return (__nvmlDeviceReadWritePRM_v1)( + device, buffer) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceProfileInfoByIdV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoByIdV is not found") + return (__nvmlDeviceGetGpuInstanceProfileInfoByIdV)( + device, profileId, info) + + +cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + _check_or_init_nvml() + if __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts is not found") + return (__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts)( + device, errorCounts) + + +cdef nvmlReturn_t _nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + _check_or_init_nvml() + if __nvmlDeviceGetUnrepairableMemoryFlag_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUnrepairableMemoryFlag_v1 is not found") + return (__nvmlDeviceGetUnrepairableMemoryFlag_v1)( + device, unrepairableMemoryStatus) + + +cdef nvmlReturn_t _nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceReadPRMCounters_v1 + _check_or_init_nvml() + if __nvmlDeviceReadPRMCounters_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceReadPRMCounters_v1 is not found") + return (__nvmlDeviceReadPRMCounters_v1)( + device, counterList) + + +cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetRusdSettings_v1 + _check_or_init_nvml() + if __nvmlDeviceSetRusdSettings_v1 == NULL: + with gil: + 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) + + +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCPER_v1 + _check_or_init_nvml() + if __nvmlSystemGetCPER_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCPER_v1 is not found") + return (__nvmlSystemGetCPER_v1)( + cper) + + +cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBBXTimeData_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBBXTimeData_v1 is not found") + return (__nvmlDeviceGetBBXTimeData_v1)( + device, timeData) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats_v2 is not found") + return (__nvmlDeviceGetAccountingStats_v2)( + device, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows_v2 is not found") + return (__nvmlDeviceGetRemappedRows_v2)( + device, info) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvml_windows.pyx new file mode 100644 index 00000000000..14462225e14 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvml_windows.pyx @@ -0,0 +1,6146 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=dfef5d61e23406c9104db88966dea7813becf53ad5e89fca63b78d618097e15a + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvml_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from .utils import FunctionNotFoundError, NotSupportedError +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvmlInit_v2 = NULL +cdef void* __nvmlInitWithFlags = NULL +cdef void* __nvmlShutdown = NULL +cdef void* __nvmlErrorString = NULL +cdef void* __nvmlSystemGetDriverVersion = NULL +cdef void* __nvmlSystemGetNVMLVersion = NULL +cdef void* __nvmlSystemGetCudaDriverVersion = NULL +cdef void* __nvmlSystemGetCudaDriverVersion_v2 = NULL +cdef void* __nvmlSystemGetProcessName = NULL +cdef void* __nvmlSystemGetHicVersion = NULL +cdef void* __nvmlSystemGetTopologyGpuSet = NULL +cdef void* __nvmlSystemGetDriverBranch = NULL +cdef void* __nvmlUnitGetCount = NULL +cdef void* __nvmlUnitGetHandleByIndex = NULL +cdef void* __nvmlUnitGetUnitInfo = NULL +cdef void* __nvmlUnitGetLedState = NULL +cdef void* __nvmlUnitGetPsuInfo = NULL +cdef void* __nvmlUnitGetTemperature = NULL +cdef void* __nvmlUnitGetFanSpeedInfo = NULL +cdef void* __nvmlUnitGetDevices = NULL +cdef void* __nvmlDeviceGetCount_v2 = NULL +cdef void* __nvmlDeviceGetAttributes_v2 = NULL +cdef void* __nvmlDeviceGetHandleByIndex_v2 = NULL +cdef void* __nvmlDeviceGetHandleBySerial = NULL +cdef void* __nvmlDeviceGetHandleByUUID = NULL +cdef void* __nvmlDeviceGetHandleByUUIDV = NULL +cdef void* __nvmlDeviceGetHandleByPciBusId_v2 = NULL +cdef void* __nvmlDeviceGetName = NULL +cdef void* __nvmlDeviceGetBrand = NULL +cdef void* __nvmlDeviceGetIndex = NULL +cdef void* __nvmlDeviceGetSerial = NULL +cdef void* __nvmlDeviceGetModuleId = NULL +cdef void* __nvmlDeviceGetC2cModeInfoV = NULL +cdef void* __nvmlDeviceGetMemoryAffinity = NULL +cdef void* __nvmlDeviceGetCpuAffinityWithinScope = NULL +cdef void* __nvmlDeviceGetCpuAffinity = NULL +cdef void* __nvmlDeviceSetCpuAffinity = NULL +cdef void* __nvmlDeviceClearCpuAffinity = NULL +cdef void* __nvmlDeviceGetNumaNodeId = NULL +cdef void* __nvmlDeviceGetTopologyCommonAncestor = NULL +cdef void* __nvmlDeviceGetTopologyNearestGpus = NULL +cdef void* __nvmlDeviceGetP2PStatus = NULL +cdef void* __nvmlDeviceGetUUID = NULL +cdef void* __nvmlDeviceGetMinorNumber = NULL +cdef void* __nvmlDeviceGetBoardPartNumber = NULL +cdef void* __nvmlDeviceGetInforomVersion = NULL +cdef void* __nvmlDeviceGetInforomImageVersion = NULL +cdef void* __nvmlDeviceGetInforomConfigurationChecksum = NULL +cdef void* __nvmlDeviceValidateInforom = NULL +cdef void* __nvmlDeviceGetLastBBXFlushTime = NULL +cdef void* __nvmlDeviceGetDisplayMode = NULL +cdef void* __nvmlDeviceGetDisplayActive = NULL +cdef void* __nvmlDeviceGetPersistenceMode = NULL +cdef void* __nvmlDeviceGetPciInfoExt = NULL +cdef void* __nvmlDeviceGetPciInfo_v3 = NULL +cdef void* __nvmlDeviceGetMaxPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetGpuMaxPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetMaxPcieLinkWidth = NULL +cdef void* __nvmlDeviceGetCurrPcieLinkGeneration = NULL +cdef void* __nvmlDeviceGetCurrPcieLinkWidth = NULL +cdef void* __nvmlDeviceGetPcieThroughput = NULL +cdef void* __nvmlDeviceGetPcieReplayCounter = NULL +cdef void* __nvmlDeviceGetClockInfo = NULL +cdef void* __nvmlDeviceGetMaxClockInfo = NULL +cdef void* __nvmlDeviceGetGpcClkVfOffset = NULL +cdef void* __nvmlDeviceGetClock = NULL +cdef void* __nvmlDeviceGetMaxCustomerBoostClock = NULL +cdef void* __nvmlDeviceGetSupportedMemoryClocks = NULL +cdef void* __nvmlDeviceGetSupportedGraphicsClocks = NULL +cdef void* __nvmlDeviceGetAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceGetFanSpeed = NULL +cdef void* __nvmlDeviceGetFanSpeed_v2 = NULL +cdef void* __nvmlDeviceGetFanSpeedRPM = NULL +cdef void* __nvmlDeviceGetTargetFanSpeed = NULL +cdef void* __nvmlDeviceGetMinMaxFanSpeed = NULL +cdef void* __nvmlDeviceGetFanControlPolicy_v2 = NULL +cdef void* __nvmlDeviceGetNumFans = NULL +cdef void* __nvmlDeviceGetCoolerInfo = NULL +cdef void* __nvmlDeviceGetTemperatureV = NULL +cdef void* __nvmlDeviceGetTemperatureThreshold = NULL +cdef void* __nvmlDeviceGetMarginTemperature = NULL +cdef void* __nvmlDeviceGetThermalSettings = NULL +cdef void* __nvmlDeviceGetPerformanceState = NULL +cdef void* __nvmlDeviceGetCurrentClocksEventReasons = NULL +cdef void* __nvmlDeviceGetSupportedClocksEventReasons = NULL +cdef void* __nvmlDeviceGetPowerState = NULL +cdef void* __nvmlDeviceGetDynamicPstatesInfo = NULL +cdef void* __nvmlDeviceGetMemClkVfOffset = NULL +cdef void* __nvmlDeviceGetMinMaxClockOfPState = NULL +cdef void* __nvmlDeviceGetSupportedPerformanceStates = NULL +cdef void* __nvmlDeviceGetGpcClkMinMaxVfOffset = NULL +cdef void* __nvmlDeviceGetMemClkMinMaxVfOffset = NULL +cdef void* __nvmlDeviceGetClockOffsets = NULL +cdef void* __nvmlDeviceSetClockOffsets = NULL +cdef void* __nvmlDeviceGetPerformanceModes = NULL +cdef void* __nvmlDeviceGetCurrentClockFreqs = NULL +cdef void* __nvmlDeviceGetPowerManagementLimit = NULL +cdef void* __nvmlDeviceGetPowerManagementLimitConstraints = NULL +cdef void* __nvmlDeviceGetPowerManagementDefaultLimit = NULL +cdef void* __nvmlDeviceGetPowerUsage = NULL +cdef void* __nvmlDeviceGetTotalEnergyConsumption = NULL +cdef void* __nvmlDeviceGetEnforcedPowerLimit = NULL +cdef void* __nvmlDeviceGetGpuOperationMode = NULL +cdef void* __nvmlDeviceGetMemoryInfo_v2 = NULL +cdef void* __nvmlDeviceGetComputeMode = NULL +cdef void* __nvmlDeviceGetCudaComputeCapability = NULL +cdef void* __nvmlDeviceGetDramEncryptionMode = NULL +cdef void* __nvmlDeviceSetDramEncryptionMode = NULL +cdef void* __nvmlDeviceGetEccMode = NULL +cdef void* __nvmlDeviceGetDefaultEccMode = NULL +cdef void* __nvmlDeviceGetBoardId = NULL +cdef void* __nvmlDeviceGetMultiGpuBoard = NULL +cdef void* __nvmlDeviceGetTotalEccErrors = NULL +cdef void* __nvmlDeviceGetMemoryErrorCounter = NULL +cdef void* __nvmlDeviceGetUtilizationRates = NULL +cdef void* __nvmlDeviceGetEncoderUtilization = NULL +cdef void* __nvmlDeviceGetEncoderCapacity = NULL +cdef void* __nvmlDeviceGetEncoderStats = NULL +cdef void* __nvmlDeviceGetEncoderSessions = NULL +cdef void* __nvmlDeviceGetDecoderUtilization = NULL +cdef void* __nvmlDeviceGetJpgUtilization = NULL +cdef void* __nvmlDeviceGetOfaUtilization = NULL +cdef void* __nvmlDeviceGetFBCStats = NULL +cdef void* __nvmlDeviceGetFBCSessions = NULL +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 +cdef void* __nvmlDeviceGetAPIRestriction = NULL +cdef void* __nvmlDeviceGetSamples = NULL +cdef void* __nvmlDeviceGetBAR1MemoryInfo = NULL +cdef void* __nvmlDeviceGetIrqNum = NULL +cdef void* __nvmlDeviceGetNumGpuCores = NULL +cdef void* __nvmlDeviceGetPowerSource = NULL +cdef void* __nvmlDeviceGetMemoryBusWidth = NULL +cdef void* __nvmlDeviceGetPcieLinkMaxSpeed = NULL +cdef void* __nvmlDeviceGetPcieSpeed = NULL +cdef void* __nvmlDeviceGetAdaptiveClockInfoStatus = NULL +cdef void* __nvmlDeviceGetBusType = NULL +cdef void* __nvmlDeviceGetGpuFabricInfoV = NULL +cdef void* __nvmlSystemGetConfComputeCapabilities = NULL +cdef void* __nvmlSystemGetConfComputeState = NULL +cdef void* __nvmlDeviceGetConfComputeMemSizeInfo = NULL +cdef void* __nvmlSystemGetConfComputeGpusReadyState = NULL +cdef void* __nvmlDeviceGetConfComputeProtectedMemoryUsage = NULL +cdef void* __nvmlDeviceGetConfComputeGpuCertificate = NULL +cdef void* __nvmlDeviceGetConfComputeGpuAttestationReport = NULL +cdef void* __nvmlSystemGetConfComputeKeyRotationThresholdInfo = NULL +cdef void* __nvmlDeviceSetConfComputeUnprotectedMemSize = NULL +cdef void* __nvmlSystemSetConfComputeGpusReadyState = NULL +cdef void* __nvmlSystemSetConfComputeKeyRotationThresholdInfo = NULL +cdef void* __nvmlSystemGetConfComputeSettings = NULL +cdef void* __nvmlDeviceGetGspFirmwareVersion = NULL +cdef void* __nvmlDeviceGetGspFirmwareMode = NULL +cdef void* __nvmlDeviceGetSramEccErrorStatus = NULL +cdef void* __nvmlDeviceGetAccountingMode = NULL +cdef void* __nvmlDeviceGetAccountingStats = NULL +cdef void* __nvmlDeviceGetAccountingPids = NULL +cdef void* __nvmlDeviceGetAccountingBufferSize = NULL +cdef void* __nvmlDeviceGetRetiredPages = NULL +cdef void* __nvmlDeviceGetRetiredPages_v2 = NULL +cdef void* __nvmlDeviceGetRetiredPagesPendingStatus = NULL +cdef void* __nvmlDeviceGetRemappedRows = NULL +cdef void* __nvmlDeviceGetRowRemapperHistogram = NULL +cdef void* __nvmlDeviceGetArchitecture = NULL +cdef void* __nvmlDeviceGetClkMonStatus = NULL +cdef void* __nvmlDeviceGetProcessUtilization = NULL +cdef void* __nvmlDeviceGetProcessesUtilizationInfo = NULL +cdef void* __nvmlDeviceGetPlatformInfo = NULL +cdef void* __nvmlUnitSetLedState = NULL +cdef void* __nvmlDeviceSetPersistenceMode = NULL +cdef void* __nvmlDeviceSetComputeMode = NULL +cdef void* __nvmlDeviceSetEccMode = NULL +cdef void* __nvmlDeviceClearEccErrorCounts = NULL +cdef void* __nvmlDeviceSetDriverModel = NULL +cdef void* __nvmlDeviceSetGpuLockedClocks = NULL +cdef void* __nvmlDeviceResetGpuLockedClocks = NULL +cdef void* __nvmlDeviceSetMemoryLockedClocks = NULL +cdef void* __nvmlDeviceResetMemoryLockedClocks = NULL +cdef void* __nvmlDeviceSetAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = NULL +cdef void* __nvmlDeviceSetDefaultFanSpeed_v2 = NULL +cdef void* __nvmlDeviceSetFanControlPolicy = NULL +cdef void* __nvmlDeviceSetTemperatureThreshold = NULL +cdef void* __nvmlDeviceSetGpuOperationMode = NULL +cdef void* __nvmlDeviceSetAPIRestriction = NULL +cdef void* __nvmlDeviceSetFanSpeed_v2 = NULL +cdef void* __nvmlDeviceSetAccountingMode = NULL +cdef void* __nvmlDeviceClearAccountingPids = NULL +cdef void* __nvmlDeviceSetPowerManagementLimit_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkState = NULL +cdef void* __nvmlDeviceGetNvLinkVersion = NULL +cdef void* __nvmlDeviceGetNvLinkCapability = NULL +cdef void* __nvmlDeviceGetNvLinkRemotePciInfo_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkErrorCounter = NULL +cdef void* __nvmlDeviceResetNvLinkErrorCounters = NULL +cdef void* __nvmlDeviceGetNvLinkRemoteDeviceType = NULL +cdef void* __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = NULL +cdef void* __nvmlSystemSetNvlinkBwMode = NULL +cdef void* __nvmlSystemGetNvlinkBwMode = NULL +cdef void* __nvmlDeviceGetNvlinkSupportedBwModes = NULL +cdef void* __nvmlDeviceGetNvlinkBwMode = NULL +cdef void* __nvmlDeviceSetNvlinkBwMode = NULL +cdef void* __nvmlEventSetCreate = NULL +cdef void* __nvmlDeviceRegisterEvents = NULL +cdef void* __nvmlDeviceGetSupportedEventTypes = NULL +cdef void* __nvmlEventSetWait_v2 = NULL +cdef void* __nvmlEventSetFree = NULL +cdef void* __nvmlSystemEventSetCreate = NULL +cdef void* __nvmlSystemEventSetFree = NULL +cdef void* __nvmlSystemRegisterEvents = NULL +cdef void* __nvmlSystemEventSetWait = NULL +cdef void* __nvmlDeviceModifyDrainState = NULL +cdef void* __nvmlDeviceQueryDrainState = NULL +cdef void* __nvmlDeviceRemoveGpu_v2 = NULL +cdef void* __nvmlDeviceDiscoverGpus = NULL +cdef void* __nvmlDeviceGetFieldValues = NULL +cdef void* __nvmlDeviceClearFieldValues = NULL +cdef void* __nvmlDeviceGetVirtualizationMode = NULL +cdef void* __nvmlDeviceGetHostVgpuMode = NULL +cdef void* __nvmlDeviceSetVirtualizationMode = NULL +cdef void* __nvmlDeviceGetVgpuHeterogeneousMode = NULL +cdef void* __nvmlDeviceSetVgpuHeterogeneousMode = NULL +cdef void* __nvmlVgpuInstanceGetPlacementId = NULL +cdef void* __nvmlDeviceGetVgpuTypeSupportedPlacements = NULL +cdef void* __nvmlDeviceGetVgpuTypeCreatablePlacements = NULL +cdef void* __nvmlVgpuTypeGetGspHeapSize = NULL +cdef void* __nvmlVgpuTypeGetFbReservation = NULL +cdef void* __nvmlVgpuInstanceGetRuntimeStateSize = NULL +cdef void* __nvmlDeviceSetVgpuCapabilities = NULL +cdef void* __nvmlDeviceGetGridLicensableFeatures_v4 = NULL +cdef void* __nvmlGetVgpuDriverCapabilities = NULL +cdef void* __nvmlDeviceGetVgpuCapabilities = NULL +cdef void* __nvmlDeviceGetSupportedVgpus = NULL +cdef void* __nvmlDeviceGetCreatableVgpus = NULL +cdef void* __nvmlVgpuTypeGetClass = NULL +cdef void* __nvmlVgpuTypeGetName = NULL +cdef void* __nvmlVgpuTypeGetGpuInstanceProfileId = NULL +cdef void* __nvmlVgpuTypeGetDeviceID = NULL +cdef void* __nvmlVgpuTypeGetFramebufferSize = NULL +cdef void* __nvmlVgpuTypeGetNumDisplayHeads = NULL +cdef void* __nvmlVgpuTypeGetResolution = NULL +cdef void* __nvmlVgpuTypeGetLicense = NULL +cdef void* __nvmlVgpuTypeGetFrameRateLimit = NULL +cdef void* __nvmlVgpuTypeGetMaxInstances = NULL +cdef void* __nvmlVgpuTypeGetMaxInstancesPerVm = NULL +cdef void* __nvmlVgpuTypeGetBAR1Info = NULL +cdef void* __nvmlDeviceGetActiveVgpus = NULL +cdef void* __nvmlVgpuInstanceGetVmID = NULL +cdef void* __nvmlVgpuInstanceGetUUID = NULL +cdef void* __nvmlVgpuInstanceGetVmDriverVersion = NULL +cdef void* __nvmlVgpuInstanceGetFbUsage = NULL +cdef void* __nvmlVgpuInstanceGetLicenseStatus = NULL +cdef void* __nvmlVgpuInstanceGetType = NULL +cdef void* __nvmlVgpuInstanceGetFrameRateLimit = NULL +cdef void* __nvmlVgpuInstanceGetEccMode = NULL +cdef void* __nvmlVgpuInstanceGetEncoderCapacity = NULL +cdef void* __nvmlVgpuInstanceSetEncoderCapacity = NULL +cdef void* __nvmlVgpuInstanceGetEncoderStats = NULL +cdef void* __nvmlVgpuInstanceGetEncoderSessions = NULL +cdef void* __nvmlVgpuInstanceGetFBCStats = NULL +cdef void* __nvmlVgpuInstanceGetFBCSessions = NULL +cdef void* __nvmlVgpuInstanceGetGpuInstanceId = NULL +cdef void* __nvmlVgpuInstanceGetGpuPciId = NULL +cdef void* __nvmlVgpuTypeGetCapabilities = NULL +cdef void* __nvmlVgpuInstanceGetMdevUUID = NULL +cdef void* __nvmlGpuInstanceGetCreatableVgpus = NULL +cdef void* __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = NULL +cdef void* __nvmlGpuInstanceGetActiveVgpus = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog = NULL +cdef void* __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = NULL +cdef void* __nvmlGpuInstanceGetVgpuHeterogeneousMode = NULL +cdef void* __nvmlGpuInstanceSetVgpuHeterogeneousMode = NULL +cdef void* __nvmlVgpuInstanceGetMetadata = NULL +cdef void* __nvmlDeviceGetVgpuMetadata = NULL +cdef void* __nvmlGetVgpuCompatibility = NULL +cdef void* __nvmlDeviceGetPgpuMetadataString = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerCapabilities = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState = NULL +cdef void* __nvmlGetVgpuVersion = NULL +cdef void* __nvmlSetVgpuVersion = NULL +cdef void* __nvmlDeviceGetVgpuUtilization = NULL +cdef void* __nvmlDeviceGetVgpuInstancesUtilizationInfo = NULL +cdef void* __nvmlDeviceGetVgpuProcessUtilization = NULL +cdef void* __nvmlDeviceGetVgpuProcessesUtilizationInfo = NULL +cdef void* __nvmlVgpuInstanceGetAccountingMode = NULL +cdef void* __nvmlVgpuInstanceGetAccountingPids = NULL +cdef void* __nvmlVgpuInstanceGetAccountingStats = NULL +cdef void* __nvmlVgpuInstanceClearAccountingPids = NULL +cdef void* __nvmlVgpuInstanceGetLicenseInfo_v2 = NULL +cdef void* __nvmlGetExcludedDeviceCount = NULL +cdef void* __nvmlGetExcludedDeviceInfoByIndex = NULL +cdef void* __nvmlDeviceSetMigMode = NULL +cdef void* __nvmlDeviceGetMigMode = NULL +cdef void* __nvmlDeviceGetGpuInstanceProfileInfoV = NULL +cdef void* __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = NULL +cdef void* __nvmlDeviceGetGpuInstanceRemainingCapacity = NULL +cdef void* __nvmlDeviceCreateGpuInstance = NULL +cdef void* __nvmlDeviceCreateGpuInstanceWithPlacement = NULL +cdef void* __nvmlGpuInstanceDestroy = NULL +cdef void* __nvmlDeviceGetGpuInstances = NULL +cdef void* __nvmlDeviceGetGpuInstanceById = NULL +cdef void* __nvmlGpuInstanceGetInfo = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceProfileInfoV = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = NULL +cdef void* __nvmlGpuInstanceGetComputeInstancePossiblePlacements = NULL +cdef void* __nvmlGpuInstanceCreateComputeInstance = NULL +cdef void* __nvmlGpuInstanceCreateComputeInstanceWithPlacement = NULL +cdef void* __nvmlComputeInstanceDestroy = NULL +cdef void* __nvmlGpuInstanceGetComputeInstances = NULL +cdef void* __nvmlGpuInstanceGetComputeInstanceById = NULL +cdef void* __nvmlComputeInstanceGetInfo_v2 = NULL +cdef void* __nvmlDeviceIsMigDeviceHandle = NULL +cdef void* __nvmlDeviceGetGpuInstanceId = NULL +cdef void* __nvmlDeviceGetComputeInstanceId = NULL +cdef void* __nvmlDeviceGetMaxMigDeviceCount = NULL +cdef void* __nvmlDeviceGetMigDeviceHandleByIndex = NULL +cdef void* __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = NULL +cdef void* __nvmlDeviceGetCapabilities = NULL +cdef void* __nvmlDevicePowerSmoothingActivatePresetProfile = NULL +cdef void* __nvmlDevicePowerSmoothingUpdatePresetProfileParam = NULL +cdef void* __nvmlDevicePowerSmoothingSetState = NULL +cdef void* __nvmlDeviceGetAddressingMode = NULL +cdef void* __nvmlDeviceGetRepairStatus = NULL +cdef void* __nvmlDeviceGetPowerMizerMode_v1 = NULL +cdef void* __nvmlDeviceSetPowerMizerMode_v1 = NULL +cdef void* __nvmlDeviceGetPdi = NULL +cdef void* __nvmlDeviceSetHostname_v1 = NULL +cdef void* __nvmlDeviceGetHostname_v1 = NULL +cdef void* __nvmlDeviceGetNvLinkInfo = NULL +cdef void* __nvmlDeviceReadWritePRM_v1 = NULL +cdef void* __nvmlDeviceGetGpuInstanceProfileInfoByIdV = NULL +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* __nvmlSystemGetCPER_v1 = NULL +cdef void* __nvmlDeviceGetBBXTimeData_v1 = NULL +cdef void* __nvmlDeviceGetAccountingStats_v2 = NULL +cdef void* __nvmlDeviceGetRemappedRows_v2 = NULL + +cdef int _init_nvml() except -1 nogil: + global _cyb___py_nvml_init + + cdef int err + cdef uintptr_t handle + with gil, _cyb_symbol_lock: + if _cyb___py_nvml_init: return 0 + + handle = load_library() + global __nvmlInit_v2 + __nvmlInit_v2 = _cyb_GetProcAddress(handle, 'nvmlInit_v2') + + global __nvmlInitWithFlags + __nvmlInitWithFlags = _cyb_GetProcAddress(handle, 'nvmlInitWithFlags') + + global __nvmlShutdown + __nvmlShutdown = _cyb_GetProcAddress(handle, 'nvmlShutdown') + + global __nvmlErrorString + __nvmlErrorString = _cyb_GetProcAddress(handle, 'nvmlErrorString') + + global __nvmlSystemGetDriverVersion + __nvmlSystemGetDriverVersion = _cyb_GetProcAddress(handle, 'nvmlSystemGetDriverVersion') + + global __nvmlSystemGetNVMLVersion + __nvmlSystemGetNVMLVersion = _cyb_GetProcAddress(handle, 'nvmlSystemGetNVMLVersion') + + global __nvmlSystemGetCudaDriverVersion + __nvmlSystemGetCudaDriverVersion = _cyb_GetProcAddress(handle, 'nvmlSystemGetCudaDriverVersion') + + global __nvmlSystemGetCudaDriverVersion_v2 + __nvmlSystemGetCudaDriverVersion_v2 = _cyb_GetProcAddress(handle, 'nvmlSystemGetCudaDriverVersion_v2') + + global __nvmlSystemGetProcessName + __nvmlSystemGetProcessName = _cyb_GetProcAddress(handle, 'nvmlSystemGetProcessName') + + global __nvmlSystemGetHicVersion + __nvmlSystemGetHicVersion = _cyb_GetProcAddress(handle, 'nvmlSystemGetHicVersion') + + global __nvmlSystemGetTopologyGpuSet + __nvmlSystemGetTopologyGpuSet = _cyb_GetProcAddress(handle, 'nvmlSystemGetTopologyGpuSet') + + global __nvmlSystemGetDriverBranch + __nvmlSystemGetDriverBranch = _cyb_GetProcAddress(handle, 'nvmlSystemGetDriverBranch') + + global __nvmlUnitGetCount + __nvmlUnitGetCount = _cyb_GetProcAddress(handle, 'nvmlUnitGetCount') + + global __nvmlUnitGetHandleByIndex + __nvmlUnitGetHandleByIndex = _cyb_GetProcAddress(handle, 'nvmlUnitGetHandleByIndex') + + global __nvmlUnitGetUnitInfo + __nvmlUnitGetUnitInfo = _cyb_GetProcAddress(handle, 'nvmlUnitGetUnitInfo') + + global __nvmlUnitGetLedState + __nvmlUnitGetLedState = _cyb_GetProcAddress(handle, 'nvmlUnitGetLedState') + + global __nvmlUnitGetPsuInfo + __nvmlUnitGetPsuInfo = _cyb_GetProcAddress(handle, 'nvmlUnitGetPsuInfo') + + global __nvmlUnitGetTemperature + __nvmlUnitGetTemperature = _cyb_GetProcAddress(handle, 'nvmlUnitGetTemperature') + + global __nvmlUnitGetFanSpeedInfo + __nvmlUnitGetFanSpeedInfo = _cyb_GetProcAddress(handle, 'nvmlUnitGetFanSpeedInfo') + + global __nvmlUnitGetDevices + __nvmlUnitGetDevices = _cyb_GetProcAddress(handle, 'nvmlUnitGetDevices') + + global __nvmlDeviceGetCount_v2 + __nvmlDeviceGetCount_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCount_v2') + + global __nvmlDeviceGetAttributes_v2 + __nvmlDeviceGetAttributes_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAttributes_v2') + + global __nvmlDeviceGetHandleByIndex_v2 + __nvmlDeviceGetHandleByIndex_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHandleByIndex_v2') + + global __nvmlDeviceGetHandleBySerial + __nvmlDeviceGetHandleBySerial = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHandleBySerial') + + global __nvmlDeviceGetHandleByUUID + __nvmlDeviceGetHandleByUUID = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHandleByUUID') + + global __nvmlDeviceGetHandleByUUIDV + __nvmlDeviceGetHandleByUUIDV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHandleByUUIDV') + + global __nvmlDeviceGetHandleByPciBusId_v2 + __nvmlDeviceGetHandleByPciBusId_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHandleByPciBusId_v2') + + global __nvmlDeviceGetName + __nvmlDeviceGetName = _cyb_GetProcAddress(handle, 'nvmlDeviceGetName') + + global __nvmlDeviceGetBrand + __nvmlDeviceGetBrand = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBrand') + + global __nvmlDeviceGetIndex + __nvmlDeviceGetIndex = _cyb_GetProcAddress(handle, 'nvmlDeviceGetIndex') + + global __nvmlDeviceGetSerial + __nvmlDeviceGetSerial = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSerial') + + global __nvmlDeviceGetModuleId + __nvmlDeviceGetModuleId = _cyb_GetProcAddress(handle, 'nvmlDeviceGetModuleId') + + global __nvmlDeviceGetC2cModeInfoV + __nvmlDeviceGetC2cModeInfoV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetC2cModeInfoV') + + global __nvmlDeviceGetMemoryAffinity + __nvmlDeviceGetMemoryAffinity = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemoryAffinity') + + global __nvmlDeviceGetCpuAffinityWithinScope + __nvmlDeviceGetCpuAffinityWithinScope = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCpuAffinityWithinScope') + + global __nvmlDeviceGetCpuAffinity + __nvmlDeviceGetCpuAffinity = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCpuAffinity') + + global __nvmlDeviceSetCpuAffinity + __nvmlDeviceSetCpuAffinity = _cyb_GetProcAddress(handle, 'nvmlDeviceSetCpuAffinity') + + global __nvmlDeviceClearCpuAffinity + __nvmlDeviceClearCpuAffinity = _cyb_GetProcAddress(handle, 'nvmlDeviceClearCpuAffinity') + + global __nvmlDeviceGetNumaNodeId + __nvmlDeviceGetNumaNodeId = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNumaNodeId') + + global __nvmlDeviceGetTopologyCommonAncestor + __nvmlDeviceGetTopologyCommonAncestor = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTopologyCommonAncestor') + + global __nvmlDeviceGetTopologyNearestGpus + __nvmlDeviceGetTopologyNearestGpus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTopologyNearestGpus') + + global __nvmlDeviceGetP2PStatus + __nvmlDeviceGetP2PStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetP2PStatus') + + global __nvmlDeviceGetUUID + __nvmlDeviceGetUUID = _cyb_GetProcAddress(handle, 'nvmlDeviceGetUUID') + + global __nvmlDeviceGetMinorNumber + __nvmlDeviceGetMinorNumber = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMinorNumber') + + global __nvmlDeviceGetBoardPartNumber + __nvmlDeviceGetBoardPartNumber = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBoardPartNumber') + + global __nvmlDeviceGetInforomVersion + __nvmlDeviceGetInforomVersion = _cyb_GetProcAddress(handle, 'nvmlDeviceGetInforomVersion') + + global __nvmlDeviceGetInforomImageVersion + __nvmlDeviceGetInforomImageVersion = _cyb_GetProcAddress(handle, 'nvmlDeviceGetInforomImageVersion') + + global __nvmlDeviceGetInforomConfigurationChecksum + __nvmlDeviceGetInforomConfigurationChecksum = _cyb_GetProcAddress(handle, 'nvmlDeviceGetInforomConfigurationChecksum') + + global __nvmlDeviceValidateInforom + __nvmlDeviceValidateInforom = _cyb_GetProcAddress(handle, 'nvmlDeviceValidateInforom') + + global __nvmlDeviceGetLastBBXFlushTime + __nvmlDeviceGetLastBBXFlushTime = _cyb_GetProcAddress(handle, 'nvmlDeviceGetLastBBXFlushTime') + + global __nvmlDeviceGetDisplayMode + __nvmlDeviceGetDisplayMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDisplayMode') + + global __nvmlDeviceGetDisplayActive + __nvmlDeviceGetDisplayActive = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDisplayActive') + + global __nvmlDeviceGetPersistenceMode + __nvmlDeviceGetPersistenceMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPersistenceMode') + + global __nvmlDeviceGetPciInfoExt + __nvmlDeviceGetPciInfoExt = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPciInfoExt') + + global __nvmlDeviceGetPciInfo_v3 + __nvmlDeviceGetPciInfo_v3 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPciInfo_v3') + + global __nvmlDeviceGetMaxPcieLinkGeneration + __nvmlDeviceGetMaxPcieLinkGeneration = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMaxPcieLinkGeneration') + + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + __nvmlDeviceGetGpuMaxPcieLinkGeneration = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuMaxPcieLinkGeneration') + + global __nvmlDeviceGetMaxPcieLinkWidth + __nvmlDeviceGetMaxPcieLinkWidth = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMaxPcieLinkWidth') + + global __nvmlDeviceGetCurrPcieLinkGeneration + __nvmlDeviceGetCurrPcieLinkGeneration = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCurrPcieLinkGeneration') + + global __nvmlDeviceGetCurrPcieLinkWidth + __nvmlDeviceGetCurrPcieLinkWidth = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCurrPcieLinkWidth') + + global __nvmlDeviceGetPcieThroughput + __nvmlDeviceGetPcieThroughput = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPcieThroughput') + + global __nvmlDeviceGetPcieReplayCounter + __nvmlDeviceGetPcieReplayCounter = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPcieReplayCounter') + + global __nvmlDeviceGetClockInfo + __nvmlDeviceGetClockInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetClockInfo') + + global __nvmlDeviceGetMaxClockInfo + __nvmlDeviceGetMaxClockInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMaxClockInfo') + + global __nvmlDeviceGetGpcClkVfOffset + __nvmlDeviceGetGpcClkVfOffset = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpcClkVfOffset') + + global __nvmlDeviceGetClock + __nvmlDeviceGetClock = _cyb_GetProcAddress(handle, 'nvmlDeviceGetClock') + + global __nvmlDeviceGetMaxCustomerBoostClock + __nvmlDeviceGetMaxCustomerBoostClock = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMaxCustomerBoostClock') + + global __nvmlDeviceGetSupportedMemoryClocks + __nvmlDeviceGetSupportedMemoryClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedMemoryClocks') + + global __nvmlDeviceGetSupportedGraphicsClocks + __nvmlDeviceGetSupportedGraphicsClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedGraphicsClocks') + + global __nvmlDeviceGetAutoBoostedClocksEnabled + __nvmlDeviceGetAutoBoostedClocksEnabled = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAutoBoostedClocksEnabled') + + global __nvmlDeviceGetFanSpeed + __nvmlDeviceGetFanSpeed = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFanSpeed') + + global __nvmlDeviceGetFanSpeed_v2 + __nvmlDeviceGetFanSpeed_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFanSpeed_v2') + + global __nvmlDeviceGetFanSpeedRPM + __nvmlDeviceGetFanSpeedRPM = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFanSpeedRPM') + + global __nvmlDeviceGetTargetFanSpeed + __nvmlDeviceGetTargetFanSpeed = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTargetFanSpeed') + + global __nvmlDeviceGetMinMaxFanSpeed + __nvmlDeviceGetMinMaxFanSpeed = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMinMaxFanSpeed') + + global __nvmlDeviceGetFanControlPolicy_v2 + __nvmlDeviceGetFanControlPolicy_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFanControlPolicy_v2') + + global __nvmlDeviceGetNumFans + __nvmlDeviceGetNumFans = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNumFans') + + global __nvmlDeviceGetCoolerInfo + __nvmlDeviceGetCoolerInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCoolerInfo') + + global __nvmlDeviceGetTemperatureV + __nvmlDeviceGetTemperatureV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTemperatureV') + + global __nvmlDeviceGetTemperatureThreshold + __nvmlDeviceGetTemperatureThreshold = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTemperatureThreshold') + + global __nvmlDeviceGetMarginTemperature + __nvmlDeviceGetMarginTemperature = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMarginTemperature') + + global __nvmlDeviceGetThermalSettings + __nvmlDeviceGetThermalSettings = _cyb_GetProcAddress(handle, 'nvmlDeviceGetThermalSettings') + + global __nvmlDeviceGetPerformanceState + __nvmlDeviceGetPerformanceState = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPerformanceState') + + global __nvmlDeviceGetCurrentClocksEventReasons + __nvmlDeviceGetCurrentClocksEventReasons = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCurrentClocksEventReasons') + + global __nvmlDeviceGetSupportedClocksEventReasons + __nvmlDeviceGetSupportedClocksEventReasons = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedClocksEventReasons') + + global __nvmlDeviceGetPowerState + __nvmlDeviceGetPowerState = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerState') + + global __nvmlDeviceGetDynamicPstatesInfo + __nvmlDeviceGetDynamicPstatesInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDynamicPstatesInfo') + + global __nvmlDeviceGetMemClkVfOffset + __nvmlDeviceGetMemClkVfOffset = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemClkVfOffset') + + global __nvmlDeviceGetMinMaxClockOfPState + __nvmlDeviceGetMinMaxClockOfPState = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMinMaxClockOfPState') + + global __nvmlDeviceGetSupportedPerformanceStates + __nvmlDeviceGetSupportedPerformanceStates = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedPerformanceStates') + + global __nvmlDeviceGetGpcClkMinMaxVfOffset + __nvmlDeviceGetGpcClkMinMaxVfOffset = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpcClkMinMaxVfOffset') + + global __nvmlDeviceGetMemClkMinMaxVfOffset + __nvmlDeviceGetMemClkMinMaxVfOffset = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemClkMinMaxVfOffset') + + global __nvmlDeviceGetClockOffsets + __nvmlDeviceGetClockOffsets = _cyb_GetProcAddress(handle, 'nvmlDeviceGetClockOffsets') + + global __nvmlDeviceSetClockOffsets + __nvmlDeviceSetClockOffsets = _cyb_GetProcAddress(handle, 'nvmlDeviceSetClockOffsets') + + global __nvmlDeviceGetPerformanceModes + __nvmlDeviceGetPerformanceModes = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPerformanceModes') + + global __nvmlDeviceGetCurrentClockFreqs + __nvmlDeviceGetCurrentClockFreqs = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCurrentClockFreqs') + + global __nvmlDeviceGetPowerManagementLimit + __nvmlDeviceGetPowerManagementLimit = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerManagementLimit') + + global __nvmlDeviceGetPowerManagementLimitConstraints + __nvmlDeviceGetPowerManagementLimitConstraints = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerManagementLimitConstraints') + + global __nvmlDeviceGetPowerManagementDefaultLimit + __nvmlDeviceGetPowerManagementDefaultLimit = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerManagementDefaultLimit') + + global __nvmlDeviceGetPowerUsage + __nvmlDeviceGetPowerUsage = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerUsage') + + global __nvmlDeviceGetTotalEnergyConsumption + __nvmlDeviceGetTotalEnergyConsumption = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTotalEnergyConsumption') + + global __nvmlDeviceGetEnforcedPowerLimit + __nvmlDeviceGetEnforcedPowerLimit = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEnforcedPowerLimit') + + global __nvmlDeviceGetGpuOperationMode + __nvmlDeviceGetGpuOperationMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuOperationMode') + + global __nvmlDeviceGetMemoryInfo_v2 + __nvmlDeviceGetMemoryInfo_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemoryInfo_v2') + + global __nvmlDeviceGetComputeMode + __nvmlDeviceGetComputeMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetComputeMode') + + global __nvmlDeviceGetCudaComputeCapability + __nvmlDeviceGetCudaComputeCapability = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCudaComputeCapability') + + global __nvmlDeviceGetDramEncryptionMode + __nvmlDeviceGetDramEncryptionMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDramEncryptionMode') + + global __nvmlDeviceSetDramEncryptionMode + __nvmlDeviceSetDramEncryptionMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetDramEncryptionMode') + + global __nvmlDeviceGetEccMode + __nvmlDeviceGetEccMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEccMode') + + global __nvmlDeviceGetDefaultEccMode + __nvmlDeviceGetDefaultEccMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDefaultEccMode') + + global __nvmlDeviceGetBoardId + __nvmlDeviceGetBoardId = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBoardId') + + global __nvmlDeviceGetMultiGpuBoard + __nvmlDeviceGetMultiGpuBoard = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMultiGpuBoard') + + global __nvmlDeviceGetTotalEccErrors + __nvmlDeviceGetTotalEccErrors = _cyb_GetProcAddress(handle, 'nvmlDeviceGetTotalEccErrors') + + global __nvmlDeviceGetMemoryErrorCounter + __nvmlDeviceGetMemoryErrorCounter = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemoryErrorCounter') + + global __nvmlDeviceGetUtilizationRates + __nvmlDeviceGetUtilizationRates = _cyb_GetProcAddress(handle, 'nvmlDeviceGetUtilizationRates') + + global __nvmlDeviceGetEncoderUtilization + __nvmlDeviceGetEncoderUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEncoderUtilization') + + global __nvmlDeviceGetEncoderCapacity + __nvmlDeviceGetEncoderCapacity = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEncoderCapacity') + + global __nvmlDeviceGetEncoderStats + __nvmlDeviceGetEncoderStats = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEncoderStats') + + global __nvmlDeviceGetEncoderSessions + __nvmlDeviceGetEncoderSessions = _cyb_GetProcAddress(handle, 'nvmlDeviceGetEncoderSessions') + + global __nvmlDeviceGetDecoderUtilization + __nvmlDeviceGetDecoderUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDecoderUtilization') + + global __nvmlDeviceGetJpgUtilization + __nvmlDeviceGetJpgUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetJpgUtilization') + + global __nvmlDeviceGetOfaUtilization + __nvmlDeviceGetOfaUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetOfaUtilization') + + global __nvmlDeviceGetFBCStats + __nvmlDeviceGetFBCStats = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFBCStats') + + global __nvmlDeviceGetFBCSessions + __nvmlDeviceGetFBCSessions = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFBCSessions') + + global __nvmlDeviceGetDriverModel_v2 + __nvmlDeviceGetDriverModel_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDriverModel_v2') + + global __nvmlDeviceGetVbiosVersion + __nvmlDeviceGetVbiosVersion = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVbiosVersion') + + global __nvmlDeviceGetBridgeChipInfo + __nvmlDeviceGetBridgeChipInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBridgeChipInfo') + + global __nvmlDeviceGetComputeRunningProcesses_v3 + __nvmlDeviceGetComputeRunningProcesses_v3 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 + __nvmlDeviceGetMPSComputeRunningProcesses_v3 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') + + global __nvmlDeviceGetRunningProcessDetailList + __nvmlDeviceGetRunningProcessDetailList = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRunningProcessDetailList') + + global __nvmlDeviceOnSameBoard + __nvmlDeviceOnSameBoard = _cyb_GetProcAddress(handle, 'nvmlDeviceOnSameBoard') + + global __nvmlDeviceGetAPIRestriction + __nvmlDeviceGetAPIRestriction = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAPIRestriction') + + global __nvmlDeviceGetSamples + __nvmlDeviceGetSamples = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSamples') + + global __nvmlDeviceGetBAR1MemoryInfo + __nvmlDeviceGetBAR1MemoryInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBAR1MemoryInfo') + + global __nvmlDeviceGetIrqNum + __nvmlDeviceGetIrqNum = _cyb_GetProcAddress(handle, 'nvmlDeviceGetIrqNum') + + global __nvmlDeviceGetNumGpuCores + __nvmlDeviceGetNumGpuCores = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNumGpuCores') + + global __nvmlDeviceGetPowerSource + __nvmlDeviceGetPowerSource = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerSource') + + global __nvmlDeviceGetMemoryBusWidth + __nvmlDeviceGetMemoryBusWidth = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemoryBusWidth') + + global __nvmlDeviceGetPcieLinkMaxSpeed + __nvmlDeviceGetPcieLinkMaxSpeed = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPcieLinkMaxSpeed') + + global __nvmlDeviceGetPcieSpeed + __nvmlDeviceGetPcieSpeed = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPcieSpeed') + + global __nvmlDeviceGetAdaptiveClockInfoStatus + __nvmlDeviceGetAdaptiveClockInfoStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAdaptiveClockInfoStatus') + + global __nvmlDeviceGetBusType + __nvmlDeviceGetBusType = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBusType') + + global __nvmlDeviceGetGpuFabricInfoV + __nvmlDeviceGetGpuFabricInfoV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuFabricInfoV') + + global __nvmlSystemGetConfComputeCapabilities + __nvmlSystemGetConfComputeCapabilities = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeCapabilities') + + global __nvmlSystemGetConfComputeState + __nvmlSystemGetConfComputeState = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeState') + + global __nvmlDeviceGetConfComputeMemSizeInfo + __nvmlDeviceGetConfComputeMemSizeInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetConfComputeMemSizeInfo') + + global __nvmlSystemGetConfComputeGpusReadyState + __nvmlSystemGetConfComputeGpusReadyState = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeGpusReadyState') + + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + __nvmlDeviceGetConfComputeProtectedMemoryUsage = _cyb_GetProcAddress(handle, 'nvmlDeviceGetConfComputeProtectedMemoryUsage') + + global __nvmlDeviceGetConfComputeGpuCertificate + __nvmlDeviceGetConfComputeGpuCertificate = _cyb_GetProcAddress(handle, 'nvmlDeviceGetConfComputeGpuCertificate') + + global __nvmlDeviceGetConfComputeGpuAttestationReport + __nvmlDeviceGetConfComputeGpuAttestationReport = _cyb_GetProcAddress(handle, 'nvmlDeviceGetConfComputeGpuAttestationReport') + + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + __nvmlSystemGetConfComputeKeyRotationThresholdInfo = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeKeyRotationThresholdInfo') + + global __nvmlDeviceSetConfComputeUnprotectedMemSize + __nvmlDeviceSetConfComputeUnprotectedMemSize = _cyb_GetProcAddress(handle, 'nvmlDeviceSetConfComputeUnprotectedMemSize') + + global __nvmlSystemSetConfComputeGpusReadyState + __nvmlSystemSetConfComputeGpusReadyState = _cyb_GetProcAddress(handle, 'nvmlSystemSetConfComputeGpusReadyState') + + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + __nvmlSystemSetConfComputeKeyRotationThresholdInfo = _cyb_GetProcAddress(handle, 'nvmlSystemSetConfComputeKeyRotationThresholdInfo') + + global __nvmlSystemGetConfComputeSettings + __nvmlSystemGetConfComputeSettings = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeSettings') + + global __nvmlDeviceGetGspFirmwareVersion + __nvmlDeviceGetGspFirmwareVersion = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGspFirmwareVersion') + + global __nvmlDeviceGetGspFirmwareMode + __nvmlDeviceGetGspFirmwareMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGspFirmwareMode') + + global __nvmlDeviceGetSramEccErrorStatus + __nvmlDeviceGetSramEccErrorStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSramEccErrorStatus') + + global __nvmlDeviceGetAccountingMode + __nvmlDeviceGetAccountingMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingMode') + + global __nvmlDeviceGetAccountingStats + __nvmlDeviceGetAccountingStats = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingStats') + + global __nvmlDeviceGetAccountingPids + __nvmlDeviceGetAccountingPids = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingPids') + + global __nvmlDeviceGetAccountingBufferSize + __nvmlDeviceGetAccountingBufferSize = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingBufferSize') + + global __nvmlDeviceGetRetiredPages + __nvmlDeviceGetRetiredPages = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRetiredPages') + + global __nvmlDeviceGetRetiredPages_v2 + __nvmlDeviceGetRetiredPages_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRetiredPages_v2') + + global __nvmlDeviceGetRetiredPagesPendingStatus + __nvmlDeviceGetRetiredPagesPendingStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRetiredPagesPendingStatus') + + global __nvmlDeviceGetRemappedRows + __nvmlDeviceGetRemappedRows = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRemappedRows') + + global __nvmlDeviceGetRowRemapperHistogram + __nvmlDeviceGetRowRemapperHistogram = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRowRemapperHistogram') + + global __nvmlDeviceGetArchitecture + __nvmlDeviceGetArchitecture = _cyb_GetProcAddress(handle, 'nvmlDeviceGetArchitecture') + + global __nvmlDeviceGetClkMonStatus + __nvmlDeviceGetClkMonStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetClkMonStatus') + + global __nvmlDeviceGetProcessUtilization + __nvmlDeviceGetProcessUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetProcessUtilization') + + global __nvmlDeviceGetProcessesUtilizationInfo + __nvmlDeviceGetProcessesUtilizationInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetProcessesUtilizationInfo') + + global __nvmlDeviceGetPlatformInfo + __nvmlDeviceGetPlatformInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPlatformInfo') + + global __nvmlUnitSetLedState + __nvmlUnitSetLedState = _cyb_GetProcAddress(handle, 'nvmlUnitSetLedState') + + global __nvmlDeviceSetPersistenceMode + __nvmlDeviceSetPersistenceMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetPersistenceMode') + + global __nvmlDeviceSetComputeMode + __nvmlDeviceSetComputeMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetComputeMode') + + global __nvmlDeviceSetEccMode + __nvmlDeviceSetEccMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetEccMode') + + global __nvmlDeviceClearEccErrorCounts + __nvmlDeviceClearEccErrorCounts = _cyb_GetProcAddress(handle, 'nvmlDeviceClearEccErrorCounts') + + global __nvmlDeviceSetDriverModel + __nvmlDeviceSetDriverModel = _cyb_GetProcAddress(handle, 'nvmlDeviceSetDriverModel') + + global __nvmlDeviceSetGpuLockedClocks + __nvmlDeviceSetGpuLockedClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceSetGpuLockedClocks') + + global __nvmlDeviceResetGpuLockedClocks + __nvmlDeviceResetGpuLockedClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceResetGpuLockedClocks') + + global __nvmlDeviceSetMemoryLockedClocks + __nvmlDeviceSetMemoryLockedClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceSetMemoryLockedClocks') + + global __nvmlDeviceResetMemoryLockedClocks + __nvmlDeviceResetMemoryLockedClocks = _cyb_GetProcAddress(handle, 'nvmlDeviceResetMemoryLockedClocks') + + global __nvmlDeviceSetAutoBoostedClocksEnabled + __nvmlDeviceSetAutoBoostedClocksEnabled = _cyb_GetProcAddress(handle, 'nvmlDeviceSetAutoBoostedClocksEnabled') + + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = _cyb_GetProcAddress(handle, 'nvmlDeviceSetDefaultAutoBoostedClocksEnabled') + + global __nvmlDeviceSetDefaultFanSpeed_v2 + __nvmlDeviceSetDefaultFanSpeed_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetDefaultFanSpeed_v2') + + global __nvmlDeviceSetFanControlPolicy + __nvmlDeviceSetFanControlPolicy = _cyb_GetProcAddress(handle, 'nvmlDeviceSetFanControlPolicy') + + global __nvmlDeviceSetTemperatureThreshold + __nvmlDeviceSetTemperatureThreshold = _cyb_GetProcAddress(handle, 'nvmlDeviceSetTemperatureThreshold') + + global __nvmlDeviceSetGpuOperationMode + __nvmlDeviceSetGpuOperationMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetGpuOperationMode') + + global __nvmlDeviceSetAPIRestriction + __nvmlDeviceSetAPIRestriction = _cyb_GetProcAddress(handle, 'nvmlDeviceSetAPIRestriction') + + global __nvmlDeviceSetFanSpeed_v2 + __nvmlDeviceSetFanSpeed_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetFanSpeed_v2') + + global __nvmlDeviceSetAccountingMode + __nvmlDeviceSetAccountingMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetAccountingMode') + + global __nvmlDeviceClearAccountingPids + __nvmlDeviceClearAccountingPids = _cyb_GetProcAddress(handle, 'nvmlDeviceClearAccountingPids') + + global __nvmlDeviceSetPowerManagementLimit_v2 + __nvmlDeviceSetPowerManagementLimit_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetPowerManagementLimit_v2') + + global __nvmlDeviceGetNvLinkState + __nvmlDeviceGetNvLinkState = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkState') + + global __nvmlDeviceGetNvLinkVersion + __nvmlDeviceGetNvLinkVersion = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkVersion') + + global __nvmlDeviceGetNvLinkCapability + __nvmlDeviceGetNvLinkCapability = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkCapability') + + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + __nvmlDeviceGetNvLinkRemotePciInfo_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkRemotePciInfo_v2') + + global __nvmlDeviceGetNvLinkErrorCounter + __nvmlDeviceGetNvLinkErrorCounter = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkErrorCounter') + + global __nvmlDeviceResetNvLinkErrorCounters + __nvmlDeviceResetNvLinkErrorCounters = _cyb_GetProcAddress(handle, 'nvmlDeviceResetNvLinkErrorCounters') + + global __nvmlDeviceGetNvLinkRemoteDeviceType + __nvmlDeviceGetNvLinkRemoteDeviceType = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkRemoteDeviceType') + + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = _cyb_GetProcAddress(handle, 'nvmlDeviceSetNvLinkDeviceLowPowerThreshold') + + global __nvmlSystemSetNvlinkBwMode + __nvmlSystemSetNvlinkBwMode = _cyb_GetProcAddress(handle, 'nvmlSystemSetNvlinkBwMode') + + global __nvmlSystemGetNvlinkBwMode + __nvmlSystemGetNvlinkBwMode = _cyb_GetProcAddress(handle, 'nvmlSystemGetNvlinkBwMode') + + global __nvmlDeviceGetNvlinkSupportedBwModes + __nvmlDeviceGetNvlinkSupportedBwModes = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvlinkSupportedBwModes') + + global __nvmlDeviceGetNvlinkBwMode + __nvmlDeviceGetNvlinkBwMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvlinkBwMode') + + global __nvmlDeviceSetNvlinkBwMode + __nvmlDeviceSetNvlinkBwMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetNvlinkBwMode') + + global __nvmlEventSetCreate + __nvmlEventSetCreate = _cyb_GetProcAddress(handle, 'nvmlEventSetCreate') + + global __nvmlDeviceRegisterEvents + __nvmlDeviceRegisterEvents = _cyb_GetProcAddress(handle, 'nvmlDeviceRegisterEvents') + + global __nvmlDeviceGetSupportedEventTypes + __nvmlDeviceGetSupportedEventTypes = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedEventTypes') + + global __nvmlEventSetWait_v2 + __nvmlEventSetWait_v2 = _cyb_GetProcAddress(handle, 'nvmlEventSetWait_v2') + + global __nvmlEventSetFree + __nvmlEventSetFree = _cyb_GetProcAddress(handle, 'nvmlEventSetFree') + + global __nvmlSystemEventSetCreate + __nvmlSystemEventSetCreate = _cyb_GetProcAddress(handle, 'nvmlSystemEventSetCreate') + + global __nvmlSystemEventSetFree + __nvmlSystemEventSetFree = _cyb_GetProcAddress(handle, 'nvmlSystemEventSetFree') + + global __nvmlSystemRegisterEvents + __nvmlSystemRegisterEvents = _cyb_GetProcAddress(handle, 'nvmlSystemRegisterEvents') + + global __nvmlSystemEventSetWait + __nvmlSystemEventSetWait = _cyb_GetProcAddress(handle, 'nvmlSystemEventSetWait') + + global __nvmlDeviceModifyDrainState + __nvmlDeviceModifyDrainState = _cyb_GetProcAddress(handle, 'nvmlDeviceModifyDrainState') + + global __nvmlDeviceQueryDrainState + __nvmlDeviceQueryDrainState = _cyb_GetProcAddress(handle, 'nvmlDeviceQueryDrainState') + + global __nvmlDeviceRemoveGpu_v2 + __nvmlDeviceRemoveGpu_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceRemoveGpu_v2') + + global __nvmlDeviceDiscoverGpus + __nvmlDeviceDiscoverGpus = _cyb_GetProcAddress(handle, 'nvmlDeviceDiscoverGpus') + + global __nvmlDeviceGetFieldValues + __nvmlDeviceGetFieldValues = _cyb_GetProcAddress(handle, 'nvmlDeviceGetFieldValues') + + global __nvmlDeviceClearFieldValues + __nvmlDeviceClearFieldValues = _cyb_GetProcAddress(handle, 'nvmlDeviceClearFieldValues') + + global __nvmlDeviceGetVirtualizationMode + __nvmlDeviceGetVirtualizationMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVirtualizationMode') + + global __nvmlDeviceGetHostVgpuMode + __nvmlDeviceGetHostVgpuMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHostVgpuMode') + + global __nvmlDeviceSetVirtualizationMode + __nvmlDeviceSetVirtualizationMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetVirtualizationMode') + + global __nvmlDeviceGetVgpuHeterogeneousMode + __nvmlDeviceGetVgpuHeterogeneousMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuHeterogeneousMode') + + global __nvmlDeviceSetVgpuHeterogeneousMode + __nvmlDeviceSetVgpuHeterogeneousMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetVgpuHeterogeneousMode') + + global __nvmlVgpuInstanceGetPlacementId + __nvmlVgpuInstanceGetPlacementId = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetPlacementId') + + global __nvmlDeviceGetVgpuTypeSupportedPlacements + __nvmlDeviceGetVgpuTypeSupportedPlacements = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuTypeSupportedPlacements') + + global __nvmlDeviceGetVgpuTypeCreatablePlacements + __nvmlDeviceGetVgpuTypeCreatablePlacements = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuTypeCreatablePlacements') + + global __nvmlVgpuTypeGetGspHeapSize + __nvmlVgpuTypeGetGspHeapSize = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetGspHeapSize') + + global __nvmlVgpuTypeGetFbReservation + __nvmlVgpuTypeGetFbReservation = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetFbReservation') + + global __nvmlVgpuInstanceGetRuntimeStateSize + __nvmlVgpuInstanceGetRuntimeStateSize = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetRuntimeStateSize') + + global __nvmlDeviceSetVgpuCapabilities + __nvmlDeviceSetVgpuCapabilities = _cyb_GetProcAddress(handle, 'nvmlDeviceSetVgpuCapabilities') + + global __nvmlDeviceGetGridLicensableFeatures_v4 + __nvmlDeviceGetGridLicensableFeatures_v4 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGridLicensableFeatures_v4') + + global __nvmlGetVgpuDriverCapabilities + __nvmlGetVgpuDriverCapabilities = _cyb_GetProcAddress(handle, 'nvmlGetVgpuDriverCapabilities') + + global __nvmlDeviceGetVgpuCapabilities + __nvmlDeviceGetVgpuCapabilities = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuCapabilities') + + global __nvmlDeviceGetSupportedVgpus + __nvmlDeviceGetSupportedVgpus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSupportedVgpus') + + global __nvmlDeviceGetCreatableVgpus + __nvmlDeviceGetCreatableVgpus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCreatableVgpus') + + global __nvmlVgpuTypeGetClass + __nvmlVgpuTypeGetClass = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetClass') + + global __nvmlVgpuTypeGetName + __nvmlVgpuTypeGetName = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetName') + + global __nvmlVgpuTypeGetGpuInstanceProfileId + __nvmlVgpuTypeGetGpuInstanceProfileId = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetGpuInstanceProfileId') + + global __nvmlVgpuTypeGetDeviceID + __nvmlVgpuTypeGetDeviceID = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetDeviceID') + + global __nvmlVgpuTypeGetFramebufferSize + __nvmlVgpuTypeGetFramebufferSize = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetFramebufferSize') + + global __nvmlVgpuTypeGetNumDisplayHeads + __nvmlVgpuTypeGetNumDisplayHeads = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetNumDisplayHeads') + + global __nvmlVgpuTypeGetResolution + __nvmlVgpuTypeGetResolution = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetResolution') + + global __nvmlVgpuTypeGetLicense + __nvmlVgpuTypeGetLicense = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetLicense') + + global __nvmlVgpuTypeGetFrameRateLimit + __nvmlVgpuTypeGetFrameRateLimit = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetFrameRateLimit') + + global __nvmlVgpuTypeGetMaxInstances + __nvmlVgpuTypeGetMaxInstances = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetMaxInstances') + + global __nvmlVgpuTypeGetMaxInstancesPerVm + __nvmlVgpuTypeGetMaxInstancesPerVm = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetMaxInstancesPerVm') + + global __nvmlVgpuTypeGetBAR1Info + __nvmlVgpuTypeGetBAR1Info = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetBAR1Info') + + global __nvmlDeviceGetActiveVgpus + __nvmlDeviceGetActiveVgpus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetActiveVgpus') + + global __nvmlVgpuInstanceGetVmID + __nvmlVgpuInstanceGetVmID = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetVmID') + + global __nvmlVgpuInstanceGetUUID + __nvmlVgpuInstanceGetUUID = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetUUID') + + global __nvmlVgpuInstanceGetVmDriverVersion + __nvmlVgpuInstanceGetVmDriverVersion = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetVmDriverVersion') + + global __nvmlVgpuInstanceGetFbUsage + __nvmlVgpuInstanceGetFbUsage = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetFbUsage') + + global __nvmlVgpuInstanceGetLicenseStatus + __nvmlVgpuInstanceGetLicenseStatus = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetLicenseStatus') + + global __nvmlVgpuInstanceGetType + __nvmlVgpuInstanceGetType = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetType') + + global __nvmlVgpuInstanceGetFrameRateLimit + __nvmlVgpuInstanceGetFrameRateLimit = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetFrameRateLimit') + + global __nvmlVgpuInstanceGetEccMode + __nvmlVgpuInstanceGetEccMode = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetEccMode') + + global __nvmlVgpuInstanceGetEncoderCapacity + __nvmlVgpuInstanceGetEncoderCapacity = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetEncoderCapacity') + + global __nvmlVgpuInstanceSetEncoderCapacity + __nvmlVgpuInstanceSetEncoderCapacity = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceSetEncoderCapacity') + + global __nvmlVgpuInstanceGetEncoderStats + __nvmlVgpuInstanceGetEncoderStats = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetEncoderStats') + + global __nvmlVgpuInstanceGetEncoderSessions + __nvmlVgpuInstanceGetEncoderSessions = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetEncoderSessions') + + global __nvmlVgpuInstanceGetFBCStats + __nvmlVgpuInstanceGetFBCStats = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetFBCStats') + + global __nvmlVgpuInstanceGetFBCSessions + __nvmlVgpuInstanceGetFBCSessions = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetFBCSessions') + + global __nvmlVgpuInstanceGetGpuInstanceId + __nvmlVgpuInstanceGetGpuInstanceId = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetGpuInstanceId') + + global __nvmlVgpuInstanceGetGpuPciId + __nvmlVgpuInstanceGetGpuPciId = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetGpuPciId') + + global __nvmlVgpuTypeGetCapabilities + __nvmlVgpuTypeGetCapabilities = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetCapabilities') + + global __nvmlVgpuInstanceGetMdevUUID + __nvmlVgpuInstanceGetMdevUUID = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetMdevUUID') + + global __nvmlGpuInstanceGetCreatableVgpus + __nvmlGpuInstanceGetCreatableVgpus = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetCreatableVgpus') + + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = _cyb_GetProcAddress(handle, 'nvmlVgpuTypeGetMaxInstancesPerGpuInstance') + + global __nvmlGpuInstanceGetActiveVgpus + __nvmlGpuInstanceGetActiveVgpus = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetActiveVgpus') + + global __nvmlGpuInstanceSetVgpuSchedulerState + __nvmlGpuInstanceSetVgpuSchedulerState = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuSchedulerState') + + global __nvmlGpuInstanceGetVgpuSchedulerState + __nvmlGpuInstanceGetVgpuSchedulerState = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerState') + + global __nvmlGpuInstanceGetVgpuSchedulerLog + __nvmlGpuInstanceGetVgpuSchedulerLog = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog') + + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuTypeCreatablePlacements') + + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + __nvmlGpuInstanceGetVgpuHeterogeneousMode = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuHeterogeneousMode') + + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + __nvmlGpuInstanceSetVgpuHeterogeneousMode = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuHeterogeneousMode') + + global __nvmlVgpuInstanceGetMetadata + __nvmlVgpuInstanceGetMetadata = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetMetadata') + + global __nvmlDeviceGetVgpuMetadata + __nvmlDeviceGetVgpuMetadata = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuMetadata') + + global __nvmlGetVgpuCompatibility + __nvmlGetVgpuCompatibility = _cyb_GetProcAddress(handle, 'nvmlGetVgpuCompatibility') + + global __nvmlDeviceGetPgpuMetadataString + __nvmlDeviceGetPgpuMetadataString = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPgpuMetadataString') + + global __nvmlDeviceGetVgpuSchedulerLog + __nvmlDeviceGetVgpuSchedulerLog = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerLog') + + global __nvmlDeviceGetVgpuSchedulerState + __nvmlDeviceGetVgpuSchedulerState = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerState') + + global __nvmlDeviceGetVgpuSchedulerCapabilities + __nvmlDeviceGetVgpuSchedulerCapabilities = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerCapabilities') + + global __nvmlDeviceSetVgpuSchedulerState + __nvmlDeviceSetVgpuSchedulerState = _cyb_GetProcAddress(handle, 'nvmlDeviceSetVgpuSchedulerState') + + global __nvmlGetVgpuVersion + __nvmlGetVgpuVersion = _cyb_GetProcAddress(handle, 'nvmlGetVgpuVersion') + + global __nvmlSetVgpuVersion + __nvmlSetVgpuVersion = _cyb_GetProcAddress(handle, 'nvmlSetVgpuVersion') + + global __nvmlDeviceGetVgpuUtilization + __nvmlDeviceGetVgpuUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuUtilization') + + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + __nvmlDeviceGetVgpuInstancesUtilizationInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuInstancesUtilizationInfo') + + global __nvmlDeviceGetVgpuProcessUtilization + __nvmlDeviceGetVgpuProcessUtilization = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuProcessUtilization') + + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + __nvmlDeviceGetVgpuProcessesUtilizationInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuProcessesUtilizationInfo') + + global __nvmlVgpuInstanceGetAccountingMode + __nvmlVgpuInstanceGetAccountingMode = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetAccountingMode') + + global __nvmlVgpuInstanceGetAccountingPids + __nvmlVgpuInstanceGetAccountingPids = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetAccountingPids') + + global __nvmlVgpuInstanceGetAccountingStats + __nvmlVgpuInstanceGetAccountingStats = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetAccountingStats') + + global __nvmlVgpuInstanceClearAccountingPids + __nvmlVgpuInstanceClearAccountingPids = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceClearAccountingPids') + + global __nvmlVgpuInstanceGetLicenseInfo_v2 + __nvmlVgpuInstanceGetLicenseInfo_v2 = _cyb_GetProcAddress(handle, 'nvmlVgpuInstanceGetLicenseInfo_v2') + + global __nvmlGetExcludedDeviceCount + __nvmlGetExcludedDeviceCount = _cyb_GetProcAddress(handle, 'nvmlGetExcludedDeviceCount') + + global __nvmlGetExcludedDeviceInfoByIndex + __nvmlGetExcludedDeviceInfoByIndex = _cyb_GetProcAddress(handle, 'nvmlGetExcludedDeviceInfoByIndex') + + global __nvmlDeviceSetMigMode + __nvmlDeviceSetMigMode = _cyb_GetProcAddress(handle, 'nvmlDeviceSetMigMode') + + global __nvmlDeviceGetMigMode + __nvmlDeviceGetMigMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMigMode') + + global __nvmlDeviceGetGpuInstanceProfileInfoV + __nvmlDeviceGetGpuInstanceProfileInfoV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstanceProfileInfoV') + + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstancePossiblePlacements_v2') + + global __nvmlDeviceGetGpuInstanceRemainingCapacity + __nvmlDeviceGetGpuInstanceRemainingCapacity = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstanceRemainingCapacity') + + global __nvmlDeviceCreateGpuInstance + __nvmlDeviceCreateGpuInstance = _cyb_GetProcAddress(handle, 'nvmlDeviceCreateGpuInstance') + + global __nvmlDeviceCreateGpuInstanceWithPlacement + __nvmlDeviceCreateGpuInstanceWithPlacement = _cyb_GetProcAddress(handle, 'nvmlDeviceCreateGpuInstanceWithPlacement') + + global __nvmlGpuInstanceDestroy + __nvmlGpuInstanceDestroy = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceDestroy') + + global __nvmlDeviceGetGpuInstances + __nvmlDeviceGetGpuInstances = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstances') + + global __nvmlDeviceGetGpuInstanceById + __nvmlDeviceGetGpuInstanceById = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstanceById') + + global __nvmlGpuInstanceGetInfo + __nvmlGpuInstanceGetInfo = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetInfo') + + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + __nvmlGpuInstanceGetComputeInstanceProfileInfoV = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetComputeInstanceProfileInfoV') + + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetComputeInstanceRemainingCapacity') + + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + __nvmlGpuInstanceGetComputeInstancePossiblePlacements = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetComputeInstancePossiblePlacements') + + global __nvmlGpuInstanceCreateComputeInstance + __nvmlGpuInstanceCreateComputeInstance = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceCreateComputeInstance') + + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + __nvmlGpuInstanceCreateComputeInstanceWithPlacement = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceCreateComputeInstanceWithPlacement') + + global __nvmlComputeInstanceDestroy + __nvmlComputeInstanceDestroy = _cyb_GetProcAddress(handle, 'nvmlComputeInstanceDestroy') + + global __nvmlGpuInstanceGetComputeInstances + __nvmlGpuInstanceGetComputeInstances = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetComputeInstances') + + global __nvmlGpuInstanceGetComputeInstanceById + __nvmlGpuInstanceGetComputeInstanceById = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetComputeInstanceById') + + global __nvmlComputeInstanceGetInfo_v2 + __nvmlComputeInstanceGetInfo_v2 = _cyb_GetProcAddress(handle, 'nvmlComputeInstanceGetInfo_v2') + + global __nvmlDeviceIsMigDeviceHandle + __nvmlDeviceIsMigDeviceHandle = _cyb_GetProcAddress(handle, 'nvmlDeviceIsMigDeviceHandle') + + global __nvmlDeviceGetGpuInstanceId + __nvmlDeviceGetGpuInstanceId = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstanceId') + + global __nvmlDeviceGetComputeInstanceId + __nvmlDeviceGetComputeInstanceId = _cyb_GetProcAddress(handle, 'nvmlDeviceGetComputeInstanceId') + + global __nvmlDeviceGetMaxMigDeviceCount + __nvmlDeviceGetMaxMigDeviceCount = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMaxMigDeviceCount') + + global __nvmlDeviceGetMigDeviceHandleByIndex + __nvmlDeviceGetMigDeviceHandleByIndex = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMigDeviceHandleByIndex') + + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = _cyb_GetProcAddress(handle, 'nvmlDeviceGetDeviceHandleFromMigDeviceHandle') + + global __nvmlDeviceGetCapabilities + __nvmlDeviceGetCapabilities = _cyb_GetProcAddress(handle, 'nvmlDeviceGetCapabilities') + + global __nvmlDevicePowerSmoothingActivatePresetProfile + __nvmlDevicePowerSmoothingActivatePresetProfile = _cyb_GetProcAddress(handle, 'nvmlDevicePowerSmoothingActivatePresetProfile') + + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + __nvmlDevicePowerSmoothingUpdatePresetProfileParam = _cyb_GetProcAddress(handle, 'nvmlDevicePowerSmoothingUpdatePresetProfileParam') + + global __nvmlDevicePowerSmoothingSetState + __nvmlDevicePowerSmoothingSetState = _cyb_GetProcAddress(handle, 'nvmlDevicePowerSmoothingSetState') + + global __nvmlDeviceGetAddressingMode + __nvmlDeviceGetAddressingMode = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAddressingMode') + + global __nvmlDeviceGetRepairStatus + __nvmlDeviceGetRepairStatus = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRepairStatus') + + global __nvmlDeviceGetPowerMizerMode_v1 + __nvmlDeviceGetPowerMizerMode_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPowerMizerMode_v1') + + global __nvmlDeviceSetPowerMizerMode_v1 + __nvmlDeviceSetPowerMizerMode_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetPowerMizerMode_v1') + + global __nvmlDeviceGetPdi + __nvmlDeviceGetPdi = _cyb_GetProcAddress(handle, 'nvmlDeviceGetPdi') + + global __nvmlDeviceSetHostname_v1 + __nvmlDeviceSetHostname_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetHostname_v1') + + global __nvmlDeviceGetHostname_v1 + __nvmlDeviceGetHostname_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetHostname_v1') + + global __nvmlDeviceGetNvLinkInfo + __nvmlDeviceGetNvLinkInfo = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkInfo') + + global __nvmlDeviceReadWritePRM_v1 + __nvmlDeviceReadWritePRM_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceReadWritePRM_v1') + + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + __nvmlDeviceGetGpuInstanceProfileInfoByIdV = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuInstanceProfileInfoByIdV') + + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = _cyb_GetProcAddress(handle, 'nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts') + + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + __nvmlDeviceGetUnrepairableMemoryFlag_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetUnrepairableMemoryFlag_v1') + + global __nvmlDeviceReadPRMCounters_v1 + __nvmlDeviceReadPRMCounters_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceReadPRMCounters_v1') + + global __nvmlDeviceSetRusdSettings_v1 + __nvmlDeviceSetRusdSettings_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetRusdSettings_v1') + + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = _cyb_GetProcAddress(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + + global __nvmlSystemGetCPER_v1 + __nvmlSystemGetCPER_v1 = _cyb_GetProcAddress(handle, 'nvmlSystemGetCPER_v1') + + global __nvmlDeviceGetBBXTimeData_v1 + __nvmlDeviceGetBBXTimeData_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBBXTimeData_v1') + + global __nvmlDeviceGetAccountingStats_v2 + __nvmlDeviceGetAccountingStats_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingStats_v2') + + global __nvmlDeviceGetRemappedRows_v2 + __nvmlDeviceGetRemappedRows_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRemappedRows_v2') + + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) + return 0 + +cdef inline int _check_or_init_nvml() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvml_init): + return 0 + + return _init_nvml() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvml() + cdef dict data = {} + global __nvmlInit_v2 + data["__nvmlInit_v2"] = __nvmlInit_v2 + + global __nvmlInitWithFlags + data["__nvmlInitWithFlags"] = __nvmlInitWithFlags + + global __nvmlShutdown + data["__nvmlShutdown"] = __nvmlShutdown + + global __nvmlErrorString + data["__nvmlErrorString"] = __nvmlErrorString + + global __nvmlSystemGetDriverVersion + data["__nvmlSystemGetDriverVersion"] = __nvmlSystemGetDriverVersion + + global __nvmlSystemGetNVMLVersion + data["__nvmlSystemGetNVMLVersion"] = __nvmlSystemGetNVMLVersion + + global __nvmlSystemGetCudaDriverVersion + data["__nvmlSystemGetCudaDriverVersion"] = __nvmlSystemGetCudaDriverVersion + + global __nvmlSystemGetCudaDriverVersion_v2 + data["__nvmlSystemGetCudaDriverVersion_v2"] = __nvmlSystemGetCudaDriverVersion_v2 + + global __nvmlSystemGetProcessName + data["__nvmlSystemGetProcessName"] = __nvmlSystemGetProcessName + + global __nvmlSystemGetHicVersion + data["__nvmlSystemGetHicVersion"] = __nvmlSystemGetHicVersion + + global __nvmlSystemGetTopologyGpuSet + data["__nvmlSystemGetTopologyGpuSet"] = __nvmlSystemGetTopologyGpuSet + + global __nvmlSystemGetDriverBranch + data["__nvmlSystemGetDriverBranch"] = __nvmlSystemGetDriverBranch + + global __nvmlUnitGetCount + data["__nvmlUnitGetCount"] = __nvmlUnitGetCount + + global __nvmlUnitGetHandleByIndex + data["__nvmlUnitGetHandleByIndex"] = __nvmlUnitGetHandleByIndex + + global __nvmlUnitGetUnitInfo + data["__nvmlUnitGetUnitInfo"] = __nvmlUnitGetUnitInfo + + global __nvmlUnitGetLedState + data["__nvmlUnitGetLedState"] = __nvmlUnitGetLedState + + global __nvmlUnitGetPsuInfo + data["__nvmlUnitGetPsuInfo"] = __nvmlUnitGetPsuInfo + + global __nvmlUnitGetTemperature + data["__nvmlUnitGetTemperature"] = __nvmlUnitGetTemperature + + global __nvmlUnitGetFanSpeedInfo + data["__nvmlUnitGetFanSpeedInfo"] = __nvmlUnitGetFanSpeedInfo + + global __nvmlUnitGetDevices + data["__nvmlUnitGetDevices"] = __nvmlUnitGetDevices + + global __nvmlDeviceGetCount_v2 + data["__nvmlDeviceGetCount_v2"] = __nvmlDeviceGetCount_v2 + + global __nvmlDeviceGetAttributes_v2 + data["__nvmlDeviceGetAttributes_v2"] = __nvmlDeviceGetAttributes_v2 + + global __nvmlDeviceGetHandleByIndex_v2 + data["__nvmlDeviceGetHandleByIndex_v2"] = __nvmlDeviceGetHandleByIndex_v2 + + global __nvmlDeviceGetHandleBySerial + data["__nvmlDeviceGetHandleBySerial"] = __nvmlDeviceGetHandleBySerial + + global __nvmlDeviceGetHandleByUUID + data["__nvmlDeviceGetHandleByUUID"] = __nvmlDeviceGetHandleByUUID + + global __nvmlDeviceGetHandleByUUIDV + data["__nvmlDeviceGetHandleByUUIDV"] = __nvmlDeviceGetHandleByUUIDV + + global __nvmlDeviceGetHandleByPciBusId_v2 + data["__nvmlDeviceGetHandleByPciBusId_v2"] = __nvmlDeviceGetHandleByPciBusId_v2 + + global __nvmlDeviceGetName + data["__nvmlDeviceGetName"] = __nvmlDeviceGetName + + global __nvmlDeviceGetBrand + data["__nvmlDeviceGetBrand"] = __nvmlDeviceGetBrand + + global __nvmlDeviceGetIndex + data["__nvmlDeviceGetIndex"] = __nvmlDeviceGetIndex + + global __nvmlDeviceGetSerial + data["__nvmlDeviceGetSerial"] = __nvmlDeviceGetSerial + + global __nvmlDeviceGetModuleId + data["__nvmlDeviceGetModuleId"] = __nvmlDeviceGetModuleId + + global __nvmlDeviceGetC2cModeInfoV + data["__nvmlDeviceGetC2cModeInfoV"] = __nvmlDeviceGetC2cModeInfoV + + global __nvmlDeviceGetMemoryAffinity + data["__nvmlDeviceGetMemoryAffinity"] = __nvmlDeviceGetMemoryAffinity + + global __nvmlDeviceGetCpuAffinityWithinScope + data["__nvmlDeviceGetCpuAffinityWithinScope"] = __nvmlDeviceGetCpuAffinityWithinScope + + global __nvmlDeviceGetCpuAffinity + data["__nvmlDeviceGetCpuAffinity"] = __nvmlDeviceGetCpuAffinity + + global __nvmlDeviceSetCpuAffinity + data["__nvmlDeviceSetCpuAffinity"] = __nvmlDeviceSetCpuAffinity + + global __nvmlDeviceClearCpuAffinity + data["__nvmlDeviceClearCpuAffinity"] = __nvmlDeviceClearCpuAffinity + + global __nvmlDeviceGetNumaNodeId + data["__nvmlDeviceGetNumaNodeId"] = __nvmlDeviceGetNumaNodeId + + global __nvmlDeviceGetTopologyCommonAncestor + data["__nvmlDeviceGetTopologyCommonAncestor"] = __nvmlDeviceGetTopologyCommonAncestor + + global __nvmlDeviceGetTopologyNearestGpus + data["__nvmlDeviceGetTopologyNearestGpus"] = __nvmlDeviceGetTopologyNearestGpus + + global __nvmlDeviceGetP2PStatus + data["__nvmlDeviceGetP2PStatus"] = __nvmlDeviceGetP2PStatus + + global __nvmlDeviceGetUUID + data["__nvmlDeviceGetUUID"] = __nvmlDeviceGetUUID + + global __nvmlDeviceGetMinorNumber + data["__nvmlDeviceGetMinorNumber"] = __nvmlDeviceGetMinorNumber + + global __nvmlDeviceGetBoardPartNumber + data["__nvmlDeviceGetBoardPartNumber"] = __nvmlDeviceGetBoardPartNumber + + global __nvmlDeviceGetInforomVersion + data["__nvmlDeviceGetInforomVersion"] = __nvmlDeviceGetInforomVersion + + global __nvmlDeviceGetInforomImageVersion + data["__nvmlDeviceGetInforomImageVersion"] = __nvmlDeviceGetInforomImageVersion + + global __nvmlDeviceGetInforomConfigurationChecksum + data["__nvmlDeviceGetInforomConfigurationChecksum"] = __nvmlDeviceGetInforomConfigurationChecksum + + global __nvmlDeviceValidateInforom + data["__nvmlDeviceValidateInforom"] = __nvmlDeviceValidateInforom + + global __nvmlDeviceGetLastBBXFlushTime + data["__nvmlDeviceGetLastBBXFlushTime"] = __nvmlDeviceGetLastBBXFlushTime + + global __nvmlDeviceGetDisplayMode + data["__nvmlDeviceGetDisplayMode"] = __nvmlDeviceGetDisplayMode + + global __nvmlDeviceGetDisplayActive + data["__nvmlDeviceGetDisplayActive"] = __nvmlDeviceGetDisplayActive + + global __nvmlDeviceGetPersistenceMode + data["__nvmlDeviceGetPersistenceMode"] = __nvmlDeviceGetPersistenceMode + + global __nvmlDeviceGetPciInfoExt + data["__nvmlDeviceGetPciInfoExt"] = __nvmlDeviceGetPciInfoExt + + global __nvmlDeviceGetPciInfo_v3 + data["__nvmlDeviceGetPciInfo_v3"] = __nvmlDeviceGetPciInfo_v3 + + global __nvmlDeviceGetMaxPcieLinkGeneration + data["__nvmlDeviceGetMaxPcieLinkGeneration"] = __nvmlDeviceGetMaxPcieLinkGeneration + + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = __nvmlDeviceGetGpuMaxPcieLinkGeneration + + global __nvmlDeviceGetMaxPcieLinkWidth + data["__nvmlDeviceGetMaxPcieLinkWidth"] = __nvmlDeviceGetMaxPcieLinkWidth + + global __nvmlDeviceGetCurrPcieLinkGeneration + data["__nvmlDeviceGetCurrPcieLinkGeneration"] = __nvmlDeviceGetCurrPcieLinkGeneration + + global __nvmlDeviceGetCurrPcieLinkWidth + data["__nvmlDeviceGetCurrPcieLinkWidth"] = __nvmlDeviceGetCurrPcieLinkWidth + + global __nvmlDeviceGetPcieThroughput + data["__nvmlDeviceGetPcieThroughput"] = __nvmlDeviceGetPcieThroughput + + global __nvmlDeviceGetPcieReplayCounter + data["__nvmlDeviceGetPcieReplayCounter"] = __nvmlDeviceGetPcieReplayCounter + + global __nvmlDeviceGetClockInfo + data["__nvmlDeviceGetClockInfo"] = __nvmlDeviceGetClockInfo + + global __nvmlDeviceGetMaxClockInfo + data["__nvmlDeviceGetMaxClockInfo"] = __nvmlDeviceGetMaxClockInfo + + global __nvmlDeviceGetGpcClkVfOffset + data["__nvmlDeviceGetGpcClkVfOffset"] = __nvmlDeviceGetGpcClkVfOffset + + global __nvmlDeviceGetClock + data["__nvmlDeviceGetClock"] = __nvmlDeviceGetClock + + global __nvmlDeviceGetMaxCustomerBoostClock + data["__nvmlDeviceGetMaxCustomerBoostClock"] = __nvmlDeviceGetMaxCustomerBoostClock + + global __nvmlDeviceGetSupportedMemoryClocks + data["__nvmlDeviceGetSupportedMemoryClocks"] = __nvmlDeviceGetSupportedMemoryClocks + + global __nvmlDeviceGetSupportedGraphicsClocks + data["__nvmlDeviceGetSupportedGraphicsClocks"] = __nvmlDeviceGetSupportedGraphicsClocks + + global __nvmlDeviceGetAutoBoostedClocksEnabled + data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = __nvmlDeviceGetAutoBoostedClocksEnabled + + global __nvmlDeviceGetFanSpeed + data["__nvmlDeviceGetFanSpeed"] = __nvmlDeviceGetFanSpeed + + global __nvmlDeviceGetFanSpeed_v2 + data["__nvmlDeviceGetFanSpeed_v2"] = __nvmlDeviceGetFanSpeed_v2 + + global __nvmlDeviceGetFanSpeedRPM + data["__nvmlDeviceGetFanSpeedRPM"] = __nvmlDeviceGetFanSpeedRPM + + global __nvmlDeviceGetTargetFanSpeed + data["__nvmlDeviceGetTargetFanSpeed"] = __nvmlDeviceGetTargetFanSpeed + + global __nvmlDeviceGetMinMaxFanSpeed + data["__nvmlDeviceGetMinMaxFanSpeed"] = __nvmlDeviceGetMinMaxFanSpeed + + global __nvmlDeviceGetFanControlPolicy_v2 + data["__nvmlDeviceGetFanControlPolicy_v2"] = __nvmlDeviceGetFanControlPolicy_v2 + + global __nvmlDeviceGetNumFans + data["__nvmlDeviceGetNumFans"] = __nvmlDeviceGetNumFans + + global __nvmlDeviceGetCoolerInfo + data["__nvmlDeviceGetCoolerInfo"] = __nvmlDeviceGetCoolerInfo + + global __nvmlDeviceGetTemperatureV + data["__nvmlDeviceGetTemperatureV"] = __nvmlDeviceGetTemperatureV + + global __nvmlDeviceGetTemperatureThreshold + data["__nvmlDeviceGetTemperatureThreshold"] = __nvmlDeviceGetTemperatureThreshold + + global __nvmlDeviceGetMarginTemperature + data["__nvmlDeviceGetMarginTemperature"] = __nvmlDeviceGetMarginTemperature + + global __nvmlDeviceGetThermalSettings + data["__nvmlDeviceGetThermalSettings"] = __nvmlDeviceGetThermalSettings + + global __nvmlDeviceGetPerformanceState + data["__nvmlDeviceGetPerformanceState"] = __nvmlDeviceGetPerformanceState + + global __nvmlDeviceGetCurrentClocksEventReasons + data["__nvmlDeviceGetCurrentClocksEventReasons"] = __nvmlDeviceGetCurrentClocksEventReasons + + global __nvmlDeviceGetSupportedClocksEventReasons + data["__nvmlDeviceGetSupportedClocksEventReasons"] = __nvmlDeviceGetSupportedClocksEventReasons + + global __nvmlDeviceGetPowerState + data["__nvmlDeviceGetPowerState"] = __nvmlDeviceGetPowerState + + global __nvmlDeviceGetDynamicPstatesInfo + data["__nvmlDeviceGetDynamicPstatesInfo"] = __nvmlDeviceGetDynamicPstatesInfo + + global __nvmlDeviceGetMemClkVfOffset + data["__nvmlDeviceGetMemClkVfOffset"] = __nvmlDeviceGetMemClkVfOffset + + global __nvmlDeviceGetMinMaxClockOfPState + data["__nvmlDeviceGetMinMaxClockOfPState"] = __nvmlDeviceGetMinMaxClockOfPState + + global __nvmlDeviceGetSupportedPerformanceStates + data["__nvmlDeviceGetSupportedPerformanceStates"] = __nvmlDeviceGetSupportedPerformanceStates + + global __nvmlDeviceGetGpcClkMinMaxVfOffset + data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = __nvmlDeviceGetGpcClkMinMaxVfOffset + + global __nvmlDeviceGetMemClkMinMaxVfOffset + data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = __nvmlDeviceGetMemClkMinMaxVfOffset + + global __nvmlDeviceGetClockOffsets + data["__nvmlDeviceGetClockOffsets"] = __nvmlDeviceGetClockOffsets + + global __nvmlDeviceSetClockOffsets + data["__nvmlDeviceSetClockOffsets"] = __nvmlDeviceSetClockOffsets + + global __nvmlDeviceGetPerformanceModes + data["__nvmlDeviceGetPerformanceModes"] = __nvmlDeviceGetPerformanceModes + + global __nvmlDeviceGetCurrentClockFreqs + data["__nvmlDeviceGetCurrentClockFreqs"] = __nvmlDeviceGetCurrentClockFreqs + + global __nvmlDeviceGetPowerManagementLimit + data["__nvmlDeviceGetPowerManagementLimit"] = __nvmlDeviceGetPowerManagementLimit + + global __nvmlDeviceGetPowerManagementLimitConstraints + data["__nvmlDeviceGetPowerManagementLimitConstraints"] = __nvmlDeviceGetPowerManagementLimitConstraints + + global __nvmlDeviceGetPowerManagementDefaultLimit + data["__nvmlDeviceGetPowerManagementDefaultLimit"] = __nvmlDeviceGetPowerManagementDefaultLimit + + global __nvmlDeviceGetPowerUsage + data["__nvmlDeviceGetPowerUsage"] = __nvmlDeviceGetPowerUsage + + global __nvmlDeviceGetTotalEnergyConsumption + data["__nvmlDeviceGetTotalEnergyConsumption"] = __nvmlDeviceGetTotalEnergyConsumption + + global __nvmlDeviceGetEnforcedPowerLimit + data["__nvmlDeviceGetEnforcedPowerLimit"] = __nvmlDeviceGetEnforcedPowerLimit + + global __nvmlDeviceGetGpuOperationMode + data["__nvmlDeviceGetGpuOperationMode"] = __nvmlDeviceGetGpuOperationMode + + global __nvmlDeviceGetMemoryInfo_v2 + data["__nvmlDeviceGetMemoryInfo_v2"] = __nvmlDeviceGetMemoryInfo_v2 + + global __nvmlDeviceGetComputeMode + data["__nvmlDeviceGetComputeMode"] = __nvmlDeviceGetComputeMode + + global __nvmlDeviceGetCudaComputeCapability + data["__nvmlDeviceGetCudaComputeCapability"] = __nvmlDeviceGetCudaComputeCapability + + global __nvmlDeviceGetDramEncryptionMode + data["__nvmlDeviceGetDramEncryptionMode"] = __nvmlDeviceGetDramEncryptionMode + + global __nvmlDeviceSetDramEncryptionMode + data["__nvmlDeviceSetDramEncryptionMode"] = __nvmlDeviceSetDramEncryptionMode + + global __nvmlDeviceGetEccMode + data["__nvmlDeviceGetEccMode"] = __nvmlDeviceGetEccMode + + global __nvmlDeviceGetDefaultEccMode + data["__nvmlDeviceGetDefaultEccMode"] = __nvmlDeviceGetDefaultEccMode + + global __nvmlDeviceGetBoardId + data["__nvmlDeviceGetBoardId"] = __nvmlDeviceGetBoardId + + global __nvmlDeviceGetMultiGpuBoard + data["__nvmlDeviceGetMultiGpuBoard"] = __nvmlDeviceGetMultiGpuBoard + + global __nvmlDeviceGetTotalEccErrors + data["__nvmlDeviceGetTotalEccErrors"] = __nvmlDeviceGetTotalEccErrors + + global __nvmlDeviceGetMemoryErrorCounter + data["__nvmlDeviceGetMemoryErrorCounter"] = __nvmlDeviceGetMemoryErrorCounter + + global __nvmlDeviceGetUtilizationRates + data["__nvmlDeviceGetUtilizationRates"] = __nvmlDeviceGetUtilizationRates + + global __nvmlDeviceGetEncoderUtilization + data["__nvmlDeviceGetEncoderUtilization"] = __nvmlDeviceGetEncoderUtilization + + global __nvmlDeviceGetEncoderCapacity + data["__nvmlDeviceGetEncoderCapacity"] = __nvmlDeviceGetEncoderCapacity + + global __nvmlDeviceGetEncoderStats + data["__nvmlDeviceGetEncoderStats"] = __nvmlDeviceGetEncoderStats + + global __nvmlDeviceGetEncoderSessions + data["__nvmlDeviceGetEncoderSessions"] = __nvmlDeviceGetEncoderSessions + + global __nvmlDeviceGetDecoderUtilization + data["__nvmlDeviceGetDecoderUtilization"] = __nvmlDeviceGetDecoderUtilization + + global __nvmlDeviceGetJpgUtilization + data["__nvmlDeviceGetJpgUtilization"] = __nvmlDeviceGetJpgUtilization + + global __nvmlDeviceGetOfaUtilization + data["__nvmlDeviceGetOfaUtilization"] = __nvmlDeviceGetOfaUtilization + + global __nvmlDeviceGetFBCStats + data["__nvmlDeviceGetFBCStats"] = __nvmlDeviceGetFBCStats + + global __nvmlDeviceGetFBCSessions + data["__nvmlDeviceGetFBCSessions"] = __nvmlDeviceGetFBCSessions + + global __nvmlDeviceGetDriverModel_v2 + data["__nvmlDeviceGetDriverModel_v2"] = __nvmlDeviceGetDriverModel_v2 + + global __nvmlDeviceGetVbiosVersion + data["__nvmlDeviceGetVbiosVersion"] = __nvmlDeviceGetVbiosVersion + + global __nvmlDeviceGetBridgeChipInfo + data["__nvmlDeviceGetBridgeChipInfo"] = __nvmlDeviceGetBridgeChipInfo + + global __nvmlDeviceGetComputeRunningProcesses_v3 + data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 + data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 + + global __nvmlDeviceGetRunningProcessDetailList + data["__nvmlDeviceGetRunningProcessDetailList"] = __nvmlDeviceGetRunningProcessDetailList + + global __nvmlDeviceOnSameBoard + data["__nvmlDeviceOnSameBoard"] = __nvmlDeviceOnSameBoard + + global __nvmlDeviceGetAPIRestriction + data["__nvmlDeviceGetAPIRestriction"] = __nvmlDeviceGetAPIRestriction + + global __nvmlDeviceGetSamples + data["__nvmlDeviceGetSamples"] = __nvmlDeviceGetSamples + + global __nvmlDeviceGetBAR1MemoryInfo + data["__nvmlDeviceGetBAR1MemoryInfo"] = __nvmlDeviceGetBAR1MemoryInfo + + global __nvmlDeviceGetIrqNum + data["__nvmlDeviceGetIrqNum"] = __nvmlDeviceGetIrqNum + + global __nvmlDeviceGetNumGpuCores + data["__nvmlDeviceGetNumGpuCores"] = __nvmlDeviceGetNumGpuCores + + global __nvmlDeviceGetPowerSource + data["__nvmlDeviceGetPowerSource"] = __nvmlDeviceGetPowerSource + + global __nvmlDeviceGetMemoryBusWidth + data["__nvmlDeviceGetMemoryBusWidth"] = __nvmlDeviceGetMemoryBusWidth + + global __nvmlDeviceGetPcieLinkMaxSpeed + data["__nvmlDeviceGetPcieLinkMaxSpeed"] = __nvmlDeviceGetPcieLinkMaxSpeed + + global __nvmlDeviceGetPcieSpeed + data["__nvmlDeviceGetPcieSpeed"] = __nvmlDeviceGetPcieSpeed + + global __nvmlDeviceGetAdaptiveClockInfoStatus + data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = __nvmlDeviceGetAdaptiveClockInfoStatus + + global __nvmlDeviceGetBusType + data["__nvmlDeviceGetBusType"] = __nvmlDeviceGetBusType + + global __nvmlDeviceGetGpuFabricInfoV + data["__nvmlDeviceGetGpuFabricInfoV"] = __nvmlDeviceGetGpuFabricInfoV + + global __nvmlSystemGetConfComputeCapabilities + data["__nvmlSystemGetConfComputeCapabilities"] = __nvmlSystemGetConfComputeCapabilities + + global __nvmlSystemGetConfComputeState + data["__nvmlSystemGetConfComputeState"] = __nvmlSystemGetConfComputeState + + global __nvmlDeviceGetConfComputeMemSizeInfo + data["__nvmlDeviceGetConfComputeMemSizeInfo"] = __nvmlDeviceGetConfComputeMemSizeInfo + + global __nvmlSystemGetConfComputeGpusReadyState + data["__nvmlSystemGetConfComputeGpusReadyState"] = __nvmlSystemGetConfComputeGpusReadyState + + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = __nvmlDeviceGetConfComputeProtectedMemoryUsage + + global __nvmlDeviceGetConfComputeGpuCertificate + data["__nvmlDeviceGetConfComputeGpuCertificate"] = __nvmlDeviceGetConfComputeGpuCertificate + + global __nvmlDeviceGetConfComputeGpuAttestationReport + data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = __nvmlDeviceGetConfComputeGpuAttestationReport + + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = __nvmlSystemGetConfComputeKeyRotationThresholdInfo + + global __nvmlDeviceSetConfComputeUnprotectedMemSize + data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = __nvmlDeviceSetConfComputeUnprotectedMemSize + + global __nvmlSystemSetConfComputeGpusReadyState + data["__nvmlSystemSetConfComputeGpusReadyState"] = __nvmlSystemSetConfComputeGpusReadyState + + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = __nvmlSystemSetConfComputeKeyRotationThresholdInfo + + global __nvmlSystemGetConfComputeSettings + data["__nvmlSystemGetConfComputeSettings"] = __nvmlSystemGetConfComputeSettings + + global __nvmlDeviceGetGspFirmwareVersion + data["__nvmlDeviceGetGspFirmwareVersion"] = __nvmlDeviceGetGspFirmwareVersion + + global __nvmlDeviceGetGspFirmwareMode + data["__nvmlDeviceGetGspFirmwareMode"] = __nvmlDeviceGetGspFirmwareMode + + global __nvmlDeviceGetSramEccErrorStatus + data["__nvmlDeviceGetSramEccErrorStatus"] = __nvmlDeviceGetSramEccErrorStatus + + global __nvmlDeviceGetAccountingMode + data["__nvmlDeviceGetAccountingMode"] = __nvmlDeviceGetAccountingMode + + global __nvmlDeviceGetAccountingStats + data["__nvmlDeviceGetAccountingStats"] = __nvmlDeviceGetAccountingStats + + global __nvmlDeviceGetAccountingPids + data["__nvmlDeviceGetAccountingPids"] = __nvmlDeviceGetAccountingPids + + global __nvmlDeviceGetAccountingBufferSize + data["__nvmlDeviceGetAccountingBufferSize"] = __nvmlDeviceGetAccountingBufferSize + + global __nvmlDeviceGetRetiredPages + data["__nvmlDeviceGetRetiredPages"] = __nvmlDeviceGetRetiredPages + + global __nvmlDeviceGetRetiredPages_v2 + data["__nvmlDeviceGetRetiredPages_v2"] = __nvmlDeviceGetRetiredPages_v2 + + global __nvmlDeviceGetRetiredPagesPendingStatus + data["__nvmlDeviceGetRetiredPagesPendingStatus"] = __nvmlDeviceGetRetiredPagesPendingStatus + + global __nvmlDeviceGetRemappedRows + data["__nvmlDeviceGetRemappedRows"] = __nvmlDeviceGetRemappedRows + + global __nvmlDeviceGetRowRemapperHistogram + data["__nvmlDeviceGetRowRemapperHistogram"] = __nvmlDeviceGetRowRemapperHistogram + + global __nvmlDeviceGetArchitecture + data["__nvmlDeviceGetArchitecture"] = __nvmlDeviceGetArchitecture + + global __nvmlDeviceGetClkMonStatus + data["__nvmlDeviceGetClkMonStatus"] = __nvmlDeviceGetClkMonStatus + + global __nvmlDeviceGetProcessUtilization + data["__nvmlDeviceGetProcessUtilization"] = __nvmlDeviceGetProcessUtilization + + global __nvmlDeviceGetProcessesUtilizationInfo + data["__nvmlDeviceGetProcessesUtilizationInfo"] = __nvmlDeviceGetProcessesUtilizationInfo + + global __nvmlDeviceGetPlatformInfo + data["__nvmlDeviceGetPlatformInfo"] = __nvmlDeviceGetPlatformInfo + + global __nvmlUnitSetLedState + data["__nvmlUnitSetLedState"] = __nvmlUnitSetLedState + + global __nvmlDeviceSetPersistenceMode + data["__nvmlDeviceSetPersistenceMode"] = __nvmlDeviceSetPersistenceMode + + global __nvmlDeviceSetComputeMode + data["__nvmlDeviceSetComputeMode"] = __nvmlDeviceSetComputeMode + + global __nvmlDeviceSetEccMode + data["__nvmlDeviceSetEccMode"] = __nvmlDeviceSetEccMode + + global __nvmlDeviceClearEccErrorCounts + data["__nvmlDeviceClearEccErrorCounts"] = __nvmlDeviceClearEccErrorCounts + + global __nvmlDeviceSetDriverModel + data["__nvmlDeviceSetDriverModel"] = __nvmlDeviceSetDriverModel + + global __nvmlDeviceSetGpuLockedClocks + data["__nvmlDeviceSetGpuLockedClocks"] = __nvmlDeviceSetGpuLockedClocks + + global __nvmlDeviceResetGpuLockedClocks + data["__nvmlDeviceResetGpuLockedClocks"] = __nvmlDeviceResetGpuLockedClocks + + global __nvmlDeviceSetMemoryLockedClocks + data["__nvmlDeviceSetMemoryLockedClocks"] = __nvmlDeviceSetMemoryLockedClocks + + global __nvmlDeviceResetMemoryLockedClocks + data["__nvmlDeviceResetMemoryLockedClocks"] = __nvmlDeviceResetMemoryLockedClocks + + global __nvmlDeviceSetAutoBoostedClocksEnabled + data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = __nvmlDeviceSetAutoBoostedClocksEnabled + + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + + global __nvmlDeviceSetDefaultFanSpeed_v2 + data["__nvmlDeviceSetDefaultFanSpeed_v2"] = __nvmlDeviceSetDefaultFanSpeed_v2 + + global __nvmlDeviceSetFanControlPolicy + data["__nvmlDeviceSetFanControlPolicy"] = __nvmlDeviceSetFanControlPolicy + + global __nvmlDeviceSetTemperatureThreshold + data["__nvmlDeviceSetTemperatureThreshold"] = __nvmlDeviceSetTemperatureThreshold + + global __nvmlDeviceSetGpuOperationMode + data["__nvmlDeviceSetGpuOperationMode"] = __nvmlDeviceSetGpuOperationMode + + global __nvmlDeviceSetAPIRestriction + data["__nvmlDeviceSetAPIRestriction"] = __nvmlDeviceSetAPIRestriction + + global __nvmlDeviceSetFanSpeed_v2 + data["__nvmlDeviceSetFanSpeed_v2"] = __nvmlDeviceSetFanSpeed_v2 + + global __nvmlDeviceSetAccountingMode + data["__nvmlDeviceSetAccountingMode"] = __nvmlDeviceSetAccountingMode + + global __nvmlDeviceClearAccountingPids + data["__nvmlDeviceClearAccountingPids"] = __nvmlDeviceClearAccountingPids + + global __nvmlDeviceSetPowerManagementLimit_v2 + data["__nvmlDeviceSetPowerManagementLimit_v2"] = __nvmlDeviceSetPowerManagementLimit_v2 + + global __nvmlDeviceGetNvLinkState + data["__nvmlDeviceGetNvLinkState"] = __nvmlDeviceGetNvLinkState + + global __nvmlDeviceGetNvLinkVersion + data["__nvmlDeviceGetNvLinkVersion"] = __nvmlDeviceGetNvLinkVersion + + global __nvmlDeviceGetNvLinkCapability + data["__nvmlDeviceGetNvLinkCapability"] = __nvmlDeviceGetNvLinkCapability + + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = __nvmlDeviceGetNvLinkRemotePciInfo_v2 + + global __nvmlDeviceGetNvLinkErrorCounter + data["__nvmlDeviceGetNvLinkErrorCounter"] = __nvmlDeviceGetNvLinkErrorCounter + + global __nvmlDeviceResetNvLinkErrorCounters + data["__nvmlDeviceResetNvLinkErrorCounters"] = __nvmlDeviceResetNvLinkErrorCounters + + global __nvmlDeviceGetNvLinkRemoteDeviceType + data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = __nvmlDeviceGetNvLinkRemoteDeviceType + + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + + global __nvmlSystemSetNvlinkBwMode + data["__nvmlSystemSetNvlinkBwMode"] = __nvmlSystemSetNvlinkBwMode + + global __nvmlSystemGetNvlinkBwMode + data["__nvmlSystemGetNvlinkBwMode"] = __nvmlSystemGetNvlinkBwMode + + global __nvmlDeviceGetNvlinkSupportedBwModes + data["__nvmlDeviceGetNvlinkSupportedBwModes"] = __nvmlDeviceGetNvlinkSupportedBwModes + + global __nvmlDeviceGetNvlinkBwMode + data["__nvmlDeviceGetNvlinkBwMode"] = __nvmlDeviceGetNvlinkBwMode + + global __nvmlDeviceSetNvlinkBwMode + data["__nvmlDeviceSetNvlinkBwMode"] = __nvmlDeviceSetNvlinkBwMode + + global __nvmlEventSetCreate + data["__nvmlEventSetCreate"] = __nvmlEventSetCreate + + global __nvmlDeviceRegisterEvents + data["__nvmlDeviceRegisterEvents"] = __nvmlDeviceRegisterEvents + + global __nvmlDeviceGetSupportedEventTypes + data["__nvmlDeviceGetSupportedEventTypes"] = __nvmlDeviceGetSupportedEventTypes + + global __nvmlEventSetWait_v2 + data["__nvmlEventSetWait_v2"] = __nvmlEventSetWait_v2 + + global __nvmlEventSetFree + data["__nvmlEventSetFree"] = __nvmlEventSetFree + + global __nvmlSystemEventSetCreate + data["__nvmlSystemEventSetCreate"] = __nvmlSystemEventSetCreate + + global __nvmlSystemEventSetFree + data["__nvmlSystemEventSetFree"] = __nvmlSystemEventSetFree + + global __nvmlSystemRegisterEvents + data["__nvmlSystemRegisterEvents"] = __nvmlSystemRegisterEvents + + global __nvmlSystemEventSetWait + data["__nvmlSystemEventSetWait"] = __nvmlSystemEventSetWait + + global __nvmlDeviceModifyDrainState + data["__nvmlDeviceModifyDrainState"] = __nvmlDeviceModifyDrainState + + global __nvmlDeviceQueryDrainState + data["__nvmlDeviceQueryDrainState"] = __nvmlDeviceQueryDrainState + + global __nvmlDeviceRemoveGpu_v2 + data["__nvmlDeviceRemoveGpu_v2"] = __nvmlDeviceRemoveGpu_v2 + + global __nvmlDeviceDiscoverGpus + data["__nvmlDeviceDiscoverGpus"] = __nvmlDeviceDiscoverGpus + + global __nvmlDeviceGetFieldValues + data["__nvmlDeviceGetFieldValues"] = __nvmlDeviceGetFieldValues + + global __nvmlDeviceClearFieldValues + data["__nvmlDeviceClearFieldValues"] = __nvmlDeviceClearFieldValues + + global __nvmlDeviceGetVirtualizationMode + data["__nvmlDeviceGetVirtualizationMode"] = __nvmlDeviceGetVirtualizationMode + + global __nvmlDeviceGetHostVgpuMode + data["__nvmlDeviceGetHostVgpuMode"] = __nvmlDeviceGetHostVgpuMode + + global __nvmlDeviceSetVirtualizationMode + data["__nvmlDeviceSetVirtualizationMode"] = __nvmlDeviceSetVirtualizationMode + + global __nvmlDeviceGetVgpuHeterogeneousMode + data["__nvmlDeviceGetVgpuHeterogeneousMode"] = __nvmlDeviceGetVgpuHeterogeneousMode + + global __nvmlDeviceSetVgpuHeterogeneousMode + data["__nvmlDeviceSetVgpuHeterogeneousMode"] = __nvmlDeviceSetVgpuHeterogeneousMode + + global __nvmlVgpuInstanceGetPlacementId + data["__nvmlVgpuInstanceGetPlacementId"] = __nvmlVgpuInstanceGetPlacementId + + global __nvmlDeviceGetVgpuTypeSupportedPlacements + data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = __nvmlDeviceGetVgpuTypeSupportedPlacements + + global __nvmlDeviceGetVgpuTypeCreatablePlacements + data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = __nvmlDeviceGetVgpuTypeCreatablePlacements + + global __nvmlVgpuTypeGetGspHeapSize + data["__nvmlVgpuTypeGetGspHeapSize"] = __nvmlVgpuTypeGetGspHeapSize + + global __nvmlVgpuTypeGetFbReservation + data["__nvmlVgpuTypeGetFbReservation"] = __nvmlVgpuTypeGetFbReservation + + global __nvmlVgpuInstanceGetRuntimeStateSize + data["__nvmlVgpuInstanceGetRuntimeStateSize"] = __nvmlVgpuInstanceGetRuntimeStateSize + + global __nvmlDeviceSetVgpuCapabilities + data["__nvmlDeviceSetVgpuCapabilities"] = __nvmlDeviceSetVgpuCapabilities + + global __nvmlDeviceGetGridLicensableFeatures_v4 + data["__nvmlDeviceGetGridLicensableFeatures_v4"] = __nvmlDeviceGetGridLicensableFeatures_v4 + + global __nvmlGetVgpuDriverCapabilities + data["__nvmlGetVgpuDriverCapabilities"] = __nvmlGetVgpuDriverCapabilities + + global __nvmlDeviceGetVgpuCapabilities + data["__nvmlDeviceGetVgpuCapabilities"] = __nvmlDeviceGetVgpuCapabilities + + global __nvmlDeviceGetSupportedVgpus + data["__nvmlDeviceGetSupportedVgpus"] = __nvmlDeviceGetSupportedVgpus + + global __nvmlDeviceGetCreatableVgpus + data["__nvmlDeviceGetCreatableVgpus"] = __nvmlDeviceGetCreatableVgpus + + global __nvmlVgpuTypeGetClass + data["__nvmlVgpuTypeGetClass"] = __nvmlVgpuTypeGetClass + + global __nvmlVgpuTypeGetName + data["__nvmlVgpuTypeGetName"] = __nvmlVgpuTypeGetName + + global __nvmlVgpuTypeGetGpuInstanceProfileId + data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = __nvmlVgpuTypeGetGpuInstanceProfileId + + global __nvmlVgpuTypeGetDeviceID + data["__nvmlVgpuTypeGetDeviceID"] = __nvmlVgpuTypeGetDeviceID + + global __nvmlVgpuTypeGetFramebufferSize + data["__nvmlVgpuTypeGetFramebufferSize"] = __nvmlVgpuTypeGetFramebufferSize + + global __nvmlVgpuTypeGetNumDisplayHeads + data["__nvmlVgpuTypeGetNumDisplayHeads"] = __nvmlVgpuTypeGetNumDisplayHeads + + global __nvmlVgpuTypeGetResolution + data["__nvmlVgpuTypeGetResolution"] = __nvmlVgpuTypeGetResolution + + global __nvmlVgpuTypeGetLicense + data["__nvmlVgpuTypeGetLicense"] = __nvmlVgpuTypeGetLicense + + global __nvmlVgpuTypeGetFrameRateLimit + data["__nvmlVgpuTypeGetFrameRateLimit"] = __nvmlVgpuTypeGetFrameRateLimit + + global __nvmlVgpuTypeGetMaxInstances + data["__nvmlVgpuTypeGetMaxInstances"] = __nvmlVgpuTypeGetMaxInstances + + global __nvmlVgpuTypeGetMaxInstancesPerVm + data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = __nvmlVgpuTypeGetMaxInstancesPerVm + + global __nvmlVgpuTypeGetBAR1Info + data["__nvmlVgpuTypeGetBAR1Info"] = __nvmlVgpuTypeGetBAR1Info + + global __nvmlDeviceGetActiveVgpus + data["__nvmlDeviceGetActiveVgpus"] = __nvmlDeviceGetActiveVgpus + + global __nvmlVgpuInstanceGetVmID + data["__nvmlVgpuInstanceGetVmID"] = __nvmlVgpuInstanceGetVmID + + global __nvmlVgpuInstanceGetUUID + data["__nvmlVgpuInstanceGetUUID"] = __nvmlVgpuInstanceGetUUID + + global __nvmlVgpuInstanceGetVmDriverVersion + data["__nvmlVgpuInstanceGetVmDriverVersion"] = __nvmlVgpuInstanceGetVmDriverVersion + + global __nvmlVgpuInstanceGetFbUsage + data["__nvmlVgpuInstanceGetFbUsage"] = __nvmlVgpuInstanceGetFbUsage + + global __nvmlVgpuInstanceGetLicenseStatus + data["__nvmlVgpuInstanceGetLicenseStatus"] = __nvmlVgpuInstanceGetLicenseStatus + + global __nvmlVgpuInstanceGetType + data["__nvmlVgpuInstanceGetType"] = __nvmlVgpuInstanceGetType + + global __nvmlVgpuInstanceGetFrameRateLimit + data["__nvmlVgpuInstanceGetFrameRateLimit"] = __nvmlVgpuInstanceGetFrameRateLimit + + global __nvmlVgpuInstanceGetEccMode + data["__nvmlVgpuInstanceGetEccMode"] = __nvmlVgpuInstanceGetEccMode + + global __nvmlVgpuInstanceGetEncoderCapacity + data["__nvmlVgpuInstanceGetEncoderCapacity"] = __nvmlVgpuInstanceGetEncoderCapacity + + global __nvmlVgpuInstanceSetEncoderCapacity + data["__nvmlVgpuInstanceSetEncoderCapacity"] = __nvmlVgpuInstanceSetEncoderCapacity + + global __nvmlVgpuInstanceGetEncoderStats + data["__nvmlVgpuInstanceGetEncoderStats"] = __nvmlVgpuInstanceGetEncoderStats + + global __nvmlVgpuInstanceGetEncoderSessions + data["__nvmlVgpuInstanceGetEncoderSessions"] = __nvmlVgpuInstanceGetEncoderSessions + + global __nvmlVgpuInstanceGetFBCStats + data["__nvmlVgpuInstanceGetFBCStats"] = __nvmlVgpuInstanceGetFBCStats + + global __nvmlVgpuInstanceGetFBCSessions + data["__nvmlVgpuInstanceGetFBCSessions"] = __nvmlVgpuInstanceGetFBCSessions + + global __nvmlVgpuInstanceGetGpuInstanceId + data["__nvmlVgpuInstanceGetGpuInstanceId"] = __nvmlVgpuInstanceGetGpuInstanceId + + global __nvmlVgpuInstanceGetGpuPciId + data["__nvmlVgpuInstanceGetGpuPciId"] = __nvmlVgpuInstanceGetGpuPciId + + global __nvmlVgpuTypeGetCapabilities + data["__nvmlVgpuTypeGetCapabilities"] = __nvmlVgpuTypeGetCapabilities + + global __nvmlVgpuInstanceGetMdevUUID + data["__nvmlVgpuInstanceGetMdevUUID"] = __nvmlVgpuInstanceGetMdevUUID + + global __nvmlGpuInstanceGetCreatableVgpus + data["__nvmlGpuInstanceGetCreatableVgpus"] = __nvmlGpuInstanceGetCreatableVgpus + + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + + global __nvmlGpuInstanceGetActiveVgpus + data["__nvmlGpuInstanceGetActiveVgpus"] = __nvmlGpuInstanceGetActiveVgpus + + global __nvmlGpuInstanceSetVgpuSchedulerState + data["__nvmlGpuInstanceSetVgpuSchedulerState"] = __nvmlGpuInstanceSetVgpuSchedulerState + + global __nvmlGpuInstanceGetVgpuSchedulerState + data["__nvmlGpuInstanceGetVgpuSchedulerState"] = __nvmlGpuInstanceGetVgpuSchedulerState + + global __nvmlGpuInstanceGetVgpuSchedulerLog + data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = __nvmlGpuInstanceGetVgpuSchedulerLog + + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = __nvmlGpuInstanceGetVgpuHeterogeneousMode + + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = __nvmlGpuInstanceSetVgpuHeterogeneousMode + + global __nvmlVgpuInstanceGetMetadata + data["__nvmlVgpuInstanceGetMetadata"] = __nvmlVgpuInstanceGetMetadata + + global __nvmlDeviceGetVgpuMetadata + data["__nvmlDeviceGetVgpuMetadata"] = __nvmlDeviceGetVgpuMetadata + + global __nvmlGetVgpuCompatibility + data["__nvmlGetVgpuCompatibility"] = __nvmlGetVgpuCompatibility + + global __nvmlDeviceGetPgpuMetadataString + data["__nvmlDeviceGetPgpuMetadataString"] = __nvmlDeviceGetPgpuMetadataString + + global __nvmlDeviceGetVgpuSchedulerLog + data["__nvmlDeviceGetVgpuSchedulerLog"] = __nvmlDeviceGetVgpuSchedulerLog + + global __nvmlDeviceGetVgpuSchedulerState + data["__nvmlDeviceGetVgpuSchedulerState"] = __nvmlDeviceGetVgpuSchedulerState + + global __nvmlDeviceGetVgpuSchedulerCapabilities + data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = __nvmlDeviceGetVgpuSchedulerCapabilities + + global __nvmlDeviceSetVgpuSchedulerState + data["__nvmlDeviceSetVgpuSchedulerState"] = __nvmlDeviceSetVgpuSchedulerState + + global __nvmlGetVgpuVersion + data["__nvmlGetVgpuVersion"] = __nvmlGetVgpuVersion + + global __nvmlSetVgpuVersion + data["__nvmlSetVgpuVersion"] = __nvmlSetVgpuVersion + + global __nvmlDeviceGetVgpuUtilization + data["__nvmlDeviceGetVgpuUtilization"] = __nvmlDeviceGetVgpuUtilization + + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = __nvmlDeviceGetVgpuInstancesUtilizationInfo + + global __nvmlDeviceGetVgpuProcessUtilization + data["__nvmlDeviceGetVgpuProcessUtilization"] = __nvmlDeviceGetVgpuProcessUtilization + + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = __nvmlDeviceGetVgpuProcessesUtilizationInfo + + global __nvmlVgpuInstanceGetAccountingMode + data["__nvmlVgpuInstanceGetAccountingMode"] = __nvmlVgpuInstanceGetAccountingMode + + global __nvmlVgpuInstanceGetAccountingPids + data["__nvmlVgpuInstanceGetAccountingPids"] = __nvmlVgpuInstanceGetAccountingPids + + global __nvmlVgpuInstanceGetAccountingStats + data["__nvmlVgpuInstanceGetAccountingStats"] = __nvmlVgpuInstanceGetAccountingStats + + global __nvmlVgpuInstanceClearAccountingPids + data["__nvmlVgpuInstanceClearAccountingPids"] = __nvmlVgpuInstanceClearAccountingPids + + global __nvmlVgpuInstanceGetLicenseInfo_v2 + data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = __nvmlVgpuInstanceGetLicenseInfo_v2 + + global __nvmlGetExcludedDeviceCount + data["__nvmlGetExcludedDeviceCount"] = __nvmlGetExcludedDeviceCount + + global __nvmlGetExcludedDeviceInfoByIndex + data["__nvmlGetExcludedDeviceInfoByIndex"] = __nvmlGetExcludedDeviceInfoByIndex + + global __nvmlDeviceSetMigMode + data["__nvmlDeviceSetMigMode"] = __nvmlDeviceSetMigMode + + global __nvmlDeviceGetMigMode + data["__nvmlDeviceGetMigMode"] = __nvmlDeviceGetMigMode + + global __nvmlDeviceGetGpuInstanceProfileInfoV + data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = __nvmlDeviceGetGpuInstanceProfileInfoV + + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + + global __nvmlDeviceGetGpuInstanceRemainingCapacity + data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = __nvmlDeviceGetGpuInstanceRemainingCapacity + + global __nvmlDeviceCreateGpuInstance + data["__nvmlDeviceCreateGpuInstance"] = __nvmlDeviceCreateGpuInstance + + global __nvmlDeviceCreateGpuInstanceWithPlacement + data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = __nvmlDeviceCreateGpuInstanceWithPlacement + + global __nvmlGpuInstanceDestroy + data["__nvmlGpuInstanceDestroy"] = __nvmlGpuInstanceDestroy + + global __nvmlDeviceGetGpuInstances + data["__nvmlDeviceGetGpuInstances"] = __nvmlDeviceGetGpuInstances + + global __nvmlDeviceGetGpuInstanceById + data["__nvmlDeviceGetGpuInstanceById"] = __nvmlDeviceGetGpuInstanceById + + global __nvmlGpuInstanceGetInfo + data["__nvmlGpuInstanceGetInfo"] = __nvmlGpuInstanceGetInfo + + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = __nvmlGpuInstanceGetComputeInstanceProfileInfoV + + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = __nvmlGpuInstanceGetComputeInstancePossiblePlacements + + global __nvmlGpuInstanceCreateComputeInstance + data["__nvmlGpuInstanceCreateComputeInstance"] = __nvmlGpuInstanceCreateComputeInstance + + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = __nvmlGpuInstanceCreateComputeInstanceWithPlacement + + global __nvmlComputeInstanceDestroy + data["__nvmlComputeInstanceDestroy"] = __nvmlComputeInstanceDestroy + + global __nvmlGpuInstanceGetComputeInstances + data["__nvmlGpuInstanceGetComputeInstances"] = __nvmlGpuInstanceGetComputeInstances + + global __nvmlGpuInstanceGetComputeInstanceById + data["__nvmlGpuInstanceGetComputeInstanceById"] = __nvmlGpuInstanceGetComputeInstanceById + + global __nvmlComputeInstanceGetInfo_v2 + data["__nvmlComputeInstanceGetInfo_v2"] = __nvmlComputeInstanceGetInfo_v2 + + global __nvmlDeviceIsMigDeviceHandle + data["__nvmlDeviceIsMigDeviceHandle"] = __nvmlDeviceIsMigDeviceHandle + + global __nvmlDeviceGetGpuInstanceId + data["__nvmlDeviceGetGpuInstanceId"] = __nvmlDeviceGetGpuInstanceId + + global __nvmlDeviceGetComputeInstanceId + data["__nvmlDeviceGetComputeInstanceId"] = __nvmlDeviceGetComputeInstanceId + + global __nvmlDeviceGetMaxMigDeviceCount + data["__nvmlDeviceGetMaxMigDeviceCount"] = __nvmlDeviceGetMaxMigDeviceCount + + global __nvmlDeviceGetMigDeviceHandleByIndex + data["__nvmlDeviceGetMigDeviceHandleByIndex"] = __nvmlDeviceGetMigDeviceHandleByIndex + + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + + global __nvmlDeviceGetCapabilities + data["__nvmlDeviceGetCapabilities"] = __nvmlDeviceGetCapabilities + + global __nvmlDevicePowerSmoothingActivatePresetProfile + data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = __nvmlDevicePowerSmoothingActivatePresetProfile + + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = __nvmlDevicePowerSmoothingUpdatePresetProfileParam + + global __nvmlDevicePowerSmoothingSetState + data["__nvmlDevicePowerSmoothingSetState"] = __nvmlDevicePowerSmoothingSetState + + global __nvmlDeviceGetAddressingMode + data["__nvmlDeviceGetAddressingMode"] = __nvmlDeviceGetAddressingMode + + global __nvmlDeviceGetRepairStatus + data["__nvmlDeviceGetRepairStatus"] = __nvmlDeviceGetRepairStatus + + global __nvmlDeviceGetPowerMizerMode_v1 + data["__nvmlDeviceGetPowerMizerMode_v1"] = __nvmlDeviceGetPowerMizerMode_v1 + + global __nvmlDeviceSetPowerMizerMode_v1 + data["__nvmlDeviceSetPowerMizerMode_v1"] = __nvmlDeviceSetPowerMizerMode_v1 + + global __nvmlDeviceGetPdi + data["__nvmlDeviceGetPdi"] = __nvmlDeviceGetPdi + + global __nvmlDeviceSetHostname_v1 + data["__nvmlDeviceSetHostname_v1"] = __nvmlDeviceSetHostname_v1 + + global __nvmlDeviceGetHostname_v1 + data["__nvmlDeviceGetHostname_v1"] = __nvmlDeviceGetHostname_v1 + + global __nvmlDeviceGetNvLinkInfo + data["__nvmlDeviceGetNvLinkInfo"] = __nvmlDeviceGetNvLinkInfo + + global __nvmlDeviceReadWritePRM_v1 + data["__nvmlDeviceReadWritePRM_v1"] = __nvmlDeviceReadWritePRM_v1 + + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = __nvmlDeviceGetGpuInstanceProfileInfoByIdV + + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = __nvmlDeviceGetUnrepairableMemoryFlag_v1 + + global __nvmlDeviceReadPRMCounters_v1 + data["__nvmlDeviceReadPRMCounters_v1"] = __nvmlDeviceReadPRMCounters_v1 + + 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 + + global __nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = __nvmlSystemGetCPER_v1 + + global __nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = __nvmlDeviceGetBBXTimeData_v1 + + global __nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = __nvmlDeviceGetAccountingStats_v2 + + global __nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = __nvmlDeviceGetRemappedRows_v2 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + return load_nvidia_dynamic_lib("nvml")._handle_uint + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvmlReturn_t _nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlInit_v2 + _check_or_init_nvml() + if __nvmlInit_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlInit_v2 is not found") + return (__nvmlInit_v2)( + ) + + +cdef nvmlReturn_t _nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlInitWithFlags + _check_or_init_nvml() + if __nvmlInitWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function nvmlInitWithFlags is not found") + return (__nvmlInitWithFlags)( + flags) + + +cdef nvmlReturn_t _nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlShutdown + _check_or_init_nvml() + if __nvmlShutdown == NULL: + with gil: + raise FunctionNotFoundError("function nvmlShutdown is not found") + return (__nvmlShutdown)( + ) + + +cdef const char* _nvmlErrorString(nvmlReturn_t result) except?NULL nogil: + global __nvmlErrorString + _check_or_init_nvml() + if __nvmlErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvmlErrorString is not found") + return (__nvmlErrorString)( + result) + + +cdef nvmlReturn_t _nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetDriverVersion + _check_or_init_nvml() + if __nvmlSystemGetDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetDriverVersion is not found") + return (__nvmlSystemGetDriverVersion)( + version, length) + + +cdef nvmlReturn_t _nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetNVMLVersion + _check_or_init_nvml() + if __nvmlSystemGetNVMLVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetNVMLVersion is not found") + return (__nvmlSystemGetNVMLVersion)( + version, length) + + +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCudaDriverVersion + _check_or_init_nvml() + if __nvmlSystemGetCudaDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion is not found") + return (__nvmlSystemGetCudaDriverVersion)( + cudaDriverVersion) + + +cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCudaDriverVersion_v2 + _check_or_init_nvml() + if __nvmlSystemGetCudaDriverVersion_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion_v2 is not found") + return (__nvmlSystemGetCudaDriverVersion_v2)( + cudaDriverVersion) + + +cdef nvmlReturn_t _nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetProcessName + _check_or_init_nvml() + if __nvmlSystemGetProcessName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetProcessName is not found") + return (__nvmlSystemGetProcessName)( + pid, name, length) + + +cdef nvmlReturn_t _nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetHicVersion + _check_or_init_nvml() + if __nvmlSystemGetHicVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetHicVersion is not found") + return (__nvmlSystemGetHicVersion)( + hwbcCount, hwbcEntries) + + +cdef nvmlReturn_t _nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetTopologyGpuSet + _check_or_init_nvml() + if __nvmlSystemGetTopologyGpuSet == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetTopologyGpuSet is not found") + return (__nvmlSystemGetTopologyGpuSet)( + cpuNumber, count, deviceArray) + + +cdef nvmlReturn_t _nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetDriverBranch + _check_or_init_nvml() + if __nvmlSystemGetDriverBranch == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetDriverBranch is not found") + return (__nvmlSystemGetDriverBranch)( + branchInfo, length) + + +cdef nvmlReturn_t _nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetCount + _check_or_init_nvml() + if __nvmlUnitGetCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetCount is not found") + return (__nvmlUnitGetCount)( + unitCount) + + +cdef nvmlReturn_t _nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetHandleByIndex + _check_or_init_nvml() + if __nvmlUnitGetHandleByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetHandleByIndex is not found") + return (__nvmlUnitGetHandleByIndex)( + index, unit) + + +cdef nvmlReturn_t _nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetUnitInfo + _check_or_init_nvml() + if __nvmlUnitGetUnitInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetUnitInfo is not found") + return (__nvmlUnitGetUnitInfo)( + unit, info) + + +cdef nvmlReturn_t _nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetLedState + _check_or_init_nvml() + if __nvmlUnitGetLedState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetLedState is not found") + return (__nvmlUnitGetLedState)( + unit, state) + + +cdef nvmlReturn_t _nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetPsuInfo + _check_or_init_nvml() + if __nvmlUnitGetPsuInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetPsuInfo is not found") + return (__nvmlUnitGetPsuInfo)( + unit, psu) + + +cdef nvmlReturn_t _nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetTemperature + _check_or_init_nvml() + if __nvmlUnitGetTemperature == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetTemperature is not found") + return (__nvmlUnitGetTemperature)( + unit, type, temp) + + +cdef nvmlReturn_t _nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetFanSpeedInfo + _check_or_init_nvml() + if __nvmlUnitGetFanSpeedInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetFanSpeedInfo is not found") + return (__nvmlUnitGetFanSpeedInfo)( + unit, fanSpeeds) + + +cdef nvmlReturn_t _nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitGetDevices + _check_or_init_nvml() + if __nvmlUnitGetDevices == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitGetDevices is not found") + return (__nvmlUnitGetDevices)( + unit, deviceCount, devices) + + +cdef nvmlReturn_t _nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCount_v2 + _check_or_init_nvml() + if __nvmlDeviceGetCount_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCount_v2 is not found") + return (__nvmlDeviceGetCount_v2)( + deviceCount) + + +cdef nvmlReturn_t _nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAttributes_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAttributes_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAttributes_v2 is not found") + return (__nvmlDeviceGetAttributes_v2)( + device, attributes) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByIndex_v2 + _check_or_init_nvml() + if __nvmlDeviceGetHandleByIndex_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByIndex_v2 is not found") + return (__nvmlDeviceGetHandleByIndex_v2)( + index, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleBySerial + _check_or_init_nvml() + if __nvmlDeviceGetHandleBySerial == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleBySerial is not found") + return (__nvmlDeviceGetHandleBySerial)( + serial, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByUUID + _check_or_init_nvml() + if __nvmlDeviceGetHandleByUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUID is not found") + return (__nvmlDeviceGetHandleByUUID)( + uuid, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByUUIDV + _check_or_init_nvml() + if __nvmlDeviceGetHandleByUUIDV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUIDV is not found") + return (__nvmlDeviceGetHandleByUUIDV)( + uuid, device) + + +cdef nvmlReturn_t _nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHandleByPciBusId_v2 + _check_or_init_nvml() + if __nvmlDeviceGetHandleByPciBusId_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHandleByPciBusId_v2 is not found") + return (__nvmlDeviceGetHandleByPciBusId_v2)( + pciBusId, device) + + +cdef nvmlReturn_t _nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetName + _check_or_init_nvml() + if __nvmlDeviceGetName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetName is not found") + return (__nvmlDeviceGetName)( + device, name, length) + + +cdef nvmlReturn_t _nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBrand + _check_or_init_nvml() + if __nvmlDeviceGetBrand == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBrand is not found") + return (__nvmlDeviceGetBrand)( + device, type) + + +cdef nvmlReturn_t _nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetIndex + _check_or_init_nvml() + if __nvmlDeviceGetIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetIndex is not found") + return (__nvmlDeviceGetIndex)( + device, index) + + +cdef nvmlReturn_t _nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSerial + _check_or_init_nvml() + if __nvmlDeviceGetSerial == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSerial is not found") + return (__nvmlDeviceGetSerial)( + device, serial, length) + + +cdef nvmlReturn_t _nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetModuleId + _check_or_init_nvml() + if __nvmlDeviceGetModuleId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetModuleId is not found") + return (__nvmlDeviceGetModuleId)( + device, moduleId) + + +cdef nvmlReturn_t _nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetC2cModeInfoV + _check_or_init_nvml() + if __nvmlDeviceGetC2cModeInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetC2cModeInfoV is not found") + return (__nvmlDeviceGetC2cModeInfoV)( + device, c2cModeInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryAffinity + _check_or_init_nvml() + if __nvmlDeviceGetMemoryAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryAffinity is not found") + return (__nvmlDeviceGetMemoryAffinity)( + device, nodeSetSize, nodeSet, scope) + + +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCpuAffinityWithinScope + _check_or_init_nvml() + if __nvmlDeviceGetCpuAffinityWithinScope == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinityWithinScope is not found") + return (__nvmlDeviceGetCpuAffinityWithinScope)( + device, cpuSetSize, cpuSet, scope) + + +cdef nvmlReturn_t _nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceGetCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinity is not found") + return (__nvmlDeviceGetCpuAffinity)( + device, cpuSetSize, cpuSet) + + +cdef nvmlReturn_t _nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceSetCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetCpuAffinity is not found") + return (__nvmlDeviceSetCpuAffinity)( + device) + + +cdef nvmlReturn_t _nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearCpuAffinity + _check_or_init_nvml() + if __nvmlDeviceClearCpuAffinity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearCpuAffinity is not found") + return (__nvmlDeviceClearCpuAffinity)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumaNodeId + _check_or_init_nvml() + if __nvmlDeviceGetNumaNodeId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumaNodeId is not found") + return (__nvmlDeviceGetNumaNodeId)( + device, node) + + +cdef nvmlReturn_t _nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTopologyCommonAncestor + _check_or_init_nvml() + if __nvmlDeviceGetTopologyCommonAncestor == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTopologyCommonAncestor is not found") + return (__nvmlDeviceGetTopologyCommonAncestor)( + device1, device2, pathInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTopologyNearestGpus + _check_or_init_nvml() + if __nvmlDeviceGetTopologyNearestGpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTopologyNearestGpus is not found") + return (__nvmlDeviceGetTopologyNearestGpus)( + device, level, count, deviceArray) + + +cdef nvmlReturn_t _nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetP2PStatus + _check_or_init_nvml() + if __nvmlDeviceGetP2PStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetP2PStatus is not found") + return (__nvmlDeviceGetP2PStatus)( + device1, device2, p2pIndex, p2pStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUUID + _check_or_init_nvml() + if __nvmlDeviceGetUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUUID is not found") + return (__nvmlDeviceGetUUID)( + device, uuid, length) + + +cdef nvmlReturn_t _nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinorNumber + _check_or_init_nvml() + if __nvmlDeviceGetMinorNumber == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinorNumber is not found") + return (__nvmlDeviceGetMinorNumber)( + device, minorNumber) + + +cdef nvmlReturn_t _nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBoardPartNumber + _check_or_init_nvml() + if __nvmlDeviceGetBoardPartNumber == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBoardPartNumber is not found") + return (__nvmlDeviceGetBoardPartNumber)( + device, partNumber, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomVersion + _check_or_init_nvml() + if __nvmlDeviceGetInforomVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomVersion is not found") + return (__nvmlDeviceGetInforomVersion)( + device, object, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomImageVersion + _check_or_init_nvml() + if __nvmlDeviceGetInforomImageVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomImageVersion is not found") + return (__nvmlDeviceGetInforomImageVersion)( + device, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetInforomConfigurationChecksum + _check_or_init_nvml() + if __nvmlDeviceGetInforomConfigurationChecksum == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetInforomConfigurationChecksum is not found") + return (__nvmlDeviceGetInforomConfigurationChecksum)( + device, checksum) + + +cdef nvmlReturn_t _nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceValidateInforom + _check_or_init_nvml() + if __nvmlDeviceValidateInforom == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceValidateInforom is not found") + return (__nvmlDeviceValidateInforom)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetLastBBXFlushTime + _check_or_init_nvml() + if __nvmlDeviceGetLastBBXFlushTime == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetLastBBXFlushTime is not found") + return (__nvmlDeviceGetLastBBXFlushTime)( + device, timestamp, durationUs) + + +cdef nvmlReturn_t _nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDisplayMode + _check_or_init_nvml() + if __nvmlDeviceGetDisplayMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDisplayMode is not found") + return (__nvmlDeviceGetDisplayMode)( + device, display) + + +cdef nvmlReturn_t _nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDisplayActive + _check_or_init_nvml() + if __nvmlDeviceGetDisplayActive == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDisplayActive is not found") + return (__nvmlDeviceGetDisplayActive)( + device, isActive) + + +cdef nvmlReturn_t _nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPersistenceMode + _check_or_init_nvml() + if __nvmlDeviceGetPersistenceMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPersistenceMode is not found") + return (__nvmlDeviceGetPersistenceMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPciInfoExt + _check_or_init_nvml() + if __nvmlDeviceGetPciInfoExt == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPciInfoExt is not found") + return (__nvmlDeviceGetPciInfoExt)( + device, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPciInfo_v3 + _check_or_init_nvml() + if __nvmlDeviceGetPciInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPciInfo_v3 is not found") + return (__nvmlDeviceGetPciInfo_v3)( + device, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetMaxPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkGeneration is not found") + return (__nvmlDeviceGetMaxPcieLinkGeneration)( + device, maxLinkGen) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuMaxPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuMaxPcieLinkGeneration is not found") + return (__nvmlDeviceGetGpuMaxPcieLinkGeneration)( + device, maxLinkGenDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxPcieLinkWidth + _check_or_init_nvml() + if __nvmlDeviceGetMaxPcieLinkWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkWidth is not found") + return (__nvmlDeviceGetMaxPcieLinkWidth)( + device, maxLinkWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrPcieLinkGeneration + _check_or_init_nvml() + if __nvmlDeviceGetCurrPcieLinkGeneration == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkGeneration is not found") + return (__nvmlDeviceGetCurrPcieLinkGeneration)( + device, currLinkGen) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrPcieLinkWidth + _check_or_init_nvml() + if __nvmlDeviceGetCurrPcieLinkWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkWidth is not found") + return (__nvmlDeviceGetCurrPcieLinkWidth)( + device, currLinkWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieThroughput + _check_or_init_nvml() + if __nvmlDeviceGetPcieThroughput == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieThroughput is not found") + return (__nvmlDeviceGetPcieThroughput)( + device, counter, value) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieReplayCounter + _check_or_init_nvml() + if __nvmlDeviceGetPcieReplayCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieReplayCounter is not found") + return (__nvmlDeviceGetPcieReplayCounter)( + device, value) + + +cdef nvmlReturn_t _nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClockInfo + _check_or_init_nvml() + if __nvmlDeviceGetClockInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClockInfo is not found") + return (__nvmlDeviceGetClockInfo)( + device, type, clock) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxClockInfo + _check_or_init_nvml() + if __nvmlDeviceGetMaxClockInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxClockInfo is not found") + return (__nvmlDeviceGetMaxClockInfo)( + device, type, clock) + + +cdef nvmlReturn_t _nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpcClkVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetGpcClkVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpcClkVfOffset is not found") + return (__nvmlDeviceGetGpcClkVfOffset)( + device, offset) + + +cdef nvmlReturn_t _nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClock + _check_or_init_nvml() + if __nvmlDeviceGetClock == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClock is not found") + return (__nvmlDeviceGetClock)( + device, clockType, clockId, clockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxCustomerBoostClock + _check_or_init_nvml() + if __nvmlDeviceGetMaxCustomerBoostClock == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxCustomerBoostClock is not found") + return (__nvmlDeviceGetMaxCustomerBoostClock)( + device, clockType, clockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedMemoryClocks + _check_or_init_nvml() + if __nvmlDeviceGetSupportedMemoryClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedMemoryClocks is not found") + return (__nvmlDeviceGetSupportedMemoryClocks)( + device, count, clocksMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedGraphicsClocks + _check_or_init_nvml() + if __nvmlDeviceGetSupportedGraphicsClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedGraphicsClocks is not found") + return (__nvmlDeviceGetSupportedGraphicsClocks)( + device, memoryClockMHz, count, clocksMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceGetAutoBoostedClocksEnabled)( + device, isEnabled, defaultIsEnabled) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed is not found") + return (__nvmlDeviceGetFanSpeed)( + device, speed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed_v2 is not found") + return (__nvmlDeviceGetFanSpeed_v2)( + device, fan, speed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanSpeedRPM + _check_or_init_nvml() + if __nvmlDeviceGetFanSpeedRPM == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanSpeedRPM is not found") + return (__nvmlDeviceGetFanSpeedRPM)( + device, fanSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTargetFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetTargetFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTargetFanSpeed is not found") + return (__nvmlDeviceGetTargetFanSpeed)( + device, fan, targetSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinMaxFanSpeed + _check_or_init_nvml() + if __nvmlDeviceGetMinMaxFanSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinMaxFanSpeed is not found") + return (__nvmlDeviceGetMinMaxFanSpeed)( + device, minSpeed, maxSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFanControlPolicy_v2 + _check_or_init_nvml() + if __nvmlDeviceGetFanControlPolicy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFanControlPolicy_v2 is not found") + return (__nvmlDeviceGetFanControlPolicy_v2)( + device, fan, policy) + + +cdef nvmlReturn_t _nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumFans + _check_or_init_nvml() + if __nvmlDeviceGetNumFans == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumFans is not found") + return (__nvmlDeviceGetNumFans)( + device, numFans) + + +cdef nvmlReturn_t _nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCoolerInfo + _check_or_init_nvml() + if __nvmlDeviceGetCoolerInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCoolerInfo is not found") + return (__nvmlDeviceGetCoolerInfo)( + device, coolerInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTemperatureV + _check_or_init_nvml() + if __nvmlDeviceGetTemperatureV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTemperatureV is not found") + return (__nvmlDeviceGetTemperatureV)( + device, temperature) + + +cdef nvmlReturn_t _nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTemperatureThreshold + _check_or_init_nvml() + if __nvmlDeviceGetTemperatureThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTemperatureThreshold is not found") + return (__nvmlDeviceGetTemperatureThreshold)( + device, thresholdType, temp) + + +cdef nvmlReturn_t _nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMarginTemperature + _check_or_init_nvml() + if __nvmlDeviceGetMarginTemperature == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMarginTemperature is not found") + return (__nvmlDeviceGetMarginTemperature)( + device, marginTempInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetThermalSettings + _check_or_init_nvml() + if __nvmlDeviceGetThermalSettings == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetThermalSettings is not found") + return (__nvmlDeviceGetThermalSettings)( + device, sensorIndex, pThermalSettings) + + +cdef nvmlReturn_t _nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPerformanceState + _check_or_init_nvml() + if __nvmlDeviceGetPerformanceState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPerformanceState is not found") + return (__nvmlDeviceGetPerformanceState)( + device, pState) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrentClocksEventReasons + _check_or_init_nvml() + if __nvmlDeviceGetCurrentClocksEventReasons == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrentClocksEventReasons is not found") + return (__nvmlDeviceGetCurrentClocksEventReasons)( + device, clocksEventReasons) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedClocksEventReasons + _check_or_init_nvml() + if __nvmlDeviceGetSupportedClocksEventReasons == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedClocksEventReasons is not found") + return (__nvmlDeviceGetSupportedClocksEventReasons)( + device, supportedClocksEventReasons) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerState + _check_or_init_nvml() + if __nvmlDeviceGetPowerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerState is not found") + return (__nvmlDeviceGetPowerState)( + device, pState) + + +cdef nvmlReturn_t _nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDynamicPstatesInfo + _check_or_init_nvml() + if __nvmlDeviceGetDynamicPstatesInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDynamicPstatesInfo is not found") + return (__nvmlDeviceGetDynamicPstatesInfo)( + device, pDynamicPstatesInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemClkVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetMemClkVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemClkVfOffset is not found") + return (__nvmlDeviceGetMemClkVfOffset)( + device, offset) + + +cdef nvmlReturn_t _nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMinMaxClockOfPState + _check_or_init_nvml() + if __nvmlDeviceGetMinMaxClockOfPState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMinMaxClockOfPState is not found") + return (__nvmlDeviceGetMinMaxClockOfPState)( + device, type, pstate, minClockMHz, maxClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedPerformanceStates + _check_or_init_nvml() + if __nvmlDeviceGetSupportedPerformanceStates == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedPerformanceStates is not found") + return (__nvmlDeviceGetSupportedPerformanceStates)( + device, pstates, size) + + +cdef nvmlReturn_t _nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpcClkMinMaxVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetGpcClkMinMaxVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpcClkMinMaxVfOffset is not found") + return (__nvmlDeviceGetGpcClkMinMaxVfOffset)( + device, minOffset, maxOffset) + + +cdef nvmlReturn_t _nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemClkMinMaxVfOffset + _check_or_init_nvml() + if __nvmlDeviceGetMemClkMinMaxVfOffset == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemClkMinMaxVfOffset is not found") + return (__nvmlDeviceGetMemClkMinMaxVfOffset)( + device, minOffset, maxOffset) + + +cdef nvmlReturn_t _nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClockOffsets + _check_or_init_nvml() + if __nvmlDeviceGetClockOffsets == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClockOffsets is not found") + return (__nvmlDeviceGetClockOffsets)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetClockOffsets + _check_or_init_nvml() + if __nvmlDeviceSetClockOffsets == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetClockOffsets is not found") + return (__nvmlDeviceSetClockOffsets)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPerformanceModes + _check_or_init_nvml() + if __nvmlDeviceGetPerformanceModes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPerformanceModes is not found") + return (__nvmlDeviceGetPerformanceModes)( + device, perfModes) + + +cdef nvmlReturn_t _nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCurrentClockFreqs + _check_or_init_nvml() + if __nvmlDeviceGetCurrentClockFreqs == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCurrentClockFreqs is not found") + return (__nvmlDeviceGetCurrentClockFreqs)( + device, currentClockFreqs) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementLimit + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimit is not found") + return (__nvmlDeviceGetPowerManagementLimit)( + device, limit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementLimitConstraints + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementLimitConstraints == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimitConstraints is not found") + return (__nvmlDeviceGetPowerManagementLimitConstraints)( + device, minLimit, maxLimit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerManagementDefaultLimit + _check_or_init_nvml() + if __nvmlDeviceGetPowerManagementDefaultLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementDefaultLimit is not found") + return (__nvmlDeviceGetPowerManagementDefaultLimit)( + device, defaultLimit) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerUsage + _check_or_init_nvml() + if __nvmlDeviceGetPowerUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerUsage is not found") + return (__nvmlDeviceGetPowerUsage)( + device, power) + + +cdef nvmlReturn_t _nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTotalEnergyConsumption + _check_or_init_nvml() + if __nvmlDeviceGetTotalEnergyConsumption == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTotalEnergyConsumption is not found") + return (__nvmlDeviceGetTotalEnergyConsumption)( + device, energy) + + +cdef nvmlReturn_t _nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEnforcedPowerLimit + _check_or_init_nvml() + if __nvmlDeviceGetEnforcedPowerLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEnforcedPowerLimit is not found") + return (__nvmlDeviceGetEnforcedPowerLimit)( + device, limit) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuOperationMode + _check_or_init_nvml() + if __nvmlDeviceGetGpuOperationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuOperationMode is not found") + return (__nvmlDeviceGetGpuOperationMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryInfo_v2 + _check_or_init_nvml() + if __nvmlDeviceGetMemoryInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryInfo_v2 is not found") + return (__nvmlDeviceGetMemoryInfo_v2)( + device, memory) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeMode + _check_or_init_nvml() + if __nvmlDeviceGetComputeMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeMode is not found") + return (__nvmlDeviceGetComputeMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCudaComputeCapability + _check_or_init_nvml() + if __nvmlDeviceGetCudaComputeCapability == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCudaComputeCapability is not found") + return (__nvmlDeviceGetCudaComputeCapability)( + device, major, minor) + + +cdef nvmlReturn_t _nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDramEncryptionMode + _check_or_init_nvml() + if __nvmlDeviceGetDramEncryptionMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDramEncryptionMode is not found") + return (__nvmlDeviceGetDramEncryptionMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDramEncryptionMode + _check_or_init_nvml() + if __nvmlDeviceSetDramEncryptionMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDramEncryptionMode is not found") + return (__nvmlDeviceSetDramEncryptionMode)( + device, dramEncryption) + + +cdef nvmlReturn_t _nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEccMode + _check_or_init_nvml() + if __nvmlDeviceGetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEccMode is not found") + return (__nvmlDeviceGetEccMode)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDefaultEccMode + _check_or_init_nvml() + if __nvmlDeviceGetDefaultEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDefaultEccMode is not found") + return (__nvmlDeviceGetDefaultEccMode)( + device, defaultMode) + + +cdef nvmlReturn_t _nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBoardId + _check_or_init_nvml() + if __nvmlDeviceGetBoardId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBoardId is not found") + return (__nvmlDeviceGetBoardId)( + device, boardId) + + +cdef nvmlReturn_t _nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMultiGpuBoard + _check_or_init_nvml() + if __nvmlDeviceGetMultiGpuBoard == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMultiGpuBoard is not found") + return (__nvmlDeviceGetMultiGpuBoard)( + device, multiGpuBool) + + +cdef nvmlReturn_t _nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetTotalEccErrors + _check_or_init_nvml() + if __nvmlDeviceGetTotalEccErrors == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetTotalEccErrors is not found") + return (__nvmlDeviceGetTotalEccErrors)( + device, errorType, counterType, eccCounts) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryErrorCounter + _check_or_init_nvml() + if __nvmlDeviceGetMemoryErrorCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryErrorCounter is not found") + return (__nvmlDeviceGetMemoryErrorCounter)( + device, errorType, counterType, locationType, count) + + +cdef nvmlReturn_t _nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUtilizationRates + _check_or_init_nvml() + if __nvmlDeviceGetUtilizationRates == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUtilizationRates is not found") + return (__nvmlDeviceGetUtilizationRates)( + device, utilization) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderUtilization + _check_or_init_nvml() + if __nvmlDeviceGetEncoderUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderUtilization is not found") + return (__nvmlDeviceGetEncoderUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderCapacity + _check_or_init_nvml() + if __nvmlDeviceGetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderCapacity is not found") + return (__nvmlDeviceGetEncoderCapacity)( + device, encoderQueryType, encoderCapacity) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderStats + _check_or_init_nvml() + if __nvmlDeviceGetEncoderStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderStats is not found") + return (__nvmlDeviceGetEncoderStats)( + device, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t _nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetEncoderSessions + _check_or_init_nvml() + if __nvmlDeviceGetEncoderSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetEncoderSessions is not found") + return (__nvmlDeviceGetEncoderSessions)( + device, sessionCount, sessionInfos) + + +cdef nvmlReturn_t _nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDecoderUtilization + _check_or_init_nvml() + if __nvmlDeviceGetDecoderUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDecoderUtilization is not found") + return (__nvmlDeviceGetDecoderUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetJpgUtilization + _check_or_init_nvml() + if __nvmlDeviceGetJpgUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetJpgUtilization is not found") + return (__nvmlDeviceGetJpgUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetOfaUtilization + _check_or_init_nvml() + if __nvmlDeviceGetOfaUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetOfaUtilization is not found") + return (__nvmlDeviceGetOfaUtilization)( + device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t _nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFBCStats + _check_or_init_nvml() + if __nvmlDeviceGetFBCStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFBCStats is not found") + return (__nvmlDeviceGetFBCStats)( + device, fbcStats) + + +cdef nvmlReturn_t _nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFBCSessions + _check_or_init_nvml() + if __nvmlDeviceGetFBCSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFBCSessions is not found") + return (__nvmlDeviceGetFBCSessions)( + device, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDriverModel_v2 + _check_or_init_nvml() + if __nvmlDeviceGetDriverModel_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDriverModel_v2 is not found") + return (__nvmlDeviceGetDriverModel_v2)( + device, current, pending) + + +cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVbiosVersion + _check_or_init_nvml() + if __nvmlDeviceGetVbiosVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVbiosVersion is not found") + return (__nvmlDeviceGetVbiosVersion)( + device, version, length) + + +cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBridgeChipInfo + _check_or_init_nvml() + if __nvmlDeviceGetBridgeChipInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBridgeChipInfo is not found") + return (__nvmlDeviceGetBridgeChipInfo)( + device, bridgeHierarchy) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetComputeRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeRunningProcesses_v3 is not found") + return (__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: + 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() + if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMPSComputeRunningProcesses_v3 is not found") + return (__nvmlDeviceGetMPSComputeRunningProcesses_v3)( + device, infoCount, infos) + + +cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRunningProcessDetailList + _check_or_init_nvml() + if __nvmlDeviceGetRunningProcessDetailList == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRunningProcessDetailList is not found") + return (__nvmlDeviceGetRunningProcessDetailList)( + device, plist) + + +cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceOnSameBoard + _check_or_init_nvml() + if __nvmlDeviceOnSameBoard == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceOnSameBoard is not found") + return (__nvmlDeviceOnSameBoard)( + device1, device2, onSameBoard) + + +cdef nvmlReturn_t _nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAPIRestriction + _check_or_init_nvml() + if __nvmlDeviceGetAPIRestriction == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAPIRestriction is not found") + return (__nvmlDeviceGetAPIRestriction)( + device, apiType, isRestricted) + + +cdef nvmlReturn_t _nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSamples + _check_or_init_nvml() + if __nvmlDeviceGetSamples == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSamples is not found") + return (__nvmlDeviceGetSamples)( + device, type, lastSeenTimeStamp, sampleValType, sampleCount, samples) + + +cdef nvmlReturn_t _nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBAR1MemoryInfo + _check_or_init_nvml() + if __nvmlDeviceGetBAR1MemoryInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBAR1MemoryInfo is not found") + return (__nvmlDeviceGetBAR1MemoryInfo)( + device, bar1Memory) + + +cdef nvmlReturn_t _nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetIrqNum + _check_or_init_nvml() + if __nvmlDeviceGetIrqNum == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetIrqNum is not found") + return (__nvmlDeviceGetIrqNum)( + device, irqNum) + + +cdef nvmlReturn_t _nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNumGpuCores + _check_or_init_nvml() + if __nvmlDeviceGetNumGpuCores == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNumGpuCores is not found") + return (__nvmlDeviceGetNumGpuCores)( + device, numCores) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerSource + _check_or_init_nvml() + if __nvmlDeviceGetPowerSource == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerSource is not found") + return (__nvmlDeviceGetPowerSource)( + device, powerSource) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryBusWidth + _check_or_init_nvml() + if __nvmlDeviceGetMemoryBusWidth == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryBusWidth is not found") + return (__nvmlDeviceGetMemoryBusWidth)( + device, busWidth) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieLinkMaxSpeed + _check_or_init_nvml() + if __nvmlDeviceGetPcieLinkMaxSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieLinkMaxSpeed is not found") + return (__nvmlDeviceGetPcieLinkMaxSpeed)( + device, maxSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPcieSpeed + _check_or_init_nvml() + if __nvmlDeviceGetPcieSpeed == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPcieSpeed is not found") + return (__nvmlDeviceGetPcieSpeed)( + device, pcieSpeed) + + +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAdaptiveClockInfoStatus + _check_or_init_nvml() + if __nvmlDeviceGetAdaptiveClockInfoStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAdaptiveClockInfoStatus is not found") + return (__nvmlDeviceGetAdaptiveClockInfoStatus)( + device, adaptiveClockStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBusType + _check_or_init_nvml() + if __nvmlDeviceGetBusType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBusType is not found") + return (__nvmlDeviceGetBusType)( + device, type) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuFabricInfoV + _check_or_init_nvml() + if __nvmlDeviceGetGpuFabricInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuFabricInfoV is not found") + return (__nvmlDeviceGetGpuFabricInfoV)( + device, gpuFabricInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeCapabilities + _check_or_init_nvml() + if __nvmlSystemGetConfComputeCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeCapabilities is not found") + return (__nvmlSystemGetConfComputeCapabilities)( + capabilities) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeState + _check_or_init_nvml() + if __nvmlSystemGetConfComputeState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeState is not found") + return (__nvmlSystemGetConfComputeState)( + state) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeMemSizeInfo + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeMemSizeInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeMemSizeInfo is not found") + return (__nvmlDeviceGetConfComputeMemSizeInfo)( + device, memInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeGpusReadyState + _check_or_init_nvml() + if __nvmlSystemGetConfComputeGpusReadyState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeGpusReadyState is not found") + return (__nvmlSystemGetConfComputeGpusReadyState)( + isAcceptingWork) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeProtectedMemoryUsage + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeProtectedMemoryUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeProtectedMemoryUsage is not found") + return (__nvmlDeviceGetConfComputeProtectedMemoryUsage)( + device, memory) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeGpuCertificate + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeGpuCertificate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuCertificate is not found") + return (__nvmlDeviceGetConfComputeGpuCertificate)( + device, gpuCert) + + +cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetConfComputeGpuAttestationReport + _check_or_init_nvml() + if __nvmlDeviceGetConfComputeGpuAttestationReport == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuAttestationReport is not found") + return (__nvmlDeviceGetConfComputeGpuAttestationReport)( + device, gpuAtstReport) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeKeyRotationThresholdInfo + _check_or_init_nvml() + if __nvmlSystemGetConfComputeKeyRotationThresholdInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeKeyRotationThresholdInfo is not found") + return (__nvmlSystemGetConfComputeKeyRotationThresholdInfo)( + pKeyRotationThrInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetConfComputeUnprotectedMemSize + _check_or_init_nvml() + if __nvmlDeviceSetConfComputeUnprotectedMemSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetConfComputeUnprotectedMemSize is not found") + return (__nvmlDeviceSetConfComputeUnprotectedMemSize)( + device, sizeKiB) + + +cdef nvmlReturn_t _nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetConfComputeGpusReadyState + _check_or_init_nvml() + if __nvmlSystemSetConfComputeGpusReadyState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetConfComputeGpusReadyState is not found") + return (__nvmlSystemSetConfComputeGpusReadyState)( + isAcceptingWork) + + +cdef nvmlReturn_t _nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetConfComputeKeyRotationThresholdInfo + _check_or_init_nvml() + if __nvmlSystemSetConfComputeKeyRotationThresholdInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetConfComputeKeyRotationThresholdInfo is not found") + return (__nvmlSystemSetConfComputeKeyRotationThresholdInfo)( + pKeyRotationThrInfo) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeSettings + _check_or_init_nvml() + if __nvmlSystemGetConfComputeSettings == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeSettings is not found") + return (__nvmlSystemGetConfComputeSettings)( + settings) + + +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGspFirmwareVersion + _check_or_init_nvml() + if __nvmlDeviceGetGspFirmwareVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareVersion is not found") + return (__nvmlDeviceGetGspFirmwareVersion)( + device, version) + + +cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGspFirmwareMode + _check_or_init_nvml() + if __nvmlDeviceGetGspFirmwareMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareMode is not found") + return (__nvmlDeviceGetGspFirmwareMode)( + device, isEnabled, defaultMode) + + +cdef nvmlReturn_t _nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSramEccErrorStatus + _check_or_init_nvml() + if __nvmlDeviceGetSramEccErrorStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSramEccErrorStatus is not found") + return (__nvmlDeviceGetSramEccErrorStatus)( + device, status) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingMode + _check_or_init_nvml() + if __nvmlDeviceGetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingMode is not found") + return (__nvmlDeviceGetAccountingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats is not found") + return (__nvmlDeviceGetAccountingStats)( + device, pid, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingPids + _check_or_init_nvml() + if __nvmlDeviceGetAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingPids is not found") + return (__nvmlDeviceGetAccountingPids)( + device, count, pids) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingBufferSize + _check_or_init_nvml() + if __nvmlDeviceGetAccountingBufferSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingBufferSize is not found") + return (__nvmlDeviceGetAccountingBufferSize)( + device, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPages + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPages == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages is not found") + return (__nvmlDeviceGetRetiredPages)( + device, cause, pageCount, addresses) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPages_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPages_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages_v2 is not found") + return (__nvmlDeviceGetRetiredPages_v2)( + device, cause, pageCount, addresses, timestamps) + + +cdef nvmlReturn_t _nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRetiredPagesPendingStatus + _check_or_init_nvml() + if __nvmlDeviceGetRetiredPagesPendingStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRetiredPagesPendingStatus is not found") + return (__nvmlDeviceGetRetiredPagesPendingStatus)( + device, isPending) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows is not found") + return (__nvmlDeviceGetRemappedRows)( + device, corrRows, uncRows, isPending, failureOccurred) + + +cdef nvmlReturn_t _nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRowRemapperHistogram + _check_or_init_nvml() + if __nvmlDeviceGetRowRemapperHistogram == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRowRemapperHistogram is not found") + return (__nvmlDeviceGetRowRemapperHistogram)( + device, values) + + +cdef nvmlReturn_t _nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetArchitecture + _check_or_init_nvml() + if __nvmlDeviceGetArchitecture == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetArchitecture is not found") + return (__nvmlDeviceGetArchitecture)( + device, arch) + + +cdef nvmlReturn_t _nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetClkMonStatus + _check_or_init_nvml() + if __nvmlDeviceGetClkMonStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetClkMonStatus is not found") + return (__nvmlDeviceGetClkMonStatus)( + device, status) + + +cdef nvmlReturn_t _nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetProcessUtilization + _check_or_init_nvml() + if __nvmlDeviceGetProcessUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetProcessUtilization is not found") + return (__nvmlDeviceGetProcessUtilization)( + device, utilization, processSamplesCount, lastSeenTimeStamp) + + +cdef nvmlReturn_t _nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetProcessesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetProcessesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetProcessesUtilizationInfo is not found") + return (__nvmlDeviceGetProcessesUtilizationInfo)( + device, procesesUtilInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPlatformInfo + _check_or_init_nvml() + if __nvmlDeviceGetPlatformInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPlatformInfo is not found") + return (__nvmlDeviceGetPlatformInfo)( + device, platformInfo) + + +cdef nvmlReturn_t _nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlUnitSetLedState + _check_or_init_nvml() + if __nvmlUnitSetLedState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlUnitSetLedState is not found") + return (__nvmlUnitSetLedState)( + unit, color) + + +cdef nvmlReturn_t _nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPersistenceMode + _check_or_init_nvml() + if __nvmlDeviceSetPersistenceMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPersistenceMode is not found") + return (__nvmlDeviceSetPersistenceMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetComputeMode + _check_or_init_nvml() + if __nvmlDeviceSetComputeMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetComputeMode is not found") + return (__nvmlDeviceSetComputeMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetEccMode + _check_or_init_nvml() + if __nvmlDeviceSetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetEccMode is not found") + return (__nvmlDeviceSetEccMode)( + device, ecc) + + +cdef nvmlReturn_t _nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearEccErrorCounts + _check_or_init_nvml() + if __nvmlDeviceClearEccErrorCounts == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearEccErrorCounts is not found") + return (__nvmlDeviceClearEccErrorCounts)( + device, counterType) + + +cdef nvmlReturn_t _nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDriverModel + _check_or_init_nvml() + if __nvmlDeviceSetDriverModel == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDriverModel is not found") + return (__nvmlDeviceSetDriverModel)( + device, driverModel, flags) + + +cdef nvmlReturn_t _nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetGpuLockedClocks + _check_or_init_nvml() + if __nvmlDeviceSetGpuLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetGpuLockedClocks is not found") + return (__nvmlDeviceSetGpuLockedClocks)( + device, minGpuClockMHz, maxGpuClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetGpuLockedClocks + _check_or_init_nvml() + if __nvmlDeviceResetGpuLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetGpuLockedClocks is not found") + return (__nvmlDeviceResetGpuLockedClocks)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMemoryLockedClocks + _check_or_init_nvml() + if __nvmlDeviceSetMemoryLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMemoryLockedClocks is not found") + return (__nvmlDeviceSetMemoryLockedClocks)( + device, minMemClockMHz, maxMemClockMHz) + + +cdef nvmlReturn_t _nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetMemoryLockedClocks + _check_or_init_nvml() + if __nvmlDeviceResetMemoryLockedClocks == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetMemoryLockedClocks is not found") + return (__nvmlDeviceResetMemoryLockedClocks)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceSetAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceSetAutoBoostedClocksEnabled)( + device, enabled) + + +cdef nvmlReturn_t _nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled + _check_or_init_nvml() + if __nvmlDeviceSetDefaultAutoBoostedClocksEnabled == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDefaultAutoBoostedClocksEnabled is not found") + return (__nvmlDeviceSetDefaultAutoBoostedClocksEnabled)( + device, enabled, flags) + + +cdef nvmlReturn_t _nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetDefaultFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceSetDefaultFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetDefaultFanSpeed_v2 is not found") + return (__nvmlDeviceSetDefaultFanSpeed_v2)( + device, fan) + + +cdef nvmlReturn_t _nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetFanControlPolicy + _check_or_init_nvml() + if __nvmlDeviceSetFanControlPolicy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetFanControlPolicy is not found") + return (__nvmlDeviceSetFanControlPolicy)( + device, fan, policy) + + +cdef nvmlReturn_t _nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetTemperatureThreshold + _check_or_init_nvml() + if __nvmlDeviceSetTemperatureThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetTemperatureThreshold is not found") + return (__nvmlDeviceSetTemperatureThreshold)( + device, thresholdType, temp) + + +cdef nvmlReturn_t _nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetGpuOperationMode + _check_or_init_nvml() + if __nvmlDeviceSetGpuOperationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetGpuOperationMode is not found") + return (__nvmlDeviceSetGpuOperationMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAPIRestriction + _check_or_init_nvml() + if __nvmlDeviceSetAPIRestriction == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAPIRestriction is not found") + return (__nvmlDeviceSetAPIRestriction)( + device, apiType, isRestricted) + + +cdef nvmlReturn_t _nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetFanSpeed_v2 + _check_or_init_nvml() + if __nvmlDeviceSetFanSpeed_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetFanSpeed_v2 is not found") + return (__nvmlDeviceSetFanSpeed_v2)( + device, fan, speed) + + +cdef nvmlReturn_t _nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAccountingMode + _check_or_init_nvml() + if __nvmlDeviceSetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAccountingMode is not found") + return (__nvmlDeviceSetAccountingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearAccountingPids + _check_or_init_nvml() + if __nvmlDeviceClearAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearAccountingPids is not found") + return (__nvmlDeviceClearAccountingPids)( + device) + + +cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPowerManagementLimit_v2 + _check_or_init_nvml() + if __nvmlDeviceSetPowerManagementLimit_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPowerManagementLimit_v2 is not found") + return (__nvmlDeviceSetPowerManagementLimit_v2)( + device, powerValue) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkState + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkState is not found") + return (__nvmlDeviceGetNvLinkState)( + device, link, isActive) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkVersion + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkVersion is not found") + return (__nvmlDeviceGetNvLinkVersion)( + device, link, version) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkCapability + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkCapability == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkCapability is not found") + return (__nvmlDeviceGetNvLinkCapability)( + device, link, capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkRemotePciInfo_v2 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkRemotePciInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemotePciInfo_v2 is not found") + return (__nvmlDeviceGetNvLinkRemotePciInfo_v2)( + device, link, pci) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkErrorCounter + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkErrorCounter == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkErrorCounter is not found") + return (__nvmlDeviceGetNvLinkErrorCounter)( + device, link, counter, counterValue) + + +cdef nvmlReturn_t _nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceResetNvLinkErrorCounters + _check_or_init_nvml() + if __nvmlDeviceResetNvLinkErrorCounters == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceResetNvLinkErrorCounters is not found") + return (__nvmlDeviceResetNvLinkErrorCounters)( + device, link) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkRemoteDeviceType + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkRemoteDeviceType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemoteDeviceType is not found") + return (__nvmlDeviceGetNvLinkRemoteDeviceType)( + device, link, pNvLinkDeviceType) + + +cdef nvmlReturn_t _nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold + _check_or_init_nvml() + if __nvmlDeviceSetNvLinkDeviceLowPowerThreshold == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvLinkDeviceLowPowerThreshold is not found") + return (__nvmlDeviceSetNvLinkDeviceLowPowerThreshold)( + device, info) + + +cdef nvmlReturn_t _nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemSetNvlinkBwMode + _check_or_init_nvml() + if __nvmlSystemSetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemSetNvlinkBwMode is not found") + return (__nvmlSystemSetNvlinkBwMode)( + nvlinkBwMode) + + +cdef nvmlReturn_t _nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetNvlinkBwMode + _check_or_init_nvml() + if __nvmlSystemGetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetNvlinkBwMode is not found") + return (__nvmlSystemGetNvlinkBwMode)( + nvlinkBwMode) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkSupportedBwModes + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkSupportedBwModes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkSupportedBwModes is not found") + return (__nvmlDeviceGetNvlinkSupportedBwModes)( + device, supportedBwMode) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkBwMode + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkBwMode is not found") + return (__nvmlDeviceGetNvlinkBwMode)( + device, getBwMode) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkBwMode + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkBwMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkBwMode is not found") + return (__nvmlDeviceSetNvlinkBwMode)( + device, setBwMode) + + +cdef nvmlReturn_t _nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetCreate + _check_or_init_nvml() + if __nvmlEventSetCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetCreate is not found") + return (__nvmlEventSetCreate)( + set) + + +cdef nvmlReturn_t _nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceRegisterEvents + _check_or_init_nvml() + if __nvmlDeviceRegisterEvents == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceRegisterEvents is not found") + return (__nvmlDeviceRegisterEvents)( + device, eventTypes, set) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedEventTypes + _check_or_init_nvml() + if __nvmlDeviceGetSupportedEventTypes == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedEventTypes is not found") + return (__nvmlDeviceGetSupportedEventTypes)( + device, eventTypes) + + +cdef nvmlReturn_t _nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetWait_v2 + _check_or_init_nvml() + if __nvmlEventSetWait_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetWait_v2 is not found") + return (__nvmlEventSetWait_v2)( + set, data, timeoutms) + + +cdef nvmlReturn_t _nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetFree + _check_or_init_nvml() + if __nvmlEventSetFree == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetFree is not found") + return (__nvmlEventSetFree)( + set) + + +cdef nvmlReturn_t _nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetCreate + _check_or_init_nvml() + if __nvmlSystemEventSetCreate == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetCreate is not found") + return (__nvmlSystemEventSetCreate)( + request) + + +cdef nvmlReturn_t _nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetFree + _check_or_init_nvml() + if __nvmlSystemEventSetFree == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetFree is not found") + return (__nvmlSystemEventSetFree)( + request) + + +cdef nvmlReturn_t _nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemRegisterEvents + _check_or_init_nvml() + if __nvmlSystemRegisterEvents == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemRegisterEvents is not found") + return (__nvmlSystemRegisterEvents)( + request) + + +cdef nvmlReturn_t _nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemEventSetWait + _check_or_init_nvml() + if __nvmlSystemEventSetWait == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemEventSetWait is not found") + return (__nvmlSystemEventSetWait)( + request) + + +cdef nvmlReturn_t _nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceModifyDrainState + _check_or_init_nvml() + if __nvmlDeviceModifyDrainState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceModifyDrainState is not found") + return (__nvmlDeviceModifyDrainState)( + pciInfo, newState) + + +cdef nvmlReturn_t _nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceQueryDrainState + _check_or_init_nvml() + if __nvmlDeviceQueryDrainState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceQueryDrainState is not found") + return (__nvmlDeviceQueryDrainState)( + pciInfo, currentState) + + +cdef nvmlReturn_t _nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceRemoveGpu_v2 + _check_or_init_nvml() + if __nvmlDeviceRemoveGpu_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceRemoveGpu_v2 is not found") + return (__nvmlDeviceRemoveGpu_v2)( + pciInfo, gpuState, linkState) + + +cdef nvmlReturn_t _nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceDiscoverGpus + _check_or_init_nvml() + if __nvmlDeviceDiscoverGpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceDiscoverGpus is not found") + return (__nvmlDeviceDiscoverGpus)( + pciInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetFieldValues + _check_or_init_nvml() + if __nvmlDeviceGetFieldValues == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetFieldValues is not found") + return (__nvmlDeviceGetFieldValues)( + device, valuesCount, values) + + +cdef nvmlReturn_t _nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceClearFieldValues + _check_or_init_nvml() + if __nvmlDeviceClearFieldValues == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceClearFieldValues is not found") + return (__nvmlDeviceClearFieldValues)( + device, valuesCount, values) + + +cdef nvmlReturn_t _nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVirtualizationMode + _check_or_init_nvml() + if __nvmlDeviceGetVirtualizationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVirtualizationMode is not found") + return (__nvmlDeviceGetVirtualizationMode)( + device, pVirtualMode) + + +cdef nvmlReturn_t _nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHostVgpuMode + _check_or_init_nvml() + if __nvmlDeviceGetHostVgpuMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHostVgpuMode is not found") + return (__nvmlDeviceGetHostVgpuMode)( + device, pHostVgpuMode) + + +cdef nvmlReturn_t _nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVirtualizationMode + _check_or_init_nvml() + if __nvmlDeviceSetVirtualizationMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVirtualizationMode is not found") + return (__nvmlDeviceSetVirtualizationMode)( + device, virtualMode) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlDeviceGetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuHeterogeneousMode is not found") + return (__nvmlDeviceGetVgpuHeterogeneousMode)( + device, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlDeviceSetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuHeterogeneousMode is not found") + return (__nvmlDeviceSetVgpuHeterogeneousMode)( + device, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetPlacementId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetPlacementId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetPlacementId is not found") + return (__nvmlVgpuInstanceGetPlacementId)( + vgpuInstance, pPlacement) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuTypeSupportedPlacements + _check_or_init_nvml() + if __nvmlDeviceGetVgpuTypeSupportedPlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeSupportedPlacements is not found") + return (__nvmlDeviceGetVgpuTypeSupportedPlacements)( + device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuTypeCreatablePlacements + _check_or_init_nvml() + if __nvmlDeviceGetVgpuTypeCreatablePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeCreatablePlacements is not found") + return (__nvmlDeviceGetVgpuTypeCreatablePlacements)( + device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetGspHeapSize + _check_or_init_nvml() + if __nvmlVgpuTypeGetGspHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetGspHeapSize is not found") + return (__nvmlVgpuTypeGetGspHeapSize)( + vgpuTypeId, gspHeapSize) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFbReservation + _check_or_init_nvml() + if __nvmlVgpuTypeGetFbReservation == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFbReservation is not found") + return (__nvmlVgpuTypeGetFbReservation)( + vgpuTypeId, fbReservation) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetRuntimeStateSize + _check_or_init_nvml() + if __nvmlVgpuInstanceGetRuntimeStateSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetRuntimeStateSize is not found") + return (__nvmlVgpuInstanceGetRuntimeStateSize)( + vgpuInstance, pState) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuCapabilities + _check_or_init_nvml() + if __nvmlDeviceSetVgpuCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuCapabilities is not found") + return (__nvmlDeviceSetVgpuCapabilities)( + device, capability, state) + + +cdef nvmlReturn_t _nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGridLicensableFeatures_v4 + _check_or_init_nvml() + if __nvmlDeviceGetGridLicensableFeatures_v4 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGridLicensableFeatures_v4 is not found") + return (__nvmlDeviceGetGridLicensableFeatures_v4)( + device, pGridLicensableFeatures) + + +cdef nvmlReturn_t _nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuDriverCapabilities + _check_or_init_nvml() + if __nvmlGetVgpuDriverCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuDriverCapabilities is not found") + return (__nvmlGetVgpuDriverCapabilities)( + capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetVgpuCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuCapabilities is not found") + return (__nvmlDeviceGetVgpuCapabilities)( + device, capability, capResult) + + +cdef nvmlReturn_t _nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSupportedVgpus + _check_or_init_nvml() + if __nvmlDeviceGetSupportedVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSupportedVgpus is not found") + return (__nvmlDeviceGetSupportedVgpus)( + device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t _nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCreatableVgpus + _check_or_init_nvml() + if __nvmlDeviceGetCreatableVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCreatableVgpus is not found") + return (__nvmlDeviceGetCreatableVgpus)( + device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetClass + _check_or_init_nvml() + if __nvmlVgpuTypeGetClass == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetClass is not found") + return (__nvmlVgpuTypeGetClass)( + vgpuTypeId, vgpuTypeClass, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetName + _check_or_init_nvml() + if __nvmlVgpuTypeGetName == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetName is not found") + return (__nvmlVgpuTypeGetName)( + vgpuTypeId, vgpuTypeName, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetGpuInstanceProfileId + _check_or_init_nvml() + if __nvmlVgpuTypeGetGpuInstanceProfileId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetGpuInstanceProfileId is not found") + return (__nvmlVgpuTypeGetGpuInstanceProfileId)( + vgpuTypeId, gpuInstanceProfileId) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetDeviceID + _check_or_init_nvml() + if __nvmlVgpuTypeGetDeviceID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetDeviceID is not found") + return (__nvmlVgpuTypeGetDeviceID)( + vgpuTypeId, deviceID, subsystemID) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFramebufferSize + _check_or_init_nvml() + if __nvmlVgpuTypeGetFramebufferSize == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFramebufferSize is not found") + return (__nvmlVgpuTypeGetFramebufferSize)( + vgpuTypeId, fbSize) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetNumDisplayHeads + _check_or_init_nvml() + if __nvmlVgpuTypeGetNumDisplayHeads == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetNumDisplayHeads is not found") + return (__nvmlVgpuTypeGetNumDisplayHeads)( + vgpuTypeId, numDisplayHeads) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetResolution + _check_or_init_nvml() + if __nvmlVgpuTypeGetResolution == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetResolution is not found") + return (__nvmlVgpuTypeGetResolution)( + vgpuTypeId, displayIndex, xdim, ydim) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetLicense + _check_or_init_nvml() + if __nvmlVgpuTypeGetLicense == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetLicense is not found") + return (__nvmlVgpuTypeGetLicense)( + vgpuTypeId, vgpuTypeLicenseString, size) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetFrameRateLimit + _check_or_init_nvml() + if __nvmlVgpuTypeGetFrameRateLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetFrameRateLimit is not found") + return (__nvmlVgpuTypeGetFrameRateLimit)( + vgpuTypeId, frameRateLimit) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstances + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstances is not found") + return (__nvmlVgpuTypeGetMaxInstances)( + device, vgpuTypeId, vgpuInstanceCount) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstancesPerVm + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstancesPerVm == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerVm is not found") + return (__nvmlVgpuTypeGetMaxInstancesPerVm)( + vgpuTypeId, vgpuInstanceCountPerVm) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetBAR1Info + _check_or_init_nvml() + if __nvmlVgpuTypeGetBAR1Info == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetBAR1Info is not found") + return (__nvmlVgpuTypeGetBAR1Info)( + vgpuTypeId, bar1Info) + + +cdef nvmlReturn_t _nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetActiveVgpus + _check_or_init_nvml() + if __nvmlDeviceGetActiveVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetActiveVgpus is not found") + return (__nvmlDeviceGetActiveVgpus)( + device, vgpuCount, vgpuInstances) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetVmID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetVmID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmID is not found") + return (__nvmlVgpuInstanceGetVmID)( + vgpuInstance, vmId, size, vmIdType) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetUUID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetUUID is not found") + return (__nvmlVgpuInstanceGetUUID)( + vgpuInstance, uuid, size) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetVmDriverVersion + _check_or_init_nvml() + if __nvmlVgpuInstanceGetVmDriverVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmDriverVersion is not found") + return (__nvmlVgpuInstanceGetVmDriverVersion)( + vgpuInstance, version, length) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFbUsage + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFbUsage == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFbUsage is not found") + return (__nvmlVgpuInstanceGetFbUsage)( + vgpuInstance, fbUsage) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetLicenseStatus + _check_or_init_nvml() + if __nvmlVgpuInstanceGetLicenseStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseStatus is not found") + return (__nvmlVgpuInstanceGetLicenseStatus)( + vgpuInstance, licensed) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetType + _check_or_init_nvml() + if __nvmlVgpuInstanceGetType == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetType is not found") + return (__nvmlVgpuInstanceGetType)( + vgpuInstance, vgpuTypeId) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFrameRateLimit + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFrameRateLimit == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFrameRateLimit is not found") + return (__nvmlVgpuInstanceGetFrameRateLimit)( + vgpuInstance, frameRateLimit) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEccMode + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEccMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEccMode is not found") + return (__nvmlVgpuInstanceGetEccMode)( + vgpuInstance, eccMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderCapacity + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderCapacity is not found") + return (__nvmlVgpuInstanceGetEncoderCapacity)( + vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t _nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceSetEncoderCapacity + _check_or_init_nvml() + if __nvmlVgpuInstanceSetEncoderCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceSetEncoderCapacity is not found") + return (__nvmlVgpuInstanceSetEncoderCapacity)( + vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderStats is not found") + return (__nvmlVgpuInstanceGetEncoderStats)( + vgpuInstance, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetEncoderSessions + _check_or_init_nvml() + if __nvmlVgpuInstanceGetEncoderSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderSessions is not found") + return (__nvmlVgpuInstanceGetEncoderSessions)( + vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFBCStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFBCStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCStats is not found") + return (__nvmlVgpuInstanceGetFBCStats)( + vgpuInstance, fbcStats) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetFBCSessions + _check_or_init_nvml() + if __nvmlVgpuInstanceGetFBCSessions == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCSessions is not found") + return (__nvmlVgpuInstanceGetFBCSessions)( + vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetGpuInstanceId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetGpuInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuInstanceId is not found") + return (__nvmlVgpuInstanceGetGpuInstanceId)( + vgpuInstance, gpuInstanceId) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetGpuPciId + _check_or_init_nvml() + if __nvmlVgpuInstanceGetGpuPciId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuPciId is not found") + return (__nvmlVgpuInstanceGetGpuPciId)( + vgpuInstance, vgpuPciId, length) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetCapabilities + _check_or_init_nvml() + if __nvmlVgpuTypeGetCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetCapabilities is not found") + return (__nvmlVgpuTypeGetCapabilities)( + vgpuTypeId, capability, capResult) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetMdevUUID + _check_or_init_nvml() + if __nvmlVgpuInstanceGetMdevUUID == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetMdevUUID is not found") + return (__nvmlVgpuInstanceGetMdevUUID)( + vgpuInstance, mdevUuid, size) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetCreatableVgpus + _check_or_init_nvml() + if __nvmlGpuInstanceGetCreatableVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetCreatableVgpus is not found") + return (__nvmlGpuInstanceGetCreatableVgpus)( + gpuInstance, pVgpus) + + +cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance + _check_or_init_nvml() + if __nvmlVgpuTypeGetMaxInstancesPerGpuInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerGpuInstance is not found") + return (__nvmlVgpuTypeGetMaxInstancesPerGpuInstance)( + pMaxInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetActiveVgpus + _check_or_init_nvml() + if __nvmlGpuInstanceGetActiveVgpus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetActiveVgpus is not found") + return (__nvmlGpuInstanceGetActiveVgpus)( + gpuInstance, pVgpuInstanceInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState)( + gpuInstance, pScheduler) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuTypeCreatablePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuTypeCreatablePlacements is not found") + return (__nvmlGpuInstanceGetVgpuTypeCreatablePlacements)( + gpuInstance, pCreatablePlacementInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuHeterogeneousMode is not found") + return (__nvmlGpuInstanceGetVgpuHeterogeneousMode)( + gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuHeterogeneousMode + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuHeterogeneousMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuHeterogeneousMode is not found") + return (__nvmlGpuInstanceSetVgpuHeterogeneousMode)( + gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetMetadata + _check_or_init_nvml() + if __nvmlVgpuInstanceGetMetadata == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetMetadata is not found") + return (__nvmlVgpuInstanceGetMetadata)( + vgpuInstance, vgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuMetadata + _check_or_init_nvml() + if __nvmlDeviceGetVgpuMetadata == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuMetadata is not found") + return (__nvmlDeviceGetVgpuMetadata)( + device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuCompatibility + _check_or_init_nvml() + if __nvmlGetVgpuCompatibility == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuCompatibility is not found") + return (__nvmlGetVgpuCompatibility)( + vgpuMetadata, pgpuMetadata, compatibilityInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPgpuMetadataString + _check_or_init_nvml() + if __nvmlDeviceGetPgpuMetadataString == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPgpuMetadataString is not found") + return (__nvmlDeviceGetPgpuMetadataString)( + device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog is not found") + return (__nvmlDeviceGetVgpuSchedulerLog)( + device, pSchedulerLog) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState is not found") + return (__nvmlDeviceGetVgpuSchedulerState)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerCapabilities is not found") + return (__nvmlDeviceGetVgpuSchedulerCapabilities)( + device, pCapabilities) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState is not found") + return (__nvmlDeviceSetVgpuSchedulerState)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetVgpuVersion + _check_or_init_nvml() + if __nvmlGetVgpuVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetVgpuVersion is not found") + return (__nvmlGetVgpuVersion)( + supported, current) + + +cdef nvmlReturn_t _nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSetVgpuVersion + _check_or_init_nvml() + if __nvmlSetVgpuVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSetVgpuVersion is not found") + return (__nvmlSetVgpuVersion)( + vgpuVersion) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuUtilization + _check_or_init_nvml() + if __nvmlDeviceGetVgpuUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuUtilization is not found") + return (__nvmlDeviceGetVgpuUtilization)( + device, lastSeenTimeStamp, sampleValType, vgpuInstanceSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuInstancesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetVgpuInstancesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuInstancesUtilizationInfo is not found") + return (__nvmlDeviceGetVgpuInstancesUtilizationInfo)( + device, vgpuUtilInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuProcessUtilization + _check_or_init_nvml() + if __nvmlDeviceGetVgpuProcessUtilization == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessUtilization is not found") + return (__nvmlDeviceGetVgpuProcessUtilization)( + device, lastSeenTimeStamp, vgpuProcessSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuProcessesUtilizationInfo + _check_or_init_nvml() + if __nvmlDeviceGetVgpuProcessesUtilizationInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessesUtilizationInfo is not found") + return (__nvmlDeviceGetVgpuProcessesUtilizationInfo)( + device, vgpuProcUtilInfo) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingMode + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingMode is not found") + return (__nvmlVgpuInstanceGetAccountingMode)( + vgpuInstance, mode) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingPids + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingPids is not found") + return (__nvmlVgpuInstanceGetAccountingPids)( + vgpuInstance, count, pids) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetAccountingStats + _check_or_init_nvml() + if __nvmlVgpuInstanceGetAccountingStats == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingStats is not found") + return (__nvmlVgpuInstanceGetAccountingStats)( + vgpuInstance, pid, stats) + + +cdef nvmlReturn_t _nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceClearAccountingPids + _check_or_init_nvml() + if __nvmlVgpuInstanceClearAccountingPids == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceClearAccountingPids is not found") + return (__nvmlVgpuInstanceClearAccountingPids)( + vgpuInstance) + + +cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlVgpuInstanceGetLicenseInfo_v2 + _check_or_init_nvml() + if __nvmlVgpuInstanceGetLicenseInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseInfo_v2 is not found") + return (__nvmlVgpuInstanceGetLicenseInfo_v2)( + vgpuInstance, licenseInfo) + + +cdef nvmlReturn_t _nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetExcludedDeviceCount + _check_or_init_nvml() + if __nvmlGetExcludedDeviceCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetExcludedDeviceCount is not found") + return (__nvmlGetExcludedDeviceCount)( + deviceCount) + + +cdef nvmlReturn_t _nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGetExcludedDeviceInfoByIndex + _check_or_init_nvml() + if __nvmlGetExcludedDeviceInfoByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGetExcludedDeviceInfoByIndex is not found") + return (__nvmlGetExcludedDeviceInfoByIndex)( + index, info) + + +cdef nvmlReturn_t _nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMigMode + _check_or_init_nvml() + if __nvmlDeviceSetMigMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMigMode is not found") + return (__nvmlDeviceSetMigMode)( + device, mode, activationStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMigMode + _check_or_init_nvml() + if __nvmlDeviceGetMigMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMigMode is not found") + return (__nvmlDeviceGetMigMode)( + device, currentMode, pendingMode) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceProfileInfoV + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceProfileInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoV is not found") + return (__nvmlDeviceGetGpuInstanceProfileInfoV)( + device, profile, info) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstancePossiblePlacements_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstancePossiblePlacements_v2 is not found") + return (__nvmlDeviceGetGpuInstancePossiblePlacements_v2)( + device, profileId, placements, count) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceRemainingCapacity + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceRemainingCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceRemainingCapacity is not found") + return (__nvmlDeviceGetGpuInstanceRemainingCapacity)( + device, profileId, count) + + +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceCreateGpuInstance + _check_or_init_nvml() + if __nvmlDeviceCreateGpuInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstance is not found") + return (__nvmlDeviceCreateGpuInstance)( + device, profileId, gpuInstance) + + +cdef nvmlReturn_t _nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceCreateGpuInstanceWithPlacement + _check_or_init_nvml() + if __nvmlDeviceCreateGpuInstanceWithPlacement == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstanceWithPlacement is not found") + return (__nvmlDeviceCreateGpuInstanceWithPlacement)( + device, profileId, placement, gpuInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceDestroy + _check_or_init_nvml() + if __nvmlGpuInstanceDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceDestroy is not found") + return (__nvmlGpuInstanceDestroy)( + gpuInstance) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstances + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstances is not found") + return (__nvmlDeviceGetGpuInstances)( + device, profileId, gpuInstances, count) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceById + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceById == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceById is not found") + return (__nvmlDeviceGetGpuInstanceById)( + device, id, gpuInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetInfo + _check_or_init_nvml() + if __nvmlGpuInstanceGetInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetInfo is not found") + return (__nvmlGpuInstanceGetInfo)( + gpuInstance, info) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceProfileInfoV + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceProfileInfoV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceProfileInfoV is not found") + return (__nvmlGpuInstanceGetComputeInstanceProfileInfoV)( + gpuInstance, profile, engProfile, info) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceRemainingCapacity == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceRemainingCapacity is not found") + return (__nvmlGpuInstanceGetComputeInstanceRemainingCapacity)( + gpuInstance, profileId, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstancePossiblePlacements + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstancePossiblePlacements == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstancePossiblePlacements is not found") + return (__nvmlGpuInstanceGetComputeInstancePossiblePlacements)( + gpuInstance, profileId, placements, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceCreateComputeInstance + _check_or_init_nvml() + if __nvmlGpuInstanceCreateComputeInstance == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstance is not found") + return (__nvmlGpuInstanceCreateComputeInstance)( + gpuInstance, profileId, computeInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceCreateComputeInstanceWithPlacement + _check_or_init_nvml() + if __nvmlGpuInstanceCreateComputeInstanceWithPlacement == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstanceWithPlacement is not found") + return (__nvmlGpuInstanceCreateComputeInstanceWithPlacement)( + gpuInstance, profileId, placement, computeInstance) + + +cdef nvmlReturn_t _nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlComputeInstanceDestroy + _check_or_init_nvml() + if __nvmlComputeInstanceDestroy == NULL: + with gil: + raise FunctionNotFoundError("function nvmlComputeInstanceDestroy is not found") + return (__nvmlComputeInstanceDestroy)( + computeInstance) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstances + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstances == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstances is not found") + return (__nvmlGpuInstanceGetComputeInstances)( + gpuInstance, profileId, computeInstances, count) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetComputeInstanceById + _check_or_init_nvml() + if __nvmlGpuInstanceGetComputeInstanceById == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceById is not found") + return (__nvmlGpuInstanceGetComputeInstanceById)( + gpuInstance, id, computeInstance) + + +cdef nvmlReturn_t _nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlComputeInstanceGetInfo_v2 + _check_or_init_nvml() + if __nvmlComputeInstanceGetInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlComputeInstanceGetInfo_v2 is not found") + return (__nvmlComputeInstanceGetInfo_v2)( + computeInstance, info) + + +cdef nvmlReturn_t _nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceIsMigDeviceHandle + _check_or_init_nvml() + if __nvmlDeviceIsMigDeviceHandle == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceIsMigDeviceHandle is not found") + return (__nvmlDeviceIsMigDeviceHandle)( + device, isMigDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceId + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceId is not found") + return (__nvmlDeviceGetGpuInstanceId)( + device, id) + + +cdef nvmlReturn_t _nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetComputeInstanceId + _check_or_init_nvml() + if __nvmlDeviceGetComputeInstanceId == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetComputeInstanceId is not found") + return (__nvmlDeviceGetComputeInstanceId)( + device, id) + + +cdef nvmlReturn_t _nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMaxMigDeviceCount + _check_or_init_nvml() + if __nvmlDeviceGetMaxMigDeviceCount == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMaxMigDeviceCount is not found") + return (__nvmlDeviceGetMaxMigDeviceCount)( + device, count) + + +cdef nvmlReturn_t _nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMigDeviceHandleByIndex + _check_or_init_nvml() + if __nvmlDeviceGetMigDeviceHandleByIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMigDeviceHandleByIndex is not found") + return (__nvmlDeviceGetMigDeviceHandleByIndex)( + device, index, migDevice) + + +cdef nvmlReturn_t _nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle + _check_or_init_nvml() + if __nvmlDeviceGetDeviceHandleFromMigDeviceHandle == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetDeviceHandleFromMigDeviceHandle is not found") + return (__nvmlDeviceGetDeviceHandleFromMigDeviceHandle)( + migDevice, device) + + +cdef nvmlReturn_t _nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetCapabilities + _check_or_init_nvml() + if __nvmlDeviceGetCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetCapabilities is not found") + return (__nvmlDeviceGetCapabilities)( + device, caps) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingActivatePresetProfile + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingActivatePresetProfile == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingActivatePresetProfile is not found") + return (__nvmlDevicePowerSmoothingActivatePresetProfile)( + device, profile) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingUpdatePresetProfileParam + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingUpdatePresetProfileParam == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingUpdatePresetProfileParam is not found") + return (__nvmlDevicePowerSmoothingUpdatePresetProfileParam)( + device, profile) + + +cdef nvmlReturn_t _nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePowerSmoothingSetState + _check_or_init_nvml() + if __nvmlDevicePowerSmoothingSetState == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePowerSmoothingSetState is not found") + return (__nvmlDevicePowerSmoothingSetState)( + device, state) + + +cdef nvmlReturn_t _nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAddressingMode + _check_or_init_nvml() + if __nvmlDeviceGetAddressingMode == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAddressingMode is not found") + return (__nvmlDeviceGetAddressingMode)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRepairStatus + _check_or_init_nvml() + if __nvmlDeviceGetRepairStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRepairStatus is not found") + return (__nvmlDeviceGetRepairStatus)( + device, repairStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPowerMizerMode_v1 + _check_or_init_nvml() + if __nvmlDeviceGetPowerMizerMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPowerMizerMode_v1 is not found") + return (__nvmlDeviceGetPowerMizerMode_v1)( + device, powerMizerMode) + + +cdef nvmlReturn_t _nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetPowerMizerMode_v1 + _check_or_init_nvml() + if __nvmlDeviceSetPowerMizerMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetPowerMizerMode_v1 is not found") + return (__nvmlDeviceSetPowerMizerMode_v1)( + device, powerMizerMode) + + +cdef nvmlReturn_t _nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetPdi + _check_or_init_nvml() + if __nvmlDeviceGetPdi == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetPdi is not found") + return (__nvmlDeviceGetPdi)( + device, pdi) + + +cdef nvmlReturn_t _nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetHostname_v1 + _check_or_init_nvml() + if __nvmlDeviceSetHostname_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetHostname_v1 is not found") + return (__nvmlDeviceSetHostname_v1)( + device, hostname) + + +cdef nvmlReturn_t _nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetHostname_v1 + _check_or_init_nvml() + if __nvmlDeviceGetHostname_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetHostname_v1 is not found") + return (__nvmlDeviceGetHostname_v1)( + device, hostname) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkInfo + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkInfo is not found") + return (__nvmlDeviceGetNvLinkInfo)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceReadWritePRM_v1 + _check_or_init_nvml() + if __nvmlDeviceReadWritePRM_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceReadWritePRM_v1 is not found") + return (__nvmlDeviceReadWritePRM_v1)( + device, buffer) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuInstanceProfileInfoByIdV + _check_or_init_nvml() + if __nvmlDeviceGetGpuInstanceProfileInfoByIdV == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoByIdV is not found") + return (__nvmlDeviceGetGpuInstanceProfileInfoByIdV)( + device, profileId, info) + + +cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + _check_or_init_nvml() + if __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts is not found") + return (__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts)( + device, errorCounts) + + +cdef nvmlReturn_t _nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetUnrepairableMemoryFlag_v1 + _check_or_init_nvml() + if __nvmlDeviceGetUnrepairableMemoryFlag_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetUnrepairableMemoryFlag_v1 is not found") + return (__nvmlDeviceGetUnrepairableMemoryFlag_v1)( + device, unrepairableMemoryStatus) + + +cdef nvmlReturn_t _nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceReadPRMCounters_v1 + _check_or_init_nvml() + if __nvmlDeviceReadPRMCounters_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceReadPRMCounters_v1 is not found") + return (__nvmlDeviceReadPRMCounters_v1)( + device, counterList) + + +cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetRusdSettings_v1 + _check_or_init_nvml() + if __nvmlDeviceSetRusdSettings_v1 == NULL: + with gil: + 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) + + +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCPER_v1 + _check_or_init_nvml() + if __nvmlSystemGetCPER_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCPER_v1 is not found") + return (__nvmlSystemGetCPER_v1)( + cper) + + +cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBBXTimeData_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBBXTimeData_v1 is not found") + return (__nvmlDeviceGetBBXTimeData_v1)( + device, timeData) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats_v2 is not found") + return (__nvmlDeviceGetAccountingStats_v2)( + device, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows_v2 is not found") + return (__nvmlDeviceGetRemappedRows_v2)( + device, info) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvrtc.pxd b/cuda_bindings_12/cuda/bindings/_internal/nvrtc.pxd new file mode 100644 index 00000000000..4bd30cafc6f --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvrtc.pxd @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1c512204cd635031a07589fb651b8a44584a9ec1b670efd33db175fd033d1dc9 +from ..cynvrtc cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvrtcGetErrorString(nvrtcResult result) except?NULL nogil +cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil +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 +cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvrtc_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvrtc_linux.pyx new file mode 100644 index 00000000000..4b892fbb805 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvrtc_linux.pyx @@ -0,0 +1,613 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b382b06daa43bc67abaa1ef39ecee58156ba05220b82cbec693a063fa73f1b27 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +from libc.stdint cimport intptr_t + +import threading as _cyb_threading + +cdef int _cyb___py_nvrtc_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __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 int _init_nvrtc() except -1 nogil: + global _cyb___py_nvrtc_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_nvrtc_init: return 0 + + global __nvrtcGetErrorString + __nvrtcGetErrorString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetErrorString') + if __nvrtcGetErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetErrorString = _cyb_dlsym(handle, 'nvrtcGetErrorString') + + global __nvrtcVersion + __nvrtcVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcVersion') + if __nvrtcVersion == NULL: + if handle == NULL: + handle = load_library() + __nvrtcVersion = _cyb_dlsym(handle, 'nvrtcVersion') + + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetNumSupportedArchs') + if __nvrtcGetNumSupportedArchs == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetNumSupportedArchs = _cyb_dlsym(handle, 'nvrtcGetNumSupportedArchs') + + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetSupportedArchs') + if __nvrtcGetSupportedArchs == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetSupportedArchs = _cyb_dlsym(handle, 'nvrtcGetSupportedArchs') + + global __nvrtcCreateProgram + __nvrtcCreateProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcCreateProgram') + if __nvrtcCreateProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcCreateProgram = _cyb_dlsym(handle, 'nvrtcCreateProgram') + + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcDestroyProgram') + if __nvrtcDestroyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcDestroyProgram = _cyb_dlsym(handle, 'nvrtcDestroyProgram') + + global __nvrtcCompileProgram + __nvrtcCompileProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcCompileProgram') + if __nvrtcCompileProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcCompileProgram = _cyb_dlsym(handle, 'nvrtcCompileProgram') + + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetPTXSize') + if __nvrtcGetPTXSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPTXSize = _cyb_dlsym(handle, 'nvrtcGetPTXSize') + + global __nvrtcGetPTX + __nvrtcGetPTX = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetPTX') + if __nvrtcGetPTX == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPTX = _cyb_dlsym(handle, 'nvrtcGetPTX') + + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetCUBINSize') + if __nvrtcGetCUBINSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetCUBINSize = _cyb_dlsym(handle, 'nvrtcGetCUBINSize') + + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetCUBIN') + if __nvrtcGetCUBIN == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetCUBIN = _cyb_dlsym(handle, 'nvrtcGetCUBIN') + + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetLTOIRSize') + if __nvrtcGetLTOIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLTOIRSize = _cyb_dlsym(handle, 'nvrtcGetLTOIRSize') + + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetLTOIR') + if __nvrtcGetLTOIR == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLTOIR = _cyb_dlsym(handle, 'nvrtcGetLTOIR') + + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetOptiXIRSize') + if __nvrtcGetOptiXIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetOptiXIRSize = _cyb_dlsym(handle, 'nvrtcGetOptiXIRSize') + + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetOptiXIR') + if __nvrtcGetOptiXIR == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetOptiXIR = _cyb_dlsym(handle, 'nvrtcGetOptiXIR') + + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetProgramLogSize') + if __nvrtcGetProgramLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetProgramLogSize = _cyb_dlsym(handle, 'nvrtcGetProgramLogSize') + + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetProgramLog') + if __nvrtcGetProgramLog == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetProgramLog = _cyb_dlsym(handle, 'nvrtcGetProgramLog') + + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcAddNameExpression') + if __nvrtcAddNameExpression == NULL: + if handle == NULL: + handle = load_library() + __nvrtcAddNameExpression = _cyb_dlsym(handle, 'nvrtcAddNameExpression') + + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetLoweredName') + if __nvrtcGetLoweredName == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLoweredName = _cyb_dlsym(handle, 'nvrtcGetLoweredName') + + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetPCHHeapSize') + if __nvrtcGetPCHHeapSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHHeapSize = _cyb_dlsym(handle, 'nvrtcGetPCHHeapSize') + + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcSetPCHHeapSize') + if __nvrtcSetPCHHeapSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcSetPCHHeapSize = _cyb_dlsym(handle, 'nvrtcSetPCHHeapSize') + + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetPCHCreateStatus') + if __nvrtcGetPCHCreateStatus == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHCreateStatus = _cyb_dlsym(handle, 'nvrtcGetPCHCreateStatus') + + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcGetPCHHeapSizeRequired') + if __nvrtcGetPCHHeapSizeRequired == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHHeapSizeRequired = _cyb_dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') + + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvrtcSetFlowCallback') + if __nvrtcSetFlowCallback == NULL: + if handle == NULL: + handle = load_library() + __nvrtcSetFlowCallback = _cyb_dlsym(handle, 'nvrtcSetFlowCallback') + + _cyb_atomic_int_store(&_cyb___py_nvrtc_init, 1) + return 0 + +cdef inline int _check_or_init_nvrtc() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvrtc_init): + return 0 + + return _init_nvrtc() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_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 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint + return handle + + +############################################################################### +# 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) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvrtc_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvrtc_windows.pyx new file mode 100644 index 00000000000..11441473a74 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvrtc_windows.pyx @@ -0,0 +1,519 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=59def78264f6eb2ac30eb34435bdefcfc2f8718c6d017c8a693c9e3df3e35df6 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvrtc_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from .utils import FunctionNotFoundError, NotSupportedError +############################################################################### +# Wrapper init +############################################################################### + +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 int _init_nvrtc() except -1 nogil: + global _cyb___py_nvrtc_init + + cdef int err + cdef uintptr_t handle + with gil, _cyb_symbol_lock: + if _cyb___py_nvrtc_init: return 0 + + handle = load_library() + global __nvrtcGetErrorString + __nvrtcGetErrorString = _cyb_GetProcAddress(handle, 'nvrtcGetErrorString') + + global __nvrtcVersion + __nvrtcVersion = _cyb_GetProcAddress(handle, 'nvrtcVersion') + + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = _cyb_GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') + + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = _cyb_GetProcAddress(handle, 'nvrtcGetSupportedArchs') + + global __nvrtcCreateProgram + __nvrtcCreateProgram = _cyb_GetProcAddress(handle, 'nvrtcCreateProgram') + + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = _cyb_GetProcAddress(handle, 'nvrtcDestroyProgram') + + global __nvrtcCompileProgram + __nvrtcCompileProgram = _cyb_GetProcAddress(handle, 'nvrtcCompileProgram') + + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = _cyb_GetProcAddress(handle, 'nvrtcGetPTXSize') + + global __nvrtcGetPTX + __nvrtcGetPTX = _cyb_GetProcAddress(handle, 'nvrtcGetPTX') + + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = _cyb_GetProcAddress(handle, 'nvrtcGetCUBINSize') + + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = _cyb_GetProcAddress(handle, 'nvrtcGetCUBIN') + + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = _cyb_GetProcAddress(handle, 'nvrtcGetLTOIRSize') + + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = _cyb_GetProcAddress(handle, 'nvrtcGetLTOIR') + + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = _cyb_GetProcAddress(handle, 'nvrtcGetOptiXIRSize') + + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = _cyb_GetProcAddress(handle, 'nvrtcGetOptiXIR') + + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = _cyb_GetProcAddress(handle, 'nvrtcGetProgramLogSize') + + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = _cyb_GetProcAddress(handle, 'nvrtcGetProgramLog') + + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = _cyb_GetProcAddress(handle, 'nvrtcAddNameExpression') + + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = _cyb_GetProcAddress(handle, 'nvrtcGetLoweredName') + + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = _cyb_GetProcAddress(handle, 'nvrtcGetPCHHeapSize') + + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = _cyb_GetProcAddress(handle, 'nvrtcSetPCHHeapSize') + + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = _cyb_GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') + + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = _cyb_GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') + + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = _cyb_GetProcAddress(handle, 'nvrtcSetFlowCallback') + + _cyb_atomic_int_store(&_cyb___py_nvrtc_init, 1) + return 0 + +cdef inline int _check_or_init_nvrtc() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvrtc_init): + return 0 + + return _init_nvrtc() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_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 + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + return load_nvidia_dynamic_lib("nvrtc")._handle_uint + + +############################################################################### +# 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) diff --git a/cuda_bindings_12/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings_12/cuda/bindings/_internal/nvvm.pxd new file mode 100644 index 00000000000..e4ac3cf1258 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvvm.pxd @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=a27b041eb470b98bf5b1a0a92ace9467c5f3921d47ee10557a4f00ff1e4ac411 +from ..cynvvm cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvvmGetErrorString(nvvmResult result) except?NULL nogil +cdef nvvmResult _nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvvm_linux.pyx new file mode 100644 index 00000000000..9ca6695547c --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvvm_linux.pyx @@ -0,0 +1,403 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=5d1c4358f6dd269e4a5313c7a717acafaebf90ab58acc30002affa060c8389b4 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + void* _cyb_dlsym "dlsym"(void*, const char*) nogil + const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" + +from libc.stdint cimport intptr_t + +import threading as _cyb_threading + +cdef int _cyb___py_nvvm_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t + +from .utils import FunctionNotFoundError, NotSupportedError +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvvmGetErrorString = NULL +cdef void* __nvvmVersion = NULL +cdef void* __nvvmIRVersion = NULL +cdef void* __nvvmCreateProgram = NULL +cdef void* __nvvmDestroyProgram = NULL +cdef void* __nvvmAddModuleToProgram = NULL +cdef void* __nvvmLazyAddModuleToProgram = NULL +cdef void* __nvvmCompileProgram = NULL +cdef void* __nvvmVerifyProgram = NULL +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: + global _cyb___py_nvvm_init + cdef void* handle = NULL + with gil, _cyb_symbol_lock: + if _cyb___py_nvvm_init: return 0 + + global __nvvmGetErrorString + __nvvmGetErrorString = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmGetErrorString') + if __nvvmGetErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetErrorString = _cyb_dlsym(handle, 'nvvmGetErrorString') + + global __nvvmVersion + __nvvmVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmVersion') + if __nvvmVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmVersion = _cyb_dlsym(handle, 'nvvmVersion') + + global __nvvmIRVersion + __nvvmIRVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmIRVersion') + if __nvvmIRVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmIRVersion = _cyb_dlsym(handle, 'nvvmIRVersion') + + global __nvvmCreateProgram + __nvvmCreateProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmCreateProgram') + if __nvvmCreateProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmCreateProgram = _cyb_dlsym(handle, 'nvvmCreateProgram') + + global __nvvmDestroyProgram + __nvvmDestroyProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmDestroyProgram') + if __nvvmDestroyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmDestroyProgram = _cyb_dlsym(handle, 'nvvmDestroyProgram') + + global __nvvmAddModuleToProgram + __nvvmAddModuleToProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmAddModuleToProgram') + if __nvvmAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmAddModuleToProgram = _cyb_dlsym(handle, 'nvvmAddModuleToProgram') + + global __nvvmLazyAddModuleToProgram + __nvvmLazyAddModuleToProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') + if __nvvmLazyAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmLazyAddModuleToProgram = _cyb_dlsym(handle, 'nvvmLazyAddModuleToProgram') + + global __nvvmCompileProgram + __nvvmCompileProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmCompileProgram') + if __nvvmCompileProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmCompileProgram = _cyb_dlsym(handle, 'nvvmCompileProgram') + + global __nvvmVerifyProgram + __nvvmVerifyProgram = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmVerifyProgram') + if __nvvmVerifyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmVerifyProgram = _cyb_dlsym(handle, 'nvvmVerifyProgram') + + global __nvvmGetCompiledResultSize + __nvvmGetCompiledResultSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmGetCompiledResultSize') + if __nvvmGetCompiledResultSize == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetCompiledResultSize = _cyb_dlsym(handle, 'nvvmGetCompiledResultSize') + + global __nvvmGetCompiledResult + __nvvmGetCompiledResult = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmGetCompiledResult') + if __nvvmGetCompiledResult == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetCompiledResult = _cyb_dlsym(handle, 'nvvmGetCompiledResult') + + global __nvvmGetProgramLogSize + __nvvmGetProgramLogSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmGetProgramLogSize') + if __nvvmGetProgramLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetProgramLogSize = _cyb_dlsym(handle, 'nvvmGetProgramLogSize') + + global __nvvmGetProgramLog + __nvvmGetProgramLog = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmGetProgramLog') + if __nvvmGetProgramLog == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetProgramLog = _cyb_dlsym(handle, 'nvvmGetProgramLog') + + global __nvvmLLVMVersion + __nvvmLLVMVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvvmLLVMVersion') + if __nvvmLLVMVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmLLVMVersion = _cyb_dlsym(handle, 'nvvmLLVMVersion') + + _cyb_atomic_int_store(&_cyb___py_nvvm_init, 1) + return 0 + +cdef inline int _check_or_init_nvvm() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvvm_init): + return 0 + + return _init_nvvm() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvvm() + cdef dict data = {} + global __nvvmGetErrorString + data["__nvvmGetErrorString"] = __nvvmGetErrorString + + global __nvvmVersion + data["__nvvmVersion"] = __nvvmVersion + + global __nvvmIRVersion + data["__nvvmIRVersion"] = __nvvmIRVersion + + global __nvvmCreateProgram + data["__nvvmCreateProgram"] = __nvvmCreateProgram + + global __nvvmDestroyProgram + data["__nvvmDestroyProgram"] = __nvvmDestroyProgram + + global __nvvmAddModuleToProgram + data["__nvvmAddModuleToProgram"] = __nvvmAddModuleToProgram + + global __nvvmLazyAddModuleToProgram + data["__nvvmLazyAddModuleToProgram"] = __nvvmLazyAddModuleToProgram + + global __nvvmCompileProgram + data["__nvvmCompileProgram"] = __nvvmCompileProgram + + global __nvvmVerifyProgram + data["__nvvmVerifyProgram"] = __nvvmVerifyProgram + + global __nvvmGetCompiledResultSize + data["__nvvmGetCompiledResultSize"] = __nvvmGetCompiledResultSize + + global __nvvmGetCompiledResult + data["__nvvmGetCompiledResult"] = __nvvmGetCompiledResult + + global __nvvmGetProgramLogSize + data["__nvvmGetProgramLogSize"] = __nvvmGetProgramLogSize + + global __nvvmGetProgramLog + data["__nvvmGetProgramLog"] = __nvvmGetProgramLog + + global __nvvmLLVMVersion + data["__nvvmLLVMVersion"] = __nvvmLLVMVersion + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint + return handle + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvvmGetErrorString(nvvmResult result) except?NULL nogil: + global __nvvmGetErrorString + _check_or_init_nvvm() + if __nvvmGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetErrorString is not found") + return (__nvvmGetErrorString)( + result) + + +cdef nvvmResult _nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmVersion + _check_or_init_nvvm() + if __nvvmVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmVersion is not found") + return (__nvvmVersion)( + major, minor) + + +cdef nvvmResult _nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmIRVersion + _check_or_init_nvvm() + if __nvvmIRVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmIRVersion is not found") + return (__nvvmIRVersion)( + majorIR, minorIR, majorDbg, minorDbg) + + +cdef nvvmResult _nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmCreateProgram + _check_or_init_nvvm() + if __nvvmCreateProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmCreateProgram is not found") + return (__nvvmCreateProgram)( + prog) + + +cdef nvvmResult _nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmDestroyProgram + _check_or_init_nvvm() + if __nvvmDestroyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmDestroyProgram is not found") + return (__nvvmDestroyProgram)( + prog) + + +cdef nvvmResult _nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmAddModuleToProgram + _check_or_init_nvvm() + if __nvvmAddModuleToProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmAddModuleToProgram is not found") + return (__nvvmAddModuleToProgram)( + prog, buffer, size, name) + + +cdef nvvmResult _nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmLazyAddModuleToProgram + _check_or_init_nvvm() + if __nvvmLazyAddModuleToProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmLazyAddModuleToProgram is not found") + return (__nvvmLazyAddModuleToProgram)( + prog, buffer, size, name) + + +cdef nvvmResult _nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmCompileProgram + _check_or_init_nvvm() + if __nvvmCompileProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmCompileProgram is not found") + return (__nvvmCompileProgram)( + prog, numOptions, options) + + +cdef nvvmResult _nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmVerifyProgram + _check_or_init_nvvm() + if __nvvmVerifyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmVerifyProgram is not found") + return (__nvvmVerifyProgram)( + prog, numOptions, options) + + +cdef nvvmResult _nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetCompiledResultSize + _check_or_init_nvvm() + if __nvvmGetCompiledResultSize == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetCompiledResultSize is not found") + return (__nvvmGetCompiledResultSize)( + prog, bufferSizeRet) + + +cdef nvvmResult _nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetCompiledResult + _check_or_init_nvvm() + if __nvvmGetCompiledResult == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetCompiledResult is not found") + return (__nvvmGetCompiledResult)( + prog, buffer) + + +cdef nvvmResult _nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetProgramLogSize + _check_or_init_nvvm() + if __nvvmGetProgramLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetProgramLogSize is not found") + return (__nvvmGetProgramLogSize)( + prog, bufferSizeRet) + + +cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetProgramLog + _check_or_init_nvvm() + if __nvvmGetProgramLog == NULL: + with gil: + 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_12/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings_12/cuda/bindings/_internal/nvvm_windows.pyx new file mode 100644 index 00000000000..bebeae150a7 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/nvvm_windows.pyx @@ -0,0 +1,349 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=fb154012a5a055db532eb391202398888c164eb266582ebc67ce3b5f8eb2c485 + + +# <<<< PREAMBLE CONTENT >>>> + +cdef extern from * nogil: + """ + #if defined(_MSC_VER) && !defined(__clang__) + #include + static __forceinline int atomic_int_load(int *p) { + int v = *(int volatile *)p; _ReadBarrier(); return v; + } + static __forceinline void atomic_int_store(int *p, int v) { + _WriteBarrier(); *(int volatile *)p = v; + } + #elif defined(__cplusplus) + /* GCC/Clang __atomic builtins work in any C++ standard without headers */ + static inline int atomic_int_load(int *p) { + return __atomic_load_n(p, __ATOMIC_ACQUIRE); + } + static inline void atomic_int_store(int *p, int v) { + __atomic_store_n(p, v, __ATOMIC_RELEASE); + } + #else + #include + static inline int atomic_int_load(int *p) { + return (int)atomic_load_explicit((atomic_int *)p, memory_order_acquire); + } + static inline void atomic_int_store(int *p, int v) { + atomic_store_explicit((atomic_int *)p, v, memory_order_release); + } + #endif + + """ + cdef int _cyb_atomic_int_load "atomic_int_load"(int *p) nogil + cdef void _cyb_atomic_int_store "atomic_int_store"(int *p, int v) nogil + +cdef extern from "": + ctypedef void* HMODULE + void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil + +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) + +import threading as _cyb_threading + +cdef int _cyb___py_nvvm_init = 0 +cdef dict _cyb_func_ptrs = None +cdef object _cyb_symbol_lock = _cyb_threading.Lock() + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from .utils import FunctionNotFoundError, NotSupportedError +############################################################################### +# Wrapper init +############################################################################### + +cdef void* __nvvmGetErrorString = NULL +cdef void* __nvvmVersion = NULL +cdef void* __nvvmIRVersion = NULL +cdef void* __nvvmCreateProgram = NULL +cdef void* __nvvmDestroyProgram = NULL +cdef void* __nvvmAddModuleToProgram = NULL +cdef void* __nvvmLazyAddModuleToProgram = NULL +cdef void* __nvvmCompileProgram = NULL +cdef void* __nvvmVerifyProgram = NULL +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: + global _cyb___py_nvvm_init + + cdef int err + cdef uintptr_t handle + with gil, _cyb_symbol_lock: + if _cyb___py_nvvm_init: return 0 + + handle = load_library() + global __nvvmGetErrorString + __nvvmGetErrorString = _cyb_GetProcAddress(handle, 'nvvmGetErrorString') + + global __nvvmVersion + __nvvmVersion = _cyb_GetProcAddress(handle, 'nvvmVersion') + + global __nvvmIRVersion + __nvvmIRVersion = _cyb_GetProcAddress(handle, 'nvvmIRVersion') + + global __nvvmCreateProgram + __nvvmCreateProgram = _cyb_GetProcAddress(handle, 'nvvmCreateProgram') + + global __nvvmDestroyProgram + __nvvmDestroyProgram = _cyb_GetProcAddress(handle, 'nvvmDestroyProgram') + + global __nvvmAddModuleToProgram + __nvvmAddModuleToProgram = _cyb_GetProcAddress(handle, 'nvvmAddModuleToProgram') + + global __nvvmLazyAddModuleToProgram + __nvvmLazyAddModuleToProgram = _cyb_GetProcAddress(handle, 'nvvmLazyAddModuleToProgram') + + global __nvvmCompileProgram + __nvvmCompileProgram = _cyb_GetProcAddress(handle, 'nvvmCompileProgram') + + global __nvvmVerifyProgram + __nvvmVerifyProgram = _cyb_GetProcAddress(handle, 'nvvmVerifyProgram') + + global __nvvmGetCompiledResultSize + __nvvmGetCompiledResultSize = _cyb_GetProcAddress(handle, 'nvvmGetCompiledResultSize') + + global __nvvmGetCompiledResult + __nvvmGetCompiledResult = _cyb_GetProcAddress(handle, 'nvvmGetCompiledResult') + + global __nvvmGetProgramLogSize + __nvvmGetProgramLogSize = _cyb_GetProcAddress(handle, 'nvvmGetProgramLogSize') + + global __nvvmGetProgramLog + __nvvmGetProgramLog = _cyb_GetProcAddress(handle, 'nvvmGetProgramLog') + + global __nvvmLLVMVersion + __nvvmLLVMVersion = _cyb_GetProcAddress(handle, 'nvvmLLVMVersion') + + _cyb_atomic_int_store(&_cyb___py_nvvm_init, 1) + return 0 + +cdef inline int _check_or_init_nvvm() except -1 nogil: + if _cyb_atomic_int_load(&_cyb___py_nvvm_init): + return 0 + + return _init_nvvm() + + +cpdef dict _inspect_function_pointers(): + global _cyb_func_ptrs + if _cyb_func_ptrs is not None: + return _cyb_func_ptrs + + _check_or_init_nvvm() + cdef dict data = {} + global __nvvmGetErrorString + data["__nvvmGetErrorString"] = __nvvmGetErrorString + + global __nvvmVersion + data["__nvvmVersion"] = __nvvmVersion + + global __nvvmIRVersion + data["__nvvmIRVersion"] = __nvvmIRVersion + + global __nvvmCreateProgram + data["__nvvmCreateProgram"] = __nvvmCreateProgram + + global __nvvmDestroyProgram + data["__nvvmDestroyProgram"] = __nvvmDestroyProgram + + global __nvvmAddModuleToProgram + data["__nvvmAddModuleToProgram"] = __nvvmAddModuleToProgram + + global __nvvmLazyAddModuleToProgram + data["__nvvmLazyAddModuleToProgram"] = __nvvmLazyAddModuleToProgram + + global __nvvmCompileProgram + data["__nvvmCompileProgram"] = __nvvmCompileProgram + + global __nvvmVerifyProgram + data["__nvvmVerifyProgram"] = __nvvmVerifyProgram + + global __nvvmGetCompiledResultSize + data["__nvvmGetCompiledResultSize"] = __nvvmGetCompiledResultSize + + global __nvvmGetCompiledResult + data["__nvvmGetCompiledResult"] = __nvvmGetCompiledResult + + global __nvvmGetProgramLogSize + data["__nvvmGetProgramLogSize"] = __nvvmGetProgramLogSize + + global __nvvmGetProgramLog + data["__nvvmGetProgramLog"] = __nvvmGetProgramLog + + global __nvvmLLVMVersion + data["__nvvmLLVMVersion"] = __nvvmLLVMVersion + _cyb_func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global _cyb_func_ptrs + if _cyb_func_ptrs is None: + _cyb_func_ptrs = _inspect_function_pointers() + return _cyb_func_ptrs[name] + + + + +cdef uintptr_t load_library() except* with gil: + return load_nvidia_dynamic_lib("nvvm")._handle_uint + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvvmGetErrorString(nvvmResult result) except?NULL nogil: + global __nvvmGetErrorString + _check_or_init_nvvm() + if __nvvmGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetErrorString is not found") + return (__nvvmGetErrorString)( + result) + + +cdef nvvmResult _nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmVersion + _check_or_init_nvvm() + if __nvvmVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmVersion is not found") + return (__nvvmVersion)( + major, minor) + + +cdef nvvmResult _nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmIRVersion + _check_or_init_nvvm() + if __nvvmIRVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmIRVersion is not found") + return (__nvvmIRVersion)( + majorIR, minorIR, majorDbg, minorDbg) + + +cdef nvvmResult _nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmCreateProgram + _check_or_init_nvvm() + if __nvvmCreateProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmCreateProgram is not found") + return (__nvvmCreateProgram)( + prog) + + +cdef nvvmResult _nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmDestroyProgram + _check_or_init_nvvm() + if __nvvmDestroyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmDestroyProgram is not found") + return (__nvvmDestroyProgram)( + prog) + + +cdef nvvmResult _nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmAddModuleToProgram + _check_or_init_nvvm() + if __nvvmAddModuleToProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmAddModuleToProgram is not found") + return (__nvvmAddModuleToProgram)( + prog, buffer, size, name) + + +cdef nvvmResult _nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmLazyAddModuleToProgram + _check_or_init_nvvm() + if __nvvmLazyAddModuleToProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmLazyAddModuleToProgram is not found") + return (__nvvmLazyAddModuleToProgram)( + prog, buffer, size, name) + + +cdef nvvmResult _nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmCompileProgram + _check_or_init_nvvm() + if __nvvmCompileProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmCompileProgram is not found") + return (__nvvmCompileProgram)( + prog, numOptions, options) + + +cdef nvvmResult _nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmVerifyProgram + _check_or_init_nvvm() + if __nvvmVerifyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvvmVerifyProgram is not found") + return (__nvvmVerifyProgram)( + prog, numOptions, options) + + +cdef nvvmResult _nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetCompiledResultSize + _check_or_init_nvvm() + if __nvvmGetCompiledResultSize == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetCompiledResultSize is not found") + return (__nvvmGetCompiledResultSize)( + prog, bufferSizeRet) + + +cdef nvvmResult _nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetCompiledResult + _check_or_init_nvvm() + if __nvvmGetCompiledResult == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetCompiledResult is not found") + return (__nvvmGetCompiledResult)( + prog, buffer) + + +cdef nvvmResult _nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetProgramLogSize + _check_or_init_nvvm() + if __nvvmGetProgramLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvvmGetProgramLogSize is not found") + return (__nvvmGetProgramLogSize)( + prog, bufferSizeRet) + + +cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmGetProgramLog + _check_or_init_nvvm() + if __nvvmGetProgramLog == NULL: + with gil: + 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_12/cuda/bindings/_internal/utils.pxd b/cuda_bindings_12/cuda/bindings/_internal/utils.pxd new file mode 100644 index 00000000000..f4a76de327e --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/utils.pxd @@ -0,0 +1,167 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.stdint cimport int32_t, int64_t, intptr_t +from libcpp.vector cimport vector +from libcpp cimport bool as cppbool +from libcpp cimport nullptr_t, nullptr +from libcpp.memory cimport unique_ptr + + +cdef extern from * nogil: + """ + template + class nullable_unique_ptr { + public: + nullable_unique_ptr() noexcept = default; + + nullable_unique_ptr(std::nullptr_t) noexcept = delete; + + explicit nullable_unique_ptr(T* data, bool own_data): + own_data_(own_data) + { + if (own_data) + manager_.reset(data); + else + raw_data_ = data; + } + + nullable_unique_ptr(const nullable_unique_ptr&) = delete; + + nullable_unique_ptr& operator=(const nullable_unique_ptr&) = delete; + + nullable_unique_ptr(nullable_unique_ptr&& other) noexcept + { + own_data_ = other.own_data_; + other.own_data_ = false; // ownership is transferred + if (own_data_) + { + manager_ = std::move(other.manager_); + raw_data_ = nullptr; // just in case + } + else + { + manager_.reset(nullptr); // just in case + raw_data_ = other.raw_data_; + } + } + + nullable_unique_ptr& operator=(nullable_unique_ptr&& other) noexcept + { + own_data_ = other.own_data_; + other.own_data_ = false; // ownership is transferred + if (own_data_) + { + manager_ = std::move(other.manager_); + raw_data_ = nullptr; // just in case + } + else + { + manager_.reset(nullptr); // just in case + raw_data_ = other.raw_data_; + } + return *this; + } + + ~nullable_unique_ptr() = default; + + void reset(T* data, bool own_data) + { + own_data_ = own_data; + if (own_data_) + { + manager_.reset(data); + raw_data_ = nullptr; + } + else + { + manager_.reset(nullptr); + raw_data_ = data; + } + } + + void swap(nullable_unique_ptr& other) noexcept + { + std::swap(manager_, other.manager_); + std::swap(raw_data_, other.raw_data_); + std::swap(own_data_, other.own_data_); + } + + /* + * Get the pointer to the underlying object (this is different from data()!). + */ + T* get() const noexcept + { + if (own_data_) + return manager_.get(); + else + return raw_data_; + } + + /* + * Get the pointer to the underlying buffer (this is different from get()!). + */ + void* data() noexcept + { + if (own_data_) + return manager_.get()->data(); + else + return raw_data_; + } + + T& operator*() + { + if (own_data_) + return *manager_; + else + return *raw_data_; + } + + private: + std::unique_ptr manager_{}; + T* raw_data_{nullptr}; + bool own_data_{false}; + }; + """ + # xref: cython/Cython/Includes/libcpp/memory.pxd + cdef cppclass nullable_unique_ptr[T]: + nullable_unique_ptr() + nullable_unique_ptr(T*, cppbool) + nullable_unique_ptr(nullable_unique_ptr[T]&) + + # Modifiers + void reset(T*, cppbool) + void swap(nullable_unique_ptr&) + + # Observers + T* get() + T& operator*() + void* data() + + +ctypedef fused ResT: + int + int32_t + int64_t + char + float + double + + +ctypedef fused PtrT: + void + + +cdef cppclass nested_resource[T]: + nullable_unique_ptr[ vector[intptr_t] ] ptrs + nullable_unique_ptr[ vector[vector[T]] ] nested_resource_ptr + + +# accepts the output pointer as input to use the return value for exception propagation +cdef int get_resource_ptr(nullable_unique_ptr[vector[ResT]] &in_out_ptr, object obj, ResT* __unused) except 1 +cdef int get_resource_ptrs(nullable_unique_ptr[ vector[PtrT*] ] &in_out_ptr, object obj, PtrT* __unused) except 1 +cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj, ResT* __unused) except 1 + +cdef bint is_nested_sequence(data) +cdef void* get_buffer_pointer(buf, Py_ssize_t size, readonly=*) except* diff --git a/cuda_bindings_12/cuda/bindings/_internal/utils.pyx b/cuda_bindings_12/cuda/bindings/_internal/utils.pyx new file mode 100644 index 00000000000..df17a9e47df --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_internal/utils.pyx @@ -0,0 +1,129 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +cimport cpython +from libc.stdint cimport intptr_t +from libcpp.utility cimport move +from cython.operator cimport dereference as deref + + +cdef bint is_nested_sequence(data): + if not cpython.PySequence_Check(data): + return False + else: + for i in data: + if not cpython.PySequence_Check(i): + return False + else: + return True + + +cdef void* get_buffer_pointer(buf, Py_ssize_t size, readonly=True) except*: + """The caller must ensure ``buf`` is alive when the returned pointer is in use.""" + cdef void* bufPtr + cdef int flags = cpython.PyBUF_ANY_CONTIGUOUS + if not readonly: + flags |= cpython.PyBUF_WRITABLE + cdef int status = -1 + cdef cpython.Py_buffer view + + if isinstance(buf, int): + bufPtr = buf + else: # try buffer protocol + try: + status = cpython.PyObject_GetBuffer(buf, &view, flags) + # when the caller does not provide a size, it is set to -1 at generate-time by cybind + if size != -1: + assert view.len == size + assert view.ndim == 1 + except Exception as e: + adj = "writable " if not readonly else "" + raise ValueError( + "buf must be either a Python int representing the pointer " + f"address to a valid buffer, or a 1D contiguous {adj}" + "buffer, of size bytes") from e + else: + bufPtr = view.buf + finally: + if status == 0: + cpython.PyBuffer_Release(&view) + + return bufPtr + + +# Cython can't infer the ResT overload when it is wrapped in nullable_unique_ptr, +# so we need a dummy (__unused) input argument to help it +cdef int get_resource_ptr(nullable_unique_ptr[vector[ResT]] &in_out_ptr, object obj, ResT* __unused) except 1: + if cpython.PySequence_Check(obj): + vec = new vector[ResT](len(obj)) + # set the ownership immediately to avoid leaking the `vec` memory in + # case of exception in the following loop + in_out_ptr.reset(vec, True) + for i in range(len(obj)): + deref(vec)[i] = obj[i] + else: + in_out_ptr.reset(obj, False) + return 0 + + +cdef int get_resource_ptrs(nullable_unique_ptr[ vector[PtrT*] ] &in_out_ptr, object obj, PtrT* __unused) except 1: + if cpython.PySequence_Check(obj): + vec = new vector[PtrT*](len(obj)) + # set the ownership immediately to avoid leaking the `vec` memory in + # case of exception in the following loop + in_out_ptr.reset(vec, True) + for i in range(len(obj)): + deref(vec)[i] = (obj[i]) + else: + in_out_ptr.reset(obj, False) + return 0 + + +cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj, ResT* __unused) except 1: + cdef nullable_unique_ptr[ vector[intptr_t] ] nested_ptr + cdef nullable_unique_ptr[ vector[vector[ResT]] ] nested_res_ptr + cdef vector[intptr_t]* nested_vec = NULL + cdef vector[vector[ResT]]* nested_res_vec = NULL + cdef size_t i = 0, length = 0 + cdef intptr_t addr + + if is_nested_sequence(obj): + length = len(obj) + nested_res_vec = new vector[vector[ResT]](length) + nested_vec = new vector[intptr_t](length) + # set the ownership immediately to avoid leaking memory in case of + # exception in the following loop + nested_res_ptr.reset(nested_res_vec, True) + nested_ptr.reset(nested_vec, True) + for i, obj_i in enumerate(obj): + if ResT is char: + obj_i_bytes = ((obj_i)).encode() + str_len = (len(obj_i_bytes)) + 1 # including null termination + deref(nested_res_vec)[i].resize(str_len) + obj_i_ptr = (obj_i_bytes) + # cast to size_t explicitly to work around a potentially Cython bug + deref(nested_res_vec)[i].assign(obj_i_ptr, obj_i_ptr + str_len) + else: + deref(nested_res_vec)[i] = obj_i + deref(nested_vec)[i] = (deref(nested_res_vec)[i].data()) + elif cpython.PySequence_Check(obj): + length = len(obj) + nested_vec = new vector[intptr_t](length) + nested_ptr.reset(nested_vec, True) + for i, addr in enumerate(obj): + deref(nested_vec)[i] = addr + nested_res_ptr.reset(NULL, False) + else: + # obj is an int (ResT**) + nested_res_ptr.reset(NULL, False) + nested_ptr.reset(obj, False) + + in_out_ptr.ptrs = move(nested_ptr) + in_out_ptr.nested_resource_ptr = move(nested_res_ptr) + return 0 + + +class FunctionNotFoundError(RuntimeError): pass + +class NotSupportedError(RuntimeError): pass diff --git a/cuda_bindings_12/cuda/bindings/_lib/__init__.py b/cuda_bindings_12/cuda/bindings/_lib/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/cuda/bindings/_lib/cyruntime/__init__.py b/cuda_bindings_12/cuda/bindings/_lib/cyruntime/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxd new file mode 100644 index 00000000000..482f91ca595 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -0,0 +1,43 @@ +# 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._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 +# use call into the static library directly. +# +# This is an ABI breaking change which can only happen in a major version bump. + +# This file is included from cuda/bindings/_bindings/cyruntime.pxd.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +# utility functions + +cdef cudaError_t getDriverEglFrame(_cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, _cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxi b/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxi new file mode 100644 index 00000000000..5a7e5e42bd4 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -0,0 +1,1176 @@ +# 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 +# use call into the static library directly. + +# This file is included from cuda/bindings/_bindings/cyruntime.pyx.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +from libc.string cimport memset +cimport cuda.bindings._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 + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + err = getDriverEglFrame(&cueglFrame, eglframe) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + if eglframe == NULL: + err = cudaErrorInvalidResourceHandle + return err + cdef cydriver.CUeglFrame cueglFrame + err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglframe, cueglFrame) + return err + +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + memset(&cueglFrame, 0, sizeof(cueglFrame)) + err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglFrame, cueglFrame) + return err + +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaErrorNotSupported + +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) + return err + +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerDisconnect(conn) + return err + +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return err + +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) + return err + +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEGLStreamProducerDisconnect(conn) + return err + +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) + return err + +## utility functions + +cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil: + return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f + + +cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, cydriver.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil: + # Check validity + if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned, + cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,): + if (d[0].x != 16) and (d[0].x != 32): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,): + if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,): + if (d[0].x != 8): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2, + cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,): + if (d[0].x != 16): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,): + if (d[0].x != 8): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): + if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0): + return cudaErrorInvalidChannelDescriptor + elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102,): + if (d[0].x != 10) or (d[0].y != 10) or (d[0].z != 10) or (d[0].w != 2): + return cudaErrorInvalidChannelDescriptor + else: + return cudaErrorInvalidChannelDescriptor + + # If Y is non-zero, it must match X + # If Z is non-zero, it must match Y + # If W is non-zero, it must match Z + if (((d[0].y != 0) and (d[0].y != d[0].x)) or + ((d[0].z != 0) and (d[0].z != d[0].y)) or + ((d[0].w != 0) and (d[0].w != d[0].z))): + if d[0].f != cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102: + return cudaErrorInvalidChannelDescriptor + if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 + elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF + elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT + elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_NV12 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM + elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4): + numberOfChannels[0] = 1 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM + elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5): + numberOfChannels[0] = 2 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16 + elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H): + numberOfChannels[0] = 3 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16 + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM + elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB + elif case_desc(d, 10, 10, 10, 2, cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102): + numberOfChannels[0] = 4 + format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT_101010_2 + else: + return cudaErrorInvalidChannelDescriptor + + if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12, + cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, + cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): + if numberOfChannels[0] != 3: + return cudaErrorInvalidChannelDescriptor + else: + if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4): + return cudaErrorInvalidChannelDescriptor + return cudaSuccess + +cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth, const cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef int channel_size = 0 + if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT8: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT32: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT8: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT32: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_HALF: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_FLOAT: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat + channel_size = 32 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_NV12: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X1: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X4: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_SNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_SNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_UF16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_SF16: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H + channel_size = 16 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM_SRGB: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB + channel_size = 8 + elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2: + pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 + else: + return cudaErrorInvalidChannelDescriptor + + # populate bits per channel + pRuntimeDesc[0].x = 0 + pRuntimeDesc[0].y = 0 + pRuntimeDesc[0].z = 0 + pRuntimeDesc[0].w = 0 + + if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2 and pDriverDesc[0].NumChannels == 4: + pRuntimeDesc[0].w = 2 + pRuntimeDesc[0].z = 10 + pRuntimeDesc[0].y = 10 + pRuntimeDesc[0].x = 10 + else: + if pDriverDesc[0].NumChannels >= 4: + pRuntimeDesc[0].w = channel_size + if pDriverDesc[0].NumChannels >= 3: + pRuntimeDesc[0].z = channel_size + if pDriverDesc[0].NumChannels >= 2: + pRuntimeDesc[0].y = channel_size + if pDriverDesc[0].NumChannels >= 1: + pRuntimeDesc[0].x = channel_size + + if pDriverDesc[0].NumChannels not in (4, 3, 2, 1): + return cudaErrorInvalidChannelDescriptor + + # populate dimensions + if pDepth != NULL: + pDepth[0] = pDriverDesc[0].Depth + if pHeight != NULL: + pHeight[0] = pDriverDesc[0].Height + if pWidth != NULL: + pWidth[0] = pDriverDesc[0].Width + return cudaSuccess + +cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + cdef unsigned int i = 0 + + err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, &cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat) + if err != cudaSuccess: + return err + for i in range(eglFrame.planeCount): + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: + cuEglFrame[0].frame.pArray[i] = eglFrame.frame.pArray[i] + else: + cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr + cuEglFrame[0].width = eglFrame.planeDesc[0].width + cuEglFrame[0].height = eglFrame.planeDesc[0].height + cuEglFrame[0].depth = eglFrame.planeDesc[0].depth + cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch + cuEglFrame[0].planeCount = eglFrame.planeCount + if eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV422: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY422: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatARGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRGBA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatABGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBGRA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatL: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20RGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20BGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspRGGB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspBGGR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGRBG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGBRG: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBCCR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRCCB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCRBC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCBRC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10CCCC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BCCR: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RCCB: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CRBC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CBRC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CCCC: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: + cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER + else: + return cudaErrorInvalidValue + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: + cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY + elif eglFrame.frameType == cyruntime.cudaEglFrameTypePitch: + cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH + else: + return cudaErrorInvalidValue + +@cython.show_performance_hints(False) +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + cdef unsigned int i + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2 ad + cdef cudaPitchedPtr pPtr + memset(eglFrame, 0, sizeof(eglFrame[0])) + memset(&ad, 0, sizeof(ad)) + for i in range(cueglFrame.planeCount): + ad.Depth = cueglFrame.depth + ad.Flags = 0 + ad.Format = cueglFrame.cuFormat + ad.Height = cueglFrame.height + ad.NumChannels = cueglFrame.numChannels + ad.Width = cueglFrame.width + + err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad) + if err != cudaSuccess: + return err + + eglFrame[0].planeDesc[i].depth = cueglFrame.depth + eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels + if i == 0: + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = (cueglFrame.height / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = (cueglFrame.height / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): + eglFrame[0].planeDesc[i].width = (cueglFrame.width / 2) + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].pitch = (cueglFrame.pitch / 2) + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[i].height = cueglFrame.height + eglFrame[0].planeDesc[i].width = cueglFrame.width + eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch + eglFrame[0].planeDesc[1].channelDesc.y = 8 + if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): + eglFrame[0].planeDesc[1].channelDesc.y = 16 + if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: + eglFrame[0].frame.pArray[i] = cueglFrame.frame.pArray[i] + else: + pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch, + eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height) + eglFrame[0].frame.pPitch[i] = pPtr + + eglFrame[0].planeCount = cueglFrame.planeCount + if cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV422 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY422 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatARGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRGBA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatABGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBGRA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatL + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20RGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20BGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspRGGB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspBGGR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGRBG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGBRG + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBCCR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRCCB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCRBC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCBRC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10CCCC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BCCR + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RCCB + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CRBC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CBRC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CCCC + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709 + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER + elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + else: + return cudaErrorInvalidValue + if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: + eglFrame[0].frameType = cyruntime.cudaEglFrameTypeArray + elif cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH: + eglFrame[0].frameType = cyruntime.cudaEglFrameTypePitch + else: + return cudaErrorInvalidValue diff --git a/cuda_bindings_12/cuda/bindings/_lib/dlfcn.pxd b/cuda_bindings_12/cuda/bindings/_lib/dlfcn.pxd new file mode 100644 index 00000000000..23fbe256484 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/dlfcn.pxd @@ -0,0 +1,14 @@ +# 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) + char *dlerror() + void *dlsym(void *, const char *) + int dlclose(void *) + + enum: + RTLD_LAZY + RTLD_NOW + RTLD_GLOBAL + RTLD_LOCAL diff --git a/cuda_bindings_12/cuda/bindings/_lib/param_packer.h b/cuda_bindings_12/cuda/bindings/_lib/param_packer.h new file mode 100644 index 00000000000..160ef5f7c92 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/param_packer.h @@ -0,0 +1,146 @@ +// SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include +#include +#include +#include + +static PyObject* ctypes_module = nullptr; + +static PyTypeObject* ctypes_c_char = nullptr; +static PyTypeObject* ctypes_c_bool = nullptr; +static PyTypeObject* ctypes_c_wchar = nullptr; +static PyTypeObject* ctypes_c_byte = nullptr; +static PyTypeObject* ctypes_c_ubyte = nullptr; +static PyTypeObject* ctypes_c_short = nullptr; +static PyTypeObject* ctypes_c_ushort = nullptr; +static PyTypeObject* ctypes_c_int = nullptr; +static PyTypeObject* ctypes_c_uint = nullptr; +static PyTypeObject* ctypes_c_long = nullptr; +static PyTypeObject* ctypes_c_ulong = nullptr; +static PyTypeObject* ctypes_c_longlong = nullptr; +static PyTypeObject* ctypes_c_ulonglong = nullptr; +static PyTypeObject* ctypes_c_size_t = nullptr; +static PyTypeObject* ctypes_c_float = nullptr; +static PyTypeObject* ctypes_c_double = nullptr; +static PyTypeObject* ctypes_c_void_p = nullptr; + +static void fetch_ctypes() +{ + ctypes_module = PyImport_ImportModule("ctypes"); + if (ctypes_module == nullptr) + throw std::runtime_error("Cannot import ctypes module"); + // get method addressof + PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); + if (ctypes_dict == nullptr) + throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); + // supportedtypes + ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); + ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); + ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); + ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); + ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); + ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); + ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); + ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); + ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); + ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); + ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); + ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); + ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); + ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); + ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); + ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); + ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp +} + + +// (target type, source type) +static std::map, std::function> m_feeders; + +static void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) +{ + if (target_t == ctypes_c_int) + { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int*)ptr) = (int)PyLong_AsLong(value); + return sizeof(int); + }; + return; + } + } else if (target_t == ctypes_c_bool) { + if (source_t == &PyBool_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((bool*)ptr) = (value == Py_True); + return sizeof(bool); + }; + return; + } + } else if (target_t == ctypes_c_byte) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); + return sizeof(int8_t); + }; + return; + } + } else if (target_t == ctypes_c_double) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((double*)ptr) = (double)PyFloat_AsDouble(value); + return sizeof(double); + }; + return; + } + } else if (target_t == ctypes_c_float) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((float*)ptr) = (float)PyFloat_AsDouble(value); + return sizeof(float); + }; + return; + } + } else if (target_t == ctypes_c_longlong) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((long long*)ptr) = (long long)PyLong_AsLongLong(value); + return sizeof(long long); + }; + return; + } + } +} + +static int feed(void* ptr, PyObject* value, PyObject* type) +{ + PyTypeObject* pto = (PyTypeObject*)type; + if (ctypes_c_int == nullptr) + fetch_ctypes(); + auto found = m_feeders.find({pto,value->ob_type}); + if (found == m_feeders.end()) + { + populate_feeders(pto, value->ob_type); + found = m_feeders.find({pto,value->ob_type}); + } + if (found != m_feeders.end()) + { + return found->second(ptr, value); + } + return 0; +} diff --git a/cuda_bindings_12/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings_12/cuda/bindings/_lib/param_packer.pxd new file mode 100644 index 00000000000..1c0ad690be4 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/param_packer.pxd @@ -0,0 +1,7 @@ +# 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. +cdef extern from "param_packer.h": + int feed(void* ptr, object o, object ct) diff --git a/cuda_bindings_12/cuda/bindings/_lib/utils.pxd b/cuda_bindings_12/cuda/bindings/_lib/utils.pxd new file mode 100644 index 00000000000..ec761534970 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/utils.pxd @@ -0,0 +1,159 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +cimport cuda.bindings.driver as driver +cimport cuda.bindings.cydriver as cydriver +cimport cuda.bindings.cyruntime as cyruntime +from libcpp.vector cimport vector +from cpython.buffer cimport PyBuffer_Release, Py_buffer + +cdef class _HelperKernelParams: + cdef Py_buffer _pybuffer + cdef bint _pyobj_acquired + cdef void** _ckernelParams + cdef char* _ckernelParamsData + cdef int _length + cdef bint _malloc_list_created + +cdef struct _HelperInputVoidPtrStruct: + Py_buffer _pybuffer + +cdef class _HelperInputVoidPtr: + cdef _HelperInputVoidPtrStruct _helper + cdef void* _cptr + +cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *buffer) + +cdef inline void * _helper_input_void_ptr_free(_HelperInputVoidPtrStruct *helper): + if helper[0]._pybuffer.buf != NULL: + PyBuffer_Release(&helper[0]._pybuffer) + + + +cdef class _HelperCUmemPool_attribute: + cdef void* _cptr + cdef cydriver.CUmemPool_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef int _int_val + cdef driver.cuuint64_t _cuuint64_t_val + + + +cdef class _HelperCUmem_range_attribute: + cdef void* _cptr + cdef cydriver.CUmem_range_attribute_enum _attr + cdef size_t _data_size + + # Return values + cdef int _int_val # 32 bit integer + cdef int* _int_val_list # 32 bit integer array + + + +cdef class _HelperCUpointer_attribute: + cdef void* _cptr + cdef cydriver.CUpointer_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef driver.CUcontext _ctx + cdef unsigned int _uint + cdef int _int + cdef driver.CUdeviceptr _devptr + cdef void** _void + cdef driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS _token + cdef bint _bool + cdef unsigned long long _ull + cdef size_t _size + cdef driver.CUmemoryPool _mempool + + + +cdef class _HelperCUgraphMem_attribute: + cdef void* _cptr + cdef cydriver.CUgraphMem_attribute_enum _attr + cdef bint _is_getter + + # Return values + cdef driver.cuuint64_t _cuuint64_t_val + + + +cdef class _HelperCUjit_option: + cdef void* _cptr + cdef cydriver.CUjit_option_enum _attr + + # Return values + cdef unsigned int _uint + cdef float _float + cdef char* _charstar + cdef cydriver.CUjit_target_enum _target + cdef cydriver.CUjit_fallback_enum _fallback + cdef int _int + cdef cydriver.CUjit_cacheMode_enum _cacheMode + cdef vector[char*] _charstarstar # list of names + cdef _InputVoidPtrPtrHelper _voidstarstar # list of addresses + + + +cdef class _HelperCudaJitOption: + cdef void* _cptr + cdef cyruntime.cudaJitOption _attr + + # Return values + cdef unsigned int _uint + cdef float _float + cdef char* _charstar + cdef cyruntime.cudaJit_Fallback _fallback + cdef int _int + cdef cyruntime.cudaJit_CacheMode _cacheMode + + + +cdef class _HelperCUlibraryOption: + cdef void* _cptr + cdef cydriver.CUlibraryOption_enum _attr + + # Return values + cdef unsigned int _uint + + + +cdef class _HelperCudaLibraryOption: + cdef void* _cptr + cdef cyruntime.cudaLibraryOption _attr + + # Return values + cdef unsigned int _uint + + + +cdef class _HelperCUmemAllocationHandleType: + cdef void* _cptr + cdef cydriver.CUmemAllocationHandleType_enum _type + + # Return values + cdef int _int + cdef void* _handle + cdef unsigned int _d3dkmt_handle + + cdef driver.CUmemFabricHandle _mem_fabric_handle + + +cdef class _InputVoidPtrPtrHelper: + cdef object _references + cdef void** _cptr + + + +cdef class _HelperCUcoredumpSettings: + cdef void* _cptr + cdef cydriver.CUcoredumpSettings_enum _attrib + cdef bint _is_getter + cdef size_t _size + + # Return values + cdef bint _bool + cdef char* _charstar diff --git a/cuda_bindings_12/cuda/bindings/_lib/utils.pxi b/cuda_bindings_12/cuda/bindings/_lib/utils.pxi new file mode 100644 index 00000000000..89ea70296bb --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/utils.pxi @@ -0,0 +1,663 @@ +# 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 +import ctypes as _ctypes +cimport cuda.bindings.cydriver as cydriver +import cuda.bindings.driver as _driver +cimport cuda.bindings._lib.param_packer as param_packer +from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum + +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): + 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 _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_12/cuda/bindings/_lib/windll.pxd b/cuda_bindings_12/cuda/bindings/_lib/windll.pxd new file mode 100644 index 00000000000..294a1a9fd90 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_lib/windll.pxd @@ -0,0 +1,45 @@ +# 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 +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + ctypedef int BOOL + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + + BOOL _FreeLibrary "FreeLibrary"(HMODULE hLibModule) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline FARPROC GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef inline BOOL FreeLibrary(uintptr_t hLibModule) nogil: + return _FreeLibrary(hLibModule) diff --git a/cuda_bindings_12/cuda/bindings/_test_helpers/__init__.py b/cuda_bindings_12/cuda/bindings/_test_helpers/__init__.py new file mode 100644 index 00000000000..2cfab242d2a --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_test_helpers/__init__.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +# This package contains test helper utilities that may also be useful for other libraries outside of `cuda.bindings`, +# such as `cuda.core`. These utilities are not part of the public API of `cuda.bindings` and may change without notice. diff --git a/cuda_bindings_12/cuda/bindings/_test_helpers/arch_check.py b/cuda_bindings_12/cuda/bindings/_test_helpers/arch_check.py new file mode 100644 index 00000000000..6dec8da7fbd --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/_test_helpers/arch_check.py @@ -0,0 +1,68 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +from contextlib import contextmanager +from functools import cache + +import pytest + +from cuda.bindings import nvml + + +@cache +def hardware_supports_nvml(): + """ + Tries to call the simplest NVML API possible to see if just the basics + works. If not we are probably on one of the platforms where NVML is not + supported at all (e.g. Jetson Orin). + """ + nvml.init_v2() + try: + nvml.system_get_driver_branch() + except (nvml.NotSupportedError, nvml.UnknownError): + return False + else: + return True + finally: + nvml.shutdown() + + +@contextmanager +def unsupported_before(device: int, expected_device_arch: nvml.DeviceArch | str | None): + device_arch = nvml.device_get_architecture(device) + + if isinstance(expected_device_arch, nvml.DeviceArch): + expected_device_arch_int = int(expected_device_arch) + elif expected_device_arch == "FERMI": + expected_device_arch_int = 1 + else: + expected_device_arch_int = 0 + + if expected_device_arch is None or expected_device_arch == "HAS_INFOROM" or device_arch == nvml.DeviceArch.UNKNOWN: + # In this case, we don't /know/ if it will fail, but we are ok if it + # does or does not. + + # TODO: There are APIs that are documented as supported only if the + # device has an InfoROM, but I couldn't find a way to detect that. For + # now, they are just handled as "possibly failing". + + try: + yield + except nvml.NotSupportedError: + # The API call raised NotSupportedError, 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)}'" + ) + # If the API call worked, just continue + elif int(device_arch) < expected_device_arch_int: + # In this case, we /know/ if will fail, and we want to assert that it does. + with pytest.raises(nvml.NotSupportedError): + yield + # The above call was unsupported, so the rest of the test is skipped + pytest.skip(f"Unsupported before {expected_device_arch.name}, got {nvml.device_get_name(device)}") + else: + # In this case, we /know/ it should work, and if it fails, the test should fail. + yield diff --git a/cuda_bindings_12/cuda/bindings/cufile.pxd b/cuda_bindings_12/cuda/bindings/cufile.pxd new file mode 100644 index 00000000000..8359aa12677 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cufile.pxd @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7de7c59ce5ce65a5fccef9b4a9566185b99213e3bb66b87256e52bda1e9cf089 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from .cycufile cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef CUfileHandle_t Handle +ctypedef CUfileBatchHandle_t BatchHandle +ctypedef CUfileError_t Error +ctypedef cufileRDMAInfo_t RDMAInfo +ctypedef CUfileFSOps_t FSOps +ctypedef CUfileDrvProps_t DrvProps + + +############################################################################### +# Enum +############################################################################### + +ctypedef CUfileOpError _OpError +ctypedef CUfileDriverStatusFlags_t _DriverStatusFlags +ctypedef CUfileDriverControlFlags_t _DriverControlFlags +ctypedef CUfileFeatureFlags_t _FeatureFlags +ctypedef CUfileFileHandleType _FileHandleType +ctypedef CUfileOpcode_t _Opcode +ctypedef CUfileStatus_t _Status +ctypedef CUfileBatchMode_t _BatchMode +ctypedef CUFileSizeTConfigParameter_t _SizeTConfigParameter +ctypedef CUFileBoolConfigParameter_t _BoolConfigParameter +ctypedef CUFileStringConfigParameter_t _StringConfigParameter + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t handle_register(intptr_t descr) except? 0 +cpdef void handle_deregister(intptr_t fh) except* +cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags) +cpdef buf_deregister(intptr_t buf_ptr_base) +cpdef driver_open() +cpdef use_count() +cpdef driver_get_properties(intptr_t props) +cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size) +cpdef driver_set_max_direct_io_size(size_t max_direct_io_size) +cpdef driver_set_max_cache_size(size_t max_cache_size) +cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size) +cpdef intptr_t batch_io_set_up(unsigned nr) except? 0 +cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, intptr_t iocbp, unsigned int flags) +cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, intptr_t iocbp, intptr_t timeout) +cpdef batch_io_cancel(intptr_t batch_idp) +cpdef void batch_io_destroy(intptr_t batch_idp) except* +cpdef read_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_read_p, intptr_t stream) +cpdef write_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_written_p, intptr_t stream) +cpdef stream_register(intptr_t stream, unsigned flags) +cpdef stream_deregister(intptr_t stream) +cpdef int get_version() except? 0 +cpdef size_t get_parameter_size_t(int param) except? 0 +cpdef bint get_parameter_bool(int param) except? 0 +cpdef str get_parameter_string(int param, int len) +cpdef set_parameter_size_t(int param, size_t value) +cpdef set_parameter_bool(int param, bint value) +cpdef set_parameter_string(int param, intptr_t desc_str) diff --git a/cuda_bindings_12/cuda/bindings/cufile.pyx b/cuda_bindings_12/cuda/bindings/cufile.pyx new file mode 100644 index 00000000000..1d679d96729 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cufile.pyx @@ -0,0 +1,1586 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3f4b1b8c4b79253c33c049ec2b53fc2e6cf7fe58912d71ec5505cb8b3cca6a98 + + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +cimport cpython.buffer as _cyb_cpython_buffer +cimport cpython.memoryview as _cyb_cpython_memoryview +from libc.stdint cimport intptr_t +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 libcpp cimport bool as _cyb_bool + +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 _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 >>>> + +cimport cython # NOQA +from libc cimport errno +from ._internal.utils cimport (get_nested_resource_ptr, + nested_resource) + +import cython + +from cuda.bindings.driver import CUresult as pyCUresult + +############################################################################### +# POD +############################################################################### + +cdef _get__py_anon_pod1_dtype_offsets(): + cdef cuda_bindings_cufile__anon_pod1 pod + return _numpy.dtype({ + 'names': ['fd', 'handle'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (&pod), + (&(pod.handle)) - (&pod), + ], + 'itemsize': sizeof((NULL).handle), + }) + +_py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() + +cdef class _py_anon_pod1: + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod1`. + + + .. seealso:: `cuda_bindings_cufile__anon_pod1` + """ + cdef: + cuda_bindings_cufile__anon_pod1 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof((NULL).handle)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_cufile__anon_pod1 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod1 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 _py_anon_pod1 other_ + if not isinstance(other, _py_anon_pod1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).handle)) == 0) + + 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 = _cyb_malloc(sizeof((NULL).handle)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).handle)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def fd(self): + """int: """ + return self._ptr[0].fd + + @fd.setter + def fd(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod1 instance is read-only") + self._ptr[0].fd = val + + @property + def handle(self): + """int: """ + return (self._ptr[0].handle) + + @handle.setter + def handle(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod1 instance is read-only") + self._ptr[0].handle = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof((NULL).handle), _py_anon_pod1) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod1_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod1 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 _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof((NULL).handle)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod1") + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).handle)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get__py_anon_pod3_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.devPtr_base)) - (&pod), + (&(pod.file_offset)) - (&pod), + (&(pod.devPtr_offset)) - (&pod), + (&(pod.size)) - (&pod), + ], + 'itemsize': sizeof((NULL).u.batch), + }) + +_py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() + +cdef class _py_anon_pod3: + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod3`. + + + .. seealso:: `cuda_bindings_cufile__anon_pod3` + """ + cdef: + cuda_bindings_cufile__anon_pod3 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof((NULL).u.batch)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod3") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_cufile__anon_pod3 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod3 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 _py_anon_pod3 other_ + if not isinstance(other, _py_anon_pod3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).u.batch)) == 0) + + 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 = _cyb_malloc(sizeof((NULL).u.batch)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod3") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u.batch)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def dev_ptr_base(self): + """int: """ + return (self._ptr[0].devPtr_base) + + @dev_ptr_base.setter + def dev_ptr_base(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod3 instance is read-only") + self._ptr[0].devPtr_base = val + + @property + def file_offset(self): + """int: """ + return self._ptr[0].file_offset + + @file_offset.setter + def file_offset(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod3 instance is read-only") + self._ptr[0].file_offset = val + + @property + def dev_ptr_offset(self): + """int: """ + return self._ptr[0].devPtr_offset + + @dev_ptr_offset.setter + def dev_ptr_offset(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod3 instance is read-only") + self._ptr[0].devPtr_offset = val + + @property + def size_(self): + """int: """ + return self._ptr[0].size + + @size_.setter + def size_(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod3 instance is read-only") + self._ptr[0].size = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof((NULL).u.batch), _py_anon_pod3) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod3_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod3 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 _py_anon_pod3 obj = _py_anon_pod3.__new__(_py_anon_pod3) + if owner is None: + obj._ptr = _cyb_malloc(sizeof((NULL).u.batch)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod3") + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).u.batch)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_io_events_dtype_offsets(): + cdef CUfileIOEvents_t pod + return _numpy.dtype({ + 'names': ['cookie', 'status', 'ret'], + 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], + 'offsets': [ + (&(pod.cookie)) - (&pod), + (&(pod.status)) - (&pod), + (&(pod.ret)) - (&pod), + ], + 'itemsize': sizeof(CUfileIOEvents_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=io_events_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(CUfileIOEvents_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(CUfileIOEvents_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.IOEvents_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.IOEvents 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, IOEvents)) 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 cookie(self): + """Union[~_numpy.intp, int]: """ + if self._data.size == 1: + return int(self._data.cookie[0]) + return self._data.cookie + + @cookie.setter + def cookie(self, val): + self._data.cookie = val + + @property + def status(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.status[0]) + return self._data.status + + @status.setter + def status(self, val): + self._data.status = val + + @property + def ret(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.ret[0]) + return self._data.ret + + @ret.setter + def ret(self, val): + self._data.ret = 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 IOEvents.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == io_events_dtype: + return IOEvents.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an IOEvents instance with the memory from the given buffer.""" + return IOEvents.from_data(_numpy.frombuffer(buffer, dtype=io_events_dtype)) + + @staticmethod + def from_data(data): + """Create an IOEvents instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `io_events_dtype` holding the data. + """ + cdef IOEvents obj = IOEvents.__new__(IOEvents) + 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 != io_events_dtype: + raise ValueError("data array must be of dtype io_events_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an IOEvents 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef IOEvents obj = IOEvents.__new__(IOEvents) + 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) + obj._owner = owner + + return obj + + +cdef _get_descr_dtype_offsets(): + cdef CUfileDescr_t pod + return _numpy.dtype({ + 'names': ['type', 'handle', 'fs_ops'], + 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], + 'offsets': [ + (&(pod.type)) - (&pod), + (&(pod.handle)) - (&pod), + (&(pod.fs_ops)) - (&pod), + ], + 'itemsize': sizeof(CUfileDescr_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=descr_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(CUfileDescr_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(CUfileDescr_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.Descr_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.Descr 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, Descr)) 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 type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.type[0]) + return self._data.type + + @type.setter + def type(self, val): + self._data.type = val + + @property + def handle(self): + """_py_anon_pod1_dtype: """ + return self._data.handle + + @handle.setter + def handle(self, val): + self._data.handle = val + + @property + def fs_ops(self): + """Union[~_numpy.intp, int]: """ + if self._data.size == 1: + return int(self._data.fs_ops[0]) + return self._data.fs_ops + + @fs_ops.setter + def fs_ops(self, val): + self._data.fs_ops = 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 Descr.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == descr_dtype: + return Descr.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an Descr instance with the memory from the given buffer.""" + return Descr.from_data(_numpy.frombuffer(buffer, dtype=descr_dtype)) + + @staticmethod + def from_data(data): + """Create an Descr instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `descr_dtype` holding the data. + """ + cdef Descr obj = Descr.__new__(Descr) + 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 != descr_dtype: + raise ValueError("data array must be of dtype descr_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an Descr 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef Descr obj = Descr.__new__(Descr) + 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) + obj._owner = owner + + return obj + + +cdef _get__py_anon_pod2_dtype_offsets(): + cdef cuda_bindings_cufile__anon_pod2 pod + return _numpy.dtype({ + 'names': ['batch'], + 'formats': [_py_anon_pod3_dtype], + 'offsets': [ + (&(pod.batch)) - (&pod), + ], + 'itemsize': sizeof((NULL).u), + }) + +_py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() + +cdef class _py_anon_pod2: + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod2`. + + + .. seealso:: `cuda_bindings_cufile__anon_pod2` + """ + cdef: + cuda_bindings_cufile__anon_pod2 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof((NULL).u)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_cufile__anon_pod2 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod2 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 _py_anon_pod2 other_ + if not isinstance(other, _py_anon_pod2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).u)) == 0) + + 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 = _cyb_malloc(sizeof((NULL).u)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def batch(self): + """_py_anon_pod3: """ + return _py_anon_pod3.from_ptr( + &(self._ptr[0].batch), + readonly=self._readonly, + owner=self, + ) + + @batch.setter + def batch(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod2 instance is read-only") + cdef _py_anon_pod3 val_ = val + _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 _cyb_from_buffer(buffer, sizeof((NULL).u), _py_anon_pod2) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod2 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 _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof((NULL).u)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod2") + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).u)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_io_params_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.mode)) - (&pod), + (&(pod.u)) - (&pod), + (&(pod.fh)) - (&pod), + (&(pod.opcode)) - (&pod), + (&(pod.cookie)) - (&pod), + ], + 'itemsize': sizeof(CUfileIOParams_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=io_params_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(CUfileIOParams_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(CUfileIOParams_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.IOParams_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.IOParams 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, IOParams)) 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 mode(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.mode[0]) + return self._data.mode + + @mode.setter + def mode(self, val): + self._data.mode = val + + @property + def u(self): + """_py_anon_pod2_dtype: """ + return self._data.u + + @u.setter + def u(self, val): + self._data.u = val + + @property + def fh(self): + """Union[~_numpy.intp, int]: """ + if self._data.size == 1: + return int(self._data.fh[0]) + return self._data.fh + + @fh.setter + def fh(self, val): + self._data.fh = val + + @property + def opcode(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.opcode[0]) + return self._data.opcode + + @opcode.setter + def opcode(self, val): + self._data.opcode = val + + @property + def cookie(self): + """Union[~_numpy.intp, int]: """ + if self._data.size == 1: + return int(self._data.cookie[0]) + return self._data.cookie + + @cookie.setter + def cookie(self, val): + self._data.cookie = 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 IOParams.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == io_params_dtype: + return IOParams.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an IOParams instance with the memory from the given buffer.""" + return IOParams.from_data(_numpy.frombuffer(buffer, dtype=io_params_dtype)) + + @staticmethod + def from_data(data): + """Create an IOParams instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `io_params_dtype` holding the data. + """ + cdef IOParams obj = IOParams.__new__(IOParams) + 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 != io_params_dtype: + raise ValueError("data array must be of dtype io_params_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an IOParams 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef IOParams obj = IOParams.__new__(IOParams) + 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) + obj._owner = owner + + return obj + + +############################################################################### +# Enum +############################################################################### + +class OpError(_cyb_FastEnum): + """ + See `CUfileOpError`. + """ + SUCCESS = CU_FILE_SUCCESS + DRIVER_NOT_INITIALIZED = CU_FILE_DRIVER_NOT_INITIALIZED + DRIVER_INVALID_PROPS = CU_FILE_DRIVER_INVALID_PROPS + DRIVER_UNSUPPORTED_LIMIT = CU_FILE_DRIVER_UNSUPPORTED_LIMIT + DRIVER_VERSION_MISMATCH = CU_FILE_DRIVER_VERSION_MISMATCH + DRIVER_VERSION_READ_ERROR = CU_FILE_DRIVER_VERSION_READ_ERROR + DRIVER_CLOSING = CU_FILE_DRIVER_CLOSING + PLATFORM_NOT_SUPPORTED = CU_FILE_PLATFORM_NOT_SUPPORTED + IO_NOT_SUPPORTED = CU_FILE_IO_NOT_SUPPORTED + DEVICE_NOT_SUPPORTED = CU_FILE_DEVICE_NOT_SUPPORTED + NVFS_DRIVER_ERROR = CU_FILE_NVFS_DRIVER_ERROR + CUDA_DRIVER_ERROR = CU_FILE_CUDA_DRIVER_ERROR + CUDA_POINTER_INVALID = CU_FILE_CUDA_POINTER_INVALID + CUDA_MEMORY_TYPE_INVALID = CU_FILE_CUDA_MEMORY_TYPE_INVALID + CUDA_POINTER_RANGE_ERROR = CU_FILE_CUDA_POINTER_RANGE_ERROR + CUDA_CONTEXT_MISMATCH = CU_FILE_CUDA_CONTEXT_MISMATCH + INVALID_MAPPING_SIZE = CU_FILE_INVALID_MAPPING_SIZE + INVALID_MAPPING_RANGE = CU_FILE_INVALID_MAPPING_RANGE + INVALID_FILE_TYPE = CU_FILE_INVALID_FILE_TYPE + INVALID_FILE_OPEN_FLAG = CU_FILE_INVALID_FILE_OPEN_FLAG + DIO_NOT_SET = CU_FILE_DIO_NOT_SET + INVALID_VALUE = CU_FILE_INVALID_VALUE + MEMORY_ALREADY_REGISTERED = CU_FILE_MEMORY_ALREADY_REGISTERED + MEMORY_NOT_REGISTERED = CU_FILE_MEMORY_NOT_REGISTERED + PERMISSION_DENIED = CU_FILE_PERMISSION_DENIED + DRIVER_ALREADY_OPEN = CU_FILE_DRIVER_ALREADY_OPEN + HANDLE_NOT_REGISTERED = CU_FILE_HANDLE_NOT_REGISTERED + HANDLE_ALREADY_REGISTERED = CU_FILE_HANDLE_ALREADY_REGISTERED + DEVICE_NOT_FOUND = CU_FILE_DEVICE_NOT_FOUND + INTERNAL_ERROR = CU_FILE_INTERNAL_ERROR + GETNEWFD_FAILED = CU_FILE_GETNEWFD_FAILED + NVFS_SETUP_ERROR = CU_FILE_NVFS_SETUP_ERROR + IO_DISABLED = CU_FILE_IO_DISABLED + BATCH_SUBMIT_FAILED = CU_FILE_BATCH_SUBMIT_FAILED + GPU_MEMORY_PINNING_FAILED = CU_FILE_GPU_MEMORY_PINNING_FAILED + BATCH_FULL = CU_FILE_BATCH_FULL + ASYNC_NOT_SUPPORTED = CU_FILE_ASYNC_NOT_SUPPORTED + IO_MAX_ERROR = CU_FILE_IO_MAX_ERROR + +class DriverStatusFlags(_cyb_FastEnum): + """ + See `CUfileDriverStatusFlags_t`. + """ + LUSTRE_SUPPORTED = (CU_FILE_LUSTRE_SUPPORTED, 'Support for DDN LUSTRE') + WEKAFS_SUPPORTED = (CU_FILE_WEKAFS_SUPPORTED, 'Support for WEKAFS') + NFS_SUPPORTED = (CU_FILE_NFS_SUPPORTED, 'Support for NFS') + GPFS_SUPPORTED = CU_FILE_GPFS_SUPPORTED + NVME_SUPPORTED = (CU_FILE_NVME_SUPPORTED, '< Support for GPFS Support for NVMe') + NVMEOF_SUPPORTED = (CU_FILE_NVMEOF_SUPPORTED, 'Support for NVMeOF') + SCSI_SUPPORTED = (CU_FILE_SCSI_SUPPORTED, 'Support for SCSI') + SCALEFLUX_CSD_SUPPORTED = (CU_FILE_SCALEFLUX_CSD_SUPPORTED, 'Support for Scaleflux CSD') + NVMESH_SUPPORTED = (CU_FILE_NVMESH_SUPPORTED, 'Support for NVMesh Block Dev') + BEEGFS_SUPPORTED = (CU_FILE_BEEGFS_SUPPORTED, 'Support for BeeGFS') + NVME_P2P_SUPPORTED = (CU_FILE_NVME_P2P_SUPPORTED, 'Support for NVMe using PCI P2PDMA') + SCATEFS_SUPPORTED = (CU_FILE_SCATEFS_SUPPORTED, 'Support for ScateFS') + +class DriverControlFlags(_cyb_FastEnum): + """ + See `CUfileDriverControlFlags_t`. + """ + USE_POLL_MODE = (CU_FILE_USE_POLL_MODE, 'use POLL mode. properties.use_poll_mode') + ALLOW_COMPAT_MODE = (CU_FILE_ALLOW_COMPAT_MODE, 'allow COMPATIBILITY mode. properties.allow_compat_mode') + +class FeatureFlags(_cyb_FastEnum): + """ + See `CUfileFeatureFlags_t`. + """ + DYN_ROUTING_SUPPORTED = (CU_FILE_DYN_ROUTING_SUPPORTED, 'Support for Dynamic routing to handle devices across the PCIe bridges') + BATCH_IO_SUPPORTED = (CU_FILE_BATCH_IO_SUPPORTED, 'Unsupported') + STREAMS_SUPPORTED = (CU_FILE_STREAMS_SUPPORTED, 'Unsupported') + PARALLEL_IO_SUPPORTED = (CU_FILE_PARALLEL_IO_SUPPORTED, 'Unsupported') + +class FileHandleType(_cyb_FastEnum): + """ + See `CUfileFileHandleType`. + """ + OPAQUE_FD = (CU_FILE_HANDLE_TYPE_OPAQUE_FD, 'Linux based fd') + OPAQUE_WIN32 = (CU_FILE_HANDLE_TYPE_OPAQUE_WIN32, 'Windows based handle (unsupported)') + USERSPACE_FS = CU_FILE_HANDLE_TYPE_USERSPACE_FS + +class Opcode(_cyb_FastEnum): + """ + See `CUfileOpcode_t`. + """ + READ = CUFILE_READ + WRITE = CUFILE_WRITE + +class Status(_cyb_FastEnum): + """ + See `CUfileStatus_t`. + """ + WAITING = CUFILE_WAITING + PENDING = CUFILE_PENDING + INVALID = CUFILE_INVALID + CANCELED = CUFILE_CANCELED + COMPLETE = CUFILE_COMPLETE + TIMEOUT = CUFILE_TIMEOUT + FAILED = CUFILE_FAILED + +class BatchMode(_cyb_FastEnum): + """ + See `CUfileBatchMode_t`. + """ + BATCH = CUFILE_BATCH + +class SizeTConfigParameter(_cyb_FastEnum): + """ + See `CUFileSizeTConfigParameter_t`. + """ + PROFILE_STATS = CUFILE_PARAM_PROFILE_STATS + EXECUTION_MAX_IO_QUEUE_DEPTH = CUFILE_PARAM_EXECUTION_MAX_IO_QUEUE_DEPTH + EXECUTION_MAX_IO_THREADS = CUFILE_PARAM_EXECUTION_MAX_IO_THREADS + EXECUTION_MIN_IO_THRESHOLD_SIZE_KB = CUFILE_PARAM_EXECUTION_MIN_IO_THRESHOLD_SIZE_KB + EXECUTION_MAX_REQUEST_PARALLELISM = CUFILE_PARAM_EXECUTION_MAX_REQUEST_PARALLELISM + PROPERTIES_MAX_DIRECT_IO_SIZE_KB = CUFILE_PARAM_PROPERTIES_MAX_DIRECT_IO_SIZE_KB + PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB = CUFILE_PARAM_PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB + PROPERTIES_PER_BUFFER_CACHE_SIZE_KB = CUFILE_PARAM_PROPERTIES_PER_BUFFER_CACHE_SIZE_KB + PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB = CUFILE_PARAM_PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB + PROPERTIES_IO_BATCHSIZE = CUFILE_PARAM_PROPERTIES_IO_BATCHSIZE + POLLTHRESHOLD_SIZE_KB = CUFILE_PARAM_POLLTHRESHOLD_SIZE_KB + PROPERTIES_BATCH_IO_TIMEOUT_MS = CUFILE_PARAM_PROPERTIES_BATCH_IO_TIMEOUT_MS + +class BoolConfigParameter(_cyb_FastEnum): + """ + See `CUFileBoolConfigParameter_t`. + """ + PROPERTIES_USE_POLL_MODE = CUFILE_PARAM_PROPERTIES_USE_POLL_MODE + PROPERTIES_ALLOW_COMPAT_MODE = CUFILE_PARAM_PROPERTIES_ALLOW_COMPAT_MODE + FORCE_COMPAT_MODE = CUFILE_PARAM_FORCE_COMPAT_MODE + FS_MISC_API_CHECK_AGGRESSIVE = CUFILE_PARAM_FS_MISC_API_CHECK_AGGRESSIVE + EXECUTION_PARALLEL_IO = CUFILE_PARAM_EXECUTION_PARALLEL_IO + PROFILE_NVTX = CUFILE_PARAM_PROFILE_NVTX + PROPERTIES_ALLOW_SYSTEM_MEMORY = CUFILE_PARAM_PROPERTIES_ALLOW_SYSTEM_MEMORY + USE_PCIP2PDMA = CUFILE_PARAM_USE_PCIP2PDMA + PREFER_IO_URING = CUFILE_PARAM_PREFER_IO_URING + FORCE_ODIRECT_MODE = CUFILE_PARAM_FORCE_ODIRECT_MODE + SKIP_TOPOLOGY_DETECTION = CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION + STREAM_MEMOPS_BYPASS = CUFILE_PARAM_STREAM_MEMOPS_BYPASS + +class StringConfigParameter(_cyb_FastEnum): + """ + See `CUFileStringConfigParameter_t`. + """ + LOGGING_LEVEL = CUFILE_PARAM_LOGGING_LEVEL + ENV_LOGFILE_PATH = CUFILE_PARAM_ENV_LOGFILE_PATH + LOG_DIR = CUFILE_PARAM_LOG_DIR + + +############################################################################### +# Error handling +############################################################################### + +ctypedef fused ReturnT: + CUfileError_t + ssize_t + + +class cuFileError(Exception): + + def __init__(self, status, cu_err=None): + self.status = status + self.cuda_error = cu_err + s = OpError(status) + cdef str err = f"{s.name} ({s.value}): {op_status_error(status)}" + if cu_err is not None: + e = pyCUresult(cu_err) + err += f"; CUDA status: {e.name} ({e.value})" + super(cuFileError, self).__init__(err) + + def __reduce__(self): + return (type(self), (self.status, self.cuda_error)) + + +@cython.profile(False) +cdef int check_status(ReturnT status) except 1 nogil: + if ReturnT is CUfileError_t: + if IS_CUDA_ERR(status): + with gil: + raise cuFileError(status.err, status.cu_err) + elif IS_CUFILE_ERR(status.err): + with gil: + raise cuFileError(status.err) + elif ReturnT is ssize_t: + if status == -1: + # note: this assumes cuFile already properly resets errno in each API + with gil: + raise cuFileError(errno.errno) + return 0 + + +############################################################################### +# Wrapper functions +############################################################################### + +cpdef intptr_t handle_register(intptr_t descr) except? 0: + """cuFileHandleRegister is required, and performs extra checking that is memoized to provide increased performance on later cuFile operations. + + Args: + descr (intptr_t): ``CUfileDescr_t`` file descriptor (OS + agnostic). + + Returns: + intptr_t: ``CUfileHandle_t`` opaque file handle for IO + operations. + + .. seealso:: `cuFileHandleRegister` + """ + cdef Handle fh + with nogil: + __status__ = cuFileHandleRegister(&fh, descr) + check_status(__status__) + return fh + + +cpdef void handle_deregister(intptr_t fh) except*: + """releases a registered filehandle from cuFile. + + Args: + fh (intptr_t): ``CUfileHandle_t`` file handle. + + .. seealso:: `cuFileHandleDeregister` + """ + with nogil: + cuFileHandleDeregister(fh) + + +cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags): + """register an existing cudaMalloced memory with cuFile to pin for GPUDirect Storage access or register host allocated memory with cuFile. + + Args: + buf_ptr_base (intptr_t): buffer pointer allocated. + length (size_t): size of memory region from the above + specified bufPtr. + flags (int): CU_FILE_RDMA_REGISTER. + + .. seealso:: `cuFileBufRegister` + """ + with nogil: + __status__ = cuFileBufRegister(buf_ptr_base, length, flags) + check_status(__status__) + + +cpdef buf_deregister(intptr_t buf_ptr_base): + """deregister an already registered device or host memory from cuFile. + + Args: + buf_ptr_base (intptr_t): buffer pointer to deregister. + + .. seealso:: `cuFileBufDeregister` + """ + with nogil: + __status__ = cuFileBufDeregister(buf_ptr_base) + check_status(__status__) + + +cpdef driver_open(): + """Initialize the cuFile library and open the nvidia-fs driver. + + .. seealso:: `cuFileDriverOpen` + """ + with nogil: + __status__ = cuFileDriverOpen() + check_status(__status__) + + +cpdef use_count(): + """returns use count of cufile drivers at that moment by the process. + + .. seealso:: `cuFileUseCount` + """ + with nogil: + __status__ = cuFileUseCount() + check_status(__status__) + + +cpdef driver_get_properties(intptr_t props): + """Gets the Driver session properties. + + Args: + props (intptr_t): to set. + + .. seealso:: `cuFileDriverGetProperties` + """ + with nogil: + __status__ = cuFileDriverGetProperties(props) + check_status(__status__) + + +cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size): + """Sets whether the Read/Write APIs use polling to do IO operations. + + Args: + poll (bint): boolean to indicate whether to use poll mode or + not. + poll_threshold_size (size_t): max IO size to use for POLLING + mode in KB. + + .. seealso:: `cuFileDriverSetPollMode` + """ + with nogil: + __status__ = cuFileDriverSetPollMode(<_cyb_bool>poll, poll_threshold_size) + check_status(__status__) + + +cpdef driver_set_max_direct_io_size(size_t max_direct_io_size): + """Control parameter to set max IO size(KB) used by the library to talk to nvidia-fs driver. + + Args: + max_direct_io_size (size_t): maximum allowed direct io size in + KB. + + .. seealso:: `cuFileDriverSetMaxDirectIOSize` + """ + with nogil: + __status__ = cuFileDriverSetMaxDirectIOSize(max_direct_io_size) + check_status(__status__) + + +cpdef driver_set_max_cache_size(size_t max_cache_size): + """Control parameter to set maximum GPU memory reserved per device by the library for internal buffering. + + Args: + max_cache_size (size_t): The maximum GPU buffer space per + device used for internal use in KB. + + .. seealso:: `cuFileDriverSetMaxCacheSize` + """ + with nogil: + __status__ = cuFileDriverSetMaxCacheSize(max_cache_size) + check_status(__status__) + + +cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size): + """Sets maximum buffer space that is pinned in KB for use by ``cuFileBufRegister``. + + Args: + max_pinned_size (size_t): maximum buffer space that is pinned + in KB. + + .. seealso:: `cuFileDriverSetMaxPinnedMemSize` + """ + with nogil: + __status__ = cuFileDriverSetMaxPinnedMemSize(max_pinned_size) + check_status(__status__) + + +cpdef intptr_t batch_io_set_up(unsigned nr) except? 0: + cdef BatchHandle batch_idp + with nogil: + __status__ = cuFileBatchIOSetUp(&batch_idp, nr) + check_status(__status__) + return batch_idp + + +cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, intptr_t iocbp, unsigned int flags): + with nogil: + __status__ = cuFileBatchIOSubmit(batch_idp, nr, iocbp, flags) + check_status(__status__) + + +cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, intptr_t iocbp, intptr_t timeout): + with nogil: + __status__ = cuFileBatchIOGetStatus(batch_idp, min_nr, nr, iocbp, timeout) + check_status(__status__) + + +cpdef batch_io_cancel(intptr_t batch_idp): + with nogil: + __status__ = cuFileBatchIOCancel(batch_idp) + check_status(__status__) + + +cpdef void batch_io_destroy(intptr_t batch_idp) except*: + with nogil: + cuFileBatchIODestroy(batch_idp) + + +cpdef read_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_read_p, intptr_t stream): + with nogil: + __status__ = cuFileReadAsync(fh, buf_ptr_base, size_p, file_offset_p, buf_ptr_offset_p, bytes_read_p, stream) + check_status(__status__) + + +cpdef write_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_written_p, intptr_t stream): + with nogil: + __status__ = cuFileWriteAsync(fh, buf_ptr_base, size_p, file_offset_p, buf_ptr_offset_p, bytes_written_p, stream) + check_status(__status__) + + +cpdef stream_register(intptr_t stream, unsigned flags): + with nogil: + __status__ = cuFileStreamRegister(stream, flags) + check_status(__status__) + + +cpdef stream_deregister(intptr_t stream): + with nogil: + __status__ = cuFileStreamDeregister(stream) + check_status(__status__) + + +cpdef int get_version() except? 0: + """Get the cuFile library version. + + Returns: + int: Pointer to an integer where the version will be stored. + + .. seealso:: `cuFileGetVersion` + """ + cdef int version + with nogil: + __status__ = cuFileGetVersion(&version) + check_status(__status__) + return version + + +cpdef size_t get_parameter_size_t(int param) except? 0: + cdef size_t value + with nogil: + __status__ = cuFileGetParameterSizeT(<_SizeTConfigParameter>param, &value) + check_status(__status__) + return value + + +cpdef bint get_parameter_bool(int param) except? 0: + cdef _cyb_bool value + with nogil: + __status__ = cuFileGetParameterBool(<_BoolConfigParameter>param, &value) + check_status(__status__) + return value + + +cpdef str get_parameter_string(int param, int len): + cdef bytes _desc_str_ = bytes(len) + cdef char* desc_str = _desc_str_ + with nogil: + __status__ = cuFileGetParameterString(<_StringConfigParameter>param, desc_str, len) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(desc_str) + + +cpdef set_parameter_size_t(int param, size_t value): + with nogil: + __status__ = cuFileSetParameterSizeT(<_SizeTConfigParameter>param, value) + check_status(__status__) + + +cpdef set_parameter_bool(int param, bint value): + with nogil: + __status__ = cuFileSetParameterBool(<_BoolConfigParameter>param, <_cyb_bool>value) + check_status(__status__) + + +cpdef set_parameter_string(int param, intptr_t desc_str): + with nogil: + __status__ = cuFileSetParameterString(<_StringConfigParameter>param, desc_str) + check_status(__status__) + + +cpdef str op_status_error(int status): + """cufileop status string. + + Args: + status (OpError): the error status to query. + + .. seealso:: `cufileop_status_error` + """ + cdef bytes _output_ + _output_ = cufileop_status_error(<_OpError>status) + return _output_.decode() + + +cpdef driver_close(): + """reset the cuFile library and release the nvidia-fs driver + """ + with nogil: + status = cuFileDriverClose_v2() + check_status(status) + +cpdef read(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): + """read data from a registered file handle to a specified device or host memory. + + Args: + fh (intptr_t): ``CUfileHandle_t`` opaque file handle. + buf_ptr_base (intptr_t): base address of buffer in device or host memory. + size (size_t): size bytes to read. + file_offset (off_t): file-offset from begining of the file. + buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to read into. + + Returns: + ssize_t: number of bytes read on success. + + .. seealso:: `cuFileRead` + """ + with nogil: + status = cuFileRead(fh, buf_ptr_base, size, file_offset, buf_ptr_offset) + check_status(status) + return status + + +cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, off_t buf_ptr_offset): + """write data from a specified device or host memory to a registered file handle. + + Args: + fh (intptr_t): ``CUfileHandle_t`` opaque file handle. + buf_ptr_base (intptr_t): base address of buffer in device or host memory. + size (size_t): size bytes to write. + file_offset (off_t): file-offset from begining of the file. + buf_ptr_offset (off_t): offset relative to the buf_ptr_base pointer to write from. + + Returns: + ssize_t: number of bytes written on success. + + .. seealso:: `cuFileWrite` + """ + with nogil: + 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_12/cuda/bindings/cycufile.pxd b/cuda_bindings_12/cuda/bindings/cycufile.pxd new file mode 100644 index 00000000000..727e6dd0c3a --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cycufile.pxd @@ -0,0 +1,308 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2dcfd746c3b9fd0e890cb0c319541c52bba6ed389e67765e542509b743dc95a9 + + +# <<<< PREAMBLE CONTENT >>>> + +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.time cimport time_t +from posix.types cimport off_t + +cimport cuda.bindings.cydriver +from cuda.bindings.cydriver cimport CUresult + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# TODO: switch to "from libc.time cimport timespec" once we can use recent +# Cython to build +cdef extern from "": + cdef struct timespec: + time_t tv_sec + long tv_nsec +cdef extern from "": + cdef struct sockaddr: + unsigned short sa_family + char sa_data[14] + ctypedef sockaddr sockaddr_t + + + + + # enums +cdef extern from 'cufile.h': + ctypedef enum CUfileOpError: + CU_FILE_SUCCESS + CU_FILE_DRIVER_NOT_INITIALIZED + CU_FILE_DRIVER_INVALID_PROPS + CU_FILE_DRIVER_UNSUPPORTED_LIMIT + CU_FILE_DRIVER_VERSION_MISMATCH + CU_FILE_DRIVER_VERSION_READ_ERROR + CU_FILE_DRIVER_CLOSING + CU_FILE_PLATFORM_NOT_SUPPORTED + CU_FILE_IO_NOT_SUPPORTED + CU_FILE_DEVICE_NOT_SUPPORTED + CU_FILE_NVFS_DRIVER_ERROR + CU_FILE_CUDA_DRIVER_ERROR + CU_FILE_CUDA_POINTER_INVALID + CU_FILE_CUDA_MEMORY_TYPE_INVALID + CU_FILE_CUDA_POINTER_RANGE_ERROR + CU_FILE_CUDA_CONTEXT_MISMATCH + CU_FILE_INVALID_MAPPING_SIZE + CU_FILE_INVALID_MAPPING_RANGE + CU_FILE_INVALID_FILE_TYPE + CU_FILE_INVALID_FILE_OPEN_FLAG + CU_FILE_DIO_NOT_SET + CU_FILE_INVALID_VALUE + CU_FILE_MEMORY_ALREADY_REGISTERED + CU_FILE_MEMORY_NOT_REGISTERED + CU_FILE_PERMISSION_DENIED + CU_FILE_DRIVER_ALREADY_OPEN + CU_FILE_HANDLE_NOT_REGISTERED + CU_FILE_HANDLE_ALREADY_REGISTERED + CU_FILE_DEVICE_NOT_FOUND + CU_FILE_INTERNAL_ERROR + CU_FILE_GETNEWFD_FAILED + CU_FILE_NVFS_SETUP_ERROR + CU_FILE_IO_DISABLED + CU_FILE_BATCH_SUBMIT_FAILED + CU_FILE_GPU_MEMORY_PINNING_FAILED + CU_FILE_BATCH_FULL + CU_FILE_ASYNC_NOT_SUPPORTED + CU_FILE_IO_MAX_ERROR + +cdef extern from 'cufile.h': + ctypedef enum CUfileDriverStatusFlags_t: + CU_FILE_LUSTRE_SUPPORTED + CU_FILE_WEKAFS_SUPPORTED + CU_FILE_NFS_SUPPORTED + CU_FILE_GPFS_SUPPORTED + CU_FILE_NVME_SUPPORTED + CU_FILE_NVMEOF_SUPPORTED + CU_FILE_SCSI_SUPPORTED + CU_FILE_SCALEFLUX_CSD_SUPPORTED + CU_FILE_NVMESH_SUPPORTED + CU_FILE_BEEGFS_SUPPORTED + CU_FILE_NVME_P2P_SUPPORTED + CU_FILE_SCATEFS_SUPPORTED + +cdef extern from 'cufile.h': + ctypedef enum CUfileDriverControlFlags_t: + CU_FILE_USE_POLL_MODE + CU_FILE_ALLOW_COMPAT_MODE + +cdef extern from 'cufile.h': + ctypedef enum CUfileFeatureFlags_t: + CU_FILE_DYN_ROUTING_SUPPORTED + CU_FILE_BATCH_IO_SUPPORTED + CU_FILE_STREAMS_SUPPORTED + CU_FILE_PARALLEL_IO_SUPPORTED + +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 'cufile.h': + ctypedef enum CUfileOpcode_t: + CUFILE_READ + CUFILE_WRITE + +cdef extern from 'cufile.h': + ctypedef enum CUfileStatus_t: + CUFILE_WAITING + CUFILE_PENDING + CUFILE_INVALID + CUFILE_CANCELED + CUFILE_COMPLETE + CUFILE_TIMEOUT + CUFILE_FAILED + +cdef extern from 'cufile.h': + ctypedef enum CUfileBatchMode_t: + CUFILE_BATCH + +cdef extern from 'cufile.h': + ctypedef enum CUFileSizeTConfigParameter_t: + CUFILE_PARAM_PROFILE_STATS + CUFILE_PARAM_EXECUTION_MAX_IO_QUEUE_DEPTH + CUFILE_PARAM_EXECUTION_MAX_IO_THREADS + CUFILE_PARAM_EXECUTION_MIN_IO_THRESHOLD_SIZE_KB + CUFILE_PARAM_EXECUTION_MAX_REQUEST_PARALLELISM + CUFILE_PARAM_PROPERTIES_MAX_DIRECT_IO_SIZE_KB + CUFILE_PARAM_PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB + CUFILE_PARAM_PROPERTIES_PER_BUFFER_CACHE_SIZE_KB + CUFILE_PARAM_PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB + CUFILE_PARAM_PROPERTIES_IO_BATCHSIZE + CUFILE_PARAM_POLLTHRESHOLD_SIZE_KB + CUFILE_PARAM_PROPERTIES_BATCH_IO_TIMEOUT_MS + +cdef extern from 'cufile.h': + ctypedef enum CUFileBoolConfigParameter_t: + CUFILE_PARAM_PROPERTIES_USE_POLL_MODE + CUFILE_PARAM_PROPERTIES_ALLOW_COMPAT_MODE + CUFILE_PARAM_FORCE_COMPAT_MODE + CUFILE_PARAM_FS_MISC_API_CHECK_AGGRESSIVE + CUFILE_PARAM_EXECUTION_PARALLEL_IO + CUFILE_PARAM_PROFILE_NVTX + CUFILE_PARAM_PROPERTIES_ALLOW_SYSTEM_MEMORY + CUFILE_PARAM_USE_PCIP2PDMA + CUFILE_PARAM_PREFER_IO_URING + CUFILE_PARAM_FORCE_ODIRECT_MODE + CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION + CUFILE_PARAM_STREAM_MEMOPS_BYPASS + +cdef extern from 'cufile.h': + ctypedef enum CUFileStringConfigParameter_t: + CUFILE_PARAM_LOGGING_LEVEL + CUFILE_PARAM_ENV_LOGFILE_PATH + CUFILE_PARAM_LOG_DIR +cdef enum: _CUFILEERROR_T_INTERNAL_LOADING_ERROR = -42 + + # types +cdef extern from 'cufile.h': + ctypedef void* CUfileHandle_t 'CUfileHandle_t' + + +cdef extern from 'cufile.h': + ctypedef void* CUfileBatchHandle_t 'CUfileBatchHandle_t' + + +cdef extern from 'cufile.h': + ctypedef struct CUfileError_t 'CUfileError_t': + CUfileOpError err + CUresult cu_err + +cdef struct cuda_bindings_cufile__anon_pod0: + unsigned int major_version + unsigned int minor_version + size_t poll_thresh_size + size_t max_direct_io_size + unsigned int dstatusflags + unsigned int dcontrolflags + +cdef extern from 'cufile.h': + ctypedef struct cufileRDMAInfo_t 'cufileRDMAInfo_t': + int version + int desc_len + char* desc_str + +cdef extern from 'cufile.h': + ctypedef struct CUfileFSOps_t 'CUfileFSOps_t': + char* (*fs_type)(void*) + int (*getRDMADeviceList)(void*, sockaddr_t**) + int (*getRDMADevicePriority)(void*, char*, size_t, loff_t, sockaddr_t*) + ssize_t (*read)(void*, char*, size_t, loff_t, cufileRDMAInfo_t*) + ssize_t (*write)(void*, const char*, size_t, loff_t, cufileRDMAInfo_t*) + +cdef union cuda_bindings_cufile__anon_pod1: + int fd + void* handle + +cdef struct cuda_bindings_cufile__anon_pod3: + void* devPtr_base + off_t file_offset + off_t devPtr_offset + size_t size + +cdef extern from 'cufile.h': + ctypedef struct CUfileIOEvents_t 'CUfileIOEvents_t': + void* cookie + CUfileStatus_t status + size_t ret + +cdef extern from 'cufile.h': + ctypedef struct CUfileDrvProps_t 'CUfileDrvProps_t': + cuda_bindings_cufile__anon_pod0 nvfs + unsigned int fflags + unsigned int max_device_cache_size + unsigned int per_buffer_cache_size + unsigned int max_device_pinned_mem_size + unsigned int max_batch_io_size + unsigned int max_batch_io_timeout_msecs + +cdef extern from 'cufile.h': + ctypedef struct CUfileDescr_t 'CUfileDescr_t': + CUfileFileHandleType type + cuda_bindings_cufile__anon_pod1 handle + CUfileFSOps_t* fs_ops + +cdef union cuda_bindings_cufile__anon_pod2: + cuda_bindings_cufile__anon_pod3 batch + +cdef extern from 'cufile.h': + ctypedef struct CUfileIOParams_t 'CUfileIOParams_t': + CUfileBatchMode_t mode + cuda_bindings_cufile__anon_pod2 u + CUfileHandle_t fh + CUfileOpcode_t opcode + void* cookie + + +# Error-inspection macros from cufile.h (declared as functions so Cython +# emits calls that the C preprocessor expands). +cdef extern from 'cufile.h' nogil: + bint IS_CUDA_ERR(CUfileError_t status) + bint IS_CUFILE_ERR(CUfileOpError err) + + +cdef extern from *: + """ + // This is the missing piece we need to supply to help Cython & C++ compilers. + inline bool operator==(const CUfileError_t& lhs, const CUfileError_t& rhs) { + return (lhs.err == rhs.err) && (lhs.cu_err == rhs.cu_err); + } + static CUfileError_t CUFILE_LOADING_ERROR{(CUfileOpError)-1, (CUresult)-1}; + """ + const CUfileError_t CUFILE_LOADING_ERROR + ctypedef void* CUstream "CUstream" + + const char* cufileop_status_error(CUfileOpError) + + +############################################################################### +# Functions +############################################################################### + +cdef CUfileError_t cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil +cdef void cuFileHandleDeregister(CUfileHandle_t fh) except* nogil +cdef CUfileError_t cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef ssize_t cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil +cdef CUfileError_t cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil +cdef long cuFileUseCount() except* nogil +cdef CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil +cdef void cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil +cdef CUfileError_t cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings_12/cuda/bindings/cycufile.pyx b/cuda_bindings_12/cuda/bindings/cycufile.pyx new file mode 100644 index 00000000000..ef177444d7d --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cycufile.pyx @@ -0,0 +1,148 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aee60fe04279013ad31bba1838560b52e50e82d469b691b63b869068bddac101 + + +# <<<< PREAMBLE CONTENT >>>> + +cimport cython as _cyb_cython +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from ._internal cimport cufile as _cufile + +import cython + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUfileError_t cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileHandleRegister(fh, descr) + + +@_cyb_cython.show_performance_hints(False) +cdef void cuFileHandleDeregister(CUfileHandle_t fh) except* nogil: + _cufile._cuFileHandleDeregister(fh) + + +cdef CUfileError_t cuFileBufRegister(const void* bufPtr_base, size_t length, int flags) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBufRegister(bufPtr_base, length, flags) + + +cdef CUfileError_t cuFileBufDeregister(const void* bufPtr_base) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBufDeregister(bufPtr_base) + + +cdef ssize_t cuFileRead(CUfileHandle_t fh, void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil: + return _cufile._cuFileRead(fh, bufPtr_base, size, file_offset, bufPtr_offset) + + +cdef ssize_t cuFileWrite(CUfileHandle_t fh, const void* bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset) except* nogil: + return _cufile._cuFileWrite(fh, bufPtr_base, size, file_offset, bufPtr_offset) + + +cdef CUfileError_t cuFileDriverOpen() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverOpen() + + +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverClose() + + +cdef CUfileError_t cuFileDriverClose_v2() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverClose_v2() + + +cdef long cuFileUseCount() except* nogil: + return _cufile._cuFileUseCount() + + +cdef CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverGetProperties(props) + + +cdef CUfileError_t cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverSetPollMode(poll, poll_threshold_size) + + +cdef CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverSetMaxDirectIOSize(max_direct_io_size) + + +cdef CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverSetMaxCacheSize(max_cache_size) + + +cdef CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverSetMaxPinnedMemSize(max_pinned_size) + + +cdef CUfileError_t cuFileBatchIOSetUp(CUfileBatchHandle_t* batch_idp, unsigned nr) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBatchIOSetUp(batch_idp, nr) + + +cdef CUfileError_t cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t* iocbp, unsigned int flags) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBatchIOSubmit(batch_idp, nr, iocbp, flags) + + +cdef CUfileError_t cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr, CUfileIOEvents_t* iocbp, timespec* timeout) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBatchIOGetStatus(batch_idp, min_nr, nr, iocbp, timeout) + + +cdef CUfileError_t cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileBatchIOCancel(batch_idp) + + +@_cyb_cython.show_performance_hints(False) +cdef void cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp) except* nogil: + _cufile._cuFileBatchIODestroy(batch_idp) + + +cdef CUfileError_t cuFileReadAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_read_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileReadAsync(fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_read_p, stream) + + +cdef CUfileError_t cuFileWriteAsync(CUfileHandle_t fh, void* bufPtr_base, size_t* size_p, off_t* file_offset_p, off_t* bufPtr_offset_p, ssize_t* bytes_written_p, CUstream stream) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileWriteAsync(fh, bufPtr_base, size_p, file_offset_p, bufPtr_offset_p, bytes_written_p, stream) + + +cdef CUfileError_t cuFileStreamRegister(CUstream stream, unsigned flags) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileStreamRegister(stream, flags) + + +cdef CUfileError_t cuFileStreamDeregister(CUstream stream) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileStreamDeregister(stream) + + +cdef CUfileError_t cuFileGetVersion(int* version) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetVersion(version) + + +cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetParameterSizeT(param, value) + + +cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetParameterBool(param, value) + + +cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileGetParameterString(param, desc_str, len) + + +cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileSetParameterSizeT(param, value) + + +cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileSetParameterBool(param, value) + + +cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileSetParameterString(param, desc_str) diff --git a/cuda_bindings_12/cuda/bindings/cydriver.pxd b/cuda_bindings_12/cuda/bindings/cydriver.pxd new file mode 100644 index 00000000000..35427dfbf05 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cydriver.pxd @@ -0,0 +1,3489 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9882ad2c1336b55915f58e8b293a27976fc3282923630b4fa6b3dbb2f8d449de + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t, uint64_t + + +# Overridden types from _extras.h + +# GL +ctypedef unsigned int GLenum +ctypedef unsigned int GLuint + +# EGL +ctypedef void *EGLImageKHR +ctypedef void *EGLStreamKHR +ctypedef unsigned int EGLint +ctypedef void *EGLSyncKHR + +# VDPAU +ctypedef uint32_t VdpDevice +ctypedef unsigned long long VdpGetProcAddress +ctypedef uint32_t VdpVideoSurface +ctypedef uint32_t VdpOutputSurface + + +# 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 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 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 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 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 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 extern from 'cuda.h': + ctypedef enum CUstream_flags_enum: + CU_STREAM_DEFAULT + CU_STREAM_NON_BLOCKING + ctypedef CUstream_flags_enum CUstream_flags + +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 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 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 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 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 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_FLUSH_REMOTE_WRITES + ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType + +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 + +cdef extern from 'cuda.h': + ctypedef enum CUoccupancy_flags_enum: + CU_OCCUPANCY_DEFAULT + CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE + ctypedef CUoccupancy_flags_enum CUoccupancy_flags + +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 + +cdef extern from 'cuda.h': + ctypedef enum CUasyncNotificationType_enum: + CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET + ctypedef CUasyncNotificationType_enum CUasyncNotificationType + +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_MAX + ctypedef CUarray_format_enum CUarray_format + +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 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 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_MAX + ctypedef CUdevice_attribute_enum CUdevice_attribute + +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 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_MAX + ctypedef CUfunction_attribute_enum CUfunction_attribute + +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 + +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 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 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 extern from 'cuda.h': + ctypedef enum CUcomputemode_enum: + CU_COMPUTEMODE_DEFAULT + CU_COMPUTEMODE_PROHIBITED + CU_COMPUTEMODE_EXCLUSIVE_PROCESS + ctypedef CUcomputemode_enum CUcomputemode + +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 + +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 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_NUM_OPTIONS + ctypedef CUjit_option_enum CUjit_option + +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_101 + CU_TARGET_COMPUTE_103 + CU_TARGET_COMPUTE_120 + CU_TARGET_COMPUTE_121 + CU_TARGET_COMPUTE_90A + CU_TARGET_COMPUTE_100A + CU_TARGET_COMPUTE_101A + CU_TARGET_COMPUTE_103A + CU_TARGET_COMPUTE_120A + CU_TARGET_COMPUTE_121A + CU_TARGET_COMPUTE_100F + CU_TARGET_COMPUTE_101F + CU_TARGET_COMPUTE_103F + CU_TARGET_COMPUTE_120F + CU_TARGET_COMPUTE_121F + ctypedef CUjit_target_enum CUjit_target + +cdef extern from 'cuda.h': + ctypedef enum CUjit_fallback_enum: + CU_PREFER_PTX + CU_PREFER_BINARY + ctypedef CUjit_fallback_enum CUjit_fallback + +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 + +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 + +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 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 + +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 + +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 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 + +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 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 + +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 + ctypedef CUgraphNodeType_enum CUgraphNodeType + +cdef extern from 'cuda.h': + ctypedef enum CUgraphDependencyType_enum: + CU_GRAPH_DEPENDENCY_TYPE_DEFAULT + CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC + ctypedef CUgraphDependencyType_enum CUgraphDependencyType + +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 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 + +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 extern from 'cuda.h': + ctypedef enum CUlaunchMemSyncDomain_enum: + CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE + ctypedef CUlaunchMemSyncDomain_enum CUlaunchMemSyncDomain + +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 + ctypedef CUlaunchAttributeID_enum CUlaunchAttributeID + +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 + +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 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 + +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 extern from 'cuda.h': + ctypedef enum CUexecAffinityType_enum: + CU_EXEC_AFFINITY_TYPE_SM_COUNT + CU_EXEC_AFFINITY_TYPE_MAX + ctypedef CUexecAffinityType_enum CUexecAffinityType + +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 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 + +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_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_UNKNOWN + ctypedef cudaError_enum CUresult + +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 + ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute + +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 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 + +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 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 + +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 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 + +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 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 + +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 + ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType + +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 + +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 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 + +cdef extern from 'cuda.h': + ctypedef enum CUmemLocationType_enum: + CU_MEM_LOCATION_TYPE_INVALID + 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_MAX + ctypedef CUmemLocationType_enum CUmemLocationType + +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationType_enum: + CU_MEM_ALLOCATION_TYPE_INVALID + CU_MEM_ALLOCATION_TYPE_PINNED + CU_MEM_ALLOCATION_TYPE_MAX + ctypedef CUmemAllocationType_enum CUmemAllocationType + +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 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 + +cdef extern from 'cuda.h': + ctypedef enum CUmemRangeFlags_enum: + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE + ctypedef CUmemRangeFlags_enum CUmemRangeFlags + +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 + +cdef extern from 'cuda.h': + ctypedef enum CUmemOperationType_enum: + CU_MEM_OPERATION_TYPE_MAP + CU_MEM_OPERATION_TYPE_UNMAP + ctypedef CUmemOperationType_enum CUmemOperationType + +cdef extern from 'cuda.h': + ctypedef enum CUmemHandleType_enum: + CU_MEM_HANDLE_TYPE_GENERIC + ctypedef CUmemHandleType_enum CUmemHandleType + +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationCompType_enum: + CU_MEM_ALLOCATION_COMP_NONE + CU_MEM_ALLOCATION_COMP_GENERIC + ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType + +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 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 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 + ctypedef CUmemPool_attribute_enum CUmemPool_attribute + +cdef extern from 'cuda.h': + ctypedef enum CUmemcpyFlags_enum: + CU_MEMCPY_FLAG_DEFAULT + CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE + ctypedef CUmemcpyFlags_enum CUmemcpyFlags + +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 + +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 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 + +cdef extern from 'cuda.h': + ctypedef enum CUgraphChildGraphNodeOwnership_enum: + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE + ctypedef CUgraphChildGraphNodeOwnership_enum CUgraphChildGraphNodeOwnership + +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 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 + +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 extern from 'cuda.h': + ctypedef enum CUflushGPUDirectRDMAWritesTarget_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX + ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget + +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 extern from 'cuda.h': + ctypedef enum CUuserObject_flags_enum: + CU_USER_OBJECT_NO_DESTRUCTOR_SYNC + ctypedef CUuserObject_flags_enum CUuserObject_flags + +cdef extern from 'cuda.h': + ctypedef enum CUuserObjectRetain_flags_enum: + CU_GRAPH_USER_OBJECT_MOVE + ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags + +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 + +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 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 extern from 'cuda.h': + ctypedef enum CUmoduleLoadingMode_enum: + CU_MODULE_EAGER_LOADING + CU_MODULE_LAZY_LOADING + ctypedef CUmoduleLoadingMode_enum CUmoduleLoadingMode + +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 + +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 + +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 + +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_LIGHTWEIGHT_FLAGS + +cdef extern from 'cuda.h': + ctypedef enum CUgreenCtxCreate_flags "CUgreenCtxCreate_flags": + CU_GREEN_CTX_DEFAULT_STREAM + +cdef extern from 'cuda.h': + ctypedef enum CUdevSmResourceSplit_flags "CUdevSmResourceSplit_flags": + CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING + CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE + +cdef extern from 'cuda.h': + ctypedef enum CUdevResourceType "CUdevResourceType": + CU_DEV_RESOURCE_TYPE_INVALID + CU_DEV_RESOURCE_TYPE_SM + +cdef extern from 'cuda.h': + ctypedef enum CUlogLevel_enum: + CU_LOG_LEVEL_ERROR + CU_LOG_LEVEL_WARNING + ctypedef CUlogLevel_enum CUlogLevel + +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 enum: _CURESULT_INTERNAL_LOADING_ERROR = CUresult.CUDA_ERROR_NOT_FOUND +cdef enum: CUDA_VERSION = 12090 + + +# TYPES +cdef extern from 'cuda.h': + ctypedef uint32_t cuuint32_t 'cuuint32_t' + + +cdef extern from 'cuda.h': + ctypedef uint64_t cuuint64_t 'cuuint64_t' + + +cdef extern from 'cuda.h': + ctypedef unsigned long long CUdeviceptr_v2 'CUdeviceptr_v2' + + +cdef extern from 'cuda.h': + ctypedef int CUdevice_v1 'CUdevice_v1' + + +cdef extern from 'cuda.h': + ctypedef unsigned long long CUtexObject_v1 'CUtexObject_v1' + + +cdef extern from 'cuda.h': + ctypedef unsigned long long CUsurfObject_v1 'CUsurfObject_v1' + + +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 CUmemLocation_st: + CUmemLocationType type + int id + ctypedef CUmemLocation_st CUmemLocation_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': + 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_pod34: + 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 + ctypedef CUdevSmResource_st CUdevSmResource + +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': + 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 CUcheckpointRestoreArgs_st: + cuuint64_t reserved[8] + ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + +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 extern from 'cuda.h': + ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount 'CUexecAffinitySmCount' + + +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR 'CUDA_ARRAY_DESCRIPTOR' + + +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR 'CUDA_ARRAY3D_DESCRIPTOR' + + +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 CUDA_ARRAY_MEMORY_REQUIREMENTS 'CUDA_ARRAY_MEMORY_REQUIREMENTS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC 'CUDA_TEXTURE_DESC' + + +cdef extern from 'cuda.h': + ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC 'CUDA_RESOURCE_VIEW_DESC' + + +cdef extern from 'cuda.h': + ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC' + + +cdef extern from 'cuda.h': + ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle 'CUmemGenericAllocationHandle' + + +cdef extern from 'cuda.h': + ctypedef CUmemLocation_v1 CUmemLocation 'CUmemLocation' + + +cdef extern from 'cuda.h': + ctypedef CUmulticastObjectProp_v1 CUmulticastObjectProp 'CUmulticastObjectProp' + + +cdef extern from 'cuda.h': + ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData 'CUmemPoolPtrExportData' + + +cdef extern from 'cuda.h': + ctypedef CUoffset3D_v1 CUoffset3D 'CUoffset3D' + + +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 + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + 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 + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + void** kernelParams + void** extra + CUkernel kern + CUcontext ctx + ctypedef CUDA_KERNEL_NODE_PARAMS_v2_st CUDA_KERNEL_NODE_PARAMS_v2 + +cdef extern from 'cuda.h': + cdef struct CUDA_KERNEL_NODE_PARAMS_v3_st: + CUfunction func + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + void** kernelParams + void** extra + CUkernel kern + CUcontext ctx + ctypedef CUDA_KERNEL_NODE_PARAMS_v3_st CUDA_KERNEL_NODE_PARAMS_v3 + +cdef struct cuda_bindings_driver__anon_pod12: + CUarray hArray + +cdef struct cuda_bindings_driver__anon_pod13: + CUmipmappedArray hMipmappedArray + +cdef union cuda_bindings_driver__anon_pod29: + CUmipmappedArray mipmap + CUarray array + +cdef struct cuda_bindings_driver__anon_pod5: + CUevent event + int flags + int triggerAtBlockStart + +cdef struct cuda_bindings_driver__anon_pod6: + CUevent event + int flags + +cdef extern from 'cuda.h': + cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: + CUevent event + ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS + +cdef extern from 'cuda.h': + cdef struct CUDA_EVENT_WAIT_NODE_PARAMS_st: + CUevent event + ctypedef CUDA_EVENT_WAIT_NODE_PARAMS_st CUDA_EVENT_WAIT_NODE_PARAMS + +cdef extern from 'cuda.h': + 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 + +cdef extern from 'cuda.h': + ctypedef void (*CUstreamCallback 'CUstreamCallback')( + CUstream hStream, + CUresult status, + void* userData + ) + + +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 + +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 extern from 'cuda.h': + cdef struct CUgraphExecUpdateResultInfo_st: + CUgraphExecUpdateResult result + CUgraphNode errorNode + CUgraphNode errorFromNode + ctypedef CUgraphExecUpdateResultInfo_st CUgraphExecUpdateResultInfo_v1 + +cdef struct cuda_bindings_driver__anon_pod8: + int deviceUpdatable + CUgraphDeviceNode devNode + +cdef union cuda_bindings_driver__anon_pod2: + cuda_bindings_driver__anon_pod3 overBudget + +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 + +cdef extern from 'cuda.h': + cdef struct CUDA_HOST_NODE_PARAMS_v2_st: + CUhostFn fn + void* userData + ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 + +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 + +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': + ctypedef struct CUDA_CONDITIONAL_NODE_PARAMS 'CUDA_CONDITIONAL_NODE_PARAMS': + CUgraphConditionalHandle handle + CUgraphConditionalNodeType type + unsigned int size + CUgraph* phGraph_out + CUcontext ctx + +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 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 + +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 + +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 + void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + size_t srcPitch + size_t dstXInBytes + size_t dstY + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + size_t dstPitch + size_t WidthInBytes + size_t Height + ctypedef CUDA_MEMCPY2D_st CUDA_MEMCPY2D_v2 + +cdef extern from 'cuda.h': + cdef struct CUDA_MEMCPY3D_st: + size_t srcXInBytes + size_t srcY + size_t srcZ + size_t srcLOD + CUmemorytype srcMemoryType + void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + void* reserved0 + size_t srcPitch + size_t srcHeight + size_t dstXInBytes + size_t dstY + size_t dstZ + size_t dstLOD + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + void* reserved1 + size_t dstPitch + size_t dstHeight + size_t WidthInBytes + size_t Height + size_t Depth + ctypedef CUDA_MEMCPY3D_st CUDA_MEMCPY3D_v2 + +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 + void* srcHost + CUdeviceptr srcDevice + CUarray srcArray + CUcontext srcContext + size_t srcPitch + size_t srcHeight + size_t dstXInBytes + size_t dstY + size_t dstZ + size_t dstLOD + CUmemorytype dstMemoryType + void* dstHost + CUdeviceptr dstDevice + CUarray dstArray + CUcontext dstContext + size_t dstPitch + size_t dstHeight + size_t WidthInBytes + size_t Height + size_t Depth + ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1 + +cdef struct cuda_bindings_driver__anon_pod14: + CUdeviceptr devPtr + CUarray_format format + unsigned int numChannels + size_t sizeInBytes + +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 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 + +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 + +cdef union cuda_bindings_driver__anon_pod33: + CUmemGenericAllocationHandle memHandle + +cdef extern from 'cuda.h': + cdef struct CUmemAllocationProp_st: + CUmemAllocationType type + CUmemAllocationHandleType requestedHandleTypes + CUmemLocation location + void* win32HandleMetaData + cuda_bindings_driver__anon_pod34 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 + +cdef extern from 'cuda.h': + cdef struct CUmemPoolProps_st: + CUmemAllocationType allocType + CUmemAllocationHandleType handleTypes + CUmemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char reserved[54] + ctypedef CUmemPoolProps_st CUmemPoolProps_v1 + +cdef extern from 'cuda.h': + cdef struct CUmemcpyAttributes_st: + CUmemcpySrcAccessOrder srcAccessOrder + CUmemLocation srcLocHint + CUmemLocation dstLocHint + unsigned int flags + ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 + +cdef struct cuda_bindings_driver__anon_pod36: + CUdeviceptr ptr + size_t rowLength + size_t layerHeight + CUmemLocation locHint + +cdef struct cuda_bindings_driver__anon_pod37: + CUarray array + CUoffset3D offset + +cdef extern from 'cuda.h': + ctypedef CUDA_KERNEL_NODE_PARAMS_v2 CUDA_KERNEL_NODE_PARAMS 'CUDA_KERNEL_NODE_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS 'CUDA_LAUNCH_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUgraphExecUpdateResultInfo_v1 CUgraphExecUpdateResultInfo 'CUgraphExecUpdateResultInfo' + + +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 + ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue + +cdef extern from 'cuda.h': + cdef struct CUasyncNotificationInfo_st: + CUasyncNotificationType type + cuda_bindings_driver__anon_pod2 info + ctypedef CUasyncNotificationInfo_st CUasyncNotificationInfo + +cdef extern from 'cuda.h': + ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS 'CUDA_HOST_NODE_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES 'CUDA_ARRAY_SPARSE_PROPERTIES' + + +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 + +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 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 + +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 extern from 'cuda.h': + cdef struct CUdevResource_st: + CUdevResourceType type + unsigned char _internal_padding[92] + CUdevSmResource sm + unsigned char _oversize[48] + ctypedef CUdevResource_st CUdevResource_v1 + +cdef extern from 'cuda.h': + cdef union CUstreamBatchMemOpParams_union: + CUstreamBatchMemOpType operation + CUstreamMemOpWaitValueParams_st waitValue + CUstreamMemOpWriteValueParams_st writeValue + CUstreamMemOpFlushRemoteWritesParams_st flushRemoteWrites + CUstreamMemOpMemoryBarrierParams_st memoryBarrier + cuuint64_t pad[6] + ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1 + +cdef extern from 'cuda.h': + ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS 'CUDA_MEMSET_NODE_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D 'CUDA_MEMCPY2D' + + +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D 'CUDA_MEMCPY3D' + + +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER 'CUDA_MEMCPY3D_PEER' + + +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 extern from 'cuda.h': + cdef struct CUexecAffinityParam_st: + CUexecAffinityType type + cuda_bindings_driver__anon_pod9 param + ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1 + +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 extern from 'cuda.h': + cdef struct CUarrayMapInfo_st: + CUresourcetype resourceType + cuda_bindings_driver__anon_pod29 resource + CUarraySparseSubresourceType subresourceType + cuda_bindings_driver__anon_pod30 subresource + CUmemOperationType memOperationType + CUmemHandleType memHandleType + 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 + +cdef extern from 'cuda.h': + ctypedef CUmemAllocationProp_v1 CUmemAllocationProp 'CUmemAllocationProp' + + +cdef extern from 'cuda.h': + ctypedef CUmemAccessDesc_v1 CUmemAccessDesc 'CUmemAccessDesc' + + +cdef extern from 'cuda.h': + ctypedef CUmemPoolProps_v1 CUmemPoolProps 'CUmemPoolProps' + + +cdef extern from 'cuda.h': + ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes 'CUmemcpyAttributes' + + +cdef union cuda_bindings_driver__anon_pod35: + cuda_bindings_driver__anon_pod36 ptr + cuda_bindings_driver__anon_pod37 array + +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeValue CUkernelNodeAttrValue_v1 'CUkernelNodeAttrValue_v1' + + +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeValue CUstreamAttrValue_v1 'CUstreamAttrValue_v1' + + +cdef extern from 'cuda.h': + cdef struct CUlaunchAttribute_st: + CUlaunchAttributeID id + CUlaunchAttributeValue value + ctypedef CUlaunchAttribute_st CUlaunchAttribute + +cdef extern from 'cuda.h': + ctypedef void (*CUasyncCallback 'CUasyncCallback')( + CUasyncNotificationInfo* info, + void* userData, + CUasyncCallbackHandle callback + ) + + +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC' + + +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC' + + +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUdevResource_v1 CUdevResource 'CUdevResource' + + +cdef extern from 'cuda.h': + ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams 'CUstreamBatchMemOpParams' + + +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 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 + +cdef extern from 'cuda.h': + ctypedef CUexecAffinityParam_v1 CUexecAffinityParam 'CUexecAffinityParam' + + +cdef extern from 'cuda.h': + ctypedef CUarrayMapInfo_v1 CUarrayMapInfo 'CUarrayMapInfo' + + +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 + +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 + +cdef extern from 'cuda.h': + cdef struct CUmemcpy3DOperand_st: + CUmemcpy3DOperandType type + cuda_bindings_driver__anon_pod35 op + ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 + +cdef extern from 'cuda.h': + ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue 'CUkernelNodeAttrValue' + + +cdef extern from 'cuda.h': + ctypedef CUstreamAttrValue_v1 CUstreamAttrValue 'CUstreamAttrValue' + + +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 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 + +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 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 + +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 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 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 + +cdef extern from 'cuda.h': + ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC 'CUDA_RESOURCE_DESC' + + +cdef extern from 'cuda.h': + cdef struct CUctxCreateParams_st: + CUexecAffinityParam* execAffinityParams + int numExecAffinityParams + CUctxCigParam* cigParams + ctypedef CUctxCreateParams_st CUctxCreateParams + +cdef extern from 'cuda.h': + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS 'CUDA_MEM_ALLOC_NODE_PARAMS' + + +cdef extern from 'cuda.h': + ctypedef CUmemcpy3DOperand_v1 CUmemcpy3DOperand 'CUmemcpy3DOperand' + + +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' + + +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' + + +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' + + +cdef extern from 'cuda.h': + 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 + +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 + long long reserved2 + ctypedef CUgraphNodeParams_st CUgraphNodeParams + +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_BATCH_OP_v1 CUDA_MEMCPY3D_BATCH_OP 'CUDA_MEMCPY3D_BATCH_OP' + + + +# 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 CUeglStreamConnection_st* CUeglStreamConnection + +cdef union anon_union16: + CUarray pArray[3] + void* pPitch[3] + +cdef struct CUeglFrame_st: + anon_union16 frame + unsigned int width + unsigned int height + unsigned int depth + unsigned int pitch + unsigned int planeCount + unsigned int numChannels + CUeglFrameType frameType + CUeglColorFormat eglColorFormat + CUarray_format cuFormat + +ctypedef CUeglFrame_st CUeglFrame_v1 + +ctypedef CUeglFrame_v1 CUeglFrame + +cdef enum CUGLDeviceList_enum: + CU_GL_DEVICE_LIST_ALL = 1 + CU_GL_DEVICE_LIST_CURRENT_FRAME = 2 + CU_GL_DEVICE_LIST_NEXT_FRAME = 3 + +ctypedef CUGLDeviceList_enum CUGLDeviceList + + +# FUNCS +cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceTotalMem(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxCreate(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetGlobal(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 +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 +cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +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 cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetAddress(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 +cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remaining, unsigned int useFlags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil +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 +cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil + + +# TODO: Extract these defines somehow? + +cdef enum: CU_IPC_HANDLE_SIZE = 64 + +cdef enum: CU_STREAM_LEGACY = 1 + +cdef enum: CU_STREAM_PER_THREAD = 2 + +cdef enum: CU_COMPUTE_ACCELERATED_TARGET_BASE = 65536 + +cdef enum: CU_COMPUTE_FAMILY_TARGET_BASE = 131072 + +cdef enum: CU_GRAPH_COND_ASSIGN_DEFAULT = 1 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1 + +cdef enum: CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = 2 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = 4 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = 8 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13 + +cdef enum: CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 14 + +cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 + +cdef enum: CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3 + +cdef enum: CU_STREAM_ATTRIBUTE_PRIORITY = 8 + +cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 + +cdef enum: CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 + +cdef enum: CU_MEMHOSTALLOC_PORTABLE = 1 + +cdef enum: CU_MEMHOSTALLOC_DEVICEMAP = 2 + +cdef enum: CU_MEMHOSTALLOC_WRITECOMBINED = 4 + +cdef enum: CU_MEMHOSTREGISTER_PORTABLE = 1 + +cdef enum: CU_MEMHOSTREGISTER_DEVICEMAP = 2 + +cdef enum: CU_MEMHOSTREGISTER_IOMEMORY = 4 + +cdef enum: CU_MEMHOSTREGISTER_READ_ONLY = 8 + +cdef enum: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = 1 + +cdef enum: CU_TENSOR_MAP_NUM_QWORDS = 16 + +cdef enum: CUDA_EXTERNAL_MEMORY_DEDICATED = 1 + +cdef enum: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = 1 + +cdef enum: CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = 2 + +cdef enum: CUDA_NVSCISYNC_ATTR_SIGNAL = 1 + +cdef enum: CUDA_NVSCISYNC_ATTR_WAIT = 2 + +cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1 + +cdef enum: CU_MEM_CREATE_USAGE_HW_DECOMPRESS = 2 + + +cdef enum: CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS = 2 + +cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1 + +cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = 2 + +cdef enum: CUDA_ARRAY3D_LAYERED = 1 + +cdef enum: CUDA_ARRAY3D_2DARRAY = 1 + +cdef enum: CUDA_ARRAY3D_SURFACE_LDST = 2 + +cdef enum: CUDA_ARRAY3D_CUBEMAP = 4 + +cdef enum: CUDA_ARRAY3D_TEXTURE_GATHER = 8 + +cdef enum: CUDA_ARRAY3D_DEPTH_TEXTURE = 16 + +cdef enum: CUDA_ARRAY3D_COLOR_ATTACHMENT = 32 + +cdef enum: CUDA_ARRAY3D_SPARSE = 64 + +cdef enum: CUDA_ARRAY3D_DEFERRED_MAPPING = 128 + +cdef enum: CUDA_ARRAY3D_VIDEO_ENCODE_DECODE = 256 + +cdef enum: CU_TRSA_OVERRIDE_FORMAT = 1 + +cdef enum: CU_TRSF_READ_AS_INTEGER = 1 + +cdef enum: CU_TRSF_NORMALIZED_COORDINATES = 2 + +cdef enum: CU_TRSF_SRGB = 16 + +cdef enum: CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32 + +cdef enum: CU_TRSF_SEAMLESS_CUBEMAP = 64 + +cdef enum: CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM = 1 + +cdef enum: CU_LAUNCH_PARAM_END_AS_INT = 0 + +cdef enum: CU_LAUNCH_PARAM_END = 0 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = 1 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_POINTER = 1 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = 2 + +cdef enum: CU_LAUNCH_PARAM_BUFFER_SIZE = 2 + +cdef enum: CU_PARAM_TR_DEFAULT = -1 + +cdef enum: CU_DEVICE_CPU = -1 + +cdef enum: CU_DEVICE_INVALID = -2 + +cdef enum: MAX_PLANES = 3 + +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_12/cuda/bindings/cydriver.pyx b/cuda_bindings_12/cuda/bindings/cydriver.pyx new file mode 100644 index 00000000000..403481bd9cf --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cydriver.pyx @@ -0,0 +1,1939 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b8293f7b94123dad8c0eadad09ece6c5262e4b28a733663b74e3601edcfac791 +from ._internal cimport driver as _driver + +cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGetErrorString(error, pStr) + + +cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGetErrorName(error, pStr) + + +cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuInit(Flags) + + +cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDriverGetVersion(driverVersion) + + +cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGet(device, ordinal) + + +cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetCount(count) + + +cdef CUresult cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetName(name, len, dev) + + +cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetUuid(uuid, dev) + + +cdef CUresult cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetUuid_v2(uuid, dev) + + +cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetLuid(luid, deviceNodeMask, dev) + + +cdef CUresult cuDeviceTotalMem(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceTotalMem_v2(bytes, dev) + + +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) + + +cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetAttribute(pi, attrib, dev) + + +cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, flags) + + +cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceSetMemPool(dev, pool) + + +cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetMemPool(pool, dev) + + +cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetDefaultMemPool(pool_out, dev) + + +cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetExecAffinitySupport(pi, type, dev) + + +cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFlushGPUDirectRDMAWrites(target, scope) + + +cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetProperties(prop, dev) + + +cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceComputeCapability(major, minor, dev) + + +cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevicePrimaryCtxRetain(pctx, dev) + + +cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevicePrimaryCtxRelease_v2(dev) + + +cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevicePrimaryCtxSetFlags_v2(dev, flags) + + +cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevicePrimaryCtxGetState(dev, flags, active) + + +cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevicePrimaryCtxReset_v2(dev) + + +cdef CUresult cuCtxCreate(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) + + +cdef CUresult cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxCreate_v4(pctx, ctxCreateParams, flags, dev) + + +cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxDestroy_v2(ctx) + + +cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxPushCurrent_v2(ctx) + + +cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxPopCurrent_v2(pctx) + + +cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSetCurrent(ctx) + + +cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetCurrent(pctx) + + +cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetDevice(device) + + +cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetFlags(flags) + + +cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSetFlags(flags) + + +cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetId(ctx, ctxId) + + +cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSynchronize() + + +cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSetLimit(limit, value) + + +cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetLimit(pvalue, limit) + + +cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetCacheConfig(pconfig) + + +cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSetCacheConfig(config) + + +cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetApiVersion(ctx, version) + + +cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority) + + +cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxResetPersistingL2Cache() + + +cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetExecAffinity(pExecAffinity, type) + + +cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxRecordEvent(hCtx, hEvent) + + +cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxWaitEvent(hCtx, hEvent) + + +cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxAttach(pctx, flags) + + +cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxDetach(ctx) + + +cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetSharedMemConfig(pConfig) + + +cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSetSharedMemConfig(config) + + +cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleLoad(module, fname) + + +cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuModuleLoadDataEx(module, image, numOptions, options, optionValues) + + +cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleLoadFatBinary(module, fatCubin) + + +cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleUnload(hmod) + + +cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleGetLoadingMode(mode) + + +cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleGetFunction(hfunc, hmod, name) + + +cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleGetFunctionCount(count, mod) + + +cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleEnumerateFunctions(functions, numFunctions, mod) + + +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) + + +cdef CUresult cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLinkCreate_v2(numOptions, options, optionValues, stateOut) + + +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) + + +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) + + +cdef CUresult cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLinkComplete(state, cubinOut, sizeOut) + + +cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLinkDestroy(state) + + +cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleGetTexRef(pTexRef, hmod, name) + + +cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + + +cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryUnload(library) + + +cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetKernel(pKernel, library, name) + + +cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetKernelCount(count, lib) + + +cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryEnumerateKernels(kernels, numKernels, lib) + + +cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetModule(pMod, library) + + +cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetFunction(pFunc, kernel) + + +cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetLibrary(pLib, kernel) + + +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) + + +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) + + +cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetUnifiedFunction(fptr, library, symbol) + + +cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetAttribute(pi, attrib, kernel, dev) + + +cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelSetAttribute(attrib, val, kernel, dev) + + +cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelSetCacheConfig(kernel, config, dev) + + +cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetName(name, hfunc) + + +cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetParamInfo(kernel, paramIndex, paramOffset, paramSize) + + +cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetInfo_v2(free, total) + + +cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAlloc_v2(dptr, bytesize) + + +cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAllocPitch_v2(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) + + +cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemFree_v2(dptr) + + +cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetAddressRange_v2(pbase, psize, dptr) + + +cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAllocHost_v2(pp, bytesize) + + +cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemFreeHost(p) + + +cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemHostAlloc(pp, bytesize, Flags) + + +cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemHostGetDevicePointer_v2(pdptr, p, Flags) + + +cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemHostGetFlags(pFlags, p) + + +cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAllocManaged(dptr, bytesize, flags) + + +cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) + + +cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceUnregisterAsyncNotification(device, callback) + + +cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetByPCIBusId(dev, pciBusId) + + +cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetPCIBusId(pciBusId, len, dev) + + +cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuIpcGetEventHandle(pHandle, event) + + +cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuIpcOpenEventHandle(phEvent, handle) + + +cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuIpcGetMemHandle(pHandle, dptr) + + +cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuIpcOpenMemHandle_v2(pdptr, handle, Flags) + + +cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuIpcCloseMemHandle(dptr) + + +cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemHostRegister_v2(p, bytesize, Flags) + + +cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemHostUnregister(p) + + +cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy(dst, src, ByteCount) + + +cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, ByteCount) + + +cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyHtoD_v2(dstDevice, srcHost, ByteCount) + + +cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyDtoH_v2(dstHost, srcDevice, ByteCount) + + +cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyDtoD_v2(dstDevice, srcDevice, ByteCount) + + +cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyDtoA_v2(dstArray, dstOffset, srcDevice, ByteCount) + + +cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyAtoD_v2(dstDevice, srcArray, srcOffset, ByteCount) + + +cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyHtoA_v2(dstArray, dstOffset, srcHost, ByteCount) + + +cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyAtoH_v2(dstHost, srcArray, srcOffset, ByteCount) + + +cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyAtoA_v2(dstArray, dstOffset, srcArray, srcOffset, ByteCount) + + +cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy2D_v2(pCopy) + + +cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy2DUnaligned_v2(pCopy) + + +cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3D_v2(pCopy) + + +cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3DPeer(pCopy) + + +cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) + + +cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyHtoDAsync_v2(dstDevice, srcHost, ByteCount, hStream) + + +cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyDtoHAsync_v2(dstHost, srcDevice, ByteCount, hStream) + + +cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyDtoDAsync_v2(dstDevice, srcDevice, ByteCount, hStream) + + +cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyHtoAAsync_v2(dstArray, dstOffset, srcHost, ByteCount, hStream) + + +cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyAtoHAsync_v2(dstHost, srcArray, srcOffset, ByteCount, hStream) + + +cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy2DAsync_v2(pCopy, hStream) + + +cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3DAsync_v2(pCopy, hStream) + + +cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3DPeerAsync(pCopy, hStream) + + +cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, hStream) + + +cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, size_t* failIdx, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3DBatchAsync(numOps, opList, failIdx, flags, hStream) + + +cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD8_v2(dstDevice, uc, N) + + +cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD16_v2(dstDevice, us, N) + + +cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD32_v2(dstDevice, ui, N) + + +cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD2D8_v2(dstDevice, dstPitch, uc, Width, Height) + + +cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD2D16_v2(dstDevice, dstPitch, us, Width, Height) + + +cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuMemsetD8Async(dstDevice, uc, N, hStream) + + +cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemsetD16Async(dstDevice, us, N, hStream) + + +cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._cuMemsetD2D32Async(dstDevice, dstPitch, ui, Width, Height, hStream) + + +cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayCreate_v2(pHandle, pAllocateArray) + + +cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayGetDescriptor_v2(pArrayDescriptor, hArray) + + +cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayGetSparseProperties(sparseProperties, array) + + +cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMipmappedArrayGetSparseProperties(sparseProperties, mipmap) + + +cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayGetMemoryRequirements(memoryRequirements, array, device) + + +cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) + + +cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayGetPlane(pPlaneArray, hArray, planeIdx) + + +cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArrayDestroy(hArray) + + +cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArray3DCreate_v2(pHandle, pAllocateArray) + + +cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuArray3DGetDescriptor_v2(pArrayDescriptor, hArray) + + +cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMipmappedArrayCreate(pHandle, pMipmappedArrayDesc, numMipmapLevels) + + +cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMipmappedArrayGetLevel(pLevelArray, hMipmappedArray, level) + + +cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMipmappedArrayDestroy(hMipmappedArray) + + +cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuMemAddressReserve(ptr, size, alignment, addr, flags) + + +cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAddressFree(ptr, size) + + +cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemCreate(handle, size, prop, flags) + + +cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuMemMap(ptr, size, offset, handle, flags) + + +cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemMapArrayAsync(mapInfoList, count, hStream) + + +cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemUnmap(ptr, size) + + +cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemSetAccess(ptr, size, desc, count) + + +cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetAccess(flags, location, ptr) + + +cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemExportToShareableHandle(shareableHandle, handle, handleType, flags) + + +cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemImportFromShareableHandle(handle, osHandle, shHandleType) + + +cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetAllocationGranularity(granularity, prop, option) + + +cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetAllocationPropertiesFromHandle(prop, handle) + + +cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemRetainAllocationHandle(handle, addr) + + +cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemFreeAsync(dptr, hStream) + + +cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAllocAsync(dptr, bytesize, hStream) + + +cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolTrimTo(pool, minBytesToKeep) + + +cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolSetAttribute(pool, attr, value) + + +cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolGetAttribute(pool, attr, value) + + +cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolSetAccess(pool, map, count) + + +cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolGetAccess(flags, memPool, location) + + +cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolCreate(pool, poolProps) + + +cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolDestroy(pool) + + +cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuMemPoolImportFromShareableHandle(pool_out, handle, handleType, flags) + + +cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolExportPointer(shareData_out, ptr) + + +cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPoolImportPointer(ptr_out, pool, shareData) + + +cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMulticastCreate(mcHandle, prop) + + +cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._cuMulticastUnbind(mcHandle, dev, mcOffset, size) + + +cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMulticastGetGranularity(granularity, prop, option) + + +cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuPointerGetAttribute(data, attribute, ptr) + + +cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPrefetchAsync(devPtr, count, dstDevice, hStream) + + +cdef CUresult cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemPrefetchAsync_v2(devPtr, count, location, flags, hStream) + + +cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemAdvise(devPtr, count, advice, device) + + +cdef CUresult cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) + + +cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuPointerSetAttribute(value, attribute, ptr) + + +cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuPointerGetAttributes(numAttributes, attributes, data, ptr) + + +cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamCreate(phStream, Flags) + + +cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamCreateWithPriority(phStream, flags, priority) + + +cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetPriority(hStream, priority) + + +cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetDevice(hStream, device) + + +cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetFlags(hStream, flags) + + +cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetId(hStream, streamId) + + +cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetCtx(hStream, pctx) + + +cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetCtx_v2(hStream, pCtx, pGreenCtx) + + +cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamWaitEvent(hStream, hEvent, Flags) + + +cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamAddCallback(hStream, callback, userData, flags) + + +cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode) + + +cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuThreadExchangeStreamCaptureMode(mode) + + +cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamEndCapture(hStream, phGraph) + + +cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamIsCapturing(hStream, captureStatus) + + +cdef CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuStreamGetCaptureInfo_v3(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + + +cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamUpdateCaptureDependencies(hStream, dependencies, numDependencies, flags) + + +cdef CUresult cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuStreamAttachMemAsync(hStream, dptr, length, flags) + + +cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamQuery(hStream) + + +cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamSynchronize(hStream) + + +cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamDestroy_v2(hStream) + + +cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamCopyAttributes(dst, src) + + +cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetAttribute(hStream, attr, value_out) + + +cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamSetAttribute(hStream, attr, value) + + +cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventCreate(phEvent, Flags) + + +cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventRecord(hEvent, hStream) + + +cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventRecordWithFlags(hEvent, hStream, flags) + + +cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventQuery(hEvent) + + +cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventSynchronize(hEvent) + + +cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventDestroy_v2(hEvent) + + +cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventElapsedTime(pMilliseconds, hStart, hEnd) + + +cdef CUresult cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventElapsedTime_v2(pMilliseconds, hStart, hEnd) + + +cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuImportExternalMemory(extMem_out, memHandleDesc) + + +cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) + + +cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDestroyExternalMemory(extMem) + + +cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) + + +cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDestroyExternalSemaphore(extSem) + + +cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamWaitValue32_v2(stream, addr, value, flags) + + +cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamWaitValue64_v2(stream, addr, value, flags) + + +cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamWriteValue32_v2(stream, addr, value, flags) + + +cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamWriteValue64_v2(stream, addr, value, flags) + + +cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamBatchMemOp_v2(stream, count, paramArray, flags) + + +cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncGetAttribute(pi, attrib, hfunc) + + +cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetAttribute(hfunc, attrib, value) + + +cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetCacheConfig(hfunc, config) + + +cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncGetModule(hmod, hfunc) + + +cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncGetName(name, hfunc) + + +cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncGetParamInfo(func, paramIndex, paramOffset, paramSize) + + +cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncIsLoaded(state, function) + + +cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._cuLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags) + + +cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLaunchHostFunc(hStream, fn, userData) + + +cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetBlockShape(hfunc, x, y, z) + + +cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetSharedSize(hfunc, bytes) + + +cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuParamSetSize(hfunc, numbytes) + + +cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuParamSeti(hfunc, offset, value) + + +cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuParamSetf(hfunc, offset, value) + + +cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuParamSetv(hfunc, offset, ptr, numbytes) + + +cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLaunch(f) + + +cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuLaunchGridAsync(f, grid_width, grid_height, hStream) + + +cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuParamSetTexRef(hfunc, texunit, hTexRef) + + +cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetSharedMemConfig(hfunc, config) + + +cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphCreate(phGraph, flags) + + +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 _driver._cuGraphAddKernelNode_v2(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphKernelNodeGetParams_v2(hNode, nodeParams) + + +cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddMemcpyNode(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) + + +cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphMemcpyNodeGetParams(hNode, nodeParams) + + +cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddMemsetNode(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) + + +cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphMemsetNodeGetParams(hNode, nodeParams) + + +cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddHostNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphHostNodeGetParams(hNode, nodeParams) + + +cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphHostNodeSetParams(hNode, nodeParams) + + +cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddChildGraphNode(phGraphNode, hGraph, dependencies, numDependencies, childGraph) + + +cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphChildGraphNodeGetGraph(hNode, phGraph) + + +cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddEventRecordNode(phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphEventRecordNodeGetEvent(hNode, event_out) + + +cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphEventRecordNodeSetEvent(hNode, event) + + +cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddEventWaitNode(phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphEventWaitNodeGetEvent(hNode, event_out) + + +cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) + + +cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) + + +cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuGraphBatchMemOpNodeGetParams(hNode, nodeParams_out) + + +cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphBatchMemOpNodeSetParams(hNode, nodeParams) + + +cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddMemAllocNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphAddMemFreeNode(phGraphNode, hGraph, dependencies, numDependencies, dptr) + + +cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphMemFreeNodeGetParams(hNode, dptr_out) + + +cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGraphMemTrim(device) + + +cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetGraphMemAttribute(device, attr, value) + + +cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceSetGraphMemAttribute(device, attr, value) + + +cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphClone(phGraphClone, originalGraph) + + +cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeFindInClone(phNode, hOriginalNode, hClonedGraph) + + +cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetType(hNode, type) + + +cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphGetNodes(hGraph, nodes, numNodes) + + +cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphGetRootNodes(hGraph, rootNodes, numRootNodes) + + +cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphGetEdges(hGraph, from_, to, numEdges) + + +cdef CUresult cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphGetEdges_v2(hGraph, from_, to, edgeData, numEdges) + + +cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetDependencies(hNode, dependencies, numDependencies) + + +cdef CUresult cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetDependencies_v2(hNode, dependencies, edgeData, numDependencies) + + +cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetDependentNodes(hNode, dependentNodes, numDependentNodes) + + +cdef CUresult cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetDependentNodes_v2(hNode, dependentNodes, edgeData, numDependentNodes) + + +cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddDependencies(hGraph, from_, to, numDependencies) + + +cdef CUresult cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddDependencies_v2(hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphRemoveDependencies(hGraph, from_, to, 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: + return _driver._cuGraphRemoveDependencies_v2(hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphDestroyNode(hNode) + + +cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphInstantiateWithFlags(phGraphExec, hGraph, flags) + + +cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphInstantiateWithParams(phGraphExec, hGraph, instantiateParams) + + +cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecGetFlags(hGraphExec, flags) + + +cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecKernelNodeSetParams_v2(hGraphExec, hNode, nodeParams) + + +cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams, ctx) + + +cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams) + + +cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph) + + +cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) + + +cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) + + +cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) + + +cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) + + +cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphUpload(hGraphExec, hStream) + + +cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphLaunch(hGraphExec, hStream) + + +cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecDestroy(hGraphExec) + + +cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphDestroy(hGraph) + + +cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecUpdate_v2(hGraphExec, hGraph, resultInfo) + + +cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphKernelNodeCopyAttributes(dst, src) + + +cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphKernelNodeGetAttribute(hNode, attr, value_out) + + +cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphKernelNodeSetAttribute(hNode, attr, value) + + +cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) + + +cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuUserObjectRetain(object, count) + + +cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuUserObjectRelease(object, count) + + +cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphRetainUserObject(graph, object, count, flags) + + +cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphReleaseUserObject(graph, object, count) + + +cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +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: + return _driver._cuGraphAddNode_v2(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeSetParams(hNode, nodeParams) + + +cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) + + +cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuOccupancyMaxPotentialClusterSize(clusterSize, func, config) + + +cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuOccupancyMaxActiveClusters(numClusters, func, config) + + +cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetArray(hTexRef, hArray, Flags) + + +cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, Flags) + + +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) + + +cdef CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetAddress2D_v3(hTexRef, desc, dptr, Pitch) + + +cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetFormat(hTexRef, fmt, NumPackedComponents) + + +cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetAddressMode(hTexRef, dim, am) + + +cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetFilterMode(hTexRef, fm) + + +cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetMipmapFilterMode(hTexRef, fm) + + +cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetMipmapLevelBias(hTexRef, bias) + + +cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetMipmapLevelClamp(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) + + +cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetMaxAnisotropy(hTexRef, maxAniso) + + +cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetBorderColor(hTexRef, pBorderColor) + + +cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetFlags(hTexRef, Flags) + + +cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetAddress_v2(pdptr, hTexRef) + + +cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetArray(phArray, hTexRef) + + +cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetMipmappedArray(phMipmappedArray, hTexRef) + + +cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetAddressMode(pam, hTexRef, dim) + + +cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetFilterMode(pfm, hTexRef) + + +cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetFormat(pFormat, pNumChannels, hTexRef) + + +cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetMipmapFilterMode(pfm, hTexRef) + + +cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetMipmapLevelBias(pbias, hTexRef) + + +cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetMipmapLevelClamp(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) + + +cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetMaxAnisotropy(pmaxAniso, hTexRef) + + +cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetBorderColor(pBorderColor, hTexRef) + + +cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefGetFlags(pFlags, hTexRef) + + +cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefCreate(pTexRef) + + +cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefDestroy(hTexRef) + + +cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuSurfRefSetArray(hSurfRef, hArray, Flags) + + +cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._cuTexObjectCreate(pTexObject, pResDesc, pTexDesc, pResViewDesc) + + +cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexObjectDestroy(texObject) + + +cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexObjectGetResourceDesc(pResDesc, texObject) + + +cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexObjectGetTextureDesc(pTexDesc, texObject) + + +cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexObjectGetResourceViewDesc(pResViewDesc, texObject) + + +cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuSurfObjectCreate(pSurfObject, pResDesc) + + +cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuSurfObjectDestroy(surfObject) + + +cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._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: + return _driver._cuTensorMapReplaceAddress(tensorMap, globalAddress) + + +cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceCanAccessPeer(canAccessPeer, dev, peerDev) + + +cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxEnablePeerAccess(peerContext, Flags) + + +cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxDisablePeerAccess(peerContext) + + +cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetP2PAttribute(value, attrib, srcDevice, dstDevice) + + +cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsUnregisterResource(resource) + + +cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsSubResourceGetMappedArray(pArray, resource, arrayIndex, mipLevel) + + +cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray, resource) + + +cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsResourceGetMappedPointer_v2(pDevPtr, pSize, resource) + + +cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsResourceSetMapFlags_v2(resource, flags) + + +cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsMapResources(count, resources, hStream) + + +cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsUnmapResources(count, resources, hStream) + + +cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGetProcAddress_v2(symbol, pfn, cudaVersion, flags, symbolStatus) + + +cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpGetAttribute(attrib, value, size) + + +cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpGetAttributeGlobal(attrib, value, size) + + +cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpSetAttribute(attrib, value, size) + + +cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpSetAttributeGlobal(attrib, value, size) + + +cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGetExportTable(ppExportTable, pExportTableId) + + +cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxCreate(phCtx, desc, dev, flags) + + +cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxDestroy(hCtx) + + +cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxFromGreenCtx(pContext, hCtx) + + +cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetDevResource(device, resource, type) + + +cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetDevResource(hCtx, resource, type) + + +cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxGetDevResource(hCtx, resource, type) + + +cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remaining, unsigned int useFlags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevSmResourceSplitByCount(result, nbGroups, input, remaining, useFlags, minCount) + + +cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevResourceGenerateDesc(phDesc, resources, nbResources) + + +cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxRecordEvent(hCtx, hEvent) + + +cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxWaitEvent(hCtx, hEvent) + + +cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetGreenCtx(hStream, phCtx) + + +cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxStreamCreate(phStream, greenCtx, flags, priority) + + +cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogsRegisterCallback(callbackFunc, userData, callback_out) + + +cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogsUnregisterCallback(callback) + + +cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogsCurrent(iterator_out, flags) + + +cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogsDumpToFile(iterator, pathToFile, flags) + + +cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogsDumpToMemory(iterator, buffer, size, flags) + + +cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessGetRestoreThreadId(pid, tid) + + +cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessGetState(pid, state) + + +cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessLock(pid, args) + + +cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessCheckpoint(pid, args) + + +cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessRestore(pid, args) + + +cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointProcessUnlock(pid, args) + + +cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) + + +cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamConsumerConnect(conn, stream) + + +cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamConsumerConnectWithFlags(conn, stream, flags) + + +cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamConsumerDisconnect(conn) + + +cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + + +cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + + +cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamProducerConnect(conn, stream, width, height) + + +cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamProducerDisconnect(conn) + + +cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamProducerPresentFrame(conn, eglframe, pStream) + + +cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEGLStreamProducerReturnFrame(conn, eglframe, pStream) + + +cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) + + +cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) + + +cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsGLRegisterBuffer(pCudaResource, buffer, Flags) + + +cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsGLRegisterImage(pCudaResource, image, target, Flags) + + +cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: + 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() + + +cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuVDPAUGetDevice(pDevice, vdpDevice, vdpGetProcAddress) + + +cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuVDPAUCtxCreate_v2(pCtx, flags, device, vdpDevice, vdpGetProcAddress) + + +cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsVDPAURegisterVideoSurface(pCudaResource, vdpSurface, flags) + + +cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphicsVDPAURegisterOutputSurface(pCudaResource, vdpSurface, flags) diff --git a/cuda_bindings_12/cuda/bindings/cynvfatbin.pxd b/cuda_bindings_12/cuda/bindings/cynvfatbin.pxd new file mode 100644 index 00000000000..503520b21c6 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvfatbin.pxd @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. + + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=98d5f975bf907917386bb6f6ef0dd0f6dc1a52c8068be876935a0a80554a8d8e +ctypedef enum nvFatbinResult "nvFatbinResult": + NVFATBIN_SUCCESS "NVFATBIN_SUCCESS" = 0 + NVFATBIN_ERROR_INTERNAL "NVFATBIN_ERROR_INTERNAL" + NVFATBIN_ERROR_ELF_ARCH_MISMATCH "NVFATBIN_ERROR_ELF_ARCH_MISMATCH" + NVFATBIN_ERROR_ELF_SIZE_MISMATCH "NVFATBIN_ERROR_ELF_SIZE_MISMATCH" + NVFATBIN_ERROR_MISSING_PTX_VERSION "NVFATBIN_ERROR_MISSING_PTX_VERSION" + NVFATBIN_ERROR_NULL_POINTER "NVFATBIN_ERROR_NULL_POINTER" + NVFATBIN_ERROR_COMPRESSION_FAILED "NVFATBIN_ERROR_COMPRESSION_FAILED" + NVFATBIN_ERROR_COMPRESSED_SIZE_EXCEEDED "NVFATBIN_ERROR_COMPRESSED_SIZE_EXCEEDED" + NVFATBIN_ERROR_UNRECOGNIZED_OPTION "NVFATBIN_ERROR_UNRECOGNIZED_OPTION" + NVFATBIN_ERROR_INVALID_ARCH "NVFATBIN_ERROR_INVALID_ARCH" + NVFATBIN_ERROR_INVALID_NVVM "NVFATBIN_ERROR_INVALID_NVVM" + NVFATBIN_ERROR_EMPTY_INPUT "NVFATBIN_ERROR_EMPTY_INPUT" + NVFATBIN_ERROR_MISSING_PTX_ARCH "NVFATBIN_ERROR_MISSING_PTX_ARCH" + NVFATBIN_ERROR_PTX_ARCH_MISMATCH "NVFATBIN_ERROR_PTX_ARCH_MISMATCH" + NVFATBIN_ERROR_MISSING_FATBIN "NVFATBIN_ERROR_MISSING_FATBIN" + NVFATBIN_ERROR_INVALID_INDEX "NVFATBIN_ERROR_INVALID_INDEX" + NVFATBIN_ERROR_IDENTIFIER_REUSE "NVFATBIN_ERROR_IDENTIFIER_REUSE" + NVFATBIN_ERROR_INTERNAL_PTX_OPTION "NVFATBIN_ERROR_INTERNAL_PTX_OPTION" + _NVFATBINRESULT_INTERNAL_LOADING_ERROR "_NVFATBINRESULT_INTERNAL_LOADING_ERROR" = -42 + + +# types +ctypedef void* nvFatbinHandle 'nvFatbinHandle' + + +############################################################################### +# Functions +############################################################################### + +cdef const char* nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil +cdef nvFatbinResult nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/cynvfatbin.pyx b/cuda_bindings_12/cuda/bindings/cynvfatbin.pyx new file mode 100644 index 00000000000..86bdd89f0f3 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvfatbin.pyx @@ -0,0 +1,60 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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 + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* nvFatbinGetErrorString(nvFatbinResult result) except?NULL nogil: + return _nvfatbin._nvFatbinGetErrorString(result) + + +cdef nvFatbinResult nvFatbinCreate(nvFatbinHandle* handle_indirect, const char** options, size_t optionsCount) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinCreate(handle_indirect, options, optionsCount) + + +cdef nvFatbinResult nvFatbinDestroy(nvFatbinHandle* handle_indirect) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinDestroy(handle_indirect) + + +cdef nvFatbinResult nvFatbinAddPTX(nvFatbinHandle handle, const char* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinAddPTX(handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult nvFatbinAddCubin(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinAddCubin(handle, code, size, arch, identifier) + + +cdef nvFatbinResult nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, size_t size, const char* arch, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinAddLTOIR(handle, code, size, arch, identifier, optionsCmdLine) + + +cdef nvFatbinResult nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinSize(handle, size) + + +cdef nvFatbinResult nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinGet(handle, buffer) + + +cdef nvFatbinResult nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + 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) + + +cdef nvFatbinResult nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinAddTileIR(handle, code, size, identifier, optionsCmdLine) diff --git a/cuda_bindings_12/cuda/bindings/cynvjitlink.pxd b/cuda_bindings_12/cuda/bindings/cynvjitlink.pxd new file mode 100644 index 00000000000..6a93bc269de --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvjitlink.pxd @@ -0,0 +1,80 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. + + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d5650f46aa9baca8a379aa5dece6b9069474ad81e53b0af898fe89e0095f4e8f + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +ctypedef enum nvJitLinkResult "nvJitLinkResult": + NVJITLINK_SUCCESS "NVJITLINK_SUCCESS" = 0 + NVJITLINK_ERROR_UNRECOGNIZED_OPTION "NVJITLINK_ERROR_UNRECOGNIZED_OPTION" + NVJITLINK_ERROR_MISSING_ARCH "NVJITLINK_ERROR_MISSING_ARCH" + NVJITLINK_ERROR_INVALID_INPUT "NVJITLINK_ERROR_INVALID_INPUT" + NVJITLINK_ERROR_PTX_COMPILE "NVJITLINK_ERROR_PTX_COMPILE" + NVJITLINK_ERROR_NVVM_COMPILE "NVJITLINK_ERROR_NVVM_COMPILE" + NVJITLINK_ERROR_INTERNAL "NVJITLINK_ERROR_INTERNAL" + NVJITLINK_ERROR_THREADPOOL "NVJITLINK_ERROR_THREADPOOL" + NVJITLINK_ERROR_UNRECOGNIZED_INPUT "NVJITLINK_ERROR_UNRECOGNIZED_INPUT" + NVJITLINK_ERROR_FINALIZE "NVJITLINK_ERROR_FINALIZE" + NVJITLINK_ERROR_NULL_INPUT "NVJITLINK_ERROR_NULL_INPUT" + NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS "NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS" + NVJITLINK_ERROR_INCORRECT_INPUT_TYPE "NVJITLINK_ERROR_INCORRECT_INPUT_TYPE" + NVJITLINK_ERROR_ARCH_MISMATCH "NVJITLINK_ERROR_ARCH_MISMATCH" + NVJITLINK_ERROR_OUTDATED_LIBRARY "NVJITLINK_ERROR_OUTDATED_LIBRARY" + NVJITLINK_ERROR_MISSING_FATBIN "NVJITLINK_ERROR_MISSING_FATBIN" + NVJITLINK_ERROR_UNRECOGNIZED_ARCH "NVJITLINK_ERROR_UNRECOGNIZED_ARCH" + NVJITLINK_ERROR_UNSUPPORTED_ARCH "NVJITLINK_ERROR_UNSUPPORTED_ARCH" + NVJITLINK_ERROR_LTO_NOT_ENABLED "NVJITLINK_ERROR_LTO_NOT_ENABLED" + _NVJITLINKRESULT_INTERNAL_LOADING_ERROR "_NVJITLINKRESULT_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum nvJitLinkInputType "nvJitLinkInputType": + NVJITLINK_INPUT_NONE "NVJITLINK_INPUT_NONE" = 0 + NVJITLINK_INPUT_CUBIN "NVJITLINK_INPUT_CUBIN" = 1 + NVJITLINK_INPUT_PTX "NVJITLINK_INPUT_PTX" + NVJITLINK_INPUT_LTOIR "NVJITLINK_INPUT_LTOIR" + NVJITLINK_INPUT_FATBIN "NVJITLINK_INPUT_FATBIN" + NVJITLINK_INPUT_OBJECT "NVJITLINK_INPUT_OBJECT" + NVJITLINK_INPUT_LIBRARY "NVJITLINK_INPUT_LIBRARY" + NVJITLINK_INPUT_INDEX "NVJITLINK_INPUT_INDEX" + NVJITLINK_INPUT_ANY "NVJITLINK_INPUT_ANY" = 10 + + +# types +ctypedef void* nvJitLinkHandle 'nvJitLinkHandle' + + +############################################################################### +# Functions +############################################################################### + +cdef nvJitLinkResult nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/cynvjitlink.pyx b/cuda_bindings_12/cuda/bindings/cynvjitlink.pyx new file mode 100644 index 00000000000..ecf4cafbaf8 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvjitlink.pyx @@ -0,0 +1,84 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7618d44448c6e1142afb5ad6cb3b7e15e1d775705ff4aaadbb8fe8744cccb1a4 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from ._internal cimport nvjitlink as _nvjitlink + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvJitLinkResult nvJitLinkCreate(nvJitLinkHandle* handle, uint32_t numOptions, const char** options) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkCreate(handle, numOptions, options) + + +cdef nvJitLinkResult nvJitLinkDestroy(nvJitLinkHandle* handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkDestroy(handle) + + +cdef nvJitLinkResult nvJitLinkAddData(nvJitLinkHandle handle, nvJitLinkInputType inputType, const void* data, size_t size, const char* name) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkAddData(handle, inputType, data, size, name) + + +cdef nvJitLinkResult nvJitLinkAddFile(nvJitLinkHandle handle, nvJitLinkInputType inputType, const char* fileName) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkAddFile(handle, inputType, fileName) + + +cdef nvJitLinkResult nvJitLinkComplete(nvJitLinkHandle handle) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkComplete(handle) + + +cdef nvJitLinkResult nvJitLinkGetLinkedCubinSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedCubinSize(handle, size) + + +cdef nvJitLinkResult nvJitLinkGetLinkedCubin(nvJitLinkHandle handle, void* cubin) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedCubin(handle, cubin) + + +cdef nvJitLinkResult nvJitLinkGetLinkedPtxSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedPtxSize(handle, size) + + +cdef nvJitLinkResult nvJitLinkGetLinkedPtx(nvJitLinkHandle handle, char* ptx) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedPtx(handle, ptx) + + +cdef nvJitLinkResult nvJitLinkGetErrorLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetErrorLogSize(handle, size) + + +cdef nvJitLinkResult nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetErrorLog(handle, log) + + +cdef nvJitLinkResult nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetInfoLogSize(handle, size) + + +cdef nvJitLinkResult nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetInfoLog(handle, log) + + +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_12/cuda/bindings/cynvml.pxd b/cuda_bindings_12/cuda/bindings/cynvml.pxd new file mode 100644 index 00000000000..9b2cd749775 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvml.pxd @@ -0,0 +1,2362 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. + + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=54d380973e59fbf316058a81b2026313f3564008841e322dd7dc3c7915e4ee87 +ctypedef enum nvmlBridgeChipType_t "nvmlBridgeChipType_t": + NVML_BRIDGE_CHIP_PLX "NVML_BRIDGE_CHIP_PLX" = 0 + NVML_BRIDGE_CHIP_BRO4 "NVML_BRIDGE_CHIP_BRO4" = 1 + +ctypedef enum nvmlNvLinkUtilizationCountUnits_t "nvmlNvLinkUtilizationCountUnits_t": + NVML_NVLINK_COUNTER_UNIT_CYCLES "NVML_NVLINK_COUNTER_UNIT_CYCLES" = 0 + NVML_NVLINK_COUNTER_UNIT_PACKETS "NVML_NVLINK_COUNTER_UNIT_PACKETS" = 1 + NVML_NVLINK_COUNTER_UNIT_BYTES "NVML_NVLINK_COUNTER_UNIT_BYTES" = 2 + NVML_NVLINK_COUNTER_UNIT_RESERVED "NVML_NVLINK_COUNTER_UNIT_RESERVED" = 3 + NVML_NVLINK_COUNTER_UNIT_COUNT "NVML_NVLINK_COUNTER_UNIT_COUNT" + +ctypedef enum nvmlNvLinkUtilizationCountPktTypes_t "nvmlNvLinkUtilizationCountPktTypes_t": + NVML_NVLINK_COUNTER_PKTFILTER_NOP "NVML_NVLINK_COUNTER_PKTFILTER_NOP" = 0x1 + NVML_NVLINK_COUNTER_PKTFILTER_READ "NVML_NVLINK_COUNTER_PKTFILTER_READ" = 0x2 + NVML_NVLINK_COUNTER_PKTFILTER_WRITE "NVML_NVLINK_COUNTER_PKTFILTER_WRITE" = 0x4 + NVML_NVLINK_COUNTER_PKTFILTER_RATOM "NVML_NVLINK_COUNTER_PKTFILTER_RATOM" = 0x8 + NVML_NVLINK_COUNTER_PKTFILTER_NRATOM "NVML_NVLINK_COUNTER_PKTFILTER_NRATOM" = 0x10 + NVML_NVLINK_COUNTER_PKTFILTER_FLUSH "NVML_NVLINK_COUNTER_PKTFILTER_FLUSH" = 0x20 + NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA "NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA" = 0x40 + NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA "NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA" = 0x80 + NVML_NVLINK_COUNTER_PKTFILTER_ALL "NVML_NVLINK_COUNTER_PKTFILTER_ALL" = 0xFF + +ctypedef enum nvmlNvLinkCapability_t "nvmlNvLinkCapability_t": + NVML_NVLINK_CAP_P2P_SUPPORTED "NVML_NVLINK_CAP_P2P_SUPPORTED" = 0 + NVML_NVLINK_CAP_SYSMEM_ACCESS "NVML_NVLINK_CAP_SYSMEM_ACCESS" = 1 + NVML_NVLINK_CAP_P2P_ATOMICS "NVML_NVLINK_CAP_P2P_ATOMICS" = 2 + NVML_NVLINK_CAP_SYSMEM_ATOMICS "NVML_NVLINK_CAP_SYSMEM_ATOMICS" = 3 + NVML_NVLINK_CAP_SLI_BRIDGE "NVML_NVLINK_CAP_SLI_BRIDGE" = 4 + NVML_NVLINK_CAP_VALID "NVML_NVLINK_CAP_VALID" = 5 + NVML_NVLINK_CAP_COUNT "NVML_NVLINK_CAP_COUNT" + +ctypedef enum nvmlNvLinkErrorCounter_t "nvmlNvLinkErrorCounter_t": + NVML_NVLINK_ERROR_DL_REPLAY "NVML_NVLINK_ERROR_DL_REPLAY" = 0 + NVML_NVLINK_ERROR_DL_RECOVERY "NVML_NVLINK_ERROR_DL_RECOVERY" = 1 + NVML_NVLINK_ERROR_DL_CRC_FLIT "NVML_NVLINK_ERROR_DL_CRC_FLIT" = 2 + NVML_NVLINK_ERROR_DL_CRC_DATA "NVML_NVLINK_ERROR_DL_CRC_DATA" = 3 + NVML_NVLINK_ERROR_DL_ECC_DATA "NVML_NVLINK_ERROR_DL_ECC_DATA" = 4 + NVML_NVLINK_ERROR_COUNT "NVML_NVLINK_ERROR_COUNT" + +ctypedef enum nvmlIntNvLinkDeviceType_t "nvmlIntNvLinkDeviceType_t": + NVML_NVLINK_DEVICE_TYPE_GPU "NVML_NVLINK_DEVICE_TYPE_GPU" = 0x00 + NVML_NVLINK_DEVICE_TYPE_IBMNPU "NVML_NVLINK_DEVICE_TYPE_IBMNPU" = 0x01 + NVML_NVLINK_DEVICE_TYPE_SWITCH "NVML_NVLINK_DEVICE_TYPE_SWITCH" = 0x02 + NVML_NVLINK_DEVICE_TYPE_UNKNOWN "NVML_NVLINK_DEVICE_TYPE_UNKNOWN" = 0xFF + +ctypedef enum nvmlGpuTopologyLevel_t "nvmlGpuTopologyLevel_t": + NVML_TOPOLOGY_INTERNAL "NVML_TOPOLOGY_INTERNAL" = 0 + NVML_TOPOLOGY_SINGLE "NVML_TOPOLOGY_SINGLE" = 10 + NVML_TOPOLOGY_MULTIPLE "NVML_TOPOLOGY_MULTIPLE" = 20 + NVML_TOPOLOGY_HOSTBRIDGE "NVML_TOPOLOGY_HOSTBRIDGE" = 30 + NVML_TOPOLOGY_NODE "NVML_TOPOLOGY_NODE" = 40 + NVML_TOPOLOGY_SYSTEM "NVML_TOPOLOGY_SYSTEM" = 50 + +ctypedef enum nvmlGpuP2PStatus_t "nvmlGpuP2PStatus_t": + NVML_P2P_STATUS_OK "NVML_P2P_STATUS_OK" = 0 + NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED "NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED" + NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED "NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED" = NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED + NVML_P2P_STATUS_GPU_NOT_SUPPORTED "NVML_P2P_STATUS_GPU_NOT_SUPPORTED" + NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED "NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED" + NVML_P2P_STATUS_DISABLED_BY_REGKEY "NVML_P2P_STATUS_DISABLED_BY_REGKEY" + NVML_P2P_STATUS_NOT_SUPPORTED "NVML_P2P_STATUS_NOT_SUPPORTED" + NVML_P2P_STATUS_UNKNOWN "NVML_P2P_STATUS_UNKNOWN" + +ctypedef enum nvmlGpuP2PCapsIndex_t "nvmlGpuP2PCapsIndex_t": + NVML_P2P_CAPS_INDEX_READ "NVML_P2P_CAPS_INDEX_READ" = 0 + NVML_P2P_CAPS_INDEX_WRITE "NVML_P2P_CAPS_INDEX_WRITE" = 1 + NVML_P2P_CAPS_INDEX_NVLINK "NVML_P2P_CAPS_INDEX_NVLINK" = 2 + NVML_P2P_CAPS_INDEX_ATOMICS "NVML_P2P_CAPS_INDEX_ATOMICS" = 3 + NVML_P2P_CAPS_INDEX_PCI "NVML_P2P_CAPS_INDEX_PCI" = 4 + NVML_P2P_CAPS_INDEX_PROP "NVML_P2P_CAPS_INDEX_PROP" = NVML_P2P_CAPS_INDEX_PCI + NVML_P2P_CAPS_INDEX_UNKNOWN "NVML_P2P_CAPS_INDEX_UNKNOWN" = 5 + +ctypedef enum nvmlSamplingType_t "nvmlSamplingType_t": + NVML_TOTAL_POWER_SAMPLES "NVML_TOTAL_POWER_SAMPLES" = 0 + NVML_GPU_UTILIZATION_SAMPLES "NVML_GPU_UTILIZATION_SAMPLES" = 1 + NVML_MEMORY_UTILIZATION_SAMPLES "NVML_MEMORY_UTILIZATION_SAMPLES" = 2 + NVML_ENC_UTILIZATION_SAMPLES "NVML_ENC_UTILIZATION_SAMPLES" = 3 + NVML_DEC_UTILIZATION_SAMPLES "NVML_DEC_UTILIZATION_SAMPLES" = 4 + NVML_PROCESSOR_CLK_SAMPLES "NVML_PROCESSOR_CLK_SAMPLES" = 5 + NVML_MEMORY_CLK_SAMPLES "NVML_MEMORY_CLK_SAMPLES" = 6 + NVML_MODULE_POWER_SAMPLES "NVML_MODULE_POWER_SAMPLES" = 7 + NVML_JPG_UTILIZATION_SAMPLES "NVML_JPG_UTILIZATION_SAMPLES" = 8 + NVML_OFA_UTILIZATION_SAMPLES "NVML_OFA_UTILIZATION_SAMPLES" = 9 + NVML_SAMPLINGTYPE_COUNT "NVML_SAMPLINGTYPE_COUNT" + +ctypedef enum nvmlPcieUtilCounter_t "nvmlPcieUtilCounter_t": + NVML_PCIE_UTIL_TX_BYTES "NVML_PCIE_UTIL_TX_BYTES" = 0 + NVML_PCIE_UTIL_RX_BYTES "NVML_PCIE_UTIL_RX_BYTES" = 1 + NVML_PCIE_UTIL_COUNT "NVML_PCIE_UTIL_COUNT" + +ctypedef enum nvmlValueType_t "nvmlValueType_t": + NVML_VALUE_TYPE_DOUBLE "NVML_VALUE_TYPE_DOUBLE" = 0 + NVML_VALUE_TYPE_UNSIGNED_INT "NVML_VALUE_TYPE_UNSIGNED_INT" = 1 + NVML_VALUE_TYPE_UNSIGNED_LONG "NVML_VALUE_TYPE_UNSIGNED_LONG" = 2 + NVML_VALUE_TYPE_UNSIGNED_LONG_LONG "NVML_VALUE_TYPE_UNSIGNED_LONG_LONG" = 3 + NVML_VALUE_TYPE_SIGNED_LONG_LONG "NVML_VALUE_TYPE_SIGNED_LONG_LONG" = 4 + NVML_VALUE_TYPE_SIGNED_INT "NVML_VALUE_TYPE_SIGNED_INT" = 5 + NVML_VALUE_TYPE_UNSIGNED_SHORT "NVML_VALUE_TYPE_UNSIGNED_SHORT" = 6 + NVML_VALUE_TYPE_COUNT "NVML_VALUE_TYPE_COUNT" + +ctypedef enum nvmlPerfPolicyType_t "nvmlPerfPolicyType_t": + NVML_PERF_POLICY_POWER "NVML_PERF_POLICY_POWER" = 0 + NVML_PERF_POLICY_THERMAL "NVML_PERF_POLICY_THERMAL" = 1 + NVML_PERF_POLICY_SYNC_BOOST "NVML_PERF_POLICY_SYNC_BOOST" = 2 + NVML_PERF_POLICY_BOARD_LIMIT "NVML_PERF_POLICY_BOARD_LIMIT" = 3 + NVML_PERF_POLICY_LOW_UTILIZATION "NVML_PERF_POLICY_LOW_UTILIZATION" = 4 + NVML_PERF_POLICY_RELIABILITY "NVML_PERF_POLICY_RELIABILITY" = 5 + NVML_PERF_POLICY_TOTAL_APP_CLOCKS "NVML_PERF_POLICY_TOTAL_APP_CLOCKS" = 10 + NVML_PERF_POLICY_TOTAL_BASE_CLOCKS "NVML_PERF_POLICY_TOTAL_BASE_CLOCKS" = 11 + NVML_PERF_POLICY_COUNT "NVML_PERF_POLICY_COUNT" + +ctypedef enum nvmlThermalTarget_t "nvmlThermalTarget_t": + NVML_THERMAL_TARGET_NONE "NVML_THERMAL_TARGET_NONE" = 0 + NVML_THERMAL_TARGET_GPU "NVML_THERMAL_TARGET_GPU" = 1 + NVML_THERMAL_TARGET_MEMORY "NVML_THERMAL_TARGET_MEMORY" = 2 + NVML_THERMAL_TARGET_POWER_SUPPLY "NVML_THERMAL_TARGET_POWER_SUPPLY" = 4 + NVML_THERMAL_TARGET_BOARD "NVML_THERMAL_TARGET_BOARD" = 8 + NVML_THERMAL_TARGET_VCD_BOARD "NVML_THERMAL_TARGET_VCD_BOARD" = 9 + NVML_THERMAL_TARGET_VCD_INLET "NVML_THERMAL_TARGET_VCD_INLET" = 10 + NVML_THERMAL_TARGET_VCD_OUTLET "NVML_THERMAL_TARGET_VCD_OUTLET" = 11 + NVML_THERMAL_TARGET_ALL "NVML_THERMAL_TARGET_ALL" = 15 + NVML_THERMAL_TARGET_UNKNOWN "NVML_THERMAL_TARGET_UNKNOWN" = -(1) + +ctypedef enum nvmlThermalController_t "nvmlThermalController_t": + NVML_THERMAL_CONTROLLER_NONE "NVML_THERMAL_CONTROLLER_NONE" = 0 + NVML_THERMAL_CONTROLLER_GPU_INTERNAL "NVML_THERMAL_CONTROLLER_GPU_INTERNAL" + NVML_THERMAL_CONTROLLER_ADM1032 "NVML_THERMAL_CONTROLLER_ADM1032" + NVML_THERMAL_CONTROLLER_ADT7461 "NVML_THERMAL_CONTROLLER_ADT7461" + NVML_THERMAL_CONTROLLER_MAX6649 "NVML_THERMAL_CONTROLLER_MAX6649" + NVML_THERMAL_CONTROLLER_MAX1617 "NVML_THERMAL_CONTROLLER_MAX1617" + NVML_THERMAL_CONTROLLER_LM99 "NVML_THERMAL_CONTROLLER_LM99" + NVML_THERMAL_CONTROLLER_LM89 "NVML_THERMAL_CONTROLLER_LM89" + NVML_THERMAL_CONTROLLER_LM64 "NVML_THERMAL_CONTROLLER_LM64" + NVML_THERMAL_CONTROLLER_G781 "NVML_THERMAL_CONTROLLER_G781" + NVML_THERMAL_CONTROLLER_ADT7473 "NVML_THERMAL_CONTROLLER_ADT7473" + NVML_THERMAL_CONTROLLER_SBMAX6649 "NVML_THERMAL_CONTROLLER_SBMAX6649" + NVML_THERMAL_CONTROLLER_VBIOSEVT "NVML_THERMAL_CONTROLLER_VBIOSEVT" + NVML_THERMAL_CONTROLLER_OS "NVML_THERMAL_CONTROLLER_OS" + NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS "NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS" + NVML_THERMAL_CONTROLLER_NVSYSCON_E551 "NVML_THERMAL_CONTROLLER_NVSYSCON_E551" + NVML_THERMAL_CONTROLLER_MAX6649R "NVML_THERMAL_CONTROLLER_MAX6649R" + NVML_THERMAL_CONTROLLER_ADT7473S "NVML_THERMAL_CONTROLLER_ADT7473S" + NVML_THERMAL_CONTROLLER_UNKNOWN "NVML_THERMAL_CONTROLLER_UNKNOWN" = -(1) + +ctypedef enum nvmlCoolerControl_t "nvmlCoolerControl_t": + NVML_THERMAL_COOLER_SIGNAL_NONE "NVML_THERMAL_COOLER_SIGNAL_NONE" = 0 + NVML_THERMAL_COOLER_SIGNAL_TOGGLE "NVML_THERMAL_COOLER_SIGNAL_TOGGLE" = 1 + NVML_THERMAL_COOLER_SIGNAL_VARIABLE "NVML_THERMAL_COOLER_SIGNAL_VARIABLE" = 2 + NVML_THERMAL_COOLER_SIGNAL_COUNT "NVML_THERMAL_COOLER_SIGNAL_COUNT" + +ctypedef enum nvmlCoolerTarget_t "nvmlCoolerTarget_t": + NVML_THERMAL_COOLER_TARGET_NONE "NVML_THERMAL_COOLER_TARGET_NONE" = (1 << 0) + NVML_THERMAL_COOLER_TARGET_GPU "NVML_THERMAL_COOLER_TARGET_GPU" = (1 << 1) + NVML_THERMAL_COOLER_TARGET_MEMORY "NVML_THERMAL_COOLER_TARGET_MEMORY" = (1 << 2) + NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY "NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY" = (1 << 3) + NVML_THERMAL_COOLER_TARGET_GPU_RELATED "NVML_THERMAL_COOLER_TARGET_GPU_RELATED" = ((NVML_THERMAL_COOLER_TARGET_GPU | NVML_THERMAL_COOLER_TARGET_MEMORY) | NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY) + +ctypedef enum nvmlUUIDType_t "nvmlUUIDType_t": + NVML_UUID_TYPE_NONE "NVML_UUID_TYPE_NONE" = 0 + NVML_UUID_TYPE_ASCII "NVML_UUID_TYPE_ASCII" = 1 + NVML_UUID_TYPE_BINARY "NVML_UUID_TYPE_BINARY" = 2 + +ctypedef enum nvmlEnableState_t "nvmlEnableState_t": + NVML_FEATURE_DISABLED "NVML_FEATURE_DISABLED" = 0 + NVML_FEATURE_ENABLED "NVML_FEATURE_ENABLED" = 1 + +ctypedef enum nvmlBrandType_t "nvmlBrandType_t": + NVML_BRAND_UNKNOWN "NVML_BRAND_UNKNOWN" = 0 + NVML_BRAND_QUADRO "NVML_BRAND_QUADRO" = 1 + NVML_BRAND_TESLA "NVML_BRAND_TESLA" = 2 + NVML_BRAND_NVS "NVML_BRAND_NVS" = 3 + NVML_BRAND_GRID "NVML_BRAND_GRID" = 4 + NVML_BRAND_GEFORCE "NVML_BRAND_GEFORCE" = 5 + NVML_BRAND_TITAN "NVML_BRAND_TITAN" = 6 + NVML_BRAND_NVIDIA_VAPPS "NVML_BRAND_NVIDIA_VAPPS" = 7 + NVML_BRAND_NVIDIA_VPC "NVML_BRAND_NVIDIA_VPC" = 8 + NVML_BRAND_NVIDIA_VCS "NVML_BRAND_NVIDIA_VCS" = 9 + NVML_BRAND_NVIDIA_VWS "NVML_BRAND_NVIDIA_VWS" = 10 + NVML_BRAND_NVIDIA_CLOUD_GAMING "NVML_BRAND_NVIDIA_CLOUD_GAMING" = 11 + NVML_BRAND_NVIDIA_VGAMING "NVML_BRAND_NVIDIA_VGAMING" = NVML_BRAND_NVIDIA_CLOUD_GAMING + NVML_BRAND_QUADRO_RTX "NVML_BRAND_QUADRO_RTX" = 12 + NVML_BRAND_NVIDIA_RTX "NVML_BRAND_NVIDIA_RTX" = 13 + NVML_BRAND_NVIDIA "NVML_BRAND_NVIDIA" = 14 + NVML_BRAND_GEFORCE_RTX "NVML_BRAND_GEFORCE_RTX" = 15 + NVML_BRAND_TITAN_RTX "NVML_BRAND_TITAN_RTX" = 16 + NVML_BRAND_COUNT "NVML_BRAND_COUNT" = 18 + +ctypedef enum nvmlTemperatureThresholds_t "nvmlTemperatureThresholds_t": + NVML_TEMPERATURE_THRESHOLD_SHUTDOWN "NVML_TEMPERATURE_THRESHOLD_SHUTDOWN" = 0 + NVML_TEMPERATURE_THRESHOLD_SLOWDOWN "NVML_TEMPERATURE_THRESHOLD_SLOWDOWN" = 1 + NVML_TEMPERATURE_THRESHOLD_MEM_MAX "NVML_TEMPERATURE_THRESHOLD_MEM_MAX" = 2 + NVML_TEMPERATURE_THRESHOLD_GPU_MAX "NVML_TEMPERATURE_THRESHOLD_GPU_MAX" = 3 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN" = 4 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR" = 5 + NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX "NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX" = 6 + NVML_TEMPERATURE_THRESHOLD_GPS_CURR "NVML_TEMPERATURE_THRESHOLD_GPS_CURR" = 7 + NVML_TEMPERATURE_THRESHOLD_COUNT "NVML_TEMPERATURE_THRESHOLD_COUNT" + +ctypedef enum nvmlTemperatureSensors_t "nvmlTemperatureSensors_t": + NVML_TEMPERATURE_GPU "NVML_TEMPERATURE_GPU" = 0 + NVML_TEMPERATURE_COUNT "NVML_TEMPERATURE_COUNT" + +ctypedef enum nvmlComputeMode_t "nvmlComputeMode_t": + NVML_COMPUTEMODE_DEFAULT "NVML_COMPUTEMODE_DEFAULT" = 0 + NVML_COMPUTEMODE_EXCLUSIVE_THREAD "NVML_COMPUTEMODE_EXCLUSIVE_THREAD" = 1 + NVML_COMPUTEMODE_PROHIBITED "NVML_COMPUTEMODE_PROHIBITED" = 2 + NVML_COMPUTEMODE_EXCLUSIVE_PROCESS "NVML_COMPUTEMODE_EXCLUSIVE_PROCESS" = 3 + NVML_COMPUTEMODE_COUNT "NVML_COMPUTEMODE_COUNT" + +ctypedef enum nvmlMemoryErrorType_t "nvmlMemoryErrorType_t": + NVML_MEMORY_ERROR_TYPE_CORRECTED "NVML_MEMORY_ERROR_TYPE_CORRECTED" = 0 + NVML_MEMORY_ERROR_TYPE_UNCORRECTED "NVML_MEMORY_ERROR_TYPE_UNCORRECTED" = 1 + NVML_MEMORY_ERROR_TYPE_COUNT "NVML_MEMORY_ERROR_TYPE_COUNT" + +ctypedef enum nvmlNvlinkVersion_t "nvmlNvlinkVersion_t": + NVML_NVLINK_VERSION_INVALID "NVML_NVLINK_VERSION_INVALID" = 0 + NVML_NVLINK_VERSION_1_0 "NVML_NVLINK_VERSION_1_0" = 1 + NVML_NVLINK_VERSION_2_0 "NVML_NVLINK_VERSION_2_0" = 2 + NVML_NVLINK_VERSION_2_2 "NVML_NVLINK_VERSION_2_2" = 3 + NVML_NVLINK_VERSION_3_0 "NVML_NVLINK_VERSION_3_0" = 4 + 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 + NVML_AGGREGATE_ECC "NVML_AGGREGATE_ECC" = 1 + NVML_ECC_COUNTER_TYPE_COUNT "NVML_ECC_COUNTER_TYPE_COUNT" + +ctypedef enum nvmlClockType_t "nvmlClockType_t": + NVML_CLOCK_GRAPHICS "NVML_CLOCK_GRAPHICS" = 0 + NVML_CLOCK_SM "NVML_CLOCK_SM" = 1 + NVML_CLOCK_MEM "NVML_CLOCK_MEM" = 2 + NVML_CLOCK_VIDEO "NVML_CLOCK_VIDEO" = 3 + NVML_CLOCK_COUNT "NVML_CLOCK_COUNT" + +ctypedef enum nvmlClockId_t "nvmlClockId_t": + NVML_CLOCK_ID_CURRENT "NVML_CLOCK_ID_CURRENT" = 0 + NVML_CLOCK_ID_APP_CLOCK_TARGET "NVML_CLOCK_ID_APP_CLOCK_TARGET" = 1 + NVML_CLOCK_ID_APP_CLOCK_DEFAULT "NVML_CLOCK_ID_APP_CLOCK_DEFAULT" = 2 + NVML_CLOCK_ID_CUSTOMER_BOOST_MAX "NVML_CLOCK_ID_CUSTOMER_BOOST_MAX" = 3 + NVML_CLOCK_ID_COUNT "NVML_CLOCK_ID_COUNT" + +ctypedef enum nvmlDriverModel_t "nvmlDriverModel_t": + NVML_DRIVER_WDDM "NVML_DRIVER_WDDM" = 0 + NVML_DRIVER_WDM "NVML_DRIVER_WDM" = 1 + NVML_DRIVER_MCDM "NVML_DRIVER_MCDM" = 2 + +ctypedef enum nvmlPstates_t "nvmlPstates_t": + NVML_PSTATE_0 "NVML_PSTATE_0" = 0 + NVML_PSTATE_1 "NVML_PSTATE_1" = 1 + NVML_PSTATE_2 "NVML_PSTATE_2" = 2 + NVML_PSTATE_3 "NVML_PSTATE_3" = 3 + NVML_PSTATE_4 "NVML_PSTATE_4" = 4 + NVML_PSTATE_5 "NVML_PSTATE_5" = 5 + NVML_PSTATE_6 "NVML_PSTATE_6" = 6 + NVML_PSTATE_7 "NVML_PSTATE_7" = 7 + NVML_PSTATE_8 "NVML_PSTATE_8" = 8 + NVML_PSTATE_9 "NVML_PSTATE_9" = 9 + NVML_PSTATE_10 "NVML_PSTATE_10" = 10 + NVML_PSTATE_11 "NVML_PSTATE_11" = 11 + NVML_PSTATE_12 "NVML_PSTATE_12" = 12 + NVML_PSTATE_13 "NVML_PSTATE_13" = 13 + NVML_PSTATE_14 "NVML_PSTATE_14" = 14 + NVML_PSTATE_15 "NVML_PSTATE_15" = 15 + NVML_PSTATE_UNKNOWN "NVML_PSTATE_UNKNOWN" = 32 + +ctypedef enum nvmlGpuOperationMode_t "nvmlGpuOperationMode_t": + NVML_GOM_ALL_ON "NVML_GOM_ALL_ON" = 0 + NVML_GOM_COMPUTE "NVML_GOM_COMPUTE" = 1 + NVML_GOM_LOW_DP "NVML_GOM_LOW_DP" = 2 + +ctypedef enum nvmlInforomObject_t "nvmlInforomObject_t": + NVML_INFOROM_OEM "NVML_INFOROM_OEM" = 0 + NVML_INFOROM_ECC "NVML_INFOROM_ECC" = 1 + NVML_INFOROM_POWER "NVML_INFOROM_POWER" = 2 + NVML_INFOROM_DEN "NVML_INFOROM_DEN" = 3 + NVML_INFOROM_COUNT "NVML_INFOROM_COUNT" + +ctypedef enum nvmlReturn_t "nvmlReturn_t": + NVML_SUCCESS "NVML_SUCCESS" = 0 + NVML_ERROR_UNINITIALIZED "NVML_ERROR_UNINITIALIZED" = 1 + NVML_ERROR_INVALID_ARGUMENT "NVML_ERROR_INVALID_ARGUMENT" = 2 + NVML_ERROR_NOT_SUPPORTED "NVML_ERROR_NOT_SUPPORTED" = 3 + NVML_ERROR_NO_PERMISSION "NVML_ERROR_NO_PERMISSION" = 4 + NVML_ERROR_ALREADY_INITIALIZED "NVML_ERROR_ALREADY_INITIALIZED" = 5 + NVML_ERROR_NOT_FOUND "NVML_ERROR_NOT_FOUND" = 6 + NVML_ERROR_INSUFFICIENT_SIZE "NVML_ERROR_INSUFFICIENT_SIZE" = 7 + NVML_ERROR_INSUFFICIENT_POWER "NVML_ERROR_INSUFFICIENT_POWER" = 8 + NVML_ERROR_DRIVER_NOT_LOADED "NVML_ERROR_DRIVER_NOT_LOADED" = 9 + NVML_ERROR_TIMEOUT "NVML_ERROR_TIMEOUT" = 10 + NVML_ERROR_IRQ_ISSUE "NVML_ERROR_IRQ_ISSUE" = 11 + NVML_ERROR_LIBRARY_NOT_FOUND "NVML_ERROR_LIBRARY_NOT_FOUND" = 12 + NVML_ERROR_FUNCTION_NOT_FOUND "NVML_ERROR_FUNCTION_NOT_FOUND" = 13 + NVML_ERROR_CORRUPTED_INFOROM "NVML_ERROR_CORRUPTED_INFOROM" = 14 + NVML_ERROR_GPU_IS_LOST "NVML_ERROR_GPU_IS_LOST" = 15 + NVML_ERROR_RESET_REQUIRED "NVML_ERROR_RESET_REQUIRED" = 16 + NVML_ERROR_OPERATING_SYSTEM "NVML_ERROR_OPERATING_SYSTEM" = 17 + NVML_ERROR_LIB_RM_VERSION_MISMATCH "NVML_ERROR_LIB_RM_VERSION_MISMATCH" = 18 + NVML_ERROR_IN_USE "NVML_ERROR_IN_USE" = 19 + NVML_ERROR_MEMORY "NVML_ERROR_MEMORY" = 20 + NVML_ERROR_NO_DATA "NVML_ERROR_NO_DATA" = 21 + NVML_ERROR_VGPU_ECC_NOT_SUPPORTED "NVML_ERROR_VGPU_ECC_NOT_SUPPORTED" = 22 + NVML_ERROR_INSUFFICIENT_RESOURCES "NVML_ERROR_INSUFFICIENT_RESOURCES" = 23 + NVML_ERROR_FREQ_NOT_SUPPORTED "NVML_ERROR_FREQ_NOT_SUPPORTED" = 24 + NVML_ERROR_ARGUMENT_VERSION_MISMATCH "NVML_ERROR_ARGUMENT_VERSION_MISMATCH" = 25 + NVML_ERROR_DEPRECATED "NVML_ERROR_DEPRECATED" = 26 + NVML_ERROR_NOT_READY "NVML_ERROR_NOT_READY" = 27 + NVML_ERROR_GPU_NOT_FOUND "NVML_ERROR_GPU_NOT_FOUND" = 28 + NVML_ERROR_INVALID_STATE "NVML_ERROR_INVALID_STATE" = 29 + NVML_ERROR_RESET_TYPE_NOT_SUPPORTED "NVML_ERROR_RESET_TYPE_NOT_SUPPORTED" = 30 + NVML_ERROR_UNKNOWN "NVML_ERROR_UNKNOWN" = 999 + _NVMLRETURN_T_INTERNAL_LOADING_ERROR "_NVMLRETURN_T_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum nvmlMemoryLocation_t "nvmlMemoryLocation_t": + NVML_MEMORY_LOCATION_L1_CACHE "NVML_MEMORY_LOCATION_L1_CACHE" = 0 + NVML_MEMORY_LOCATION_L2_CACHE "NVML_MEMORY_LOCATION_L2_CACHE" = 1 + NVML_MEMORY_LOCATION_DRAM "NVML_MEMORY_LOCATION_DRAM" = 2 + NVML_MEMORY_LOCATION_DEVICE_MEMORY "NVML_MEMORY_LOCATION_DEVICE_MEMORY" = 2 + NVML_MEMORY_LOCATION_REGISTER_FILE "NVML_MEMORY_LOCATION_REGISTER_FILE" = 3 + NVML_MEMORY_LOCATION_TEXTURE_MEMORY "NVML_MEMORY_LOCATION_TEXTURE_MEMORY" = 4 + NVML_MEMORY_LOCATION_TEXTURE_SHM "NVML_MEMORY_LOCATION_TEXTURE_SHM" = 5 + NVML_MEMORY_LOCATION_CBU "NVML_MEMORY_LOCATION_CBU" = 6 + NVML_MEMORY_LOCATION_SRAM "NVML_MEMORY_LOCATION_SRAM" = 7 + NVML_MEMORY_LOCATION_COUNT "NVML_MEMORY_LOCATION_COUNT" + +ctypedef enum nvmlPageRetirementCause_t "nvmlPageRetirementCause_t": + NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS "NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS" = 0 + NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR "NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR" = 1 + NVML_PAGE_RETIREMENT_CAUSE_COUNT "NVML_PAGE_RETIREMENT_CAUSE_COUNT" + +ctypedef enum nvmlRestrictedAPI_t "nvmlRestrictedAPI_t": + NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS "NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS" = 0 + NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS "NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS" = 1 + NVML_RESTRICTED_API_COUNT "NVML_RESTRICTED_API_COUNT" + +ctypedef enum nvmlGpuUtilizationDomainId_t "nvmlGpuUtilizationDomainId_t": + NVML_GPU_UTILIZATION_DOMAIN_GPU "NVML_GPU_UTILIZATION_DOMAIN_GPU" = 0 + NVML_GPU_UTILIZATION_DOMAIN_FB "NVML_GPU_UTILIZATION_DOMAIN_FB" = 1 + NVML_GPU_UTILIZATION_DOMAIN_VID "NVML_GPU_UTILIZATION_DOMAIN_VID" = 2 + NVML_GPU_UTILIZATION_DOMAIN_BUS "NVML_GPU_UTILIZATION_DOMAIN_BUS" = 3 + +ctypedef enum nvmlGpuVirtualizationMode_t "nvmlGpuVirtualizationMode_t": + NVML_GPU_VIRTUALIZATION_MODE_NONE "NVML_GPU_VIRTUALIZATION_MODE_NONE" = 0 + NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH "NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH" = 1 + NVML_GPU_VIRTUALIZATION_MODE_VGPU "NVML_GPU_VIRTUALIZATION_MODE_VGPU" = 2 + NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU "NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU" = 3 + NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA "NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA" = 4 + +ctypedef enum nvmlHostVgpuMode_t "nvmlHostVgpuMode_t": + NVML_HOST_VGPU_MODE_NON_SRIOV "NVML_HOST_VGPU_MODE_NON_SRIOV" = 0 + NVML_HOST_VGPU_MODE_SRIOV "NVML_HOST_VGPU_MODE_SRIOV" = 1 + +ctypedef enum nvmlVgpuVmIdType_t "nvmlVgpuVmIdType_t": + NVML_VGPU_VM_ID_DOMAIN_ID "NVML_VGPU_VM_ID_DOMAIN_ID" = 0 + NVML_VGPU_VM_ID_UUID "NVML_VGPU_VM_ID_UUID" = 1 + +ctypedef enum nvmlVgpuGuestInfoState_t "nvmlVgpuGuestInfoState_t": + NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED "NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED" = 0 + NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED "NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED" = 1 + +ctypedef enum nvmlGridLicenseFeatureCode_t "nvmlGridLicenseFeatureCode_t": + NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN "NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN" = 0 + NVML_GRID_LICENSE_FEATURE_CODE_VGPU "NVML_GRID_LICENSE_FEATURE_CODE_VGPU" = 1 + NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX "NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX" = 2 + NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION "NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION" = NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX + NVML_GRID_LICENSE_FEATURE_CODE_GAMING "NVML_GRID_LICENSE_FEATURE_CODE_GAMING" = 3 + NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE "NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE" = 4 + +ctypedef enum nvmlVgpuCapability_t "nvmlVgpuCapability_t": + NVML_VGPU_CAP_NVLINK_P2P "NVML_VGPU_CAP_NVLINK_P2P" = 0 + NVML_VGPU_CAP_GPUDIRECT "NVML_VGPU_CAP_GPUDIRECT" = 1 + NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE "NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE" = 2 + NVML_VGPU_CAP_EXCLUSIVE_TYPE "NVML_VGPU_CAP_EXCLUSIVE_TYPE" = 3 + NVML_VGPU_CAP_EXCLUSIVE_SIZE "NVML_VGPU_CAP_EXCLUSIVE_SIZE" = 4 + NVML_VGPU_CAP_COUNT "NVML_VGPU_CAP_COUNT" + +ctypedef enum nvmlVgpuDriverCapability_t "nvmlVgpuDriverCapability_t": + NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU "NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU" = 0 + NVML_VGPU_DRIVER_CAP_WARM_UPDATE "NVML_VGPU_DRIVER_CAP_WARM_UPDATE" = 1 + NVML_VGPU_DRIVER_CAP_COUNT "NVML_VGPU_DRIVER_CAP_COUNT" + +ctypedef enum nvmlDeviceVgpuCapability_t "nvmlDeviceVgpuCapability_t": + NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU "NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU" = 0 + NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES "NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES" = 1 + NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES "NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES" = 2 + NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW "NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW" = 3 + NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW "NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW" = 4 + NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING "NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING" = 5 + NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU "NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU" = 6 + NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU "NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU" = 7 + NVML_DEVICE_VGPU_CAP_WARM_UPDATE "NVML_DEVICE_VGPU_CAP_WARM_UPDATE" = 8 + NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS "NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS" = 9 + NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED "NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED" = 10 + NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED "NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED" = 11 + NVML_DEVICE_VGPU_CAP_COUNT "NVML_DEVICE_VGPU_CAP_COUNT" + +ctypedef enum nvmlDeviceGpuRecoveryAction_t "nvmlDeviceGpuRecoveryAction_t": + NVML_GPU_RECOVERY_ACTION_NONE "NVML_GPU_RECOVERY_ACTION_NONE" = 0 + NVML_GPU_RECOVERY_ACTION_GPU_RESET "NVML_GPU_RECOVERY_ACTION_GPU_RESET" = 1 + 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 + NVML_FAN_FAILED "NVML_FAN_FAILED" = 1 + +ctypedef enum nvmlLedColor_t "nvmlLedColor_t": + NVML_LED_COLOR_GREEN "NVML_LED_COLOR_GREEN" = 0 + NVML_LED_COLOR_AMBER "NVML_LED_COLOR_AMBER" = 1 + +ctypedef enum nvmlEncoderType_t "nvmlEncoderType_t": + NVML_ENCODER_QUERY_H264 "NVML_ENCODER_QUERY_H264" = 0x00 + NVML_ENCODER_QUERY_HEVC "NVML_ENCODER_QUERY_HEVC" = 0x01 + NVML_ENCODER_QUERY_AV1 "NVML_ENCODER_QUERY_AV1" = 0x02 + NVML_ENCODER_QUERY_UNKNOWN "NVML_ENCODER_QUERY_UNKNOWN" = 0xFF + +ctypedef enum nvmlFBCSessionType_t "nvmlFBCSessionType_t": + NVML_FBC_SESSION_TYPE_UNKNOWN "NVML_FBC_SESSION_TYPE_UNKNOWN" = 0 + NVML_FBC_SESSION_TYPE_TOSYS "NVML_FBC_SESSION_TYPE_TOSYS" + NVML_FBC_SESSION_TYPE_CUDA "NVML_FBC_SESSION_TYPE_CUDA" + NVML_FBC_SESSION_TYPE_VID "NVML_FBC_SESSION_TYPE_VID" + NVML_FBC_SESSION_TYPE_HWENC "NVML_FBC_SESSION_TYPE_HWENC" + +ctypedef enum nvmlDetachGpuState_t "nvmlDetachGpuState_t": + NVML_DETACH_GPU_KEEP "NVML_DETACH_GPU_KEEP" = 0 + NVML_DETACH_GPU_REMOVE "NVML_DETACH_GPU_REMOVE" + +ctypedef enum nvmlPcieLinkState_t "nvmlPcieLinkState_t": + NVML_PCIE_LINK_KEEP "NVML_PCIE_LINK_KEEP" = 0 + NVML_PCIE_LINK_SHUT_DOWN "NVML_PCIE_LINK_SHUT_DOWN" + +ctypedef enum nvmlClockLimitId_t "nvmlClockLimitId_t": + NVML_CLOCK_LIMIT_ID_RANGE_START "NVML_CLOCK_LIMIT_ID_RANGE_START" = 0xffffff00 + NVML_CLOCK_LIMIT_ID_TDP "NVML_CLOCK_LIMIT_ID_TDP" + NVML_CLOCK_LIMIT_ID_UNLIMITED "NVML_CLOCK_LIMIT_ID_UNLIMITED" + +ctypedef enum nvmlVgpuVmCompatibility_t "nvmlVgpuVmCompatibility_t": + NVML_VGPU_VM_COMPATIBILITY_NONE "NVML_VGPU_VM_COMPATIBILITY_NONE" = 0x0 + NVML_VGPU_VM_COMPATIBILITY_COLD "NVML_VGPU_VM_COMPATIBILITY_COLD" = 0x1 + NVML_VGPU_VM_COMPATIBILITY_HIBERNATE "NVML_VGPU_VM_COMPATIBILITY_HIBERNATE" = 0x2 + NVML_VGPU_VM_COMPATIBILITY_SLEEP "NVML_VGPU_VM_COMPATIBILITY_SLEEP" = 0x4 + NVML_VGPU_VM_COMPATIBILITY_LIVE "NVML_VGPU_VM_COMPATIBILITY_LIVE" = 0x8 + +ctypedef enum nvmlVgpuPgpuCompatibilityLimitCode_t "nvmlVgpuPgpuCompatibilityLimitCode_t": + NVML_VGPU_COMPATIBILITY_LIMIT_NONE "NVML_VGPU_COMPATIBILITY_LIMIT_NONE" = 0x0 + NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER "NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER" = 0x1 + NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER "NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER" = 0x2 + NVML_VGPU_COMPATIBILITY_LIMIT_GPU "NVML_VGPU_COMPATIBILITY_LIMIT_GPU" = 0x4 + NVML_VGPU_COMPATIBILITY_LIMIT_OTHER "NVML_VGPU_COMPATIBILITY_LIMIT_OTHER" = 0x80000000 + +ctypedef enum nvmlGpmMetricId_t "nvmlGpmMetricId_t": + NVML_GPM_METRIC_GRAPHICS_UTIL "NVML_GPM_METRIC_GRAPHICS_UTIL" = 1 + NVML_GPM_METRIC_SM_UTIL "NVML_GPM_METRIC_SM_UTIL" = 2 + NVML_GPM_METRIC_SM_OCCUPANCY "NVML_GPM_METRIC_SM_OCCUPANCY" = 3 + NVML_GPM_METRIC_INTEGER_UTIL "NVML_GPM_METRIC_INTEGER_UTIL" = 4 + NVML_GPM_METRIC_ANY_TENSOR_UTIL "NVML_GPM_METRIC_ANY_TENSOR_UTIL" = 5 + NVML_GPM_METRIC_DFMA_TENSOR_UTIL "NVML_GPM_METRIC_DFMA_TENSOR_UTIL" = 6 + NVML_GPM_METRIC_HMMA_TENSOR_UTIL "NVML_GPM_METRIC_HMMA_TENSOR_UTIL" = 7 + NVML_GPM_METRIC_DMMA_TENSOR_UTIL "NVML_GPM_METRIC_DMMA_TENSOR_UTIL" = 8 + NVML_GPM_METRIC_IMMA_TENSOR_UTIL "NVML_GPM_METRIC_IMMA_TENSOR_UTIL" = 9 + NVML_GPM_METRIC_DRAM_BW_UTIL "NVML_GPM_METRIC_DRAM_BW_UTIL" = 10 + NVML_GPM_METRIC_FP64_UTIL "NVML_GPM_METRIC_FP64_UTIL" = 11 + NVML_GPM_METRIC_FP32_UTIL "NVML_GPM_METRIC_FP32_UTIL" = 12 + NVML_GPM_METRIC_FP16_UTIL "NVML_GPM_METRIC_FP16_UTIL" = 13 + NVML_GPM_METRIC_PCIE_TX_PER_SEC "NVML_GPM_METRIC_PCIE_TX_PER_SEC" = 20 + NVML_GPM_METRIC_PCIE_RX_PER_SEC "NVML_GPM_METRIC_PCIE_RX_PER_SEC" = 21 + NVML_GPM_METRIC_NVDEC_0_UTIL "NVML_GPM_METRIC_NVDEC_0_UTIL" = 30 + NVML_GPM_METRIC_NVDEC_1_UTIL "NVML_GPM_METRIC_NVDEC_1_UTIL" = 31 + NVML_GPM_METRIC_NVDEC_2_UTIL "NVML_GPM_METRIC_NVDEC_2_UTIL" = 32 + NVML_GPM_METRIC_NVDEC_3_UTIL "NVML_GPM_METRIC_NVDEC_3_UTIL" = 33 + NVML_GPM_METRIC_NVDEC_4_UTIL "NVML_GPM_METRIC_NVDEC_4_UTIL" = 34 + NVML_GPM_METRIC_NVDEC_5_UTIL "NVML_GPM_METRIC_NVDEC_5_UTIL" = 35 + NVML_GPM_METRIC_NVDEC_6_UTIL "NVML_GPM_METRIC_NVDEC_6_UTIL" = 36 + NVML_GPM_METRIC_NVDEC_7_UTIL "NVML_GPM_METRIC_NVDEC_7_UTIL" = 37 + NVML_GPM_METRIC_NVJPG_0_UTIL "NVML_GPM_METRIC_NVJPG_0_UTIL" = 40 + NVML_GPM_METRIC_NVJPG_1_UTIL "NVML_GPM_METRIC_NVJPG_1_UTIL" = 41 + NVML_GPM_METRIC_NVJPG_2_UTIL "NVML_GPM_METRIC_NVJPG_2_UTIL" = 42 + NVML_GPM_METRIC_NVJPG_3_UTIL "NVML_GPM_METRIC_NVJPG_3_UTIL" = 43 + NVML_GPM_METRIC_NVJPG_4_UTIL "NVML_GPM_METRIC_NVJPG_4_UTIL" = 44 + NVML_GPM_METRIC_NVJPG_5_UTIL "NVML_GPM_METRIC_NVJPG_5_UTIL" = 45 + NVML_GPM_METRIC_NVJPG_6_UTIL "NVML_GPM_METRIC_NVJPG_6_UTIL" = 46 + NVML_GPM_METRIC_NVJPG_7_UTIL "NVML_GPM_METRIC_NVJPG_7_UTIL" = 47 + NVML_GPM_METRIC_NVOFA_0_UTIL "NVML_GPM_METRIC_NVOFA_0_UTIL" = 50 + NVML_GPM_METRIC_NVOFA_1_UTIL "NVML_GPM_METRIC_NVOFA_1_UTIL" = 51 + NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC" = 60 + NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC" = 61 + NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC" = 62 + NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC" = 63 + NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC" = 64 + NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC" = 65 + NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC" = 66 + NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC" = 67 + NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC" = 68 + NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC" = 69 + NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC" = 70 + NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC" = 71 + NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC" = 72 + NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC" = 73 + NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC" = 74 + NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC" = 75 + NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC" = 76 + NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC" = 77 + NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC" = 78 + NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC" = 79 + NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC" = 80 + NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC" = 81 + NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC" = 82 + NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC" = 83 + NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC" = 84 + NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC" = 85 + NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC" = 86 + NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC" = 87 + NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC" = 88 + NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC" = 89 + NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC" = 90 + NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC" = 91 + NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC" = 92 + NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC" = 93 + NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC" = 94 + NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC" = 95 + NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC" = 96 + NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC" = 97 + NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC" = 100 + NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC" = 101 + NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC" = 102 + NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC" = 103 + NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC" = 104 + NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC" = 105 + NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC" = 106 + NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC" = 107 + NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC" = 108 + NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC" = 109 + NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC" = 110 + NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC" = 111 + NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC" = 112 + NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC" = 113 + NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC" = 114 + NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC" = 115 + NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC" = 116 + NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC" = 117 + NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC" = 118 + NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC" = 119 + NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC" = 120 + NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC" = 121 + NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC" = 122 + NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC" = 123 + NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC" = 124 + NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC" = 125 + NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC" = 126 + NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC" = 127 + NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC" = 128 + NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC" = 129 + NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC" = 130 + NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC" = 131 + NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC" = 132 + NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC" = 133 + NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC" = 134 + NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC" = 135 + NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC" = 136 + NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC" = 137 + NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC" = 138 + NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC" = 139 + NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC" = 140 + NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC" = 141 + NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC" = 142 + NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC" = 143 + NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC" = 144 + NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC" = 145 + NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC" = 146 + NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC" = 147 + NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC" = 148 + NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC" = 149 + NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC" = 150 + NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC" = 151 + NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC" = 152 + NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC" = 153 + NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC" = 154 + NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC" = 155 + NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC" = 156 + NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC" = 157 + NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC" = 158 + NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC "NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC" = 159 + NVML_GPM_METRIC_HOSTMEM_CACHE_HIT "NVML_GPM_METRIC_HOSTMEM_CACHE_HIT" = 160 + NVML_GPM_METRIC_HOSTMEM_CACHE_MISS "NVML_GPM_METRIC_HOSTMEM_CACHE_MISS" = 161 + NVML_GPM_METRIC_PEERMEM_CACHE_HIT "NVML_GPM_METRIC_PEERMEM_CACHE_HIT" = 162 + NVML_GPM_METRIC_PEERMEM_CACHE_MISS "NVML_GPM_METRIC_PEERMEM_CACHE_MISS" = 163 + NVML_GPM_METRIC_DRAM_CACHE_HIT "NVML_GPM_METRIC_DRAM_CACHE_HIT" = 164 + NVML_GPM_METRIC_DRAM_CACHE_MISS "NVML_GPM_METRIC_DRAM_CACHE_MISS" = 165 + NVML_GPM_METRIC_NVENC_0_UTIL "NVML_GPM_METRIC_NVENC_0_UTIL" = 166 + NVML_GPM_METRIC_NVENC_1_UTIL "NVML_GPM_METRIC_NVENC_1_UTIL" = 167 + NVML_GPM_METRIC_NVENC_2_UTIL "NVML_GPM_METRIC_NVENC_2_UTIL" = 168 + NVML_GPM_METRIC_NVENC_3_UTIL "NVML_GPM_METRIC_NVENC_3_UTIL" = 169 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED" = 170 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE" = 171 + NVML_GPM_METRIC_GR0_CTXSW_REQUESTS "NVML_GPM_METRIC_GR0_CTXSW_REQUESTS" = 172 + NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ" = 173 + NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT" = 174 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED" = 175 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE" = 176 + NVML_GPM_METRIC_GR1_CTXSW_REQUESTS "NVML_GPM_METRIC_GR1_CTXSW_REQUESTS" = 177 + NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ" = 178 + NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT" = 179 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED" = 180 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE" = 181 + NVML_GPM_METRIC_GR2_CTXSW_REQUESTS "NVML_GPM_METRIC_GR2_CTXSW_REQUESTS" = 182 + NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ" = 183 + NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT" = 184 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED" = 185 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE" = 186 + NVML_GPM_METRIC_GR3_CTXSW_REQUESTS "NVML_GPM_METRIC_GR3_CTXSW_REQUESTS" = 187 + NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ" = 188 + NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT" = 189 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED" = 190 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE" = 191 + NVML_GPM_METRIC_GR4_CTXSW_REQUESTS "NVML_GPM_METRIC_GR4_CTXSW_REQUESTS" = 192 + NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ" = 193 + NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT" = 194 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED" = 195 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE" = 196 + NVML_GPM_METRIC_GR5_CTXSW_REQUESTS "NVML_GPM_METRIC_GR5_CTXSW_REQUESTS" = 197 + NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ" = 198 + NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT" = 199 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED" = 200 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE" = 201 + NVML_GPM_METRIC_GR6_CTXSW_REQUESTS "NVML_GPM_METRIC_GR6_CTXSW_REQUESTS" = 202 + NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ" = 203 + NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT" = 204 + NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED" = 205 + NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE" = 206 + 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 + NVML_GPM_METRIC_DMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_DMMA_CYCLES_ACTIVE" = 251 + NVML_GPM_METRIC_HMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_HMMA_CYCLES_ACTIVE" = 252 + NVML_GPM_METRIC_IMMA_CYCLES_ACTIVE "NVML_GPM_METRIC_IMMA_CYCLES_ACTIVE" = 253 + NVML_GPM_METRIC_DFMA_CYCLES_ACTIVE "NVML_GPM_METRIC_DFMA_CYCLES_ACTIVE" = 254 + NVML_GPM_METRIC_PCIE_TX "NVML_GPM_METRIC_PCIE_TX" = 255 + NVML_GPM_METRIC_PCIE_RX "NVML_GPM_METRIC_PCIE_RX" = 256 + NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE "NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE" = 257 + NVML_GPM_METRIC_FP64_CYCLES_ACTIVE "NVML_GPM_METRIC_FP64_CYCLES_ACTIVE" = 258 + NVML_GPM_METRIC_FP32_CYCLES_ACTIVE "NVML_GPM_METRIC_FP32_CYCLES_ACTIVE" = 259 + NVML_GPM_METRIC_FP16_CYCLES_ACTIVE "NVML_GPM_METRIC_FP16_CYCLES_ACTIVE" = 260 + NVML_GPM_METRIC_NVLINK_L0_RX "NVML_GPM_METRIC_NVLINK_L0_RX" = 261 + NVML_GPM_METRIC_NVLINK_L0_TX "NVML_GPM_METRIC_NVLINK_L0_TX" = 262 + NVML_GPM_METRIC_NVLINK_L1_RX "NVML_GPM_METRIC_NVLINK_L1_RX" = 263 + NVML_GPM_METRIC_NVLINK_L1_TX "NVML_GPM_METRIC_NVLINK_L1_TX" = 264 + NVML_GPM_METRIC_NVLINK_L2_RX "NVML_GPM_METRIC_NVLINK_L2_RX" = 265 + NVML_GPM_METRIC_NVLINK_L2_TX "NVML_GPM_METRIC_NVLINK_L2_TX" = 266 + NVML_GPM_METRIC_NVLINK_L3_RX "NVML_GPM_METRIC_NVLINK_L3_RX" = 267 + NVML_GPM_METRIC_NVLINK_L3_TX "NVML_GPM_METRIC_NVLINK_L3_TX" = 268 + NVML_GPM_METRIC_NVLINK_L4_RX "NVML_GPM_METRIC_NVLINK_L4_RX" = 269 + NVML_GPM_METRIC_NVLINK_L4_TX "NVML_GPM_METRIC_NVLINK_L4_TX" = 270 + NVML_GPM_METRIC_NVLINK_L5_RX "NVML_GPM_METRIC_NVLINK_L5_RX" = 271 + NVML_GPM_METRIC_NVLINK_L5_TX "NVML_GPM_METRIC_NVLINK_L5_TX" = 272 + NVML_GPM_METRIC_NVLINK_L6_RX "NVML_GPM_METRIC_NVLINK_L6_RX" = 273 + NVML_GPM_METRIC_NVLINK_L6_TX "NVML_GPM_METRIC_NVLINK_L6_TX" = 274 + NVML_GPM_METRIC_NVLINK_L7_RX "NVML_GPM_METRIC_NVLINK_L7_RX" = 275 + NVML_GPM_METRIC_NVLINK_L7_TX "NVML_GPM_METRIC_NVLINK_L7_TX" = 276 + NVML_GPM_METRIC_NVLINK_L8_RX "NVML_GPM_METRIC_NVLINK_L8_RX" = 277 + NVML_GPM_METRIC_NVLINK_L8_TX "NVML_GPM_METRIC_NVLINK_L8_TX" = 278 + NVML_GPM_METRIC_NVLINK_L9_RX "NVML_GPM_METRIC_NVLINK_L9_RX" = 279 + NVML_GPM_METRIC_NVLINK_L9_TX "NVML_GPM_METRIC_NVLINK_L9_TX" = 280 + NVML_GPM_METRIC_NVLINK_L10_RX "NVML_GPM_METRIC_NVLINK_L10_RX" = 281 + NVML_GPM_METRIC_NVLINK_L10_TX "NVML_GPM_METRIC_NVLINK_L10_TX" = 282 + NVML_GPM_METRIC_NVLINK_L11_RX "NVML_GPM_METRIC_NVLINK_L11_RX" = 283 + NVML_GPM_METRIC_NVLINK_L11_TX "NVML_GPM_METRIC_NVLINK_L11_TX" = 284 + NVML_GPM_METRIC_NVLINK_L12_RX "NVML_GPM_METRIC_NVLINK_L12_RX" = 285 + NVML_GPM_METRIC_NVLINK_L12_TX "NVML_GPM_METRIC_NVLINK_L12_TX" = 286 + NVML_GPM_METRIC_NVLINK_L13_RX "NVML_GPM_METRIC_NVLINK_L13_RX" = 287 + NVML_GPM_METRIC_NVLINK_L13_TX "NVML_GPM_METRIC_NVLINK_L13_TX" = 288 + NVML_GPM_METRIC_NVLINK_L14_RX "NVML_GPM_METRIC_NVLINK_L14_RX" = 289 + NVML_GPM_METRIC_NVLINK_L14_TX "NVML_GPM_METRIC_NVLINK_L14_TX" = 290 + NVML_GPM_METRIC_NVLINK_L15_RX "NVML_GPM_METRIC_NVLINK_L15_RX" = 291 + NVML_GPM_METRIC_NVLINK_L15_TX "NVML_GPM_METRIC_NVLINK_L15_TX" = 292 + NVML_GPM_METRIC_NVLINK_L16_RX "NVML_GPM_METRIC_NVLINK_L16_RX" = 293 + 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": + NVML_POWER_PROFILE_MAX_P "NVML_POWER_PROFILE_MAX_P" = 0 + NVML_POWER_PROFILE_MAX_Q "NVML_POWER_PROFILE_MAX_Q" = 1 + NVML_POWER_PROFILE_COMPUTE "NVML_POWER_PROFILE_COMPUTE" = 2 + NVML_POWER_PROFILE_MEMORY_BOUND "NVML_POWER_PROFILE_MEMORY_BOUND" = 3 + NVML_POWER_PROFILE_NETWORK "NVML_POWER_PROFILE_NETWORK" = 4 + NVML_POWER_PROFILE_BALANCED "NVML_POWER_PROFILE_BALANCED" = 5 + NVML_POWER_PROFILE_LLM_INFERENCE "NVML_POWER_PROFILE_LLM_INFERENCE" = 6 + NVML_POWER_PROFILE_LLM_TRAINING "NVML_POWER_PROFILE_LLM_TRAINING" = 7 + NVML_POWER_PROFILE_RBM "NVML_POWER_PROFILE_RBM" = 8 + NVML_POWER_PROFILE_DCPCIE "NVML_POWER_PROFILE_DCPCIE" = 9 + NVML_POWER_PROFILE_HMMA_SPARSE "NVML_POWER_PROFILE_HMMA_SPARSE" = 10 + NVML_POWER_PROFILE_HMMA_DENSE "NVML_POWER_PROFILE_HMMA_DENSE" = 11 + NVML_POWER_PROFILE_SYNC_BALANCED "NVML_POWER_PROFILE_SYNC_BALANCED" = 12 + NVML_POWER_PROFILE_HPC "NVML_POWER_PROFILE_HPC" = 13 + NVML_POWER_PROFILE_MIG "NVML_POWER_PROFILE_MIG" = 14 + NVML_POWER_PROFILE_MAX "NVML_POWER_PROFILE_MAX" = 15 + +ctypedef enum nvmlDeviceAddressingModeType_t "nvmlDeviceAddressingModeType_t": + NVML_DEVICE_ADDRESSING_MODE_NONE "NVML_DEVICE_ADDRESSING_MODE_NONE" = 0 + NVML_DEVICE_ADDRESSING_MODE_HMM "NVML_DEVICE_ADDRESSING_MODE_HMM" = 1 + NVML_DEVICE_ADDRESSING_MODE_ATS "NVML_DEVICE_ADDRESSING_MODE_ATS" = 2 + +ctypedef enum nvmlPRMCounterId_t "nvmlPRMCounterId_t": + NVML_PRM_COUNTER_ID_NONE "NVML_PRM_COUNTER_ID_NONE" = 0 + NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS" = 1 + NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS" = 2 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS" = 101 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY" = 102 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES" = 103 + NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT "NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT" = 201 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES" = 301 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR" = 302 + NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE" = 303 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES" = 304 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES" = 305 + NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS" = 306 + NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS" = 307 + NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY "NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY" = 1001 + +ctypedef enum nvmlPowerProfileOperation_t "nvmlPowerProfileOperation_t": + NVML_POWER_PROFILE_OPERATION_CLEAR "NVML_POWER_PROFILE_OPERATION_CLEAR" = 0 + NVML_POWER_PROFILE_OPERATION_SET "NVML_POWER_PROFILE_OPERATION_SET" = 1 + 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': + unsigned int version + unsigned int domain + unsigned int bus + unsigned int device + unsigned int pciDeviceId + unsigned int pciSubSystemId + unsigned int baseClass + unsigned int subClass + char busId[32] + +ctypedef struct nvmlCoolerInfo_v1_t 'nvmlCoolerInfo_v1_t': + unsigned int version + unsigned int index + nvmlCoolerControl_t signalType + nvmlCoolerTarget_t target + +ctypedef struct nvmlDramEncryptionInfo_v1_t 'nvmlDramEncryptionInfo_v1_t': + unsigned int version + nvmlEnableState_t encryptionState + +ctypedef struct nvmlMarginTemperature_v1_t 'nvmlMarginTemperature_v1_t': + unsigned int version + int marginTemperature + +ctypedef struct nvmlClockOffset_v1_t 'nvmlClockOffset_v1_t': + unsigned int version + nvmlClockType_t type + nvmlPstates_t pstate + int clockOffsetMHz + int minClockOffsetMHz + int maxClockOffsetMHz + +ctypedef struct nvmlFanSpeedInfo_v1_t 'nvmlFanSpeedInfo_v1_t': + unsigned int version + unsigned int fan + unsigned int speed + +ctypedef struct nvmlDevicePerfModes_v1_t 'nvmlDevicePerfModes_v1_t': + unsigned int version + char str[2048] + +ctypedef struct nvmlDeviceCurrentClockFreqs_v1_t 'nvmlDeviceCurrentClockFreqs_v1_t': + unsigned int version + char str[2048] + +ctypedef struct nvmlEccSramErrorStatus_v1_t 'nvmlEccSramErrorStatus_v1_t': + unsigned int version + unsigned long long aggregateUncParity + unsigned long long aggregateUncSecDed + unsigned long long aggregateCor + unsigned long long volatileUncParity + unsigned long long volatileUncSecDed + unsigned long long volatileCor + unsigned long long aggregateUncBucketL2 + unsigned long long aggregateUncBucketSm + unsigned long long aggregateUncBucketPcie + unsigned long long aggregateUncBucketMcu + unsigned long long aggregateUncBucketOther + unsigned int bThresholdExceeded + +ctypedef struct nvmlPlatformInfo_v2_t 'nvmlPlatformInfo_v2_t': + unsigned int version + unsigned char ibGuid[16] + unsigned char chassisSerialNumber[16] + unsigned char slotNumber + unsigned char trayIndex + unsigned char hostId + unsigned char peerType + 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 + +ctypedef struct nvmlVgpuPlacementId_v1_t 'nvmlVgpuPlacementId_v1_t': + unsigned int version + unsigned int placementId + +ctypedef struct nvmlVgpuPlacementList_v2_t 'nvmlVgpuPlacementList_v2_t': + unsigned int version + unsigned int placementSize + unsigned int count + unsigned int* placementIds + unsigned int mode + +ctypedef struct nvmlVgpuTypeBar1Info_v1_t 'nvmlVgpuTypeBar1Info_v1_t': + unsigned int version + unsigned long long bar1Size + +ctypedef struct nvmlVgpuRuntimeState_v1_t 'nvmlVgpuRuntimeState_v1_t': + unsigned int version + unsigned long long size + +ctypedef struct nvmlSystemConfComputeSettings_v1_t 'nvmlSystemConfComputeSettings_v1_t': + unsigned int version + unsigned int environment + unsigned int ccFeature + unsigned int devToolsMode + unsigned int multiGpuMode + +ctypedef struct nvmlConfComputeSetKeyRotationThresholdInfo_v1_t 'nvmlConfComputeSetKeyRotationThresholdInfo_v1_t': + unsigned int version + unsigned long long maxAttackerAdvantage + +ctypedef struct nvmlConfComputeGetKeyRotationThresholdInfo_v1_t 'nvmlConfComputeGetKeyRotationThresholdInfo_v1_t': + unsigned int version + 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 + int temperature + +ctypedef struct nvmlNvlinkSupportedBwModes_v1_t 'nvmlNvlinkSupportedBwModes_v1_t': + unsigned int version + unsigned char bwModes[23] + unsigned char totalBwModes + +ctypedef struct nvmlNvlinkGetBwMode_v1_t 'nvmlNvlinkGetBwMode_v1_t': + unsigned int version + unsigned int bIsBest + unsigned char bwMode + +ctypedef struct nvmlNvlinkSetBwMode_v1_t 'nvmlNvlinkSetBwMode_v1_t': + unsigned int version + unsigned int bSetBest + unsigned char bwMode + +ctypedef struct nvmlDeviceCapabilities_v1_t 'nvmlDeviceCapabilities_v1_t': + unsigned int version + unsigned int capMask + +ctypedef struct nvmlPowerSmoothingProfile_v1_t 'nvmlPowerSmoothingProfile_v1_t': + unsigned int version + unsigned int profileId + unsigned int paramId + double value + +ctypedef struct nvmlPowerSmoothingState_v1_t 'nvmlPowerSmoothingState_v1_t': + unsigned int version + nvmlEnableState_t state + +ctypedef struct nvmlDeviceAddressingMode_v1_t 'nvmlDeviceAddressingMode_v1_t': + unsigned int version + unsigned int value + +ctypedef struct nvmlRepairStatus_v1_t 'nvmlRepairStatus_v1_t': + unsigned int version + unsigned int bChannelRepairPending + unsigned int bTpcRepairPending + +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 + unsigned int bus + unsigned int device + unsigned int pciDeviceId + unsigned int pciSubSystemId + char busId[32] + +ctypedef struct nvmlEccErrorCounts_t 'nvmlEccErrorCounts_t': + unsigned long long l1Cache + unsigned long long l2Cache + unsigned long long deviceMemory + unsigned long long registerFile + +ctypedef struct nvmlUtilization_t 'nvmlUtilization_t': + unsigned int gpu + unsigned int memory + +ctypedef struct nvmlMemory_t 'nvmlMemory_t': + unsigned long long total + unsigned long long free + unsigned long long used + +ctypedef struct nvmlMemory_v2_t 'nvmlMemory_v2_t': + unsigned int version + unsigned long long total + unsigned long long reserved + unsigned long long free + unsigned long long used + +ctypedef struct nvmlBAR1Memory_t 'nvmlBAR1Memory_t': + unsigned long long bar1Total + unsigned long long bar1Free + unsigned long long bar1Used + +ctypedef struct nvmlProcessInfo_v1_t 'nvmlProcessInfo_v1_t': + unsigned int pid + unsigned long long usedGpuMemory + +ctypedef struct nvmlProcessInfo_v2_t 'nvmlProcessInfo_v2_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlProcessInfo_t 'nvmlProcessInfo_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlProcessDetail_v1_t 'nvmlProcessDetail_v1_t': + unsigned int pid + unsigned long long usedGpuMemory + unsigned int gpuInstanceId + unsigned int computeInstanceId + unsigned long long usedGpuCcProtectedMemory + +ctypedef struct nvmlDeviceAttributes_t 'nvmlDeviceAttributes_t': + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + unsigned int gpuInstanceSliceCount + unsigned int computeInstanceSliceCount + unsigned long long memorySizeMB + +ctypedef struct nvmlC2cModeInfo_v1_t 'nvmlC2cModeInfo_v1_t': + unsigned int isC2cEnabled + +ctypedef struct nvmlRowRemapperHistogramValues_t 'nvmlRowRemapperHistogramValues_t': + unsigned int max + unsigned int high + unsigned int partial + unsigned int low + unsigned int none + +ctypedef struct nvmlNvLinkUtilizationControl_t 'nvmlNvLinkUtilizationControl_t': + nvmlNvLinkUtilizationCountUnits_t units + nvmlNvLinkUtilizationCountPktTypes_t pktfilter + +ctypedef struct nvmlBridgeChipInfo_t 'nvmlBridgeChipInfo_t': + nvmlBridgeChipType_t type + unsigned int fwVersion + +ctypedef union nvmlValue_t 'nvmlValue_t': + double dVal + int siVal + unsigned int uiVal + unsigned long ulVal + unsigned long long ullVal + signed long long sllVal + unsigned short usVal + +ctypedef struct nvmlViolationTime_t 'nvmlViolationTime_t': + unsigned long long referenceTime + unsigned long long violationTime + +ctypedef struct cuda_bindings_nvml__anon_pod0: + nvmlThermalController_t controller + int defaultMinTemp + int defaultMaxTemp + int currentTemp + nvmlThermalTarget_t target + +ctypedef union nvmlUUIDValue_t 'nvmlUUIDValue_t': + char str[41] + unsigned char bytes[16] + +ctypedef struct nvmlClkMonFaultInfo_t 'nvmlClkMonFaultInfo_t': + unsigned int clkApiDomain + unsigned int clkDomainFaultMask + +ctypedef struct nvmlProcessUtilizationSample_t 'nvmlProcessUtilizationSample_t': + unsigned int pid + unsigned long long timeStamp + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + +ctypedef struct nvmlProcessUtilizationInfo_v1_t 'nvmlProcessUtilizationInfo_v1_t': + unsigned long long timeStamp + unsigned int pid + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + unsigned int jpgUtil + unsigned int ofaUtil + +ctypedef struct nvmlPlatformInfo_v1_t 'nvmlPlatformInfo_v1_t': + unsigned int version + unsigned char ibGuid[16] + unsigned char rackGuid[16] + unsigned char chassisPhysicalSlotNumber + unsigned char computeSlotIndex + unsigned char nodeIndex + unsigned char peerType + unsigned char moduleId + +ctypedef struct cuda_bindings_nvml__anon_pod1: + unsigned int bIsPresent + unsigned int percentage + unsigned int incThreshold + unsigned int decThreshold + +ctypedef struct nvmlVgpuPlacementList_v1_t 'nvmlVgpuPlacementList_v1_t': + unsigned int version + unsigned int placementSize + unsigned int count + unsigned int* placementIds + +ctypedef struct cuda_bindings_nvml__anon_pod2: + unsigned int avgFactor + unsigned int timeslice + +ctypedef struct cuda_bindings_nvml__anon_pod3: + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerLogEntry_t 'nvmlVgpuSchedulerLogEntry_t': + unsigned long long timestamp + unsigned long long timeRunTotal + unsigned long long timeRun + unsigned int swRunlistId + unsigned long long targetTimeSlice + unsigned long long cumulativePreemptionTime + +ctypedef struct cuda_bindings_nvml__anon_pod4: + unsigned int avgFactor + unsigned int frequency + +ctypedef struct cuda_bindings_nvml__anon_pod5: + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerCapabilities_t 'nvmlVgpuSchedulerCapabilities_t': + unsigned int supportedSchedulers[3] + unsigned int maxTimeslice + unsigned int minTimeslice + unsigned int isArrModeSupported + unsigned int maxFrequencyForARR + unsigned int minFrequencyForARR + unsigned int maxAvgFactorForARR + unsigned int minAvgFactorForARR + +ctypedef struct nvmlVgpuLicenseExpiry_t 'nvmlVgpuLicenseExpiry_t': + unsigned int year + unsigned short month + unsigned short day + unsigned short hour + unsigned short min + unsigned short sec + unsigned char status + +ctypedef struct nvmlGridLicenseExpiry_t 'nvmlGridLicenseExpiry_t': + unsigned int year + unsigned short month + unsigned short day + unsigned short hour + unsigned short min + unsigned short sec + unsigned char status + +ctypedef struct nvmlNvLinkPowerThres_t 'nvmlNvLinkPowerThres_t': + unsigned int lowPwrThreshold + +ctypedef struct nvmlHwbcEntry_t 'nvmlHwbcEntry_t': + unsigned int hwbcId + char firmwareVersion[32] + +ctypedef struct nvmlLedState_t 'nvmlLedState_t': + char cause[256] + nvmlLedColor_t color + +ctypedef struct nvmlUnitInfo_t 'nvmlUnitInfo_t': + char name[96] + char id[96] + char serial[96] + char firmwareVersion[96] + +ctypedef struct nvmlPSUInfo_t 'nvmlPSUInfo_t': + char state[256] + unsigned int current + unsigned int voltage + unsigned int power + +ctypedef struct nvmlUnitFanInfo_t 'nvmlUnitFanInfo_t': + unsigned int speed + nvmlFanState_t state + +ctypedef struct nvmlSystemEventData_v1_t 'nvmlSystemEventData_v1_t': + unsigned long long eventType + unsigned int gpuId + +ctypedef struct nvmlAccountingStats_t 'nvmlAccountingStats_t': + unsigned int gpuUtilization + unsigned int memoryUtilization + unsigned long long maxMemoryUsage + unsigned long long time + unsigned long long startTime + unsigned int isRunning + unsigned int reserved[5] + +ctypedef struct nvmlFBCStats_t 'nvmlFBCStats_t': + unsigned int sessionsCount + unsigned int averageFPS + unsigned int averageLatency + +ctypedef struct nvmlConfComputeSystemCaps_t 'nvmlConfComputeSystemCaps_t': + unsigned int cpuCaps + unsigned int gpusCaps + +ctypedef struct nvmlConfComputeSystemState_t 'nvmlConfComputeSystemState_t': + unsigned int environment + unsigned int ccFeature + unsigned int devToolsMode + +ctypedef struct nvmlConfComputeMemSizeInfo_t 'nvmlConfComputeMemSizeInfo_t': + unsigned long long protectedMemSizeKib + unsigned long long unprotectedMemSizeKib + +ctypedef struct nvmlConfComputeGpuCertificate_t 'nvmlConfComputeGpuCertificate_t': + unsigned int certChainSize + unsigned int attestationCertChainSize + unsigned char certChain[0x1000] + unsigned char attestationCertChain[0x1400] + +ctypedef struct nvmlConfComputeGpuAttestationReport_t 'nvmlConfComputeGpuAttestationReport_t': + unsigned int isCecAttestationReportPresent + unsigned int attestationReportSize + unsigned int cecAttestationReportSize + unsigned char nonce[0x20] + unsigned char attestationReport[0x2000] + unsigned char cecAttestationReport[0x1000] + +ctypedef struct nvmlVgpuVersion_t 'nvmlVgpuVersion_t': + unsigned int minVersion + unsigned int maxVersion + +ctypedef struct nvmlVgpuMetadata_t 'nvmlVgpuMetadata_t': + unsigned int version + unsigned int revision + nvmlVgpuGuestInfoState_t guestInfoState + char guestDriverVersion[80] + char hostDriverVersion[80] + unsigned int reserved[6] + unsigned int vgpuVirtualizationCaps + unsigned int guestVgpuVersion + unsigned int opaqueDataSize + char opaqueData[4] + +ctypedef struct nvmlVgpuPgpuCompatibility_t 'nvmlVgpuPgpuCompatibility_t': + nvmlVgpuVmCompatibility_t vgpuVmCompatibility + nvmlVgpuPgpuCompatibilityLimitCode_t compatibilityLimitCode + +ctypedef struct nvmlGpuInstancePlacement_t 'nvmlGpuInstancePlacement_t': + unsigned int start + unsigned int size + +ctypedef struct nvmlGpuInstanceProfileInfo_t 'nvmlGpuInstanceProfileInfo_t': + unsigned int id + unsigned int isP2pSupported + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + +ctypedef struct nvmlGpuInstanceProfileInfo_v2_t 'nvmlGpuInstanceProfileInfo_v2_t': + unsigned int version + unsigned int id + unsigned int isP2pSupported + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + char name[96] + +ctypedef struct nvmlGpuInstanceProfileInfo_v3_t 'nvmlGpuInstanceProfileInfo_v3_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int copyEngineCount + unsigned int decoderCount + unsigned int encoderCount + unsigned int jpegCount + unsigned int ofaCount + unsigned long long memorySizeMB + char name[96] + unsigned int capabilities + +ctypedef struct nvmlComputeInstancePlacement_t 'nvmlComputeInstancePlacement_t': + unsigned int start + unsigned int size + +ctypedef struct nvmlComputeInstanceProfileInfo_t 'nvmlComputeInstanceProfileInfo_t': + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + +ctypedef struct nvmlComputeInstanceProfileInfo_v2_t 'nvmlComputeInstanceProfileInfo_v2_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + char name[96] + +ctypedef struct nvmlComputeInstanceProfileInfo_v3_t 'nvmlComputeInstanceProfileInfo_v3_t': + unsigned int version + unsigned int id + unsigned int sliceCount + unsigned int instanceCount + unsigned int multiprocessorCount + unsigned int sharedCopyEngineCount + unsigned int sharedDecoderCount + unsigned int sharedEncoderCount + unsigned int sharedJpegCount + unsigned int sharedOfaCount + char name[96] + unsigned int capabilities + +ctypedef struct cuda_bindings_nvml__anon_pod6: + char* shortName + char* longName + char* unit + +ctypedef struct nvmlGpmSupport_t 'nvmlGpmSupport_t': + unsigned int version + unsigned int isSupportedDevice + +ctypedef struct nvmlMask255_t 'nvmlMask255_t': + unsigned int mask[8] + +ctypedef struct nvmlDevicePowerMizerModes_v1_t 'nvmlDevicePowerMizerModes_v1_t': + unsigned int currentMode + unsigned int mode + unsigned int supportedPowerMizerModes + +ctypedef struct nvmlHostname_v1_t 'nvmlHostname_v1_t': + char value[64] + +ctypedef struct nvmlEccSramUniqueUncorrectedErrorEntry_v1_t 'nvmlEccSramUniqueUncorrectedErrorEntry_v1_t': + unsigned int unit + unsigned int location + unsigned int sublocation + unsigned int extlocation + unsigned int address + unsigned int isParity + unsigned int count + +ctypedef struct nvmlNvLinkInfo_v1_t 'nvmlNvLinkInfo_v1_t': + unsigned int version + unsigned int isNvleEnabled + +ctypedef struct nvmlNvlinkFirmwareVersion_t 'nvmlNvlinkFirmwareVersion_t': + unsigned char ucodeType + unsigned int major + unsigned int minor + unsigned int subMinor + +ctypedef union cuda_bindings_nvml__anon_pod7: + unsigned char inData[496] + unsigned char outData[496] + +ctypedef struct nvmlUnrepairableMemoryStatus_v1_t 'nvmlUnrepairableMemoryStatus_v1_t': + unsigned int bUnrepairableMemory + +ctypedef struct nvmlRusdSettings_v1_t 'nvmlRusdSettings_v1_t': + unsigned int version + unsigned long long pollMask + +ctypedef struct nvmlPRMCounterInput_v1_t 'nvmlPRMCounterInput_v1_t': + unsigned int localPort + +ctypedef struct nvmlVgpuSchedulerStateInfo_v2_t 'nvmlVgpuSchedulerStateInfo_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int avgFactor + unsigned int timeslice + +ctypedef struct nvmlVgpuSchedulerLogEntry_v2_t 'nvmlVgpuSchedulerLogEntry_v2_t': + unsigned long long timestamp + unsigned long long timeRunTotal + unsigned long long timeRun + unsigned int swRunlistId + unsigned long long targetTimeSlice + unsigned long long cumulativePreemptionTime + unsigned int weight + +ctypedef struct nvmlVgpuSchedulerState_v2_t 'nvmlVgpuSchedulerState_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + 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 + unsigned int powerValueMw + +ctypedef struct nvmlVgpuTypeIdInfo_v1_t 'nvmlVgpuTypeIdInfo_v1_t': + unsigned int version + unsigned int vgpuCount + nvmlVgpuTypeId_t* vgpuTypeIds + +ctypedef struct nvmlVgpuTypeMaxInstance_v1_t 'nvmlVgpuTypeMaxInstance_v1_t': + unsigned int version + nvmlVgpuTypeId_t vgpuTypeId + unsigned int maxInstancePerGI + +ctypedef struct nvmlVgpuCreatablePlacementInfo_v1_t 'nvmlVgpuCreatablePlacementInfo_v1_t': + unsigned int version + nvmlVgpuTypeId_t vgpuTypeId + unsigned int count + unsigned int* placementIds + unsigned int placementSize + +ctypedef struct nvmlVgpuProcessUtilizationSample_t 'nvmlVgpuProcessUtilizationSample_t': + nvmlVgpuInstance_t vgpuInstance + unsigned int pid + char processName[64] + unsigned long long timeStamp + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + +ctypedef struct nvmlVgpuProcessUtilizationInfo_v1_t 'nvmlVgpuProcessUtilizationInfo_v1_t': + char processName[64] + unsigned long long timeStamp + nvmlVgpuInstance_t vgpuInstance + unsigned int pid + unsigned int smUtil + unsigned int memUtil + unsigned int encUtil + unsigned int decUtil + unsigned int jpgUtil + unsigned int ofaUtil + +ctypedef struct nvmlActiveVgpuInstanceInfo_v1_t 'nvmlActiveVgpuInstanceInfo_v1_t': + unsigned int version + unsigned int vgpuCount + nvmlVgpuInstance_t* vgpuInstances + +ctypedef struct nvmlEncoderSessionInfo_t 'nvmlEncoderSessionInfo_t': + unsigned int sessionId + unsigned int pid + nvmlVgpuInstance_t vgpuInstance + nvmlEncoderType_t codecType + unsigned int hResolution + unsigned int vResolution + unsigned int averageFps + unsigned int averageLatency + +ctypedef struct nvmlFBCSessionInfo_t 'nvmlFBCSessionInfo_t': + unsigned int sessionId + unsigned int pid + nvmlVgpuInstance_t vgpuInstance + unsigned int displayOrdinal + nvmlFBCSessionType_t sessionType + unsigned int sessionFlags + unsigned int hMaxResolution + unsigned int vMaxResolution + unsigned int hResolution + unsigned int vResolution + unsigned int averageFPS + 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 + unsigned int cliqueId + nvmlGpuFabricState_t state + +ctypedef struct nvmlGpuFabricInfo_v2_t 'nvmlGpuFabricInfo_v2_t': + unsigned int version + unsigned char clusterUuid[16] + nvmlReturn_t status + unsigned int cliqueId + nvmlGpuFabricState_t state + unsigned int healthMask + +ctypedef struct nvmlGpuFabricInfo_v3_t 'nvmlGpuFabricInfo_v3_t': + unsigned int version + unsigned char clusterUuid[16] + nvmlReturn_t status + unsigned int cliqueId + nvmlGpuFabricState_t state + unsigned int healthMask + 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 + unsigned long long eventData + unsigned int gpuInstanceId + unsigned int computeInstanceId + +ctypedef struct nvmlSystemEventSetCreateRequest_v1_t 'nvmlSystemEventSetCreateRequest_v1_t': + unsigned int version + nvmlSystemEventSet_t set + +ctypedef struct nvmlSystemEventSetFreeRequest_v1_t 'nvmlSystemEventSetFreeRequest_v1_t': + unsigned int version + nvmlSystemEventSet_t set + +ctypedef struct nvmlSystemRegisterEventRequest_v1_t 'nvmlSystemRegisterEventRequest_v1_t': + unsigned int version + unsigned long long eventTypes + nvmlSystemEventSet_t set + +ctypedef struct nvmlExcludedDeviceInfo_t 'nvmlExcludedDeviceInfo_t': + nvmlPciInfo_t pciInfo + char uuid[80] + +ctypedef struct nvmlProcessDetailList_v1_t 'nvmlProcessDetailList_v1_t': + unsigned int version + unsigned int mode + unsigned int numProcArrayEntries + nvmlProcessDetail_v1_t* procArray + +ctypedef struct nvmlBridgeChipHierarchy_t 'nvmlBridgeChipHierarchy_t': + unsigned char bridgeCount + nvmlBridgeChipInfo_t bridgeChipInfo[128] + +ctypedef struct nvmlSample_t 'nvmlSample_t': + unsigned long long timeStamp + nvmlValue_t sampleValue + +ctypedef struct nvmlVgpuInstanceUtilizationSample_t 'nvmlVgpuInstanceUtilizationSample_t': + nvmlVgpuInstance_t vgpuInstance + unsigned long long timeStamp + nvmlValue_t smUtil + nvmlValue_t memUtil + nvmlValue_t encUtil + nvmlValue_t decUtil + +ctypedef struct nvmlVgpuInstanceUtilizationInfo_v1_t 'nvmlVgpuInstanceUtilizationInfo_v1_t': + unsigned long long timeStamp + nvmlVgpuInstance_t vgpuInstance + nvmlValue_t smUtil + nvmlValue_t memUtil + nvmlValue_t encUtil + nvmlValue_t decUtil + nvmlValue_t jpgUtil + nvmlValue_t ofaUtil + +ctypedef struct nvmlFieldValue_t 'nvmlFieldValue_t': + unsigned int fieldId + unsigned int scopeId + long long timestamp + long long latencyUsec + nvmlValueType_t valueType + nvmlReturn_t nvmlReturn + nvmlValue_t value + +ctypedef struct nvmlPRMCounterValue_v1_t 'nvmlPRMCounterValue_v1_t': + nvmlReturn_t status + nvmlValueType_t outputType + nvmlValue_t outputValue + +ctypedef struct nvmlGpuThermalSettings_t 'nvmlGpuThermalSettings_t': + unsigned int count + cuda_bindings_nvml__anon_pod0 sensor[3] + +ctypedef struct nvmlUUID_v1_t 'nvmlUUID_v1_t': + unsigned int version + unsigned int type + nvmlUUIDValue_t value + +ctypedef struct nvmlClkMonStatus_t 'nvmlClkMonStatus_t': + unsigned int bGlobalStatus + unsigned int clkMonListSize + nvmlClkMonFaultInfo_t clkMonList[32] + +ctypedef struct nvmlProcessesUtilizationInfo_v1_t 'nvmlProcessesUtilizationInfo_v1_t': + unsigned int version + unsigned int processSamplesCount + unsigned long long lastSeenTimeStamp + nvmlProcessUtilizationInfo_v1_t* procUtilArray + +ctypedef struct nvmlGpuDynamicPstatesInfo_t 'nvmlGpuDynamicPstatesInfo_t': + unsigned int flags + cuda_bindings_nvml__anon_pod1 utilization[8] + +ctypedef union nvmlVgpuSchedulerParams_t 'nvmlVgpuSchedulerParams_t': + cuda_bindings_nvml__anon_pod2 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod3 vgpuSchedData + +ctypedef union nvmlVgpuSchedulerSetParams_t 'nvmlVgpuSchedulerSetParams_t': + cuda_bindings_nvml__anon_pod4 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod5 vgpuSchedData + +ctypedef struct nvmlVgpuLicenseInfo_t 'nvmlVgpuLicenseInfo_t': + unsigned char isLicensed + nvmlVgpuLicenseExpiry_t licenseExpiry + unsigned int currentState + +ctypedef struct nvmlGridLicensableFeature_t 'nvmlGridLicensableFeature_t': + nvmlGridLicenseFeatureCode_t featureCode + unsigned int featureState + char licenseInfo[128] + char productName[128] + unsigned int featureEnabled + nvmlGridLicenseExpiry_t licenseExpiry + +ctypedef struct nvmlUnitFanSpeeds_t 'nvmlUnitFanSpeeds_t': + nvmlUnitFanInfo_t fans[24] + unsigned int count + +ctypedef struct nvmlSystemEventSetWaitRequest_v1_t 'nvmlSystemEventSetWaitRequest_v1_t': + unsigned int version + unsigned int timeoutms + nvmlSystemEventSet_t set + nvmlSystemEventData_v1_t* data + unsigned int dataSize + unsigned int numEvent + +ctypedef struct nvmlVgpuPgpuMetadata_t 'nvmlVgpuPgpuMetadata_t': + unsigned int version + unsigned int revision + char hostDriverVersion[80] + unsigned int pgpuVirtualizationCaps + unsigned int reserved[5] + nvmlVgpuVersion_t hostSupportedVgpuRange + unsigned int opaqueDataSize + char opaqueData[4] + +ctypedef struct nvmlGpuInstanceInfo_t 'nvmlGpuInstanceInfo_t': + nvmlDevice_t device + unsigned int id + unsigned int profileId + nvmlGpuInstancePlacement_t placement + +ctypedef struct nvmlComputeInstanceInfo_t 'nvmlComputeInstanceInfo_t': + nvmlDevice_t device + nvmlGpuInstance_t gpuInstance + unsigned int id + unsigned int profileId + nvmlComputeInstancePlacement_t placement + +ctypedef struct nvmlGpmMetric_t 'nvmlGpmMetric_t': + unsigned int metricId + nvmlReturn_t nvmlReturn + double value + cuda_bindings_nvml__anon_pod6 metricInfo + +ctypedef struct nvmlWorkloadPowerProfileInfo_v1_t 'nvmlWorkloadPowerProfileInfo_v1_t': + unsigned int version + unsigned int profileId + unsigned int priority + nvmlMask255_t conflictingMask + +ctypedef struct nvmlWorkloadPowerProfileCurrentProfiles_v1_t 'nvmlWorkloadPowerProfileCurrentProfiles_v1_t': + unsigned int version + nvmlMask255_t perfProfilesMask + nvmlMask255_t requestedProfilesMask + nvmlMask255_t enforcedProfilesMask + +ctypedef struct nvmlWorkloadPowerProfileRequestedProfiles_v1_t 'nvmlWorkloadPowerProfileRequestedProfiles_v1_t': + unsigned int version + nvmlMask255_t requestedProfilesMask + +ctypedef struct nvmlWorkloadPowerProfileUpdateProfiles_v1_t 'nvmlWorkloadPowerProfileUpdateProfiles_v1_t': + nvmlPowerProfileOperation_t operation + nvmlMask255_t updateProfilesMask + +ctypedef struct nvmlEccSramUniqueUncorrectedErrorCounts_v1_t 'nvmlEccSramUniqueUncorrectedErrorCounts_v1_t': + unsigned int version + unsigned int entryCount + nvmlEccSramUniqueUncorrectedErrorEntry_v1_t* entries + +ctypedef struct nvmlNvlinkFirmwareInfo_t 'nvmlNvlinkFirmwareInfo_t': + nvmlNvlinkFirmwareVersion_t firmwareVersion[100] + unsigned int numValidEntries + +ctypedef struct nvmlPRMTLV_v1_t 'nvmlPRMTLV_v1_t': + unsigned dataSize + unsigned status + cuda_bindings_nvml__anon_pod7 _anon_pod_member0 + +ctypedef struct nvmlVgpuSchedulerLogInfo_v2_t 'nvmlVgpuSchedulerLogInfo_v2_t': + unsigned int engineId + unsigned int schedulerPolicy + unsigned int avgFactor + unsigned int timeslice + unsigned int entriesCount + 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 + unsigned long long lastSeenTimeStamp + 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 + unsigned int vgpuInstanceCount + unsigned long long lastSeenTimeStamp + nvmlVgpuInstanceUtilizationInfo_v1_t* vgpuUtilArray + +ctypedef struct nvmlPRMCounter_v1_t 'nvmlPRMCounter_v1_t': + unsigned int counterId + nvmlPRMCounterInput_v1_t inData + 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 + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + unsigned int entriesCount + nvmlVgpuSchedulerLogEntry_t logEntries[200] + +ctypedef struct nvmlVgpuSchedulerGetState_t 'nvmlVgpuSchedulerGetState_t': + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerStateInfo_v1_t 'nvmlVgpuSchedulerStateInfo_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerLogInfo_v1_t 'nvmlVgpuSchedulerLogInfo_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int arrMode + nvmlVgpuSchedulerParams_t schedulerParams + unsigned int entriesCount + nvmlVgpuSchedulerLogEntry_t logEntries[200] + +ctypedef struct nvmlVgpuSchedulerSetState_t 'nvmlVgpuSchedulerSetState_t': + unsigned int schedulerPolicy + unsigned int enableARRMode + nvmlVgpuSchedulerSetParams_t schedulerParams + +ctypedef struct nvmlVgpuSchedulerState_v1_t 'nvmlVgpuSchedulerState_v1_t': + unsigned int version + unsigned int engineId + unsigned int schedulerPolicy + unsigned int enableARRMode + nvmlVgpuSchedulerSetParams_t schedulerParams + +ctypedef struct nvmlGridLicensableFeatures_t 'nvmlGridLicensableFeatures_t': + int isGridLicenseSupported + unsigned int licensableFeaturesCount + nvmlGridLicensableFeature_t gridLicensableFeatures[3] + +ctypedef nvmlSystemEventSetWaitRequest_v1_t nvmlSystemEventSetWaitRequest_t 'nvmlSystemEventSetWaitRequest_t' + +ctypedef struct nvmlGpmMetricsGet_t 'nvmlGpmMetricsGet_t': + unsigned int version + unsigned int numMetrics + nvmlGpmSample_t sample1 + nvmlGpmSample_t sample2 + 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' + + +############################################################################### +# Functions +############################################################################### + +cdef nvmlReturn_t nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef const char* nvmlErrorString(nvmlReturn_t result) except?NULL nogil +cdef nvmlReturn_t nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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 +cdef nvmlReturn_t nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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 +cdef nvmlReturn_t nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings_12/cuda/bindings/cynvml.pyx b/cuda_bindings_12/cuda/bindings/cynvml.pyx new file mode 100644 index 00000000000..9b2f7df7c54 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvml.pyx @@ -0,0 +1,1432 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=b30ca4e9dfac73d38cb872e4dc7d80d69cbb7e516c50e048cb34234a6c0198a6 +from ._internal cimport nvml as _nvml + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef nvmlReturn_t nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlInit_v2() + + +cdef nvmlReturn_t nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlInitWithFlags(flags) + + +cdef nvmlReturn_t nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlShutdown() + + +cdef const char* nvmlErrorString(nvmlReturn_t result) except?NULL nogil: + return _nvml._nvmlErrorString(result) + + +cdef nvmlReturn_t nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetDriverVersion(version, length) + + +cdef nvmlReturn_t nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetNVMLVersion(version, length) + + +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetCudaDriverVersion(cudaDriverVersion) + + +cdef nvmlReturn_t nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetCudaDriverVersion_v2(cudaDriverVersion) + + +cdef nvmlReturn_t nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetProcessName(pid, name, length) + + +cdef nvmlReturn_t nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetHicVersion(hwbcCount, hwbcEntries) + + +cdef nvmlReturn_t nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetTopologyGpuSet(cpuNumber, count, deviceArray) + + +cdef nvmlReturn_t nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetDriverBranch(branchInfo, length) + + +cdef nvmlReturn_t nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetCount(unitCount) + + +cdef nvmlReturn_t nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetHandleByIndex(index, unit) + + +cdef nvmlReturn_t nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetUnitInfo(unit, info) + + +cdef nvmlReturn_t nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetLedState(unit, state) + + +cdef nvmlReturn_t nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetPsuInfo(unit, psu) + + +cdef nvmlReturn_t nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetTemperature(unit, type, temp) + + +cdef nvmlReturn_t nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetFanSpeedInfo(unit, fanSpeeds) + + +cdef nvmlReturn_t nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitGetDevices(unit, deviceCount, devices) + + +cdef nvmlReturn_t nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCount_v2(deviceCount) + + +cdef nvmlReturn_t nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAttributes_v2(device, attributes) + + +cdef nvmlReturn_t nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHandleByIndex_v2(index, device) + + +cdef nvmlReturn_t nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHandleBySerial(serial, device) + + +cdef nvmlReturn_t nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHandleByUUID(uuid, device) + + +cdef nvmlReturn_t nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHandleByUUIDV(uuid, device) + + +cdef nvmlReturn_t nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHandleByPciBusId_v2(pciBusId, device) + + +cdef nvmlReturn_t nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetName(device, name, length) + + +cdef nvmlReturn_t nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBrand(device, type) + + +cdef nvmlReturn_t nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetIndex(device, index) + + +cdef nvmlReturn_t nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSerial(device, serial, length) + + +cdef nvmlReturn_t nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetModuleId(device, moduleId) + + +cdef nvmlReturn_t nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetC2cModeInfoV(device, c2cModeInfo) + + +cdef nvmlReturn_t nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemoryAffinity(device, nodeSetSize, nodeSet, scope) + + +cdef nvmlReturn_t nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCpuAffinityWithinScope(device, cpuSetSize, cpuSet, scope) + + +cdef nvmlReturn_t nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCpuAffinity(device, cpuSetSize, cpuSet) + + +cdef nvmlReturn_t nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetCpuAffinity(device) + + +cdef nvmlReturn_t nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceClearCpuAffinity(device) + + +cdef nvmlReturn_t nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNumaNodeId(device, node) + + +cdef nvmlReturn_t nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTopologyCommonAncestor(device1, device2, pathInfo) + + +cdef nvmlReturn_t nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTopologyNearestGpus(device, level, count, deviceArray) + + +cdef nvmlReturn_t nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetP2PStatus(device1, device2, p2pIndex, p2pStatus) + + +cdef nvmlReturn_t nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetUUID(device, uuid, length) + + +cdef nvmlReturn_t nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMinorNumber(device, minorNumber) + + +cdef nvmlReturn_t nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBoardPartNumber(device, partNumber, length) + + +cdef nvmlReturn_t nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetInforomVersion(device, object, version, length) + + +cdef nvmlReturn_t nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetInforomImageVersion(device, version, length) + + +cdef nvmlReturn_t nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetInforomConfigurationChecksum(device, checksum) + + +cdef nvmlReturn_t nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceValidateInforom(device) + + +cdef nvmlReturn_t nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetLastBBXFlushTime(device, timestamp, durationUs) + + +cdef nvmlReturn_t nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDisplayMode(device, display) + + +cdef nvmlReturn_t nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDisplayActive(device, isActive) + + +cdef nvmlReturn_t nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPersistenceMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPciInfoExt(device, pci) + + +cdef nvmlReturn_t nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPciInfo_v3(device, pci) + + +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMaxPcieLinkGeneration(device, maxLinkGen) + + +cdef nvmlReturn_t nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuMaxPcieLinkGeneration(device, maxLinkGenDevice) + + +cdef nvmlReturn_t nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMaxPcieLinkWidth(device, maxLinkWidth) + + +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCurrPcieLinkGeneration(device, currLinkGen) + + +cdef nvmlReturn_t nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCurrPcieLinkWidth(device, currLinkWidth) + + +cdef nvmlReturn_t nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPcieThroughput(device, counter, value) + + +cdef nvmlReturn_t nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPcieReplayCounter(device, value) + + +cdef nvmlReturn_t nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetClockInfo(device, type, clock) + + +cdef nvmlReturn_t nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMaxClockInfo(device, type, clock) + + +cdef nvmlReturn_t nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpcClkVfOffset(device, offset) + + +cdef nvmlReturn_t nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetClock(device, clockType, clockId, clockMHz) + + +cdef nvmlReturn_t nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMaxCustomerBoostClock(device, clockType, clockMHz) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedMemoryClocks(device, count, clocksMHz) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedGraphicsClocks(device, memoryClockMHz, count, clocksMHz) + + +cdef nvmlReturn_t nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAutoBoostedClocksEnabled(device, isEnabled, defaultIsEnabled) + + +cdef nvmlReturn_t nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFanSpeed(device, speed) + + +cdef nvmlReturn_t nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFanSpeed_v2(device, fan, speed) + + +cdef nvmlReturn_t nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFanSpeedRPM(device, fanSpeed) + + +cdef nvmlReturn_t nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTargetFanSpeed(device, fan, targetSpeed) + + +cdef nvmlReturn_t nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMinMaxFanSpeed(device, minSpeed, maxSpeed) + + +cdef nvmlReturn_t nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFanControlPolicy_v2(device, fan, policy) + + +cdef nvmlReturn_t nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNumFans(device, numFans) + + +cdef nvmlReturn_t nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCoolerInfo(device, coolerInfo) + + +cdef nvmlReturn_t nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTemperatureV(device, temperature) + + +cdef nvmlReturn_t nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTemperatureThreshold(device, thresholdType, temp) + + +cdef nvmlReturn_t nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMarginTemperature(device, marginTempInfo) + + +cdef nvmlReturn_t nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetThermalSettings(device, sensorIndex, pThermalSettings) + + +cdef nvmlReturn_t nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPerformanceState(device, pState) + + +cdef nvmlReturn_t nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCurrentClocksEventReasons(device, clocksEventReasons) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedClocksEventReasons(device, supportedClocksEventReasons) + + +cdef nvmlReturn_t nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerState(device, pState) + + +cdef nvmlReturn_t nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDynamicPstatesInfo(device, pDynamicPstatesInfo) + + +cdef nvmlReturn_t nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemClkVfOffset(device, offset) + + +cdef nvmlReturn_t nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMinMaxClockOfPState(device, type, pstate, minClockMHz, maxClockMHz) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedPerformanceStates(device, pstates, size) + + +cdef nvmlReturn_t nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpcClkMinMaxVfOffset(device, minOffset, maxOffset) + + +cdef nvmlReturn_t nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemClkMinMaxVfOffset(device, minOffset, maxOffset) + + +cdef nvmlReturn_t nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetClockOffsets(device, info) + + +cdef nvmlReturn_t nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetClockOffsets(device, info) + + +cdef nvmlReturn_t nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPerformanceModes(device, perfModes) + + +cdef nvmlReturn_t nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCurrentClockFreqs(device, currentClockFreqs) + + +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerManagementLimit(device, limit) + + +cdef nvmlReturn_t nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerManagementLimitConstraints(device, minLimit, maxLimit) + + +cdef nvmlReturn_t nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerManagementDefaultLimit(device, defaultLimit) + + +cdef nvmlReturn_t nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerUsage(device, power) + + +cdef nvmlReturn_t nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTotalEnergyConsumption(device, energy) + + +cdef nvmlReturn_t nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEnforcedPowerLimit(device, limit) + + +cdef nvmlReturn_t nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuOperationMode(device, current, pending) + + +cdef nvmlReturn_t nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemoryInfo_v2(device, memory) + + +cdef nvmlReturn_t nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetComputeMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCudaComputeCapability(device, major, minor) + + +cdef nvmlReturn_t nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDramEncryptionMode(device, current, pending) + + +cdef nvmlReturn_t nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetDramEncryptionMode(device, dramEncryption) + + +cdef nvmlReturn_t nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEccMode(device, current, pending) + + +cdef nvmlReturn_t nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDefaultEccMode(device, defaultMode) + + +cdef nvmlReturn_t nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBoardId(device, boardId) + + +cdef nvmlReturn_t nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMultiGpuBoard(device, multiGpuBool) + + +cdef nvmlReturn_t nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetTotalEccErrors(device, errorType, counterType, eccCounts) + + +cdef nvmlReturn_t nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemoryErrorCounter(device, errorType, counterType, locationType, count) + + +cdef nvmlReturn_t nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetUtilizationRates(device, utilization) + + +cdef nvmlReturn_t nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEncoderUtilization(device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEncoderCapacity(device, encoderQueryType, encoderCapacity) + + +cdef nvmlReturn_t nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEncoderStats(device, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetEncoderSessions(device, sessionCount, sessionInfos) + + +cdef nvmlReturn_t nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDecoderUtilization(device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetJpgUtilization(device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetOfaUtilization(device, utilization, samplingPeriodUs) + + +cdef nvmlReturn_t nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFBCStats(device, fbcStats) + + +cdef nvmlReturn_t nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFBCSessions(device, sessionCount, sessionInfo) + + +cdef nvmlReturn_t nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDriverModel_v2(device, current, pending) + + +cdef nvmlReturn_t nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVbiosVersion(device, version, length) + + +cdef nvmlReturn_t nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBridgeChipInfo(device, bridgeHierarchy) + + +cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + 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) + + +cdef nvmlReturn_t nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRunningProcessDetailList(device, plist) + + +cdef nvmlReturn_t nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceOnSameBoard(device1, device2, onSameBoard) + + +cdef nvmlReturn_t nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAPIRestriction(device, apiType, isRestricted) + + +cdef nvmlReturn_t nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSamples(device, type, lastSeenTimeStamp, sampleValType, sampleCount, samples) + + +cdef nvmlReturn_t nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBAR1MemoryInfo(device, bar1Memory) + + +cdef nvmlReturn_t nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetIrqNum(device, irqNum) + + +cdef nvmlReturn_t nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNumGpuCores(device, numCores) + + +cdef nvmlReturn_t nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerSource(device, powerSource) + + +cdef nvmlReturn_t nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemoryBusWidth(device, busWidth) + + +cdef nvmlReturn_t nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPcieLinkMaxSpeed(device, maxSpeed) + + +cdef nvmlReturn_t nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPcieSpeed(device, pcieSpeed) + + +cdef nvmlReturn_t nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAdaptiveClockInfoStatus(device, adaptiveClockStatus) + + +cdef nvmlReturn_t nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBusType(device, type) + + +cdef nvmlReturn_t nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuFabricInfoV(device, gpuFabricInfo) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeCapabilities(capabilities) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeState(state) + + +cdef nvmlReturn_t nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetConfComputeMemSizeInfo(device, memInfo) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeGpusReadyState(isAcceptingWork) + + +cdef nvmlReturn_t nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetConfComputeProtectedMemoryUsage(device, memory) + + +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetConfComputeGpuCertificate(device, gpuCert) + + +cdef nvmlReturn_t nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetConfComputeGpuAttestationReport(device, gpuAtstReport) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeKeyRotationThresholdInfo(pKeyRotationThrInfo) + + +cdef nvmlReturn_t nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetConfComputeUnprotectedMemSize(device, sizeKiB) + + +cdef nvmlReturn_t nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemSetConfComputeGpusReadyState(isAcceptingWork) + + +cdef nvmlReturn_t nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemSetConfComputeKeyRotationThresholdInfo(pKeyRotationThrInfo) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeSettings(settings) + + +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGspFirmwareVersion(device, version) + + +cdef nvmlReturn_t nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGspFirmwareMode(device, isEnabled, defaultMode) + + +cdef nvmlReturn_t nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSramEccErrorStatus(device, status) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingStats(device, pid, stats) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingPids(device, count, pids) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingBufferSize(device, bufferSize) + + +cdef nvmlReturn_t nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRetiredPages(device, cause, pageCount, addresses) + + +cdef nvmlReturn_t nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRetiredPages_v2(device, cause, pageCount, addresses, timestamps) + + +cdef nvmlReturn_t nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRetiredPagesPendingStatus(device, isPending) + + +cdef nvmlReturn_t nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRemappedRows(device, corrRows, uncRows, isPending, failureOccurred) + + +cdef nvmlReturn_t nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRowRemapperHistogram(device, values) + + +cdef nvmlReturn_t nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetArchitecture(device, arch) + + +cdef nvmlReturn_t nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetClkMonStatus(device, status) + + +cdef nvmlReturn_t nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetProcessUtilization(device, utilization, processSamplesCount, lastSeenTimeStamp) + + +cdef nvmlReturn_t nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetProcessesUtilizationInfo(device, procesesUtilInfo) + + +cdef nvmlReturn_t nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPlatformInfo(device, platformInfo) + + +cdef nvmlReturn_t nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlUnitSetLedState(unit, color) + + +cdef nvmlReturn_t nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetPersistenceMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetComputeMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetEccMode(device, ecc) + + +cdef nvmlReturn_t nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceClearEccErrorCounts(device, counterType) + + +cdef nvmlReturn_t nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetDriverModel(device, driverModel, flags) + + +cdef nvmlReturn_t nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetGpuLockedClocks(device, minGpuClockMHz, maxGpuClockMHz) + + +cdef nvmlReturn_t nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceResetGpuLockedClocks(device) + + +cdef nvmlReturn_t nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetMemoryLockedClocks(device, minMemClockMHz, maxMemClockMHz) + + +cdef nvmlReturn_t nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceResetMemoryLockedClocks(device) + + +cdef nvmlReturn_t nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetAutoBoostedClocksEnabled(device, enabled) + + +cdef nvmlReturn_t nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetDefaultAutoBoostedClocksEnabled(device, enabled, flags) + + +cdef nvmlReturn_t nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetDefaultFanSpeed_v2(device, fan) + + +cdef nvmlReturn_t nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetFanControlPolicy(device, fan, policy) + + +cdef nvmlReturn_t nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetTemperatureThreshold(device, thresholdType, temp) + + +cdef nvmlReturn_t nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetGpuOperationMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetAPIRestriction(device, apiType, isRestricted) + + +cdef nvmlReturn_t nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetFanSpeed_v2(device, fan, speed) + + +cdef nvmlReturn_t nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetAccountingMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceClearAccountingPids(device) + + +cdef nvmlReturn_t nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetPowerManagementLimit_v2(device, powerValue) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkState(device, link, isActive) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkVersion(device, link, version) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkCapability(device, link, capability, capResult) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkRemotePciInfo_v2(device, link, pci) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkErrorCounter(device, link, counter, counterValue) + + +cdef nvmlReturn_t nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceResetNvLinkErrorCounters(device, link) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkRemoteDeviceType(device, link, pNvLinkDeviceType) + + +cdef nvmlReturn_t nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, info) + + +cdef nvmlReturn_t nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemSetNvlinkBwMode(nvlinkBwMode) + + +cdef nvmlReturn_t nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetNvlinkBwMode(nvlinkBwMode) + + +cdef nvmlReturn_t nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvlinkSupportedBwModes(device, supportedBwMode) + + +cdef nvmlReturn_t nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvlinkBwMode(device, getBwMode) + + +cdef nvmlReturn_t nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetNvlinkBwMode(device, setBwMode) + + +cdef nvmlReturn_t nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetCreate(set) + + +cdef nvmlReturn_t nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceRegisterEvents(device, eventTypes, set) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedEventTypes(device, eventTypes) + + +cdef nvmlReturn_t nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetWait_v2(set, data, timeoutms) + + +cdef nvmlReturn_t nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetFree(set) + + +cdef nvmlReturn_t nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemEventSetCreate(request) + + +cdef nvmlReturn_t nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemEventSetFree(request) + + +cdef nvmlReturn_t nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemRegisterEvents(request) + + +cdef nvmlReturn_t nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemEventSetWait(request) + + +cdef nvmlReturn_t nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceModifyDrainState(pciInfo, newState) + + +cdef nvmlReturn_t nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceQueryDrainState(pciInfo, currentState) + + +cdef nvmlReturn_t nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceRemoveGpu_v2(pciInfo, gpuState, linkState) + + +cdef nvmlReturn_t nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceDiscoverGpus(pciInfo) + + +cdef nvmlReturn_t nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetFieldValues(device, valuesCount, values) + + +cdef nvmlReturn_t nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceClearFieldValues(device, valuesCount, values) + + +cdef nvmlReturn_t nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVirtualizationMode(device, pVirtualMode) + + +cdef nvmlReturn_t nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHostVgpuMode(device, pHostVgpuMode) + + +cdef nvmlReturn_t nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVirtualizationMode(device, virtualMode) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuHeterogeneousMode(device, pHeterogeneousMode) + + +cdef nvmlReturn_t nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVgpuHeterogeneousMode(device, pHeterogeneousMode) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetPlacementId(vgpuInstance, pPlacement) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuTypeSupportedPlacements(device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuTypeCreatablePlacements(device, vgpuTypeId, pPlacementList) + + +cdef nvmlReturn_t nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetGspHeapSize(vgpuTypeId, gspHeapSize) + + +cdef nvmlReturn_t nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetFbReservation(vgpuTypeId, fbReservation) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetRuntimeStateSize(vgpuInstance, pState) + + +cdef nvmlReturn_t nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVgpuCapabilities(device, capability, state) + + +cdef nvmlReturn_t nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGridLicensableFeatures_v4(device, pGridLicensableFeatures) + + +cdef nvmlReturn_t nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGetVgpuDriverCapabilities(capability, capResult) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuCapabilities(device, capability, capResult) + + +cdef nvmlReturn_t nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSupportedVgpus(device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCreatableVgpus(device, vgpuCount, vgpuTypeIds) + + +cdef nvmlReturn_t nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetClass(vgpuTypeId, vgpuTypeClass, size) + + +cdef nvmlReturn_t nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetName(vgpuTypeId, vgpuTypeName, size) + + +cdef nvmlReturn_t nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetGpuInstanceProfileId(vgpuTypeId, gpuInstanceProfileId) + + +cdef nvmlReturn_t nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetDeviceID(vgpuTypeId, deviceID, subsystemID) + + +cdef nvmlReturn_t nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetFramebufferSize(vgpuTypeId, fbSize) + + +cdef nvmlReturn_t nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetNumDisplayHeads(vgpuTypeId, numDisplayHeads) + + +cdef nvmlReturn_t nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetResolution(vgpuTypeId, displayIndex, xdim, ydim) + + +cdef nvmlReturn_t nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetLicense(vgpuTypeId, vgpuTypeLicenseString, size) + + +cdef nvmlReturn_t nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetFrameRateLimit(vgpuTypeId, frameRateLimit) + + +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetMaxInstances(device, vgpuTypeId, vgpuInstanceCount) + + +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetMaxInstancesPerVm(vgpuTypeId, vgpuInstanceCountPerVm) + + +cdef nvmlReturn_t nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetBAR1Info(vgpuTypeId, bar1Info) + + +cdef nvmlReturn_t nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetActiveVgpus(device, vgpuCount, vgpuInstances) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetVmID(vgpuInstance, vmId, size, vmIdType) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetUUID(vgpuInstance, uuid, size) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetVmDriverVersion(vgpuInstance, version, length) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetFbUsage(vgpuInstance, fbUsage) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetLicenseStatus(vgpuInstance, licensed) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetType(vgpuInstance, vgpuTypeId) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetFrameRateLimit(vgpuInstance, frameRateLimit) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetEccMode(vgpuInstance, eccMode) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetEncoderCapacity(vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceSetEncoderCapacity(vgpuInstance, encoderCapacity) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetEncoderStats(vgpuInstance, sessionCount, averageFps, averageLatency) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetEncoderSessions(vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetFBCStats(vgpuInstance, fbcStats) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetFBCSessions(vgpuInstance, sessionCount, sessionInfo) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetGpuInstanceId(vgpuInstance, gpuInstanceId) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetGpuPciId(vgpuInstance, vgpuPciId, length) + + +cdef nvmlReturn_t nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetCapabilities(vgpuTypeId, capability, capResult) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetMdevUUID(vgpuInstance, mdevUuid, size) + + +cdef nvmlReturn_t nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetCreatableVgpus(gpuInstance, pVgpus) + + +cdef nvmlReturn_t nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuTypeGetMaxInstancesPerGpuInstance(pMaxInstance) + + +cdef nvmlReturn_t nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetActiveVgpus(gpuInstance, pVgpuInstanceInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceSetVgpuSchedulerState(gpuInstance, pScheduler) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerState(gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerLog(gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuTypeCreatablePlacements(gpuInstance, pCreatablePlacementInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuHeterogeneousMode(gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceSetVgpuHeterogeneousMode(gpuInstance, pHeterogeneousMode) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetMetadata(vgpuInstance, vgpuMetadata, bufferSize) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuMetadata(device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGetVgpuCompatibility(vgpuMetadata, pgpuMetadata, compatibilityInfo) + + +cdef nvmlReturn_t nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPgpuMetadataString(device, pgpuMetadata, bufferSize) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerLog(device, pSchedulerLog) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerState(device, pSchedulerState) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerCapabilities(device, pCapabilities) + + +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVgpuSchedulerState(device, pSchedulerState) + + +cdef nvmlReturn_t nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGetVgpuVersion(supported, current) + + +cdef nvmlReturn_t nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSetVgpuVersion(vgpuVersion) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuUtilization(device, lastSeenTimeStamp, sampleValType, vgpuInstanceSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuInstancesUtilizationInfo(device, vgpuUtilInfo) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuProcessUtilization(device, lastSeenTimeStamp, vgpuProcessSamplesCount, utilizationSamples) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuProcessesUtilizationInfo(device, vgpuProcUtilInfo) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetAccountingMode(vgpuInstance, mode) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetAccountingPids(vgpuInstance, count, pids) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetAccountingStats(vgpuInstance, pid, stats) + + +cdef nvmlReturn_t nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceClearAccountingPids(vgpuInstance) + + +cdef nvmlReturn_t nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlVgpuInstanceGetLicenseInfo_v2(vgpuInstance, licenseInfo) + + +cdef nvmlReturn_t nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGetExcludedDeviceCount(deviceCount) + + +cdef nvmlReturn_t nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGetExcludedDeviceInfoByIndex(index, info) + + +cdef nvmlReturn_t nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetMigMode(device, mode, activationStatus) + + +cdef nvmlReturn_t nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMigMode(device, currentMode, pendingMode) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstanceProfileInfoV(device, profile, info) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstancePossiblePlacements_v2(device, profileId, placements, count) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstanceRemainingCapacity(device, profileId, count) + + +cdef nvmlReturn_t nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceCreateGpuInstance(device, profileId, gpuInstance) + + +cdef nvmlReturn_t nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceCreateGpuInstanceWithPlacement(device, profileId, placement, gpuInstance) + + +cdef nvmlReturn_t nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceDestroy(gpuInstance) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstances(device, profileId, gpuInstances, count) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstanceById(device, id, gpuInstance) + + +cdef nvmlReturn_t nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetInfo(gpuInstance, info) + + +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetComputeInstanceProfileInfoV(gpuInstance, profile, engProfile, info) + + +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetComputeInstanceRemainingCapacity(gpuInstance, profileId, count) + + +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpuInstance, profileId, placements, count) + + +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceCreateComputeInstance(gpuInstance, profileId, computeInstance) + + +cdef nvmlReturn_t nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpuInstance, profileId, placement, computeInstance) + + +cdef nvmlReturn_t nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlComputeInstanceDestroy(computeInstance) + + +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetComputeInstances(gpuInstance, profileId, computeInstances, count) + + +cdef nvmlReturn_t nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetComputeInstanceById(gpuInstance, id, computeInstance) + + +cdef nvmlReturn_t nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlComputeInstanceGetInfo_v2(computeInstance, info) + + +cdef nvmlReturn_t nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceIsMigDeviceHandle(device, isMigDevice) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstanceId(device, id) + + +cdef nvmlReturn_t nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetComputeInstanceId(device, id) + + +cdef nvmlReturn_t nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMaxMigDeviceCount(device, count) + + +cdef nvmlReturn_t nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMigDeviceHandleByIndex(device, index, migDevice) + + +cdef nvmlReturn_t nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetDeviceHandleFromMigDeviceHandle(migDevice, device) + + +cdef nvmlReturn_t nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetCapabilities(device, caps) + + +cdef nvmlReturn_t nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDevicePowerSmoothingActivatePresetProfile(device, profile) + + +cdef nvmlReturn_t nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDevicePowerSmoothingUpdatePresetProfileParam(device, profile) + + +cdef nvmlReturn_t nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDevicePowerSmoothingSetState(device, state) + + +cdef nvmlReturn_t nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAddressingMode(device, mode) + + +cdef nvmlReturn_t nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRepairStatus(device, repairStatus) + + +cdef nvmlReturn_t nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPowerMizerMode_v1(device, powerMizerMode) + + +cdef nvmlReturn_t nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetPowerMizerMode_v1(device, powerMizerMode) + + +cdef nvmlReturn_t nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetPdi(device, pdi) + + +cdef nvmlReturn_t nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetHostname_v1(device, hostname) + + +cdef nvmlReturn_t nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetHostname_v1(device, hostname) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkInfo(device, info) + + +cdef nvmlReturn_t nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceReadWritePRM_v1(device, buffer) + + +cdef nvmlReturn_t nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuInstanceProfileInfoByIdV(device, profileId, info) + + +cdef nvmlReturn_t nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(device, errorCounts) + + +cdef nvmlReturn_t nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetUnrepairableMemoryFlag_v1(device, unrepairableMemoryStatus) + + +cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceReadPRMCounters_v1(device, counterList) + + +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) + + +cdef nvmlReturn_t nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetCPER_v1(cper) + + +cdef nvmlReturn_t nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBBXTimeData_v1(device, timeData) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingStats_v2(device, stats) + + +cdef nvmlReturn_t nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetRemappedRows_v2(device, info) diff --git a/cuda_bindings_12/cuda/bindings/cynvrtc.pxd b/cuda_bindings_12/cuda/bindings/cynvrtc.pxd new file mode 100644 index 00000000000..5eebe44a02d --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvrtc.pxd @@ -0,0 +1,70 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. + + + +# ENUMS +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=399fa22cff463d0f3b9a99ef5af1a65f711aee777f6afb0776203f71c10c1c32 +cdef extern from 'nvrtc.h': + ctypedef enum nvrtcResult "nvrtcResult": + 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 +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 'nvrtcProgram' + + + +# FUNCTIONS +cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil +cdef nvrtcResult nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil +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 +cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings_12/cuda/bindings/cynvrtc.pyx b/cuda_bindings_12/cuda/bindings/cynvrtc.pyx new file mode 100644 index 00000000000..5a3e82089e9 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvrtc.pyx @@ -0,0 +1,103 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=42107942e8184fd28235bc4af200f43328764cd628eaa0f0a7f9ccab583535f5 +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) diff --git a/cuda_bindings_12/cuda/bindings/cynvvm.pxd b/cuda_bindings_12/cuda/bindings/cynvvm.pxd new file mode 100644 index 00000000000..f25e7e84b3b --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvvm.pxd @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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. + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# 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 + NVVM_ERROR_PROGRAM_CREATION_FAILURE "NVVM_ERROR_PROGRAM_CREATION_FAILURE" = 2 + NVVM_ERROR_IR_VERSION_MISMATCH "NVVM_ERROR_IR_VERSION_MISMATCH" = 3 + NVVM_ERROR_INVALID_INPUT "NVVM_ERROR_INVALID_INPUT" = 4 + NVVM_ERROR_INVALID_PROGRAM "NVVM_ERROR_INVALID_PROGRAM" = 5 + NVVM_ERROR_INVALID_IR "NVVM_ERROR_INVALID_IR" = 6 + NVVM_ERROR_INVALID_OPTION "NVVM_ERROR_INVALID_OPTION" = 7 + NVVM_ERROR_NO_MODULE_IN_PROGRAM "NVVM_ERROR_NO_MODULE_IN_PROGRAM" = 8 + NVVM_ERROR_COMPILATION "NVVM_ERROR_COMPILATION" = 9 + NVVM_ERROR_CANCELLED "NVVM_ERROR_CANCELLED" = 10 + _NVVMRESULT_INTERNAL_LOADING_ERROR "_NVVMRESULT_INTERNAL_LOADING_ERROR" = -42 + + +# types +ctypedef void* nvvmProgram 'nvvmProgram' + + +############################################################################### +# Functions +############################################################################### + +cdef const char* nvvmGetErrorString(nvvmResult result) except?NULL nogil +cdef nvvmResult nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +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_12/cuda/bindings/cynvvm.pyx b/cuda_bindings_12/cuda/bindings/cynvvm.pyx new file mode 100644 index 00000000000..43f036a36c0 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cynvvm.pyx @@ -0,0 +1,68 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=7ea5803be62646c287bad43350e27d3254f35d25ab50b9c54f7ac5695b4c3114 +from ._internal cimport nvvm as _nvvm + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* nvvmGetErrorString(nvvmResult result) except?NULL nogil: + return _nvvm._nvvmGetErrorString(result) + + +cdef nvvmResult nvvmVersion(int* major, int* minor) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmVersion(major, minor) + + +cdef nvvmResult nvvmIRVersion(int* majorIR, int* minorIR, int* majorDbg, int* minorDbg) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmIRVersion(majorIR, minorIR, majorDbg, minorDbg) + + +cdef nvvmResult nvvmCreateProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmCreateProgram(prog) + + +cdef nvvmResult nvvmDestroyProgram(nvvmProgram* prog) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmDestroyProgram(prog) + + +cdef nvvmResult nvvmAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmAddModuleToProgram(prog, buffer, size, name) + + +cdef nvvmResult nvvmLazyAddModuleToProgram(nvvmProgram prog, const char* buffer, size_t size, const char* name) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmLazyAddModuleToProgram(prog, buffer, size, name) + + +cdef nvvmResult nvvmCompileProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmCompileProgram(prog, numOptions, options) + + +cdef nvvmResult nvvmVerifyProgram(nvvmProgram prog, int numOptions, const char** options) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmVerifyProgram(prog, numOptions, options) + + +cdef nvvmResult nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmGetCompiledResultSize(prog, bufferSizeRet) + + +cdef nvvmResult nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmGetCompiledResult(prog, buffer) + + +cdef nvvmResult nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmGetProgramLogSize(prog, bufferSizeRet) + + +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_12/cuda/bindings/cyruntime.pxd.in b/cuda_bindings_12/cuda/bindings/cyruntime.pxd.in new file mode 100644 index 00000000000..173b988ab81 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cyruntime.pxd.in @@ -0,0 +1,1952 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=812e2cbe43c7944dd759085cbe7beb7c37dd6389c433ecf879e584248e867cbd +from libc.stdint cimport uint32_t, uint64_t + +include "cyruntime_types.pxi" + +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 + +cdef enum cudaEglFrameType_enum: + cudaEglFrameTypeArray = 0 + cudaEglFrameTypePitch = 1 + +ctypedef cudaEglFrameType_enum cudaEglFrameType + +cdef enum cudaEglResourceLocationFlags_enum: + cudaEglResourceLocationSysmem = 0 + cudaEglResourceLocationVidmem = 1 + +ctypedef cudaEglResourceLocationFlags_enum cudaEglResourceLocationFlags + +cdef enum cudaEglColorFormat_enum: + cudaEglColorFormatYUV420Planar = 0 + cudaEglColorFormatYUV420SemiPlanar = 1 + cudaEglColorFormatYUV422Planar = 2 + cudaEglColorFormatYUV422SemiPlanar = 3 + cudaEglColorFormatARGB = 6 + cudaEglColorFormatRGBA = 7 + cudaEglColorFormatL = 8 + cudaEglColorFormatR = 9 + cudaEglColorFormatYUV444Planar = 10 + cudaEglColorFormatYUV444SemiPlanar = 11 + cudaEglColorFormatYUYV422 = 12 + cudaEglColorFormatUYVY422 = 13 + cudaEglColorFormatABGR = 14 + cudaEglColorFormatBGRA = 15 + cudaEglColorFormatA = 16 + cudaEglColorFormatRG = 17 + cudaEglColorFormatAYUV = 18 + cudaEglColorFormatYVU444SemiPlanar = 19 + cudaEglColorFormatYVU422SemiPlanar = 20 + cudaEglColorFormatYVU420SemiPlanar = 21 + cudaEglColorFormatY10V10U10_444SemiPlanar = 22 + cudaEglColorFormatY10V10U10_420SemiPlanar = 23 + cudaEglColorFormatY12V12U12_444SemiPlanar = 24 + cudaEglColorFormatY12V12U12_420SemiPlanar = 25 + cudaEglColorFormatVYUY_ER = 26 + cudaEglColorFormatUYVY_ER = 27 + cudaEglColorFormatYUYV_ER = 28 + cudaEglColorFormatYVYU_ER = 29 + cudaEglColorFormatYUVA_ER = 31 + cudaEglColorFormatAYUV_ER = 32 + cudaEglColorFormatYUV444Planar_ER = 33 + cudaEglColorFormatYUV422Planar_ER = 34 + cudaEglColorFormatYUV420Planar_ER = 35 + cudaEglColorFormatYUV444SemiPlanar_ER = 36 + cudaEglColorFormatYUV422SemiPlanar_ER = 37 + cudaEglColorFormatYUV420SemiPlanar_ER = 38 + cudaEglColorFormatYVU444Planar_ER = 39 + cudaEglColorFormatYVU422Planar_ER = 40 + cudaEglColorFormatYVU420Planar_ER = 41 + cudaEglColorFormatYVU444SemiPlanar_ER = 42 + cudaEglColorFormatYVU422SemiPlanar_ER = 43 + cudaEglColorFormatYVU420SemiPlanar_ER = 44 + cudaEglColorFormatBayerRGGB = 45 + cudaEglColorFormatBayerBGGR = 46 + cudaEglColorFormatBayerGRBG = 47 + cudaEglColorFormatBayerGBRG = 48 + cudaEglColorFormatBayer10RGGB = 49 + cudaEglColorFormatBayer10BGGR = 50 + cudaEglColorFormatBayer10GRBG = 51 + cudaEglColorFormatBayer10GBRG = 52 + cudaEglColorFormatBayer12RGGB = 53 + cudaEglColorFormatBayer12BGGR = 54 + cudaEglColorFormatBayer12GRBG = 55 + cudaEglColorFormatBayer12GBRG = 56 + cudaEglColorFormatBayer14RGGB = 57 + cudaEglColorFormatBayer14BGGR = 58 + cudaEglColorFormatBayer14GRBG = 59 + cudaEglColorFormatBayer14GBRG = 60 + cudaEglColorFormatBayer20RGGB = 61 + cudaEglColorFormatBayer20BGGR = 62 + cudaEglColorFormatBayer20GRBG = 63 + cudaEglColorFormatBayer20GBRG = 64 + cudaEglColorFormatYVU444Planar = 65 + cudaEglColorFormatYVU422Planar = 66 + cudaEglColorFormatYVU420Planar = 67 + cudaEglColorFormatBayerIspRGGB = 68 + cudaEglColorFormatBayerIspBGGR = 69 + cudaEglColorFormatBayerIspGRBG = 70 + cudaEglColorFormatBayerIspGBRG = 71 + cudaEglColorFormatBayerBCCR = 72 + cudaEglColorFormatBayerRCCB = 73 + cudaEglColorFormatBayerCRBC = 74 + cudaEglColorFormatBayerCBRC = 75 + cudaEglColorFormatBayer10CCCC = 76 + cudaEglColorFormatBayer12BCCR = 77 + cudaEglColorFormatBayer12RCCB = 78 + cudaEglColorFormatBayer12CRBC = 79 + cudaEglColorFormatBayer12CBRC = 80 + cudaEglColorFormatBayer12CCCC = 81 + cudaEglColorFormatY = 82 + cudaEglColorFormatYUV420SemiPlanar_2020 = 83 + cudaEglColorFormatYVU420SemiPlanar_2020 = 84 + cudaEglColorFormatYUV420Planar_2020 = 85 + cudaEglColorFormatYVU420Planar_2020 = 86 + cudaEglColorFormatYUV420SemiPlanar_709 = 87 + cudaEglColorFormatYVU420SemiPlanar_709 = 88 + cudaEglColorFormatYUV420Planar_709 = 89 + cudaEglColorFormatYVU420Planar_709 = 90 + cudaEglColorFormatY10V10U10_420SemiPlanar_709 = 91 + cudaEglColorFormatY10V10U10_420SemiPlanar_2020 = 92 + cudaEglColorFormatY10V10U10_422SemiPlanar_2020 = 93 + cudaEglColorFormatY10V10U10_422SemiPlanar = 94 + cudaEglColorFormatY10V10U10_422SemiPlanar_709 = 95 + cudaEglColorFormatY_ER = 96 + cudaEglColorFormatY_709_ER = 97 + cudaEglColorFormatY10_ER = 98 + cudaEglColorFormatY10_709_ER = 99 + cudaEglColorFormatY12_ER = 100 + cudaEglColorFormatY12_709_ER = 101 + cudaEglColorFormatYUVA = 102 + cudaEglColorFormatYVYU = 104 + cudaEglColorFormatVYUY = 105 + cudaEglColorFormatY10V10U10_420SemiPlanar_ER = 106 + cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER = 107 + cudaEglColorFormatY10V10U10_444SemiPlanar_ER = 108 + cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER = 109 + cudaEglColorFormatY12V12U12_420SemiPlanar_ER = 110 + cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER = 111 + cudaEglColorFormatY12V12U12_444SemiPlanar_ER = 112 + cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = 113 + cudaEglColorFormatUYVY709 = 114 + cudaEglColorFormatUYVY709_ER = 115 + cudaEglColorFormatUYVY2020 = 116 + +ctypedef cudaEglColorFormat_enum cudaEglColorFormat + +cdef struct cudaEglPlaneDesc_st: + unsigned int width + unsigned int height + unsigned int depth + unsigned int pitch + unsigned int numChannels + cudaChannelFormatDesc channelDesc + unsigned int reserved[4] + +ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc + +cdef union anon_union11: + cudaArray_t pArray[3] + cudaPitchedPtr pPitch[3] + +cdef struct cudaEglFrame_st: + anon_union11 frame + cudaEglPlaneDesc planeDesc[3] + unsigned int planeCount + cudaEglFrameType frameType + cudaEglColorFormat eglColorFormat + +ctypedef cudaEglFrame_st cudaEglFrame + +cdef extern from "": + cdef struct CUeglStreamConnection_st: + pass +ctypedef CUeglStreamConnection_st* cudaEglStreamConnection + +cdef enum cudaGLDeviceList: + cudaGLDeviceListAll = 1 + cudaGLDeviceListCurrentFrame = 2 + cudaGLDeviceListNextFrame = 3 + +cdef enum cudaGLMapFlags: + cudaGLMapFlagsNone = 0 + cudaGLMapFlagsReadOnly = 1 + cudaGLMapFlagsWriteDiscard = 2 + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* cudaGetErrorName(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* cudaGetErrorString(cudaError_t error) except ?NULL nogil +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} + +cdef cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} + +cdef cudaPitchedPtr make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil +{{endif}} + +{{if 'make_cudaPos' in found_functions}} + +cdef cudaPos make_cudaPos(size_t x, size_t y, size_t z) except* nogil +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} + +cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) except* nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource** pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +{{if True}} + +cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + +cdef enum: cudaHostAllocDefault = 0 + +cdef enum: cudaHostAllocPortable = 1 + +cdef enum: cudaHostAllocMapped = 2 + +cdef enum: cudaHostAllocWriteCombined = 4 + +cdef enum: cudaHostRegisterDefault = 0 + +cdef enum: cudaHostRegisterPortable = 1 + +cdef enum: cudaHostRegisterMapped = 2 + +cdef enum: cudaHostRegisterIoMemory = 4 + +cdef enum: cudaHostRegisterReadOnly = 8 + +cdef enum: cudaPeerAccessDefault = 0 + +cdef enum: cudaStreamDefault = 0 + +cdef enum: cudaStreamNonBlocking = 1 + +cdef enum: cudaStreamLegacy = 1 + +cdef enum: cudaStreamPerThread = 2 + +cdef enum: cudaEventDefault = 0 + +cdef enum: cudaEventBlockingSync = 1 + +cdef enum: cudaEventDisableTiming = 2 + +cdef enum: cudaEventInterprocess = 4 + +cdef enum: cudaEventRecordDefault = 0 + +cdef enum: cudaEventRecordExternal = 1 + +cdef enum: cudaEventWaitDefault = 0 + +cdef enum: cudaEventWaitExternal = 1 + +cdef enum: cudaDeviceScheduleAuto = 0 + +cdef enum: cudaDeviceScheduleSpin = 1 + +cdef enum: cudaDeviceScheduleYield = 2 + +cdef enum: cudaDeviceScheduleBlockingSync = 4 + +cdef enum: cudaDeviceBlockingSync = 4 + +cdef enum: cudaDeviceScheduleMask = 7 + +cdef enum: cudaDeviceMapHost = 8 + +cdef enum: cudaDeviceLmemResizeToMax = 16 + +cdef enum: cudaDeviceSyncMemops = 128 + +cdef enum: cudaDeviceMask = 255 + +cdef enum: cudaArrayDefault = 0 + +cdef enum: cudaArrayLayered = 1 + +cdef enum: cudaArraySurfaceLoadStore = 2 + +cdef enum: cudaArrayCubemap = 4 + +cdef enum: cudaArrayTextureGather = 8 + +cdef enum: cudaArrayColorAttachment = 32 + +cdef enum: cudaArraySparse = 64 + +cdef enum: cudaArrayDeferredMapping = 128 + +cdef enum: cudaIpcMemLazyEnablePeerAccess = 1 + +cdef enum: cudaMemAttachGlobal = 1 + +cdef enum: cudaMemAttachHost = 2 + +cdef enum: cudaMemAttachSingle = 4 + +cdef enum: cudaOccupancyDefault = 0 + +cdef enum: cudaOccupancyDisableCachingOverride = 1 + +cdef enum: cudaCpuDeviceId = -1 + +cdef enum: cudaInvalidDeviceId = -2 + +cdef enum: cudaInitDeviceFlagsAreValid = 1 + +cdef enum: cudaCooperativeLaunchMultiDeviceNoPreSync = 1 + +cdef enum: cudaCooperativeLaunchMultiDeviceNoPostSync = 2 + +cdef enum: cudaArraySparsePropertiesSingleMipTail = 1 + +cdef enum: cudaMemPoolCreateUsageHwDecompress = 2 + +cdef enum: CUDA_IPC_HANDLE_SIZE = 64 + +cdef enum: cudaExternalMemoryDedicated = 1 + +cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1 + +cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2 + +cdef enum: cudaNvSciSyncAttrSignal = 1 + +cdef enum: cudaNvSciSyncAttrWait = 2 + +cdef enum: cudaGraphKernelNodePortDefault = 0 + +cdef enum: cudaGraphKernelNodePortProgrammatic = 1 + +cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2 + +cdef enum: cudaStreamAttributeAccessPolicyWindow = 1 + +cdef enum: cudaStreamAttributeSynchronizationPolicy = 3 + +cdef enum: cudaStreamAttributeMemSyncDomainMap = 9 + +cdef enum: cudaStreamAttributeMemSyncDomain = 10 + +cdef enum: cudaStreamAttributePriority = 8 + +cdef enum: cudaKernelNodeAttributeAccessPolicyWindow = 1 + +cdef enum: cudaKernelNodeAttributeCooperative = 2 + +cdef enum: cudaKernelNodeAttributePriority = 8 + +cdef enum: cudaKernelNodeAttributeClusterDimension = 4 + +cdef enum: cudaKernelNodeAttributeClusterSchedulingPolicyPreference = 5 + +cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9 + +cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10 + +cdef enum: cudaKernelNodeAttributePreferredSharedMemoryCarveout = 14 + +cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13 + +cdef enum: cudaSurfaceType1D = 1 + +cdef enum: cudaSurfaceType2D = 2 + +cdef enum: cudaSurfaceType3D = 3 + +cdef enum: cudaSurfaceTypeCubemap = 12 + +cdef enum: cudaSurfaceType1DLayered = 241 + +cdef enum: cudaSurfaceType2DLayered = 242 + +cdef enum: cudaSurfaceTypeCubemapLayered = 252 + +cdef enum: cudaTextureType1D = 1 + +cdef enum: cudaTextureType2D = 2 + +cdef enum: cudaTextureType3D = 3 + +cdef enum: cudaTextureTypeCubemap = 12 + +cdef enum: cudaTextureType1DLayered = 241 + +cdef enum: cudaTextureType2DLayered = 242 + +cdef enum: cudaTextureTypeCubemapLayered = 252 + +cdef enum: CUDART_VERSION = 12090 + +cdef enum: __CUDART_API_VERSION = 12090 + +cdef enum: CUDA_EGL_MAX_PLANES = 3 \ No newline at end of file diff --git a/cuda_bindings_12/cuda/bindings/cyruntime.pyx.in b/cuda_bindings_12/cuda/bindings/cyruntime.pyx.in new file mode 100644 index 00000000000..10a2b114315 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cyruntime.pyx.in @@ -0,0 +1,1924 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=61af0372d09a2cd574c4c1e6ba8f3412828209f65c8fdb2acdd18ad9a300146d +cimport cuda.bindings._bindings.cyruntime as cyruntime +cimport cython + +{{if 'cudaDeviceReset' in found_functions}} + +cdef cudaError_t cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceReset() +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +cdef cudaError_t cudaDeviceSynchronize() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSynchronize() +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +cdef cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSetLimit(limit, value) +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +cdef cudaError_t cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetLimit(pValue, limit) +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +cdef cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, fmtDesc, device) +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +cdef cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetCacheConfig(pCacheConfig) +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +cdef cudaError_t cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority) +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +cdef cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSetCacheConfig(cacheConfig) +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +cdef cudaError_t cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetByPCIBusId(device, pciBusId) +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +cdef cudaError_t cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetPCIBusId(pciBusId, length, device) +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +cdef cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaIpcGetEventHandle(handle, event) +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +cdef cudaError_t cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaIpcOpenEventHandle(event, handle) +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaIpcGetMemHandle(handle, devPtr) +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaIpcOpenMemHandle(devPtr, handle, flags) +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +cdef cudaError_t cudaIpcCloseMemHandle(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaIpcCloseMemHandle(devPtr) +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +cdef cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceFlushGPUDirectRDMAWrites(target, scope) +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +cdef cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +cdef cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceUnregisterAsyncNotification(device, callback) +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetSharedMemConfig(pConfig) +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSetSharedMemConfig(config) +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +cdef cudaError_t cudaGetLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetLastError() +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +cdef cudaError_t cudaPeekAtLastError() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaPeekAtLastError() +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +cdef const char* cudaGetErrorName(cudaError_t error) except ?NULL nogil: + return cyruntime._cudaGetErrorName(error) +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +cdef const char* cudaGetErrorString(cudaError_t error) except ?NULL nogil: + return cyruntime._cudaGetErrorString(error) +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +cdef cudaError_t cudaGetDeviceCount(int* count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDeviceCount(count) +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +cdef cudaError_t cudaGetDeviceProperties(cudaDeviceProp* prop, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDeviceProperties_v2(prop, device) +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetAttribute(value, attr, device) +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetDefaultMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSetMemPool(device, memPool) +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +cdef cudaError_t cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetMemPool(memPool, device) +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +cdef cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, device, flags) +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice) +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +cdef cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaChooseDevice(device, prop) +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +cdef cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaInitDevice(device, deviceFlags, flags) +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +cdef cudaError_t cudaSetDevice(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaSetDevice(device) +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +cdef cudaError_t cudaGetDevice(int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDevice(device) +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +cdef cudaError_t cudaSetDeviceFlags(unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaSetDeviceFlags(flags) +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +cdef cudaError_t cudaGetDeviceFlags(unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDeviceFlags(flags) +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +cdef cudaError_t cudaStreamCreate(cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamCreate(pStream) +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +cdef cudaError_t cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamCreateWithFlags(pStream, flags) +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +cdef cudaError_t cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamCreateWithPriority(pStream, flags, priority) +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +cdef cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int* priority) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetPriority(hStream, priority) +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +cdef cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetFlags(hStream, flags) +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +cdef cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetId(hStream, streamId) +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +cdef cudaError_t cudaStreamGetDevice(cudaStream_t hStream, int* device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetDevice(hStream, device) +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +cdef cudaError_t cudaCtxResetPersistingL2Cache() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaCtxResetPersistingL2Cache() +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +cdef cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamCopyAttributes(dst, src) +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +cdef cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetAttribute(hStream, attr, value_out) +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +cdef cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamSetAttribute(hStream, attr, value) +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +cdef cudaError_t cudaStreamDestroy(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamDestroy(stream) +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +cdef cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamWaitEvent(stream, event, flags) +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +cdef cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamAddCallback(stream, callback, userData, flags) +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +cdef cudaError_t cudaStreamSynchronize(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamSynchronize(stream) +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +cdef cudaError_t cudaStreamQuery(cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamQuery(stream) +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +cdef cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamAttachMemAsync(stream, devPtr, length, flags) +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +cdef cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamBeginCapture(stream, mode) +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +cdef cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamBeginCaptureToGraph(stream, graph, dependencies, dependencyData, numDependencies, mode) +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +cdef cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaThreadExchangeStreamCaptureMode(mode) +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +cdef cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamEndCapture(stream, pGraph) +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +cdef cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamIsCapturing(stream, pCaptureStatus) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +cdef cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetCaptureInfo_v2(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +cdef cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamGetCaptureInfo_v3(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +cdef cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamUpdateCaptureDependencies(stream, dependencies, numDependencies, flags) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +cdef cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamUpdateCaptureDependencies_v2(stream, dependencies, dependencyData, numDependencies, flags) +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +cdef cudaError_t cudaEventCreate(cudaEvent_t* event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventCreate(event) +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +cdef cudaError_t cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventCreateWithFlags(event, flags) +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +cdef cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventRecord(event, stream) +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +cdef cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventRecordWithFlags(event, stream, flags) +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +cdef cudaError_t cudaEventQuery(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventQuery(event) +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +cdef cudaError_t cudaEventSynchronize(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventSynchronize(event) +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +cdef cudaError_t cudaEventDestroy(cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventDestroy(event) +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +cdef cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventElapsedTime(ms, start, end) +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +cdef cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventElapsedTime_v2(ms, start, end) +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +cdef cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaImportExternalMemory(extMem_out, memHandleDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +cdef cudaError_t cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +cdef cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDestroyExternalMemory(extMem) +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +cdef cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaImportExternalSemaphore(extSem_out, semHandleDesc) +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaSignalExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +cdef cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaWaitExternalSemaphoresAsync_v2(extSemArray, paramsArray, numExtSems, stream) +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +cdef cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDestroyExternalSemaphore(extSem) +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +cdef cudaError_t cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFuncSetCacheConfig(func, cacheConfig) +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +cdef cudaError_t cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFuncGetAttributes(attr, func) +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +cdef cudaError_t cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFuncSetAttribute(func, attr, value) +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +cdef cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLaunchHostFunc(stream, fn, userData) +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +cdef cudaError_t cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFuncSetSharedMemConfig(func, config) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +cdef cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +cdef cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +cdef cudaError_t cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocManaged(devPtr, size, flags) +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +cdef cudaError_t cudaMalloc(void** devPtr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMalloc(devPtr, size) +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +cdef cudaError_t cudaMallocHost(void** ptr, size_t size) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocHost(ptr, size) +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +cdef cudaError_t cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocPitch(devPtr, pitch, width, height) +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +cdef cudaError_t cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocArray(array, desc, width, height, flags) +{{endif}} + +{{if 'cudaFree' in found_functions}} + +cdef cudaError_t cudaFree(void* devPtr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFree(devPtr) +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +cdef cudaError_t cudaFreeHost(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFreeHost(ptr) +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +cdef cudaError_t cudaFreeArray(cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFreeArray(array) +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +cdef cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFreeMipmappedArray(mipmappedArray) +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +cdef cudaError_t cudaHostAlloc(void** pHost, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaHostAlloc(pHost, size, flags) +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +cdef cudaError_t cudaHostRegister(void* ptr, size_t size, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaHostRegister(ptr, size, flags) +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +cdef cudaError_t cudaHostUnregister(void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaHostUnregister(ptr) +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +cdef cudaError_t cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaHostGetDevicePointer(pDevice, pHost, flags) +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +cdef cudaError_t cudaHostGetFlags(unsigned int* pFlags, void* pHost) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaHostGetFlags(pFlags, pHost) +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +cdef cudaError_t cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMalloc3D(pitchedDevPtr, extent) +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +cdef cudaError_t cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMalloc3DArray(array, desc, extent, flags) +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +cdef cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocMipmappedArray(mipmappedArray, desc, extent, numLevels, flags) +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +cdef cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetMipmappedArrayLevel(levelArray, mipmappedArray, level) +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +cdef cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3D(p) +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +cdef cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3DPeer(p) +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3DAsync(p, stream) +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3DPeerAsync(p, stream) +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +cdef cudaError_t cudaMemGetInfo(size_t* free, size_t* total) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemGetInfo(free, total) +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +cdef cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaArrayGetInfo(desc, extent, flags, array) +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +cdef cudaError_t cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaArrayGetPlane(pPlaneArray, hArray, planeIdx) +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaArrayGetMemoryRequirements(memoryRequirements, array, device) +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +cdef cudaError_t cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaArrayGetSparseProperties(sparseProperties, array) +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +cdef cudaError_t cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMipmappedArrayGetSparseProperties(sparseProperties, mipmap) +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +cdef cudaError_t cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy(dst, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +cdef cudaError_t cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count) +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +cdef cudaError_t cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DFromArray(dst, dpitch, src, wOffset, hOffset, width, height, kind) +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +cdef cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind) +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyAsync(dst, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream) +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyBatchAsync(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, failIdx, stream) +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy3DBatchAsync(numOps, opList, failIdx, flags, stream) +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DToArrayAsync(dst, wOffset, hOffset, src, spitch, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpy2DFromArrayAsync(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream) +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +cdef cudaError_t cudaMemset(void* devPtr, int value, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemset(devPtr, value, count) +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +cdef cudaError_t cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemset2D(devPtr, pitch, value, width, height) +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +cdef cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemset3D(pitchedDevPtr, value, extent) +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +cdef cudaError_t cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemsetAsync(devPtr, value, count, stream) +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +cdef cudaError_t cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemset2DAsync(devPtr, pitch, value, width, height, stream) +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +cdef cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemset3DAsync(pitchedDevPtr, value, extent, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +cdef cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPrefetchAsync(devPtr, count, dstDevice, stream) +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +cdef cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPrefetchAsync_v2(devPtr, count, location, flags, stream) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +cdef cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemAdvise(devPtr, count, advice, device) +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +cdef cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemAdvise_v2(devPtr, count, advice, location) +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +cdef cudaError_t cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +cdef cudaError_t cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +cdef cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyToArray(dst, wOffset, hOffset, src, count, kind) +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +cdef cudaError_t cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyFromArray(dst, src, wOffset, hOffset, count, kind) +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +cdef cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyArrayToArray(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind) +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyToArrayAsync(dst, wOffset, hOffset, src, count, kind, stream) +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +cdef cudaError_t cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemcpyFromArrayAsync(dst, src, wOffset, hOffset, count, kind, stream) +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +cdef cudaError_t cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocAsync(devPtr, size, hStream) +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +cdef cudaError_t cudaFreeAsync(void* devPtr, cudaStream_t hStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaFreeAsync(devPtr, hStream) +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +cdef cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolTrimTo(memPool, minBytesToKeep) +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +cdef cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolSetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +cdef cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolGetAttribute(memPool, attr, value) +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +cdef cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolSetAccess(memPool, descList, count) +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +cdef cudaError_t cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolGetAccess(flags, memPool, location) +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +cdef cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolCreate(memPool, poolProps) +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +cdef cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolDestroy(memPool) +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +cdef cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMallocFromPoolAsync(ptr, size, memPool, stream) +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +cdef cudaError_t cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolExportToShareableHandle(shareableHandle, memPool, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +cdef cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolImportFromShareableHandle(memPool, shareableHandle, handleType, flags) +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +cdef cudaError_t cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolExportPointer(exportData, ptr) +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +cdef cudaError_t cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaMemPoolImportPointer(ptr, memPool, exportData) +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +cdef cudaError_t cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaPointerGetAttributes(attributes, ptr) +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +cdef cudaError_t cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice) +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +cdef cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceEnablePeerAccess(peerDevice, flags) +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +cdef cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceDisablePeerAccess(peerDevice) +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +cdef cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsUnregisterResource(resource) +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsResourceSetMapFlags(resource, flags) +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +cdef cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsMapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +cdef cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsUnmapResources(count, resources, stream) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsResourceGetMappedPointer(devPtr, size, resource) +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +cdef cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsSubResourceGetMappedArray(array, resource, arrayIndex, mipLevel) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +cdef cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray, resource) +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +cdef cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetChannelDesc(desc, array) +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) except* nogil: + return cyruntime._cudaCreateChannelDesc(x, y, z, w, f) +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +cdef cudaError_t cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc) +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +cdef cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDestroyTextureObject(texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetTextureObjectResourceDesc(pResDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetTextureObjectTextureDesc(pTexDesc, texObject) +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +cdef cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetTextureObjectResourceViewDesc(pResViewDesc, texObject) +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +cdef cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaCreateSurfaceObject(pSurfObject, pResDesc) +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +cdef cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDestroySurfaceObject(surfObject) +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +cdef cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetSurfaceObjectResourceDesc(pResDesc, surfObject) +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +cdef cudaError_t cudaDriverGetVersion(int* driverVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDriverGetVersion(driverVersion) +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +cdef cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaRuntimeGetVersion(runtimeVersion) +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +cdef cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphCreate(pGraph, flags) +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +cdef cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddKernelNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeCopyAttributes(hSrc, hDst) +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeGetAttribute(hNode, attr, value_out) +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +cdef cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphKernelNodeSetAttribute(hNode, attr, value) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddMemcpyNode(pGraphNode, graph, pDependencies, numDependencies, pCopyParams) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +cdef cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddMemcpyNode1D(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemcpyNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemcpyNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemcpyNodeSetParams1D(node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddMemsetNode(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemsetNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemsetNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +cdef cudaError_t cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddHostNode(pGraphNode, graph, pDependencies, numDependencies, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphHostNodeGetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphHostNodeSetParams(node, pNodeParams) +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +cdef cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddChildGraphNode(pGraphNode, graph, pDependencies, numDependencies, childGraph) +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +cdef cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphChildGraphNodeGetGraph(node, pGraph) +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddEmptyNode(pGraphNode, graph, pDependencies, numDependencies) +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddEventRecordNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphEventRecordNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphEventRecordNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +cdef cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddEventWaitNode(pGraphNode, graph, pDependencies, numDependencies, event) +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphEventWaitNodeGetEvent(node, event_out) +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphEventWaitNodeSetEvent(node, event) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +cdef cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddExternalSemaphoresSignalNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +cdef cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddExternalSemaphoresWaitNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddMemAllocNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemAllocNodeGetParams(node, params_out) +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +cdef cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddMemFreeNode(pGraphNode, graph, pDependencies, numDependencies, dptr) +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +cdef cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphMemFreeNodeGetParams(node, dptr_out) +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +cdef cudaError_t cudaDeviceGraphMemTrim(int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGraphMemTrim(device) +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceGetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +cdef cudaError_t cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaDeviceSetGraphMemAttribute(device, attr, value) +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +cdef cudaError_t cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphClone(pGraphClone, originalGraph) +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +cdef cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeFindInClone(pNode, originalNode, clonedGraph) +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetType(node, pType) +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +cdef cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphGetNodes(graph, nodes, numNodes) +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +cdef cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphGetRootNodes(graph, pRootNodes, pNumRootNodes) +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +cdef cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphGetEdges(graph, from_, to, numEdges) +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +cdef cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphGetEdges_v2(graph, from_, to, edgeData, numEdges) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependencies(node, pDependencies, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependencies_v2(node, pDependencies, edgeData, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependentNodes(node, pDependentNodes, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetDependentNodes_v2(node, pDependentNodes, edgeData, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +cdef cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +cdef cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphRemoveDependencies(graph, from_, to, numDependencies) +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +cdef cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphRemoveDependencies_v2(graph, from_, to, edgeData, numDependencies) +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +cdef cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphDestroyNode(node) +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +cdef cudaError_t cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphInstantiate(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +cdef cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphInstantiateWithFlags(pGraphExec, graph, flags) +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +cdef cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphInstantiateWithParams(pGraphExec, graph, instantiateParams) +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +cdef cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecGetFlags(graphExec, flags) +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +cdef cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, count, kind) +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams) +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph) +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +cdef cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +cdef cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +cdef cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +cdef cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecUpdate(hGraphExec, hGraph, resultInfo) +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +cdef cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphUpload(graphExec, stream) +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +cdef cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphLaunch(graphExec, stream) +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +cdef cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecDestroy(graphExec) +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +cdef cudaError_t cudaGraphDestroy(cudaGraph_t graph) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphDestroy(graph) +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +cdef cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphDebugDotPrint(graph, path, flags) +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +cdef cudaError_t cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +cdef cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaUserObjectRetain(object, count) +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +cdef cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaUserObjectRelease(object, count) +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +cdef cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphRetainUserObject(graph, object, count, flags) +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +cdef cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphReleaseUserObject(graph, object, count) +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +cdef cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddNode(pGraphNode, graph, pDependencies, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +cdef cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphAddNode_v2(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams) +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphNodeSetParams(node, nodeParams) +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +cdef cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphExecNodeSetParams(graphExec, node, nodeParams) +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +cdef cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphConditionalHandleCreate(pHandle_out, graph, defaultLaunchValue, flags) +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +cdef cudaError_t cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDriverEntryPoint(symbol, funcPtr, flags, driverStatus) +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +cdef cudaError_t cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetDriverEntryPointByVersion(symbol, funcPtr, cudaVersion, flags, driverStatus) +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +cdef cudaError_t cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +cdef cudaError_t cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +cdef cudaError_t cudaLibraryUnload(cudaLibrary_t library) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryUnload(library) +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +cdef cudaError_t cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryGetKernel(pKernel, library, name) +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +cdef cudaError_t cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryGetGlobal(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +cdef cudaError_t cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryGetManaged(dptr, numbytes, library, name) +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +cdef cudaError_t cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryGetUnifiedFunction(fptr, library, symbol) +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +cdef cudaError_t cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryGetKernelCount(count, lib) +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +cdef cudaError_t cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaLibraryEnumerateKernels(kernels, numKernels, lib) +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +cdef cudaError_t cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaKernelSetAttributeForDevice(kernel, attr, value, device) +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +cdef cudaError_t cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetExportTable(ppExportTable, pExportTableId) +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +cdef cudaError_t cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGetKernel(kernelPtr, entryFuncAddr) +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPitchedPtr make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) except* nogil: + return cyruntime._make_cudaPitchedPtr(d, p, xsz, ysz) +{{endif}} + +{{if 'make_cudaPos' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaPos make_cudaPos(size_t x, size_t y, size_t z) except* nogil: + return cyruntime._make_cudaPos(x, y, z) +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} +@cython.show_performance_hints(False) +cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) except* nogil: + return cyruntime._make_cudaExtent(w, h, d) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource** pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsEGLRegisterImage(pCudaResource, image, flags) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamConsumerConnect(conn, eglStream) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamConsumerDisconnect(conn) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamProducerConnect(conn, eglStream, width, height) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamProducerDisconnect(conn) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamProducerPresentFrame(conn, eglframe, pStream) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEGLStreamProducerReturnFrame(conn, eglframe, pStream) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaEventCreateFromEGLSync(phEvent, eglSync, flags) +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +cdef cudaError_t cudaProfilerStart() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaProfilerStart() +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +cdef cudaError_t cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaProfilerStop() +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGLGetDevices(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsGLRegisterImage(resource, image, target, flags) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsGLRegisterBuffer(resource, buffer, flags) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaVDPAUSetVDPAUDevice(device, vdpDevice, vdpGetProcAddress) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) +{{endif}} + +{{if True}} + +cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) +{{endif}} + +{{if True}} + +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +{{if 'Windows' == platform.system()}} +cimport cuda.bindings._lib.windll as windll +{{else}} +cimport cuda.bindings._lib.dlfcn as dlfcn +{{endif}} + +cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: + # Load + with gil: + loaded_dl = load_nvidia_dynamic_lib("cudart") + {{if 'Windows' == platform.system()}} + handle = loaded_dl._handle_uint + {{else}} + handle = loaded_dl._handle_uint + {{endif}} + + {{if 'Windows' == platform.system()}} + __cudaRuntimeGetVersion = windll.GetProcAddress(handle, b'cudaRuntimeGetVersion') + {{else}} + __cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion') + {{endif}} + + if __cudaRuntimeGetVersion == NULL: + with gil: + raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in {loaded_dl.abs_path}') + + # Call + cdef cudaError_t err = cudaSuccess + err = ( __cudaRuntimeGetVersion)(runtimeVersion) + + # We explicitly do *NOT* cleanup the library handle here, acknowledging + # that, yes, the handle leaks. The reason is that there's a + # `functools.cache` on the top-level caller of this function. + # + # This means this library would be opened once and then immediately closed, + # all the while remaining in the cache lurking there for people to call. + # + # Since we open the library one time (technically once per unique library name), + # there's not a ton of leakage, which we deem acceptable for the 1000x speedup + # achieved by caching (ultimately) `ctypes.CDLL` calls. + # + # Long(er)-term we can explore cleaning up the library using higher-level + # Python mechanisms, like `__del__` or `weakref.finalizer`s. + + return err +{{endif}} diff --git a/cuda_bindings_12/cuda/bindings/cyruntime_functions.pxi.in b/cuda_bindings_12/cuda/bindings/cyruntime_functions.pxi.in new file mode 100644 index 00000000000..686107f5177 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cyruntime_functions.pxi.in @@ -0,0 +1,1489 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f940ac0c504c1db7e68fdff89b8e65d35a8cf4a3962c4067e67d8afd11a5b6df +cdef extern from "cuda_runtime_api.h": + + {{if 'cudaDeviceReset' in found_functions}} + + cudaError_t cudaDeviceReset() nogil + + {{endif}} + {{if 'cudaDeviceSynchronize' in found_functions}} + + cudaError_t cudaDeviceSynchronize() nogil + + {{endif}} + {{if 'cudaDeviceSetLimit' in found_functions}} + + cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value) nogil + + {{endif}} + {{if 'cudaDeviceGetLimit' in found_functions}} + + cudaError_t cudaDeviceGetLimit(size_t* pValue, cudaLimit limit) nogil + + {{endif}} + {{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + + cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, const cudaChannelFormatDesc* fmtDesc, int device) nogil + + {{endif}} + {{if 'cudaDeviceGetCacheConfig' in found_functions}} + + cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache* pCacheConfig) nogil + + {{endif}} + {{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + + cudaError_t cudaDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) nogil + + {{endif}} + {{if 'cudaDeviceSetCacheConfig' in found_functions}} + + cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig) nogil + + {{endif}} + {{if 'cudaDeviceGetByPCIBusId' in found_functions}} + + cudaError_t cudaDeviceGetByPCIBusId(int* device, const char* pciBusId) nogil + + {{endif}} + {{if 'cudaDeviceGetPCIBusId' in found_functions}} + + cudaError_t cudaDeviceGetPCIBusId(char* pciBusId, int length, int device) nogil + + {{endif}} + {{if 'cudaIpcGetEventHandle' in found_functions}} + + cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t* handle, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaIpcOpenEventHandle' in found_functions}} + + cudaError_t cudaIpcOpenEventHandle(cudaEvent_t* event, cudaIpcEventHandle_t handle) nogil + + {{endif}} + {{if 'cudaIpcGetMemHandle' in found_functions}} + + cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t* handle, void* devPtr) nogil + + {{endif}} + {{if 'cudaIpcOpenMemHandle' in found_functions}} + + cudaError_t cudaIpcOpenMemHandle(void** devPtr, cudaIpcMemHandle_t handle, unsigned int flags) nogil + + {{endif}} + {{if 'cudaIpcCloseMemHandle' in found_functions}} + + cudaError_t cudaIpcCloseMemHandle(void* devPtr) nogil + + {{endif}} + {{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + + cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(cudaFlushGPUDirectRDMAWritesTarget target, cudaFlushGPUDirectRDMAWritesScope scope) nogil + + {{endif}} + {{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + + cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) nogil + + {{endif}} + {{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + + cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) nogil + + {{endif}} + {{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + + cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig* pConfig) nogil + + {{endif}} + {{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + + cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config) nogil + + {{endif}} + {{if 'cudaGetLastError' in found_functions}} + + cudaError_t cudaGetLastError() nogil + + {{endif}} + {{if 'cudaPeekAtLastError' in found_functions}} + + cudaError_t cudaPeekAtLastError() nogil + + {{endif}} + {{if 'cudaGetErrorName' in found_functions}} + + const char* cudaGetErrorName(cudaError_t error) nogil + + {{endif}} + {{if 'cudaGetErrorString' in found_functions}} + + const char* cudaGetErrorString(cudaError_t error) nogil + + {{endif}} + {{if 'cudaGetDeviceCount' in found_functions}} + + cudaError_t cudaGetDeviceCount(int* count) nogil + + {{endif}} + {{if 'cudaGetDeviceProperties_v2' in found_functions}} + + cudaError_t cudaGetDeviceProperties_v2(cudaDeviceProp* prop, int device) nogil + + {{endif}} + {{if 'cudaDeviceGetAttribute' in found_functions}} + + cudaError_t cudaDeviceGetAttribute(int* value, cudaDeviceAttr attr, int device) nogil + + {{endif}} + {{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + + cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t* memPool, int device) nogil + + {{endif}} + {{if 'cudaDeviceSetMemPool' in found_functions}} + + cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) nogil + + {{endif}} + {{if 'cudaDeviceGetMemPool' in found_functions}} + + cudaError_t cudaDeviceGetMemPool(cudaMemPool_t* memPool, int device) nogil + + {{endif}} + {{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + + cudaError_t cudaDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, int device, int flags) nogil + + {{endif}} + {{if 'cudaDeviceGetP2PAttribute' in found_functions}} + + cudaError_t cudaDeviceGetP2PAttribute(int* value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) nogil + + {{endif}} + {{if 'cudaChooseDevice' in found_functions}} + + cudaError_t cudaChooseDevice(int* device, const cudaDeviceProp* prop) nogil + + {{endif}} + {{if 'cudaInitDevice' in found_functions}} + + cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) nogil + + {{endif}} + {{if 'cudaSetDevice' in found_functions}} + + cudaError_t cudaSetDevice(int device) nogil + + {{endif}} + {{if 'cudaGetDevice' in found_functions}} + + cudaError_t cudaGetDevice(int* device) nogil + + {{endif}} + {{if 'cudaSetDeviceFlags' in found_functions}} + + cudaError_t cudaSetDeviceFlags(unsigned int flags) nogil + + {{endif}} + {{if 'cudaGetDeviceFlags' in found_functions}} + + cudaError_t cudaGetDeviceFlags(unsigned int* flags) nogil + + {{endif}} + {{if 'cudaStreamCreate' in found_functions}} + + cudaError_t cudaStreamCreate(cudaStream_t* pStream) nogil + + {{endif}} + {{if 'cudaStreamCreateWithFlags' in found_functions}} + + cudaError_t cudaStreamCreateWithFlags(cudaStream_t* pStream, unsigned int flags) nogil + + {{endif}} + {{if 'cudaStreamCreateWithPriority' in found_functions}} + + cudaError_t cudaStreamCreateWithPriority(cudaStream_t* pStream, unsigned int flags, int priority) nogil + + {{endif}} + {{if 'cudaStreamGetPriority' in found_functions}} + + cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int* priority) nogil + + {{endif}} + {{if 'cudaStreamGetFlags' in found_functions}} + + cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int* flags) nogil + + {{endif}} + {{if 'cudaStreamGetId' in found_functions}} + + cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long* streamId) nogil + + {{endif}} + {{if 'cudaStreamGetDevice' in found_functions}} + + cudaError_t cudaStreamGetDevice(cudaStream_t hStream, int* device) nogil + + {{endif}} + {{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + + cudaError_t cudaCtxResetPersistingL2Cache() nogil + + {{endif}} + {{if 'cudaStreamCopyAttributes' in found_functions}} + + cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) nogil + + {{endif}} + {{if 'cudaStreamGetAttribute' in found_functions}} + + cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, cudaStreamAttrValue* value_out) nogil + + {{endif}} + {{if 'cudaStreamSetAttribute' in found_functions}} + + cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaStreamAttrID attr, const cudaStreamAttrValue* value) nogil + + {{endif}} + {{if 'cudaStreamDestroy' in found_functions}} + + cudaError_t cudaStreamDestroy(cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaStreamWaitEvent' in found_functions}} + + cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) nogil + + {{endif}} + {{if 'cudaStreamAddCallback' in found_functions}} + + cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void* userData, unsigned int flags) nogil + + {{endif}} + {{if 'cudaStreamSynchronize' in found_functions}} + + cudaError_t cudaStreamSynchronize(cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaStreamQuery' in found_functions}} + + cudaError_t cudaStreamQuery(cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaStreamAttachMemAsync' in found_functions}} + + cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, size_t length, unsigned int flags) nogil + + {{endif}} + {{if 'cudaStreamBeginCapture' in found_functions}} + + cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) nogil + + {{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + + cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) nogil + + {{endif}} + {{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + + cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode* mode) nogil + + {{endif}} + {{if 'cudaStreamEndCapture' in found_functions}} + + cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t* pGraph) nogil + + {{endif}} + {{if 'cudaStreamIsCapturing' in found_functions}} + + cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus* pCaptureStatus) nogil + + {{endif}} + {{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + + cudaError_t cudaStreamGetCaptureInfo_v2_ptsz(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil + + {{endif}} + {{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + + cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, size_t* numDependencies_out) nogil + + {{endif}} + {{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + + cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, cudaStreamCaptureStatus* captureStatus_out, unsigned long long* id_out, cudaGraph_t* graph_out, const cudaGraphNode_t** dependencies_out, const cudaGraphEdgeData** edgeData_out, size_t* numDependencies_out) nogil + + {{endif}} + {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + + cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t* dependencies, size_t numDependencies, unsigned int flags) nogil + + {{endif}} + {{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + + cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) nogil + + {{endif}} + {{if 'cudaEventCreate' in found_functions}} + + cudaError_t cudaEventCreate(cudaEvent_t* event) nogil + + {{endif}} + {{if 'cudaEventCreateWithFlags' in found_functions}} + + cudaError_t cudaEventCreateWithFlags(cudaEvent_t* event, unsigned int flags) nogil + + {{endif}} + {{if 'cudaEventRecord' in found_functions}} + + cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaEventRecordWithFlags' in found_functions}} + + cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) nogil + + {{endif}} + {{if 'cudaEventQuery' in found_functions}} + + cudaError_t cudaEventQuery(cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaEventSynchronize' in found_functions}} + + cudaError_t cudaEventSynchronize(cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaEventDestroy' in found_functions}} + + cudaError_t cudaEventDestroy(cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaEventElapsedTime' in found_functions}} + + cudaError_t cudaEventElapsedTime(float* ms, cudaEvent_t start, cudaEvent_t end) nogil + + {{endif}} + {{if 'cudaEventElapsedTime_v2' in found_functions}} + + cudaError_t cudaEventElapsedTime_v2(float* ms, cudaEvent_t start, cudaEvent_t end) nogil + + {{endif}} + {{if 'cudaImportExternalMemory' in found_functions}} + + cudaError_t cudaImportExternalMemory(cudaExternalMemory_t* extMem_out, const cudaExternalMemoryHandleDesc* memHandleDesc) nogil + + {{endif}} + {{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + + cudaError_t cudaExternalMemoryGetMappedBuffer(void** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc* bufferDesc) nogil + + {{endif}} + {{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + + cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t* mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc* mipmapDesc) nogil + + {{endif}} + {{if 'cudaDestroyExternalMemory' in found_functions}} + + cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) nogil + + {{endif}} + {{if 'cudaImportExternalSemaphore' in found_functions}} + + cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t* extSem_out, const cudaExternalSemaphoreHandleDesc* semHandleDesc) nogil + + {{endif}} + {{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + + cudaError_t cudaSignalExternalSemaphoresAsync_v2_ptsz(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + + cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreSignalParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + + cudaError_t cudaWaitExternalSemaphoresAsync_v2_ptsz(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + + cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t* extSemArray, const cudaExternalSemaphoreWaitParams* paramsArray, unsigned int numExtSems, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaDestroyExternalSemaphore' in found_functions}} + + cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) nogil + + {{endif}} + {{if 'cudaFuncSetCacheConfig' in found_functions}} + + cudaError_t cudaFuncSetCacheConfig(const void* func, cudaFuncCache cacheConfig) nogil + + {{endif}} + {{if 'cudaFuncGetAttributes' in found_functions}} + + cudaError_t cudaFuncGetAttributes(cudaFuncAttributes* attr, const void* func) nogil + + {{endif}} + {{if 'cudaFuncSetAttribute' in found_functions}} + + cudaError_t cudaFuncSetAttribute(const void* func, cudaFuncAttribute attr, int value) nogil + + {{endif}} + {{if 'cudaLaunchHostFunc' in found_functions}} + + cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void* userData) nogil + + {{endif}} + {{if 'cudaFuncSetSharedMemConfig' in found_functions}} + + cudaError_t cudaFuncSetSharedMemConfig(const void* func, cudaSharedMemConfig config) nogil + + {{endif}} + {{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + + cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize) nogil + + {{endif}} + {{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + + cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, const void* func, int numBlocks, int blockSize) nogil + + {{endif}} + {{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + + cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, const void* func, int blockSize, size_t dynamicSMemSize, unsigned int flags) nogil + + {{endif}} + {{if 'cudaMallocManaged' in found_functions}} + + cudaError_t cudaMallocManaged(void** devPtr, size_t size, unsigned int flags) nogil + + {{endif}} + {{if 'cudaMalloc' in found_functions}} + + cudaError_t cudaMalloc(void** devPtr, size_t size) nogil + + {{endif}} + {{if 'cudaMallocHost' in found_functions}} + + cudaError_t cudaMallocHost(void** ptr, size_t size) nogil + + {{endif}} + {{if 'cudaMallocPitch' in found_functions}} + + cudaError_t cudaMallocPitch(void** devPtr, size_t* pitch, size_t width, size_t height) nogil + + {{endif}} + {{if 'cudaMallocArray' in found_functions}} + + cudaError_t cudaMallocArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags) nogil + + {{endif}} + {{if 'cudaFree' in found_functions}} + + cudaError_t cudaFree(void* devPtr) nogil + + {{endif}} + {{if 'cudaFreeHost' in found_functions}} + + cudaError_t cudaFreeHost(void* ptr) nogil + + {{endif}} + {{if 'cudaFreeArray' in found_functions}} + + cudaError_t cudaFreeArray(cudaArray_t array) nogil + + {{endif}} + {{if 'cudaFreeMipmappedArray' in found_functions}} + + cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) nogil + + {{endif}} + {{if 'cudaHostAlloc' in found_functions}} + + cudaError_t cudaHostAlloc(void** pHost, size_t size, unsigned int flags) nogil + + {{endif}} + {{if 'cudaHostRegister' in found_functions}} + + cudaError_t cudaHostRegister(void* ptr, size_t size, unsigned int flags) nogil + + {{endif}} + {{if 'cudaHostUnregister' in found_functions}} + + cudaError_t cudaHostUnregister(void* ptr) nogil + + {{endif}} + {{if 'cudaHostGetDevicePointer' in found_functions}} + + cudaError_t cudaHostGetDevicePointer(void** pDevice, void* pHost, unsigned int flags) nogil + + {{endif}} + {{if 'cudaHostGetFlags' in found_functions}} + + cudaError_t cudaHostGetFlags(unsigned int* pFlags, void* pHost) nogil + + {{endif}} + {{if 'cudaMalloc3D' in found_functions}} + + cudaError_t cudaMalloc3D(cudaPitchedPtr* pitchedDevPtr, cudaExtent extent) nogil + + {{endif}} + {{if 'cudaMalloc3DArray' in found_functions}} + + cudaError_t cudaMalloc3DArray(cudaArray_t* array, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int flags) nogil + + {{endif}} + {{if 'cudaMallocMipmappedArray' in found_functions}} + + cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t* mipmappedArray, const cudaChannelFormatDesc* desc, cudaExtent extent, unsigned int numLevels, unsigned int flags) nogil + + {{endif}} + {{if 'cudaGetMipmappedArrayLevel' in found_functions}} + + cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t* levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) nogil + + {{endif}} + {{if 'cudaMemcpy3D' in found_functions}} + + cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms* p) nogil + + {{endif}} + {{if 'cudaMemcpy3DPeer' in found_functions}} + + cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms* p) nogil + + {{endif}} + {{if 'cudaMemcpy3DAsync' in found_functions}} + + cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms* p, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpy3DPeerAsync' in found_functions}} + + cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms* p, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemGetInfo' in found_functions}} + + cudaError_t cudaMemGetInfo(size_t* free, size_t* total) nogil + + {{endif}} + {{if 'cudaArrayGetInfo' in found_functions}} + + cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc* desc, cudaExtent* extent, unsigned int* flags, cudaArray_t array) nogil + + {{endif}} + {{if 'cudaArrayGetPlane' in found_functions}} + + cudaError_t cudaArrayGetPlane(cudaArray_t* pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) nogil + + {{endif}} + {{if 'cudaArrayGetMemoryRequirements' in found_functions}} + + cudaError_t cudaArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaArray_t array, int device) nogil + + {{endif}} + {{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + + cudaError_t cudaMipmappedArrayGetMemoryRequirements(cudaArrayMemoryRequirements* memoryRequirements, cudaMipmappedArray_t mipmap, int device) nogil + + {{endif}} + {{if 'cudaArrayGetSparseProperties' in found_functions}} + + cudaError_t cudaArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaArray_t array) nogil + + {{endif}} + {{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + + cudaError_t cudaMipmappedArrayGetSparseProperties(cudaArraySparseProperties* sparseProperties, cudaMipmappedArray_t mipmap) nogil + + {{endif}} + {{if 'cudaMemcpy' in found_functions}} + + cudaError_t cudaMemcpy(void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpyPeer' in found_functions}} + + cudaError_t cudaMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, size_t count) nogil + + {{endif}} + {{if 'cudaMemcpy2D' in found_functions}} + + cudaError_t cudaMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpy2DToArray' in found_functions}} + + cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpy2DFromArray' in found_functions}} + + cudaError_t cudaMemcpy2DFromArray(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpy2DArrayToArray' in found_functions}} + + cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpyAsync' in found_functions}} + + cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpyPeerAsync' in found_functions}} + + cudaError_t cudaMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t count, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpyBatchAsync' in found_functions}} + + cudaError_t cudaMemcpyBatchAsync(void** dsts, void** srcs, size_t* sizes, size_t count, cudaMemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, size_t* failIdx, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpy3DBatchAsync' in found_functions}} + + cudaError_t cudaMemcpy3DBatchAsync(size_t numOps, cudaMemcpy3DBatchOp* opList, size_t* failIdx, unsigned long long flags, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpy2DAsync' in found_functions}} + + cudaError_t cudaMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + + cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + + cudaError_t cudaMemcpy2DFromArrayAsync(void* dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemset' in found_functions}} + + cudaError_t cudaMemset(void* devPtr, int value, size_t count) nogil + + {{endif}} + {{if 'cudaMemset2D' in found_functions}} + + cudaError_t cudaMemset2D(void* devPtr, size_t pitch, int value, size_t width, size_t height) nogil + + {{endif}} + {{if 'cudaMemset3D' in found_functions}} + + cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent) nogil + + {{endif}} + {{if 'cudaMemsetAsync' in found_functions}} + + cudaError_t cudaMemsetAsync(void* devPtr, int value, size_t count, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemset2DAsync' in found_functions}} + + cudaError_t cudaMemset2DAsync(void* devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemset3DAsync' in found_functions}} + + cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemPrefetchAsync' in found_functions}} + + cudaError_t cudaMemPrefetchAsync(const void* devPtr, size_t count, int dstDevice, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemPrefetchAsync_v2' in found_functions}} + + cudaError_t cudaMemPrefetchAsync_v2(const void* devPtr, size_t count, cudaMemLocation location, unsigned int flags, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemAdvise' in found_functions}} + + cudaError_t cudaMemAdvise(const void* devPtr, size_t count, cudaMemoryAdvise advice, int device) nogil + + {{endif}} + {{if 'cudaMemAdvise_v2' in found_functions}} + + cudaError_t cudaMemAdvise_v2(const void* devPtr, size_t count, cudaMemoryAdvise advice, cudaMemLocation location) nogil + + {{endif}} + {{if 'cudaMemRangeGetAttribute' in found_functions}} + + cudaError_t cudaMemRangeGetAttribute(void* data, size_t dataSize, cudaMemRangeAttribute attribute, const void* devPtr, size_t count) nogil + + {{endif}} + {{if 'cudaMemRangeGetAttributes' in found_functions}} + + cudaError_t cudaMemRangeGetAttributes(void** data, size_t* dataSizes, cudaMemRangeAttribute* attributes, size_t numAttributes, const void* devPtr, size_t count) nogil + + {{endif}} + {{if 'cudaMemcpyToArray' in found_functions}} + + cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpyFromArray' in found_functions}} + + cudaError_t cudaMemcpyFromArray(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpyArrayToArray' in found_functions}} + + cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaMemcpyToArrayAsync' in found_functions}} + + cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void* src, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemcpyFromArrayAsync' in found_functions}} + + cudaError_t cudaMemcpyFromArrayAsync(void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMallocAsync' in found_functions}} + + cudaError_t cudaMallocAsync(void** devPtr, size_t size, cudaStream_t hStream) nogil + + {{endif}} + {{if 'cudaFreeAsync' in found_functions}} + + cudaError_t cudaFreeAsync(void* devPtr, cudaStream_t hStream) nogil + + {{endif}} + {{if 'cudaMemPoolTrimTo' in found_functions}} + + cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) nogil + + {{endif}} + {{if 'cudaMemPoolSetAttribute' in found_functions}} + + cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) nogil + + {{endif}} + {{if 'cudaMemPoolGetAttribute' in found_functions}} + + cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, cudaMemPoolAttr attr, void* value) nogil + + {{endif}} + {{if 'cudaMemPoolSetAccess' in found_functions}} + + cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const cudaMemAccessDesc* descList, size_t count) nogil + + {{endif}} + {{if 'cudaMemPoolGetAccess' in found_functions}} + + cudaError_t cudaMemPoolGetAccess(cudaMemAccessFlags* flags, cudaMemPool_t memPool, cudaMemLocation* location) nogil + + {{endif}} + {{if 'cudaMemPoolCreate' in found_functions}} + + cudaError_t cudaMemPoolCreate(cudaMemPool_t* memPool, const cudaMemPoolProps* poolProps) nogil + + {{endif}} + {{if 'cudaMemPoolDestroy' in found_functions}} + + cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) nogil + + {{endif}} + {{if 'cudaMallocFromPoolAsync' in found_functions}} + + cudaError_t cudaMallocFromPoolAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + + cudaError_t cudaMemPoolExportToShareableHandle(void* shareableHandle, cudaMemPool_t memPool, cudaMemAllocationHandleType handleType, unsigned int flags) nogil + + {{endif}} + {{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + + cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t* memPool, void* shareableHandle, cudaMemAllocationHandleType handleType, unsigned int flags) nogil + + {{endif}} + {{if 'cudaMemPoolExportPointer' in found_functions}} + + cudaError_t cudaMemPoolExportPointer(cudaMemPoolPtrExportData* exportData, void* ptr) nogil + + {{endif}} + {{if 'cudaMemPoolImportPointer' in found_functions}} + + cudaError_t cudaMemPoolImportPointer(void** ptr, cudaMemPool_t memPool, cudaMemPoolPtrExportData* exportData) nogil + + {{endif}} + {{if 'cudaPointerGetAttributes' in found_functions}} + + cudaError_t cudaPointerGetAttributes(cudaPointerAttributes* attributes, const void* ptr) nogil + + {{endif}} + {{if 'cudaDeviceCanAccessPeer' in found_functions}} + + cudaError_t cudaDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) nogil + + {{endif}} + {{if 'cudaDeviceEnablePeerAccess' in found_functions}} + + cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) nogil + + {{endif}} + {{if 'cudaDeviceDisablePeerAccess' in found_functions}} + + cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) nogil + + {{endif}} + {{if 'cudaGraphicsUnregisterResource' in found_functions}} + + cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) nogil + + {{endif}} + {{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + + cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) nogil + + {{endif}} + {{if 'cudaGraphicsMapResources' in found_functions}} + + cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaGraphicsUnmapResources' in found_functions}} + + cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t* resources, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + + cudaError_t cudaGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, cudaGraphicsResource_t resource) nogil + + {{endif}} + {{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + + cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t* array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) nogil + + {{endif}} + {{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + + cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t* mipmappedArray, cudaGraphicsResource_t resource) nogil + + {{endif}} + {{if 'cudaGetChannelDesc' in found_functions}} + + cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc* desc, cudaArray_const_t array) nogil + + {{endif}} + {{if 'cudaCreateChannelDesc' in found_functions}} + + cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f) nogil + + {{endif}} + {{if 'cudaCreateTextureObject' in found_functions}} + + cudaError_t cudaCreateTextureObject(cudaTextureObject_t* pTexObject, const cudaResourceDesc* pResDesc, const cudaTextureDesc* pTexDesc, const cudaResourceViewDesc* pResViewDesc) nogil + + {{endif}} + {{if 'cudaDestroyTextureObject' in found_functions}} + + cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) nogil + + {{endif}} + {{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + + cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc* pResDesc, cudaTextureObject_t texObject) nogil + + {{endif}} + {{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + + cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc* pTexDesc, cudaTextureObject_t texObject) nogil + + {{endif}} + {{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + + cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc* pResViewDesc, cudaTextureObject_t texObject) nogil + + {{endif}} + {{if 'cudaCreateSurfaceObject' in found_functions}} + + cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t* pSurfObject, const cudaResourceDesc* pResDesc) nogil + + {{endif}} + {{if 'cudaDestroySurfaceObject' in found_functions}} + + cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) nogil + + {{endif}} + {{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + + cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc* pResDesc, cudaSurfaceObject_t surfObject) nogil + + {{endif}} + {{if 'cudaDriverGetVersion' in found_functions}} + + cudaError_t cudaDriverGetVersion(int* driverVersion) nogil + + {{endif}} + {{if 'cudaRuntimeGetVersion' in found_functions}} + + cudaError_t cudaRuntimeGetVersion(int* runtimeVersion) nogil + + {{endif}} + {{if 'cudaGraphCreate' in found_functions}} + + cudaError_t cudaGraphCreate(cudaGraph_t* pGraph, unsigned int flags) nogil + + {{endif}} + {{if 'cudaGraphAddKernelNode' in found_functions}} + + cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaKernelNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphKernelNodeGetParams' in found_functions}} + + cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphKernelNodeSetParams' in found_functions}} + + cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + + cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) nogil + + {{endif}} + {{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + + cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, cudaKernelNodeAttrValue* value_out) nogil + + {{endif}} + {{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + + cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaKernelNodeAttrID attr, const cudaKernelNodeAttrValue* value) nogil + + {{endif}} + {{if 'cudaGraphAddMemcpyNode' in found_functions}} + + cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemcpy3DParms* pCopyParams) nogil + + {{endif}} + {{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + + cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + + cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + + cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + + cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaGraphAddMemsetNode' in found_functions}} + + cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaMemsetParams* pMemsetParams) nogil + + {{endif}} + {{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + + cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + + cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphAddHostNode' in found_functions}} + + cudaError_t cudaGraphAddHostNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaHostNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphHostNodeGetParams' in found_functions}} + + cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphHostNodeSetParams' in found_functions}} + + cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphAddChildGraphNode' in found_functions}} + + cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraph_t childGraph) nogil + + {{endif}} + {{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + + cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t* pGraph) nogil + + {{endif}} + {{if 'cudaGraphAddEmptyNode' in found_functions}} + + cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies) nogil + + {{endif}} + {{if 'cudaGraphAddEventRecordNode' in found_functions}} + + cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + + cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) nogil + + {{endif}} + {{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + + cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphAddEventWaitNode' in found_functions}} + + cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + + cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t* event_out) nogil + + {{endif}} + {{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + + cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + + cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + + cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreSignalNodeParams* params_out) nogil + + {{endif}} + {{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + + cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + + cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, cudaExternalSemaphoreWaitNodeParams* params_out) nogil + + {{endif}} + {{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphAddMemAllocNode' in found_functions}} + + cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaMemAllocNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + + cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, cudaMemAllocNodeParams* params_out) nogil + + {{endif}} + {{if 'cudaGraphAddMemFreeNode' in found_functions}} + + cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, void* dptr) nogil + + {{endif}} + {{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + + cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void* dptr_out) nogil + + {{endif}} + {{if 'cudaDeviceGraphMemTrim' in found_functions}} + + cudaError_t cudaDeviceGraphMemTrim(int device) nogil + + {{endif}} + {{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + + cudaError_t cudaDeviceGetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) nogil + + {{endif}} + {{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + + cudaError_t cudaDeviceSetGraphMemAttribute(int device, cudaGraphMemAttributeType attr, void* value) nogil + + {{endif}} + {{if 'cudaGraphClone' in found_functions}} + + cudaError_t cudaGraphClone(cudaGraph_t* pGraphClone, cudaGraph_t originalGraph) nogil + + {{endif}} + {{if 'cudaGraphNodeFindInClone' in found_functions}} + + cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t* pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) nogil + + {{endif}} + {{if 'cudaGraphNodeGetType' in found_functions}} + + cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType* pType) nogil + + {{endif}} + {{if 'cudaGraphGetNodes' in found_functions}} + + cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t* nodes, size_t* numNodes) nogil + + {{endif}} + {{if 'cudaGraphGetRootNodes' in found_functions}} + + cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t* pRootNodes, size_t* pNumRootNodes) nogil + + {{endif}} + {{if 'cudaGraphGetEdges' in found_functions}} + + cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, size_t* numEdges) nogil + + {{endif}} + {{if 'cudaGraphGetEdges_v2' in found_functions}} + + cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t* from_, cudaGraphNode_t* to, cudaGraphEdgeData* edgeData, size_t* numEdges) nogil + + {{endif}} + {{if 'cudaGraphNodeGetDependencies' in found_functions}} + + cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, size_t* pNumDependencies) nogil + + {{endif}} + {{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + + cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependencies, cudaGraphEdgeData* edgeData, size_t* pNumDependencies) nogil + + {{endif}} + {{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + + cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, size_t* pNumDependentNodes) nogil + + {{endif}} + {{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + + cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t* pDependentNodes, cudaGraphEdgeData* edgeData, size_t* pNumDependentNodes) nogil + + {{endif}} + {{if 'cudaGraphAddDependencies' in found_functions}} + + cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) nogil + + {{endif}} + {{if 'cudaGraphAddDependencies_v2' in found_functions}} + + cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + + {{endif}} + {{if 'cudaGraphRemoveDependencies' in found_functions}} + + cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, size_t numDependencies) nogil + + {{endif}} + {{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + + cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t* from_, const cudaGraphNode_t* to, const cudaGraphEdgeData* edgeData, size_t numDependencies) nogil + + {{endif}} + {{if 'cudaGraphDestroyNode' in found_functions}} + + cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) nogil + + {{endif}} + {{if 'cudaGraphInstantiate' in found_functions}} + + cudaError_t cudaGraphInstantiate(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) nogil + + {{endif}} + {{if 'cudaGraphInstantiateWithFlags' in found_functions}} + + cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, unsigned long long flags) nogil + + {{endif}} + {{if 'cudaGraphInstantiateWithParams' in found_functions}} + + cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t* pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams* instantiateParams) nogil + + {{endif}} + {{if 'cudaGraphExecGetFlags' in found_functions}} + + cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long* flags) nogil + + {{endif}} + {{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemcpy3DParms* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + + cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void* dst, const void* src, size_t count, cudaMemcpyKind kind) nogil + + {{endif}} + {{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaMemsetParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaHostNodeParams* pNodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) nogil + + {{endif}} + {{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + + cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + + cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) nogil + + {{endif}} + {{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreSignalNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const cudaExternalSemaphoreWaitNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphNodeSetEnabled' in found_functions}} + + cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) nogil + + {{endif}} + {{if 'cudaGraphNodeGetEnabled' in found_functions}} + + cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int* isEnabled) nogil + + {{endif}} + {{if 'cudaGraphExecUpdate' in found_functions}} + + cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo* resultInfo) nogil + + {{endif}} + {{if 'cudaGraphUpload' in found_functions}} + + cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaGraphLaunch' in found_functions}} + + cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) nogil + + {{endif}} + {{if 'cudaGraphExecDestroy' in found_functions}} + + cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) nogil + + {{endif}} + {{if 'cudaGraphDestroy' in found_functions}} + + cudaError_t cudaGraphDestroy(cudaGraph_t graph) nogil + + {{endif}} + {{if 'cudaGraphDebugDotPrint' in found_functions}} + + cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char* path, unsigned int flags) nogil + + {{endif}} + {{if 'cudaUserObjectCreate' in found_functions}} + + cudaError_t cudaUserObjectCreate(cudaUserObject_t* object_out, void* ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) nogil + + {{endif}} + {{if 'cudaUserObjectRetain' in found_functions}} + + cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) nogil + + {{endif}} + {{if 'cudaUserObjectRelease' in found_functions}} + + cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) nogil + + {{endif}} + {{if 'cudaGraphRetainUserObject' in found_functions}} + + cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) nogil + + {{endif}} + {{if 'cudaGraphReleaseUserObject' in found_functions}} + + cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) nogil + + {{endif}} + {{if 'cudaGraphAddNode' in found_functions}} + + cudaError_t cudaGraphAddNode(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphAddNode_v2' in found_functions}} + + cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t* pGraphNode, cudaGraph_t graph, const cudaGraphNode_t* pDependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaGraphNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphNodeSetParams' in found_functions}} + + cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphExecNodeSetParams' in found_functions}} + + cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) nogil + + {{endif}} + {{if 'cudaGraphConditionalHandleCreate' in found_functions}} + + cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle* pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) nogil + + {{endif}} + {{if 'cudaGetDriverEntryPoint' in found_functions}} + + cudaError_t cudaGetDriverEntryPoint(const char* symbol, void** funcPtr, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) nogil + + {{endif}} + {{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + + cudaError_t cudaGetDriverEntryPointByVersion(const char* symbol, void** funcPtr, unsigned int cudaVersion, unsigned long long flags, cudaDriverEntryPointQueryResult* driverStatus) nogil + + {{endif}} + {{if 'cudaLibraryLoadData' in found_functions}} + + cudaError_t cudaLibraryLoadData(cudaLibrary_t* library, const void* code, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) nogil + + {{endif}} + {{if 'cudaLibraryLoadFromFile' in found_functions}} + + cudaError_t cudaLibraryLoadFromFile(cudaLibrary_t* library, const char* fileName, cudaJitOption* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, cudaLibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) nogil + + {{endif}} + {{if 'cudaLibraryUnload' in found_functions}} + + cudaError_t cudaLibraryUnload(cudaLibrary_t library) nogil + + {{endif}} + {{if 'cudaLibraryGetKernel' in found_functions}} + + cudaError_t cudaLibraryGetKernel(cudaKernel_t* pKernel, cudaLibrary_t library, const char* name) nogil + + {{endif}} + {{if 'cudaLibraryGetGlobal' in found_functions}} + + cudaError_t cudaLibraryGetGlobal(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) nogil + + {{endif}} + {{if 'cudaLibraryGetManaged' in found_functions}} + + cudaError_t cudaLibraryGetManaged(void** dptr, size_t* numbytes, cudaLibrary_t library, const char* name) nogil + + {{endif}} + {{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + + cudaError_t cudaLibraryGetUnifiedFunction(void** fptr, cudaLibrary_t library, const char* symbol) nogil + + {{endif}} + {{if 'cudaLibraryGetKernelCount' in found_functions}} + + cudaError_t cudaLibraryGetKernelCount(unsigned int* count, cudaLibrary_t lib) nogil + + {{endif}} + {{if 'cudaLibraryEnumerateKernels' in found_functions}} + + cudaError_t cudaLibraryEnumerateKernels(cudaKernel_t* kernels, unsigned int numKernels, cudaLibrary_t lib) nogil + + {{endif}} + {{if 'cudaKernelSetAttributeForDevice' in found_functions}} + + cudaError_t cudaKernelSetAttributeForDevice(cudaKernel_t kernel, cudaFuncAttribute attr, int value, int device) nogil + + {{endif}} + {{if 'cudaGetExportTable' in found_functions}} + + cudaError_t cudaGetExportTable(const void** ppExportTable, const cudaUUID_t* pExportTableId) nogil + + {{endif}} + {{if 'cudaGetKernel' in found_functions}} + + cudaError_t cudaGetKernel(cudaKernel_t* kernelPtr, const void* entryFuncAddr) nogil + + {{endif}} + +cdef extern from "cuda_runtime.h": + + {{if 'make_cudaPitchedPtr' in found_functions}} + + cudaPitchedPtr make_cudaPitchedPtr(void* d, size_t p, size_t xsz, size_t ysz) nogil + + {{endif}} + {{if 'make_cudaPos' in found_functions}} + + cudaPos make_cudaPos(size_t x, size_t y, size_t z) nogil + + {{endif}} + {{if 'make_cudaExtent' in found_functions}} + + cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) nogil + + {{endif}} + +cdef extern from "cuda_profiler_api.h": + + {{if 'cudaProfilerStart' in found_functions}} + + cudaError_t cudaProfilerStart() nogil + + {{endif}} + {{if 'cudaProfilerStop' in found_functions}} + + cudaError_t cudaProfilerStop() nogil + + {{endif}} + diff --git a/cuda_bindings_12/cuda/bindings/cyruntime_types.pxi.in b/cuda_bindings_12/cuda/bindings/cyruntime_types.pxi.in new file mode 100644 index 00000000000..b3375206bfd --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/cyruntime_types.pxi.in @@ -0,0 +1,1560 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c51143430d125993e9caa3d4ef3c8ae8c00cee1d4bbeb947dc2b2a736714e833 +cdef extern from "vector_types.h": + + cdef struct dim3: + unsigned int x + unsigned int y + unsigned int z + +cdef extern from "driver_types.h": + + cdef enum cudaError: + cudaSuccess = 0 + cudaErrorInvalidValue = 1 + cudaErrorMemoryAllocation = 2 + cudaErrorInitializationError = 3 + cudaErrorCudartUnloading = 4 + cudaErrorProfilerDisabled = 5 + cudaErrorProfilerNotInitialized = 6 + cudaErrorProfilerAlreadyStarted = 7 + cudaErrorProfilerAlreadyStopped = 8 + cudaErrorInvalidConfiguration = 9 + cudaErrorInvalidPitchValue = 12 + cudaErrorInvalidSymbol = 13 + cudaErrorInvalidHostPointer = 16 + cudaErrorInvalidDevicePointer = 17 + cudaErrorInvalidTexture = 18 + cudaErrorInvalidTextureBinding = 19 + cudaErrorInvalidChannelDescriptor = 20 + cudaErrorInvalidMemcpyDirection = 21 + cudaErrorAddressOfConstant = 22 + cudaErrorTextureFetchFailed = 23 + cudaErrorTextureNotBound = 24 + cudaErrorSynchronizationError = 25 + cudaErrorInvalidFilterSetting = 26 + cudaErrorInvalidNormSetting = 27 + cudaErrorMixedDeviceExecution = 28 + cudaErrorNotYetImplemented = 31 + cudaErrorMemoryValueTooLarge = 32 + cudaErrorStubLibrary = 34 + cudaErrorInsufficientDriver = 35 + cudaErrorCallRequiresNewerDriver = 36 + cudaErrorInvalidSurface = 37 + cudaErrorDuplicateVariableName = 43 + cudaErrorDuplicateTextureName = 44 + cudaErrorDuplicateSurfaceName = 45 + cudaErrorDevicesUnavailable = 46 + cudaErrorIncompatibleDriverContext = 49 + cudaErrorMissingConfiguration = 52 + cudaErrorPriorLaunchFailure = 53 + cudaErrorLaunchMaxDepthExceeded = 65 + cudaErrorLaunchFileScopedTex = 66 + cudaErrorLaunchFileScopedSurf = 67 + cudaErrorSyncDepthExceeded = 68 + cudaErrorLaunchPendingCountExceeded = 69 + cudaErrorInvalidDeviceFunction = 98 + cudaErrorNoDevice = 100 + cudaErrorInvalidDevice = 101 + cudaErrorDeviceNotLicensed = 102 + cudaErrorSoftwareValidityNotEstablished = 103 + cudaErrorStartupFailure = 127 + cudaErrorInvalidKernelImage = 200 + cudaErrorDeviceUninitialized = 201 + cudaErrorMapBufferObjectFailed = 205 + cudaErrorUnmapBufferObjectFailed = 206 + cudaErrorArrayIsMapped = 207 + cudaErrorAlreadyMapped = 208 + cudaErrorNoKernelImageForDevice = 209 + cudaErrorAlreadyAcquired = 210 + cudaErrorNotMapped = 211 + cudaErrorNotMappedAsArray = 212 + cudaErrorNotMappedAsPointer = 213 + cudaErrorECCUncorrectable = 214 + cudaErrorUnsupportedLimit = 215 + cudaErrorDeviceAlreadyInUse = 216 + cudaErrorPeerAccessUnsupported = 217 + cudaErrorInvalidPtx = 218 + cudaErrorInvalidGraphicsContext = 219 + cudaErrorNvlinkUncorrectable = 220 + cudaErrorJitCompilerNotFound = 221 + cudaErrorUnsupportedPtxVersion = 222 + cudaErrorJitCompilationDisabled = 223 + cudaErrorUnsupportedExecAffinity = 224 + cudaErrorUnsupportedDevSideSync = 225 + cudaErrorContained = 226 + cudaErrorInvalidSource = 300 + cudaErrorFileNotFound = 301 + cudaErrorSharedObjectSymbolNotFound = 302 + cudaErrorSharedObjectInitFailed = 303 + cudaErrorOperatingSystem = 304 + cudaErrorInvalidResourceHandle = 400 + cudaErrorIllegalState = 401 + cudaErrorLossyQuery = 402 + cudaErrorSymbolNotFound = 500 + cudaErrorNotReady = 600 + cudaErrorIllegalAddress = 700 + cudaErrorLaunchOutOfResources = 701 + cudaErrorLaunchTimeout = 702 + cudaErrorLaunchIncompatibleTexturing = 703 + cudaErrorPeerAccessAlreadyEnabled = 704 + cudaErrorPeerAccessNotEnabled = 705 + cudaErrorSetOnActiveProcess = 708 + cudaErrorContextIsDestroyed = 709 + cudaErrorAssert = 710 + cudaErrorTooManyPeers = 711 + cudaErrorHostMemoryAlreadyRegistered = 712 + cudaErrorHostMemoryNotRegistered = 713 + cudaErrorHardwareStackError = 714 + cudaErrorIllegalInstruction = 715 + cudaErrorMisalignedAddress = 716 + cudaErrorInvalidAddressSpace = 717 + cudaErrorInvalidPc = 718 + cudaErrorLaunchFailure = 719 + cudaErrorCooperativeLaunchTooLarge = 720 + cudaErrorTensorMemoryLeak = 721 + cudaErrorNotPermitted = 800 + cudaErrorNotSupported = 801 + cudaErrorSystemNotReady = 802 + cudaErrorSystemDriverMismatch = 803 + cudaErrorCompatNotSupportedOnDevice = 804 + cudaErrorMpsConnectionFailed = 805 + cudaErrorMpsRpcFailure = 806 + cudaErrorMpsServerNotReady = 807 + cudaErrorMpsMaxClientsReached = 808 + cudaErrorMpsMaxConnectionsReached = 809 + cudaErrorMpsClientTerminated = 810 + cudaErrorCdpNotSupported = 811 + cudaErrorCdpVersionMismatch = 812 + cudaErrorStreamCaptureUnsupported = 900 + cudaErrorStreamCaptureInvalidated = 901 + cudaErrorStreamCaptureMerge = 902 + cudaErrorStreamCaptureUnmatched = 903 + cudaErrorStreamCaptureUnjoined = 904 + cudaErrorStreamCaptureIsolation = 905 + cudaErrorStreamCaptureImplicit = 906 + cudaErrorCapturedEvent = 907 + cudaErrorStreamCaptureWrongThread = 908 + cudaErrorTimeout = 909 + cudaErrorGraphExecUpdateFailure = 910 + cudaErrorExternalDevice = 911 + cudaErrorInvalidClusterSize = 912 + cudaErrorFunctionNotLoaded = 913 + cudaErrorInvalidResourceType = 914 + cudaErrorInvalidResourceConfiguration = 915 + cudaErrorUnknown = 999 + cudaErrorApiFailureBase = 10000 + + ctypedef cudaError cudaError_t + + cdef struct cudaChannelFormatDesc: + int x + int y + int z + int w + cudaChannelFormatKind f + + cdef struct cudaArray: + pass + ctypedef cudaArray* cudaArray_t + + cdef struct cudaArray: + pass + ctypedef cudaArray* cudaArray_const_t + + cdef struct cudaMipmappedArray: + pass + ctypedef cudaMipmappedArray* cudaMipmappedArray_t + + cdef struct cudaMipmappedArray: + pass + ctypedef cudaMipmappedArray* cudaMipmappedArray_const_t + + cdef struct anon_struct0: + unsigned int width + unsigned int height + unsigned int depth + + cdef struct cudaArraySparseProperties: + anon_struct0 tileExtent + unsigned int miptailFirstLevel + unsigned long long miptailSize + unsigned int flags + unsigned int reserved[4] + + cdef struct cudaArrayMemoryRequirements: + size_t size + size_t alignment + unsigned int reserved[4] + + cdef struct cudaPitchedPtr: + void* ptr + size_t pitch + size_t xsize + size_t ysize + + cdef struct cudaExtent: + size_t width + size_t height + size_t depth + + cdef struct cudaPos: + size_t x + size_t y + size_t z + + cdef struct cudaMemcpy3DParms: + cudaArray_t srcArray + cudaPos srcPos + cudaPitchedPtr srcPtr + cudaArray_t dstArray + cudaPos dstPos + cudaPitchedPtr dstPtr + cudaExtent extent + cudaMemcpyKind kind + + cdef struct cudaMemcpyNodeParams: + int flags + int reserved[3] + cudaMemcpy3DParms copyParams + + cdef struct cudaMemcpy3DPeerParms: + cudaArray_t srcArray + cudaPos srcPos + cudaPitchedPtr srcPtr + int srcDevice + cudaArray_t dstArray + cudaPos dstPos + cudaPitchedPtr dstPtr + int dstDevice + cudaExtent extent + + cdef struct cudaMemsetParams: + void* dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + + cdef struct cudaMemsetParamsV2: + void* dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + + cdef struct cudaAccessPolicyWindow: + void* base_ptr + size_t num_bytes + float hitRatio + cudaAccessProperty hitProp + cudaAccessProperty missProp + + ctypedef void (*cudaHostFn_t)(void* userData) + + cdef struct cudaHostNodeParams: + cudaHostFn_t fn + void* userData + + cdef struct cudaHostNodeParamsV2: + cudaHostFn_t fn + void* userData + + cdef struct anon_struct1: + cudaArray_t array + + cdef struct anon_struct2: + cudaMipmappedArray_t mipmap + + cdef struct anon_struct3: + void* devPtr + cudaChannelFormatDesc desc + size_t sizeInBytes + + cdef struct anon_struct4: + void* devPtr + cudaChannelFormatDesc desc + size_t width + size_t height + size_t pitchInBytes + + cdef union anon_union0: + anon_struct1 array + anon_struct2 mipmap + anon_struct3 linear + anon_struct4 pitch2D + + cdef struct cudaResourceDesc: + cudaResourceType resType + anon_union0 res + + cdef struct cudaResourceViewDesc: + cudaResourceViewFormat format + size_t width + size_t height + size_t depth + unsigned int firstMipmapLevel + unsigned int lastMipmapLevel + unsigned int firstLayer + unsigned int lastLayer + + cdef struct cudaPointerAttributes: + cudaMemoryType type + int device + void* devicePointer + void* hostPointer + + cdef struct cudaFuncAttributes: + size_t sharedSizeBytes + size_t constSizeBytes + size_t localSizeBytes + int maxThreadsPerBlock + int numRegs + int ptxVersion + int binaryVersion + int cacheModeCA + int maxDynamicSharedSizeBytes + int preferredShmemCarveout + int clusterDimMustBeSet + int requiredClusterWidth + int requiredClusterHeight + int requiredClusterDepth + int clusterSchedulingPolicyPreference + int nonPortableClusterSizeAllowed + int reserved[16] + + cdef struct cudaMemLocation: + cudaMemLocationType type + int id + + cdef struct cudaMemAccessDesc: + cudaMemLocation location + cudaMemAccessFlags flags + + cdef struct cudaMemPoolProps: + cudaMemAllocationType allocType + cudaMemAllocationHandleType handleTypes + cudaMemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char reserved[54] + + cdef struct cudaMemPoolPtrExportData: + unsigned char reserved[64] + + cdef struct cudaMemAllocNodeParams: + cudaMemPoolProps poolProps + const cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr + + cdef struct cudaMemAllocNodeParamsV2: + cudaMemPoolProps poolProps + const cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr + + cdef struct cudaMemFreeNodeParams: + void* dptr + + cdef struct cudaMemcpyAttributes: + cudaMemcpySrcAccessOrder srcAccessOrder + cudaMemLocation srcLocHint + cudaMemLocation dstLocHint + unsigned int flags + + cdef struct cudaOffset3D: + size_t x + size_t y + size_t z + + cdef struct anon_struct5: + void* ptr + size_t rowLength + size_t layerHeight + cudaMemLocation locHint + + cdef struct anon_struct6: + cudaArray_t array + cudaOffset3D offset + + cdef union anon_union1: + anon_struct5 ptr + anon_struct6 array + + cdef struct cudaMemcpy3DOperand: + cudaMemcpy3DOperandType type + anon_union1 op + + cdef struct cudaMemcpy3DBatchOp: + cudaMemcpy3DOperand src + cudaMemcpy3DOperand dst + cudaExtent extent + cudaMemcpySrcAccessOrder srcAccessOrder + unsigned int flags + + cdef struct CUuuid_st: + char bytes[16] + + ctypedef CUuuid_st CUuuid + + ctypedef CUuuid_st cudaUUID_t + + cdef struct cudaDeviceProp: + char name[256] + cudaUUID_t uuid + char luid[8] + unsigned int luidDeviceNodeMask + size_t totalGlobalMem + size_t sharedMemPerBlock + int regsPerBlock + int warpSize + size_t memPitch + int maxThreadsPerBlock + int maxThreadsDim[3] + int maxGridSize[3] + int clockRate + size_t totalConstMem + int major + int minor + size_t textureAlignment + size_t texturePitchAlignment + int deviceOverlap + int multiProcessorCount + int kernelExecTimeoutEnabled + int integrated + int canMapHostMemory + int computeMode + int maxTexture1D + int maxTexture1DMipmap + int maxTexture1DLinear + int maxTexture2D[2] + int maxTexture2DMipmap[2] + int maxTexture2DLinear[3] + int maxTexture2DGather[2] + int maxTexture3D[3] + int maxTexture3DAlt[3] + int maxTextureCubemap + int maxTexture1DLayered[2] + int maxTexture2DLayered[3] + int maxTextureCubemapLayered[2] + int maxSurface1D + int maxSurface2D[2] + int maxSurface3D[3] + int maxSurface1DLayered[2] + int maxSurface2DLayered[3] + int maxSurfaceCubemap + int maxSurfaceCubemapLayered[2] + size_t surfaceAlignment + int concurrentKernels + int ECCEnabled + int pciBusID + int pciDeviceID + int pciDomainID + int tccDriver + int asyncEngineCount + int unifiedAddressing + int memoryClockRate + int memoryBusWidth + int l2CacheSize + int persistingL2CacheMaxSize + int maxThreadsPerMultiProcessor + int streamPrioritiesSupported + int globalL1CacheSupported + int localL1CacheSupported + size_t sharedMemPerMultiprocessor + int regsPerMultiprocessor + int managedMemory + int isMultiGpuBoard + int multiGpuBoardGroupID + int hostNativeAtomicSupported + int singleToDoublePrecisionPerfRatio + int pageableMemoryAccess + int concurrentManagedAccess + int computePreemptionSupported + int canUseHostPointerForRegisteredMem + int cooperativeLaunch + int cooperativeMultiDeviceLaunch + size_t sharedMemPerBlockOptin + int pageableMemoryAccessUsesHostPageTables + int directManagedMemAccessFromHost + int maxBlocksPerMultiProcessor + int accessPolicyMaxWindowSize + size_t reservedSharedMemPerBlock + int hostRegisterSupported + int sparseCudaArraySupported + int hostRegisterReadOnlySupported + int timelineSemaphoreInteropSupported + int memoryPoolsSupported + int gpuDirectRDMASupported + unsigned int gpuDirectRDMAFlushWritesOptions + int gpuDirectRDMAWritesOrdering + unsigned int memoryPoolSupportedHandleTypes + int deferredMappingCudaArraySupported + int ipcEventSupported + int clusterLaunch + int unifiedFunctionPointers + int reserved[63] + + cdef struct cudaIpcEventHandle_st: + char reserved[64] + + ctypedef cudaIpcEventHandle_st cudaIpcEventHandle_t + + cdef struct cudaIpcMemHandle_st: + char reserved[64] + + ctypedef cudaIpcMemHandle_st cudaIpcMemHandle_t + + cdef struct cudaMemFabricHandle_st: + char reserved[64] + + ctypedef cudaMemFabricHandle_st cudaMemFabricHandle_t + + cdef struct anon_struct7: + void* handle + const void* name + + cdef union anon_union2: + int fd + anon_struct7 win32 + const void* nvSciBufObject + + cdef struct cudaExternalMemoryHandleDesc: + cudaExternalMemoryHandleType type + anon_union2 handle + unsigned long long size + unsigned int flags + + cdef struct cudaExternalMemoryBufferDesc: + unsigned long long offset + unsigned long long size + unsigned int flags + + cdef struct cudaExternalMemoryMipmappedArrayDesc: + unsigned long long offset + cudaChannelFormatDesc formatDesc + cudaExtent extent + unsigned int flags + unsigned int numLevels + + cdef struct anon_struct8: + void* handle + const void* name + + cdef union anon_union3: + int fd + anon_struct8 win32 + const void* nvSciSyncObj + + cdef struct cudaExternalSemaphoreHandleDesc: + cudaExternalSemaphoreHandleType type + anon_union3 handle + unsigned int flags + + cdef struct anon_struct15: + unsigned long long value + + cdef union anon_union6: + void* fence + unsigned long long reserved + + cdef struct anon_struct16: + unsigned long long key + + cdef struct anon_struct17: + anon_struct15 fence + anon_union6 nvSciSync + anon_struct16 keyedMutex + unsigned int reserved[12] + + cdef struct cudaExternalSemaphoreSignalParams: + anon_struct17 params + unsigned int flags + unsigned int reserved[16] + + cdef struct anon_struct18: + unsigned long long value + + cdef union anon_union7: + void* fence + unsigned long long reserved + + cdef struct anon_struct19: + unsigned long long key + unsigned int timeoutMs + + cdef struct anon_struct20: + anon_struct18 fence + anon_union7 nvSciSync + anon_struct19 keyedMutex + unsigned int reserved[10] + + cdef struct cudaExternalSemaphoreWaitParams: + anon_struct20 params + unsigned int flags + unsigned int reserved[16] + + cdef struct CUstream_st: + pass + ctypedef CUstream_st* cudaStream_t + + cdef struct CUevent_st: + pass + ctypedef CUevent_st* cudaEvent_t + + cdef struct cudaGraphicsResource: + pass + ctypedef cudaGraphicsResource* cudaGraphicsResource_t + + cdef struct CUexternalMemory_st: + pass + ctypedef CUexternalMemory_st* cudaExternalMemory_t + + cdef struct CUexternalSemaphore_st: + pass + ctypedef CUexternalSemaphore_st* cudaExternalSemaphore_t + + cdef struct CUgraph_st: + pass + ctypedef CUgraph_st* cudaGraph_t + + cdef struct CUgraphNode_st: + pass + ctypedef CUgraphNode_st* cudaGraphNode_t + + cdef struct CUuserObject_st: + pass + ctypedef CUuserObject_st* cudaUserObject_t + + ctypedef unsigned long long cudaGraphConditionalHandle + + cdef struct CUfunc_st: + pass + ctypedef CUfunc_st* cudaFunction_t + + cdef struct CUkern_st: + pass + ctypedef CUkern_st* cudaKernel_t + + cdef struct cudalibraryHostUniversalFunctionAndDataTable: + void* functionTable + size_t functionWindowSize + void* dataTable + size_t dataWindowSize + + cdef struct CUlib_st: + pass + ctypedef CUlib_st* cudaLibrary_t + + cdef struct CUmemPoolHandle_st: + pass + ctypedef CUmemPoolHandle_st* cudaMemPool_t + + cdef struct cudaKernelNodeParams: + void* func + dim3 gridDim + dim3 blockDim + unsigned int sharedMemBytes + void** kernelParams + void** extra + + cdef struct cudaKernelNodeParamsV2: + void* func + dim3 gridDim + dim3 blockDim + unsigned int sharedMemBytes + void** kernelParams + void** extra + + cdef struct cudaExternalSemaphoreSignalNodeParams: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreSignalParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreSignalNodeParamsV2: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreSignalParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreWaitNodeParams: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreWaitParams* paramsArray + unsigned int numExtSems + + cdef struct cudaExternalSemaphoreWaitNodeParamsV2: + cudaExternalSemaphore_t* extSemArray + const cudaExternalSemaphoreWaitParams* paramsArray + unsigned int numExtSems + + cdef struct cudaConditionalNodeParams: + cudaGraphConditionalHandle handle + cudaGraphConditionalNodeType type + unsigned int size + cudaGraph_t* phGraph_out + + cdef struct cudaChildGraphNodeParams: + cudaGraph_t graph + cudaGraphChildGraphNodeOwnership ownership + + cdef struct cudaEventRecordNodeParams: + cudaEvent_t event + + cdef struct cudaEventWaitNodeParams: + cudaEvent_t event + + cdef struct cudaGraphNodeParams: + cudaGraphNodeType type + int reserved0[3] + long long reserved1[29] + cudaKernelNodeParamsV2 kernel + cudaMemcpyNodeParams memcpy + cudaMemsetParamsV2 memset + cudaHostNodeParamsV2 host + cudaChildGraphNodeParams graph + cudaEventWaitNodeParams eventWait + cudaEventRecordNodeParams eventRecord + cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + cudaMemAllocNodeParamsV2 alloc + cudaMemFreeNodeParams free + cudaConditionalNodeParams conditional + long long reserved2 + + cdef enum cudaGraphDependencyType_enum: + cudaGraphDependencyTypeDefault = 0 + cudaGraphDependencyTypeProgrammatic = 1 + + ctypedef cudaGraphDependencyType_enum cudaGraphDependencyType + + cdef struct cudaGraphEdgeData_st: + unsigned char from_port + unsigned char to_port + unsigned char type + unsigned char reserved[5] + + ctypedef cudaGraphEdgeData_st cudaGraphEdgeData + + cdef struct CUgraphExec_st: + pass + ctypedef CUgraphExec_st* cudaGraphExec_t + + cdef enum cudaGraphInstantiateResult: + cudaGraphInstantiateSuccess = 0 + cudaGraphInstantiateError = 1 + cudaGraphInstantiateInvalidStructure = 2 + cudaGraphInstantiateNodeOperationNotSupported = 3 + cudaGraphInstantiateMultipleDevicesNotSupported = 4 + cudaGraphInstantiateConditionalHandleUnused = 5 + + cdef struct cudaGraphInstantiateParams_st: + unsigned long long flags + cudaStream_t uploadStream + cudaGraphNode_t errNode_out + cudaGraphInstantiateResult result_out + + ctypedef cudaGraphInstantiateParams_st cudaGraphInstantiateParams + + cdef struct cudaGraphExecUpdateResultInfo_st: + cudaGraphExecUpdateResult result + cudaGraphNode_t errorNode + cudaGraphNode_t errorFromNode + + ctypedef cudaGraphExecUpdateResultInfo_st cudaGraphExecUpdateResultInfo + + cdef struct CUgraphDeviceUpdatableNode_st: + pass + ctypedef CUgraphDeviceUpdatableNode_st* cudaGraphDeviceNode_t + + cdef struct anon_struct21: + const void* pValue + size_t offset + size_t size + + cdef union anon_union9: + dim3 gridDim + anon_struct21 param + unsigned int isEnabled + + cdef struct cudaGraphKernelNodeUpdate: + cudaGraphDeviceNode_t node + cudaGraphKernelNodeField field + anon_union9 updateData + + cdef enum cudaLaunchMemSyncDomain: + cudaLaunchMemSyncDomainDefault = 0 + cudaLaunchMemSyncDomainRemote = 1 + + cdef struct cudaLaunchMemSyncDomainMap_st: + unsigned char default_ + unsigned char remote + + ctypedef cudaLaunchMemSyncDomainMap_st cudaLaunchMemSyncDomainMap + + cdef enum cudaLaunchAttributeID: + cudaLaunchAttributeIgnore = 0 + cudaLaunchAttributeAccessPolicyWindow = 1 + cudaLaunchAttributeCooperative = 2 + cudaLaunchAttributeSynchronizationPolicy = 3 + cudaLaunchAttributeClusterDimension = 4 + cudaLaunchAttributeClusterSchedulingPolicyPreference = 5 + cudaLaunchAttributeProgrammaticStreamSerialization = 6 + cudaLaunchAttributeProgrammaticEvent = 7 + cudaLaunchAttributePriority = 8 + cudaLaunchAttributeMemSyncDomainMap = 9 + cudaLaunchAttributeMemSyncDomain = 10 + cudaLaunchAttributePreferredClusterDimension = 11 + cudaLaunchAttributeLaunchCompletionEvent = 12 + cudaLaunchAttributeDeviceUpdatableKernelNode = 13 + cudaLaunchAttributePreferredSharedMemoryCarveout = 14 + + cdef struct anon_struct22: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct23: + cudaEvent_t event + int flags + int triggerAtBlockStart + + cdef struct anon_struct24: + unsigned int x + unsigned int y + unsigned int z + + cdef struct anon_struct25: + cudaEvent_t event + int flags + + cdef struct anon_struct26: + int deviceUpdatable + cudaGraphDeviceNode_t devNode + + cdef union cudaLaunchAttributeValue: + char pad[64] + cudaAccessPolicyWindow accessPolicyWindow + int cooperative + cudaSynchronizationPolicy syncPolicy + anon_struct22 clusterDim + cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + int programmaticStreamSerializationAllowed + anon_struct23 programmaticEvent + int priority + cudaLaunchMemSyncDomainMap memSyncDomainMap + cudaLaunchMemSyncDomain memSyncDomain + anon_struct24 preferredClusterDim + anon_struct25 launchCompletionEvent + anon_struct26 deviceUpdatableKernelNode + unsigned int sharedMemCarveout + + cdef struct cudaLaunchAttribute_st: + cudaLaunchAttributeID id + cudaLaunchAttributeValue val + + ctypedef cudaLaunchAttribute_st cudaLaunchAttribute + + cdef struct cudaAsyncCallbackEntry: + pass + ctypedef cudaAsyncCallbackEntry* cudaAsyncCallbackHandle_t + + cdef enum cudaAsyncNotificationType_enum: + cudaAsyncNotificationTypeOverBudget = 1 + + ctypedef cudaAsyncNotificationType_enum cudaAsyncNotificationType + + cdef struct anon_struct27: + unsigned long long bytesOverBudget + + cdef union anon_union10: + anon_struct27 overBudget + + cdef struct cudaAsyncNotificationInfo: + cudaAsyncNotificationType type + anon_union10 info + + ctypedef cudaAsyncNotificationInfo cudaAsyncNotificationInfo_t + + ctypedef void (*cudaAsyncCallback)(cudaAsyncNotificationInfo_t* , void* , cudaAsyncCallbackHandle_t ) + + cdef enum cudaChannelFormatKind: + cudaChannelFormatKindSigned = 0 + cudaChannelFormatKindUnsigned = 1 + cudaChannelFormatKindFloat = 2 + cudaChannelFormatKindNone = 3 + cudaChannelFormatKindNV12 = 4 + cudaChannelFormatKindUnsignedNormalized8X1 = 5 + cudaChannelFormatKindUnsignedNormalized8X2 = 6 + cudaChannelFormatKindUnsignedNormalized8X4 = 7 + cudaChannelFormatKindUnsignedNormalized16X1 = 8 + cudaChannelFormatKindUnsignedNormalized16X2 = 9 + cudaChannelFormatKindUnsignedNormalized16X4 = 10 + cudaChannelFormatKindSignedNormalized8X1 = 11 + cudaChannelFormatKindSignedNormalized8X2 = 12 + cudaChannelFormatKindSignedNormalized8X4 = 13 + cudaChannelFormatKindSignedNormalized16X1 = 14 + cudaChannelFormatKindSignedNormalized16X2 = 15 + cudaChannelFormatKindSignedNormalized16X4 = 16 + cudaChannelFormatKindUnsignedBlockCompressed1 = 17 + cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18 + cudaChannelFormatKindUnsignedBlockCompressed2 = 19 + cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20 + cudaChannelFormatKindUnsignedBlockCompressed3 = 21 + cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22 + cudaChannelFormatKindUnsignedBlockCompressed4 = 23 + cudaChannelFormatKindSignedBlockCompressed4 = 24 + cudaChannelFormatKindUnsignedBlockCompressed5 = 25 + cudaChannelFormatKindSignedBlockCompressed5 = 26 + cudaChannelFormatKindUnsignedBlockCompressed6H = 27 + cudaChannelFormatKindSignedBlockCompressed6H = 28 + cudaChannelFormatKindUnsignedBlockCompressed7 = 29 + cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30 + cudaChannelFormatKindUnsignedNormalized1010102 = 31 + + cdef enum cudaMemoryType: + cudaMemoryTypeUnregistered = 0 + cudaMemoryTypeHost = 1 + cudaMemoryTypeDevice = 2 + cudaMemoryTypeManaged = 3 + + cdef enum cudaMemcpyKind: + cudaMemcpyHostToHost = 0 + cudaMemcpyHostToDevice = 1 + cudaMemcpyDeviceToHost = 2 + cudaMemcpyDeviceToDevice = 3 + cudaMemcpyDefault = 4 + + cdef enum cudaAccessProperty: + cudaAccessPropertyNormal = 0 + cudaAccessPropertyStreaming = 1 + cudaAccessPropertyPersisting = 2 + + cdef enum cudaStreamCaptureStatus: + cudaStreamCaptureStatusNone = 0 + cudaStreamCaptureStatusActive = 1 + cudaStreamCaptureStatusInvalidated = 2 + + cdef enum cudaStreamCaptureMode: + cudaStreamCaptureModeGlobal = 0 + cudaStreamCaptureModeThreadLocal = 1 + cudaStreamCaptureModeRelaxed = 2 + + cdef enum cudaSynchronizationPolicy: + cudaSyncPolicyAuto = 1 + cudaSyncPolicySpin = 2 + cudaSyncPolicyYield = 3 + cudaSyncPolicyBlockingSync = 4 + + cdef enum cudaClusterSchedulingPolicy: + cudaClusterSchedulingPolicyDefault = 0 + cudaClusterSchedulingPolicySpread = 1 + cudaClusterSchedulingPolicyLoadBalancing = 2 + + cdef enum cudaStreamUpdateCaptureDependenciesFlags: + cudaStreamAddCaptureDependencies = 0 + cudaStreamSetCaptureDependencies = 1 + + cdef enum cudaUserObjectFlags: + cudaUserObjectNoDestructorSync = 1 + + cdef enum cudaUserObjectRetainFlags: + cudaGraphUserObjectMove = 1 + + cdef enum cudaGraphicsRegisterFlags: + cudaGraphicsRegisterFlagsNone = 0 + cudaGraphicsRegisterFlagsReadOnly = 1 + cudaGraphicsRegisterFlagsWriteDiscard = 2 + cudaGraphicsRegisterFlagsSurfaceLoadStore = 4 + cudaGraphicsRegisterFlagsTextureGather = 8 + + cdef enum cudaGraphicsMapFlags: + cudaGraphicsMapFlagsNone = 0 + cudaGraphicsMapFlagsReadOnly = 1 + cudaGraphicsMapFlagsWriteDiscard = 2 + + cdef enum cudaGraphicsCubeFace: + cudaGraphicsCubeFacePositiveX = 0 + cudaGraphicsCubeFaceNegativeX = 1 + cudaGraphicsCubeFacePositiveY = 2 + cudaGraphicsCubeFaceNegativeY = 3 + cudaGraphicsCubeFacePositiveZ = 4 + cudaGraphicsCubeFaceNegativeZ = 5 + + cdef enum cudaResourceType: + cudaResourceTypeArray = 0 + cudaResourceTypeMipmappedArray = 1 + cudaResourceTypeLinear = 2 + cudaResourceTypePitch2D = 3 + + cdef enum cudaResourceViewFormat: + cudaResViewFormatNone = 0 + cudaResViewFormatUnsignedChar1 = 1 + cudaResViewFormatUnsignedChar2 = 2 + cudaResViewFormatUnsignedChar4 = 3 + cudaResViewFormatSignedChar1 = 4 + cudaResViewFormatSignedChar2 = 5 + cudaResViewFormatSignedChar4 = 6 + cudaResViewFormatUnsignedShort1 = 7 + cudaResViewFormatUnsignedShort2 = 8 + cudaResViewFormatUnsignedShort4 = 9 + cudaResViewFormatSignedShort1 = 10 + cudaResViewFormatSignedShort2 = 11 + cudaResViewFormatSignedShort4 = 12 + cudaResViewFormatUnsignedInt1 = 13 + cudaResViewFormatUnsignedInt2 = 14 + cudaResViewFormatUnsignedInt4 = 15 + cudaResViewFormatSignedInt1 = 16 + cudaResViewFormatSignedInt2 = 17 + cudaResViewFormatSignedInt4 = 18 + cudaResViewFormatHalf1 = 19 + cudaResViewFormatHalf2 = 20 + cudaResViewFormatHalf4 = 21 + cudaResViewFormatFloat1 = 22 + cudaResViewFormatFloat2 = 23 + cudaResViewFormatFloat4 = 24 + cudaResViewFormatUnsignedBlockCompressed1 = 25 + cudaResViewFormatUnsignedBlockCompressed2 = 26 + cudaResViewFormatUnsignedBlockCompressed3 = 27 + cudaResViewFormatUnsignedBlockCompressed4 = 28 + cudaResViewFormatSignedBlockCompressed4 = 29 + cudaResViewFormatUnsignedBlockCompressed5 = 30 + cudaResViewFormatSignedBlockCompressed5 = 31 + cudaResViewFormatUnsignedBlockCompressed6H = 32 + cudaResViewFormatSignedBlockCompressed6H = 33 + cudaResViewFormatUnsignedBlockCompressed7 = 34 + + cdef enum cudaFuncAttribute: + cudaFuncAttributeMaxDynamicSharedMemorySize = 8 + cudaFuncAttributePreferredSharedMemoryCarveout = 9 + cudaFuncAttributeClusterDimMustBeSet = 10 + cudaFuncAttributeRequiredClusterWidth = 11 + cudaFuncAttributeRequiredClusterHeight = 12 + cudaFuncAttributeRequiredClusterDepth = 13 + cudaFuncAttributeNonPortableClusterSizeAllowed = 14 + cudaFuncAttributeClusterSchedulingPolicyPreference = 15 + cudaFuncAttributeMax = 16 + + cdef enum cudaFuncCache: + cudaFuncCachePreferNone = 0 + cudaFuncCachePreferShared = 1 + cudaFuncCachePreferL1 = 2 + cudaFuncCachePreferEqual = 3 + + cdef enum cudaSharedMemConfig: + cudaSharedMemBankSizeDefault = 0 + cudaSharedMemBankSizeFourByte = 1 + cudaSharedMemBankSizeEightByte = 2 + + cdef enum cudaSharedCarveout: + cudaSharedmemCarveoutDefault = -1 + cudaSharedmemCarveoutMaxL1 = 0 + cudaSharedmemCarveoutMaxShared = 100 + + cdef enum cudaComputeMode: + cudaComputeModeDefault = 0 + cudaComputeModeExclusive = 1 + cudaComputeModeProhibited = 2 + cudaComputeModeExclusiveProcess = 3 + + cdef enum cudaLimit: + cudaLimitStackSize = 0 + cudaLimitPrintfFifoSize = 1 + cudaLimitMallocHeapSize = 2 + cudaLimitDevRuntimeSyncDepth = 3 + cudaLimitDevRuntimePendingLaunchCount = 4 + cudaLimitMaxL2FetchGranularity = 5 + cudaLimitPersistingL2CacheSize = 6 + + cdef enum cudaMemoryAdvise: + cudaMemAdviseSetReadMostly = 1 + cudaMemAdviseUnsetReadMostly = 2 + cudaMemAdviseSetPreferredLocation = 3 + cudaMemAdviseUnsetPreferredLocation = 4 + cudaMemAdviseSetAccessedBy = 5 + cudaMemAdviseUnsetAccessedBy = 6 + + cdef enum cudaMemRangeAttribute: + cudaMemRangeAttributeReadMostly = 1 + cudaMemRangeAttributePreferredLocation = 2 + cudaMemRangeAttributeAccessedBy = 3 + cudaMemRangeAttributeLastPrefetchLocation = 4 + cudaMemRangeAttributePreferredLocationType = 5 + cudaMemRangeAttributePreferredLocationId = 6 + cudaMemRangeAttributeLastPrefetchLocationType = 7 + cudaMemRangeAttributeLastPrefetchLocationId = 8 + + cdef enum cudaFlushGPUDirectRDMAWritesOptions: + cudaFlushGPUDirectRDMAWritesOptionHost = 1 + cudaFlushGPUDirectRDMAWritesOptionMemOps = 2 + + cdef enum cudaGPUDirectRDMAWritesOrdering: + cudaGPUDirectRDMAWritesOrderingNone = 0 + cudaGPUDirectRDMAWritesOrderingOwner = 100 + cudaGPUDirectRDMAWritesOrderingAllDevices = 200 + + cdef enum cudaFlushGPUDirectRDMAWritesScope: + cudaFlushGPUDirectRDMAWritesToOwner = 100 + cudaFlushGPUDirectRDMAWritesToAllDevices = 200 + + cdef enum cudaFlushGPUDirectRDMAWritesTarget: + cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = 0 + + cdef enum cudaDeviceAttr: + cudaDevAttrMaxThreadsPerBlock = 1 + cudaDevAttrMaxBlockDimX = 2 + cudaDevAttrMaxBlockDimY = 3 + cudaDevAttrMaxBlockDimZ = 4 + cudaDevAttrMaxGridDimX = 5 + cudaDevAttrMaxGridDimY = 6 + cudaDevAttrMaxGridDimZ = 7 + cudaDevAttrMaxSharedMemoryPerBlock = 8 + cudaDevAttrTotalConstantMemory = 9 + cudaDevAttrWarpSize = 10 + cudaDevAttrMaxPitch = 11 + cudaDevAttrMaxRegistersPerBlock = 12 + cudaDevAttrClockRate = 13 + cudaDevAttrTextureAlignment = 14 + cudaDevAttrGpuOverlap = 15 + cudaDevAttrMultiProcessorCount = 16 + cudaDevAttrKernelExecTimeout = 17 + cudaDevAttrIntegrated = 18 + cudaDevAttrCanMapHostMemory = 19 + cudaDevAttrComputeMode = 20 + cudaDevAttrMaxTexture1DWidth = 21 + cudaDevAttrMaxTexture2DWidth = 22 + cudaDevAttrMaxTexture2DHeight = 23 + cudaDevAttrMaxTexture3DWidth = 24 + cudaDevAttrMaxTexture3DHeight = 25 + cudaDevAttrMaxTexture3DDepth = 26 + cudaDevAttrMaxTexture2DLayeredWidth = 27 + cudaDevAttrMaxTexture2DLayeredHeight = 28 + cudaDevAttrMaxTexture2DLayeredLayers = 29 + cudaDevAttrSurfaceAlignment = 30 + cudaDevAttrConcurrentKernels = 31 + cudaDevAttrEccEnabled = 32 + cudaDevAttrPciBusId = 33 + cudaDevAttrPciDeviceId = 34 + cudaDevAttrTccDriver = 35 + cudaDevAttrMemoryClockRate = 36 + cudaDevAttrGlobalMemoryBusWidth = 37 + cudaDevAttrL2CacheSize = 38 + cudaDevAttrMaxThreadsPerMultiProcessor = 39 + cudaDevAttrAsyncEngineCount = 40 + cudaDevAttrUnifiedAddressing = 41 + cudaDevAttrMaxTexture1DLayeredWidth = 42 + cudaDevAttrMaxTexture1DLayeredLayers = 43 + cudaDevAttrMaxTexture2DGatherWidth = 45 + cudaDevAttrMaxTexture2DGatherHeight = 46 + cudaDevAttrMaxTexture3DWidthAlt = 47 + cudaDevAttrMaxTexture3DHeightAlt = 48 + cudaDevAttrMaxTexture3DDepthAlt = 49 + cudaDevAttrPciDomainId = 50 + cudaDevAttrTexturePitchAlignment = 51 + cudaDevAttrMaxTextureCubemapWidth = 52 + cudaDevAttrMaxTextureCubemapLayeredWidth = 53 + cudaDevAttrMaxTextureCubemapLayeredLayers = 54 + cudaDevAttrMaxSurface1DWidth = 55 + cudaDevAttrMaxSurface2DWidth = 56 + cudaDevAttrMaxSurface2DHeight = 57 + cudaDevAttrMaxSurface3DWidth = 58 + cudaDevAttrMaxSurface3DHeight = 59 + cudaDevAttrMaxSurface3DDepth = 60 + cudaDevAttrMaxSurface1DLayeredWidth = 61 + cudaDevAttrMaxSurface1DLayeredLayers = 62 + cudaDevAttrMaxSurface2DLayeredWidth = 63 + cudaDevAttrMaxSurface2DLayeredHeight = 64 + cudaDevAttrMaxSurface2DLayeredLayers = 65 + cudaDevAttrMaxSurfaceCubemapWidth = 66 + cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67 + cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68 + cudaDevAttrMaxTexture1DLinearWidth = 69 + cudaDevAttrMaxTexture2DLinearWidth = 70 + cudaDevAttrMaxTexture2DLinearHeight = 71 + cudaDevAttrMaxTexture2DLinearPitch = 72 + cudaDevAttrMaxTexture2DMipmappedWidth = 73 + cudaDevAttrMaxTexture2DMipmappedHeight = 74 + cudaDevAttrComputeCapabilityMajor = 75 + cudaDevAttrComputeCapabilityMinor = 76 + cudaDevAttrMaxTexture1DMipmappedWidth = 77 + cudaDevAttrStreamPrioritiesSupported = 78 + cudaDevAttrGlobalL1CacheSupported = 79 + cudaDevAttrLocalL1CacheSupported = 80 + cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81 + cudaDevAttrMaxRegistersPerMultiprocessor = 82 + cudaDevAttrManagedMemory = 83 + cudaDevAttrIsMultiGpuBoard = 84 + cudaDevAttrMultiGpuBoardGroupID = 85 + cudaDevAttrHostNativeAtomicSupported = 86 + cudaDevAttrSingleToDoublePrecisionPerfRatio = 87 + cudaDevAttrPageableMemoryAccess = 88 + cudaDevAttrConcurrentManagedAccess = 89 + cudaDevAttrComputePreemptionSupported = 90 + cudaDevAttrCanUseHostPointerForRegisteredMem = 91 + cudaDevAttrReserved92 = 92 + cudaDevAttrReserved93 = 93 + cudaDevAttrReserved94 = 94 + cudaDevAttrCooperativeLaunch = 95 + cudaDevAttrCooperativeMultiDeviceLaunch = 96 + cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 + cudaDevAttrCanFlushRemoteWrites = 98 + cudaDevAttrHostRegisterSupported = 99 + cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100 + cudaDevAttrDirectManagedMemAccessFromHost = 101 + cudaDevAttrMaxBlocksPerMultiprocessor = 106 + cudaDevAttrMaxPersistingL2CacheSize = 108 + cudaDevAttrMaxAccessPolicyWindowSize = 109 + cudaDevAttrReservedSharedMemoryPerBlock = 111 + cudaDevAttrSparseCudaArraySupported = 112 + cudaDevAttrHostRegisterReadOnlySupported = 113 + cudaDevAttrTimelineSemaphoreInteropSupported = 114 + cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114 + cudaDevAttrMemoryPoolsSupported = 115 + cudaDevAttrGPUDirectRDMASupported = 116 + cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117 + cudaDevAttrGPUDirectRDMAWritesOrdering = 118 + cudaDevAttrMemoryPoolSupportedHandleTypes = 119 + cudaDevAttrClusterLaunch = 120 + cudaDevAttrDeferredMappingCudaArraySupported = 121 + cudaDevAttrReserved122 = 122 + cudaDevAttrReserved123 = 123 + cudaDevAttrReserved124 = 124 + cudaDevAttrIpcEventSupport = 125 + cudaDevAttrMemSyncDomainCount = 126 + cudaDevAttrReserved127 = 127 + cudaDevAttrReserved128 = 128 + cudaDevAttrReserved129 = 129 + cudaDevAttrNumaConfig = 130 + cudaDevAttrNumaId = 131 + cudaDevAttrReserved132 = 132 + cudaDevAttrMpsEnabled = 133 + cudaDevAttrHostNumaId = 134 + cudaDevAttrD3D12CigSupported = 135 + cudaDevAttrVulkanCigSupported = 138 + cudaDevAttrGpuPciDeviceId = 139 + cudaDevAttrGpuPciSubsystemId = 140 + cudaDevAttrReserved141 = 141 + cudaDevAttrHostNumaMemoryPoolsSupported = 142 + cudaDevAttrHostNumaMultinodeIpcSupported = 143 + cudaDevAttrMax = 144 + + cdef enum cudaMemPoolAttr: + cudaMemPoolReuseFollowEventDependencies = 1 + cudaMemPoolReuseAllowOpportunistic = 2 + cudaMemPoolReuseAllowInternalDependencies = 3 + cudaMemPoolAttrReleaseThreshold = 4 + cudaMemPoolAttrReservedMemCurrent = 5 + cudaMemPoolAttrReservedMemHigh = 6 + cudaMemPoolAttrUsedMemCurrent = 7 + cudaMemPoolAttrUsedMemHigh = 8 + + cdef enum cudaMemLocationType: + cudaMemLocationTypeInvalid = 0 + cudaMemLocationTypeDevice = 1 + cudaMemLocationTypeHost = 2 + cudaMemLocationTypeHostNuma = 3 + cudaMemLocationTypeHostNumaCurrent = 4 + + cdef enum cudaMemAccessFlags: + cudaMemAccessFlagsProtNone = 0 + cudaMemAccessFlagsProtRead = 1 + cudaMemAccessFlagsProtReadWrite = 3 + + cdef enum cudaMemAllocationType: + cudaMemAllocationTypeInvalid = 0 + cudaMemAllocationTypePinned = 1 + cudaMemAllocationTypeMax = 2147483647 + + cdef enum cudaMemAllocationHandleType: + cudaMemHandleTypeNone = 0 + cudaMemHandleTypePosixFileDescriptor = 1 + cudaMemHandleTypeWin32 = 2 + cudaMemHandleTypeWin32Kmt = 4 + cudaMemHandleTypeFabric = 8 + + cdef enum cudaGraphMemAttributeType: + cudaGraphMemAttrUsedMemCurrent = 0 + cudaGraphMemAttrUsedMemHigh = 1 + cudaGraphMemAttrReservedMemCurrent = 2 + cudaGraphMemAttrReservedMemHigh = 3 + + cdef enum cudaMemcpyFlags: + cudaMemcpyFlagDefault = 0 + cudaMemcpyFlagPreferOverlapWithCompute = 1 + + cdef enum cudaMemcpySrcAccessOrder: + cudaMemcpySrcAccessOrderInvalid = 0 + cudaMemcpySrcAccessOrderStream = 1 + cudaMemcpySrcAccessOrderDuringApiCall = 2 + cudaMemcpySrcAccessOrderAny = 3 + cudaMemcpySrcAccessOrderMax = 2147483647 + + cdef enum cudaMemcpy3DOperandType: + cudaMemcpyOperandTypePointer = 1 + cudaMemcpyOperandTypeArray = 2 + cudaMemcpyOperandTypeMax = 2147483647 + + cdef enum cudaDeviceP2PAttr: + cudaDevP2PAttrPerformanceRank = 1 + cudaDevP2PAttrAccessSupported = 2 + cudaDevP2PAttrNativeAtomicSupported = 3 + cudaDevP2PAttrCudaArrayAccessSupported = 4 + + cdef enum cudaExternalMemoryHandleType: + cudaExternalMemoryHandleTypeOpaqueFd = 1 + cudaExternalMemoryHandleTypeOpaqueWin32 = 2 + cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3 + cudaExternalMemoryHandleTypeD3D12Heap = 4 + cudaExternalMemoryHandleTypeD3D12Resource = 5 + cudaExternalMemoryHandleTypeD3D11Resource = 6 + cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7 + cudaExternalMemoryHandleTypeNvSciBuf = 8 + + cdef enum cudaExternalSemaphoreHandleType: + cudaExternalSemaphoreHandleTypeOpaqueFd = 1 + cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2 + cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3 + cudaExternalSemaphoreHandleTypeD3D12Fence = 4 + cudaExternalSemaphoreHandleTypeD3D11Fence = 5 + cudaExternalSemaphoreHandleTypeNvSciSync = 6 + cudaExternalSemaphoreHandleTypeKeyedMutex = 7 + cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8 + cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9 + cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10 + + cdef enum cudaJitOption: + cudaJitMaxRegisters = 0 + cudaJitThreadsPerBlock = 1 + cudaJitWallTime = 2 + cudaJitInfoLogBuffer = 3 + cudaJitInfoLogBufferSizeBytes = 4 + cudaJitErrorLogBuffer = 5 + cudaJitErrorLogBufferSizeBytes = 6 + cudaJitOptimizationLevel = 7 + cudaJitFallbackStrategy = 10 + cudaJitGenerateDebugInfo = 11 + cudaJitLogVerbose = 12 + cudaJitGenerateLineInfo = 13 + cudaJitCacheMode = 14 + cudaJitPositionIndependentCode = 30 + cudaJitMinCtaPerSm = 31 + cudaJitMaxThreadsPerBlock = 32 + cudaJitOverrideDirectiveValues = 33 + + cdef enum cudaLibraryOption: + cudaLibraryHostUniversalFunctionAndDataTable = 0 + cudaLibraryBinaryIsPreserved = 1 + + cdef enum cudaJit_CacheMode: + cudaJitCacheOptionNone = 0 + cudaJitCacheOptionCG = 1 + cudaJitCacheOptionCA = 2 + + cdef enum cudaJit_Fallback: + cudaPreferPtx = 0 + cudaPreferBinary = 1 + + cdef enum cudaCGScope: + cudaCGScopeInvalid = 0 + cudaCGScopeGrid = 1 + cudaCGScopeMultiGrid = 2 + + cdef enum cudaGraphConditionalHandleFlags: + cudaGraphCondAssignDefault = 1 + + cdef enum cudaGraphConditionalNodeType: + cudaGraphCondTypeIf = 0 + cudaGraphCondTypeWhile = 1 + cudaGraphCondTypeSwitch = 2 + + cdef enum cudaGraphNodeType: + cudaGraphNodeTypeKernel = 0 + cudaGraphNodeTypeMemcpy = 1 + cudaGraphNodeTypeMemset = 2 + cudaGraphNodeTypeHost = 3 + cudaGraphNodeTypeGraph = 4 + cudaGraphNodeTypeEmpty = 5 + cudaGraphNodeTypeWaitEvent = 6 + cudaGraphNodeTypeEventRecord = 7 + cudaGraphNodeTypeExtSemaphoreSignal = 8 + cudaGraphNodeTypeExtSemaphoreWait = 9 + cudaGraphNodeTypeMemAlloc = 10 + cudaGraphNodeTypeMemFree = 11 + cudaGraphNodeTypeConditional = 13 + cudaGraphNodeTypeCount = 14 + + cdef enum cudaGraphChildGraphNodeOwnership: + cudaGraphChildGraphOwnershipClone = 0 + cudaGraphChildGraphOwnershipMove = 1 + + cdef enum cudaGraphExecUpdateResult: + cudaGraphExecUpdateSuccess = 0 + cudaGraphExecUpdateError = 1 + cudaGraphExecUpdateErrorTopologyChanged = 2 + cudaGraphExecUpdateErrorNodeTypeChanged = 3 + cudaGraphExecUpdateErrorFunctionChanged = 4 + cudaGraphExecUpdateErrorParametersChanged = 5 + cudaGraphExecUpdateErrorNotSupported = 6 + cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7 + cudaGraphExecUpdateErrorAttributesChanged = 8 + + cdef enum cudaGraphKernelNodeField: + cudaGraphKernelNodeFieldInvalid = 0 + cudaGraphKernelNodeFieldGridDim = 1 + cudaGraphKernelNodeFieldParam = 2 + cudaGraphKernelNodeFieldEnabled = 3 + + cdef enum cudaGetDriverEntryPointFlags: + cudaEnableDefault = 0 + cudaEnableLegacyStream = 1 + cudaEnablePerThreadDefaultStream = 2 + + cdef enum cudaDriverEntryPointQueryResult: + cudaDriverEntryPointSuccess = 0 + cudaDriverEntryPointSymbolNotFound = 1 + cudaDriverEntryPointVersionNotSufficent = 2 + + cdef enum cudaGraphDebugDotFlags: + cudaGraphDebugDotFlagsVerbose = 1 + cudaGraphDebugDotFlagsKernelNodeParams = 4 + cudaGraphDebugDotFlagsMemcpyNodeParams = 8 + cudaGraphDebugDotFlagsMemsetNodeParams = 16 + cudaGraphDebugDotFlagsHostNodeParams = 32 + cudaGraphDebugDotFlagsEventNodeParams = 64 + cudaGraphDebugDotFlagsExtSemasSignalNodeParams = 128 + cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 256 + cudaGraphDebugDotFlagsKernelNodeAttributes = 512 + cudaGraphDebugDotFlagsHandles = 1024 + cudaGraphDebugDotFlagsConditionalNodeParams = 32768 + + cdef enum cudaGraphInstantiateFlags: + cudaGraphInstantiateFlagAutoFreeOnLaunch = 1 + cudaGraphInstantiateFlagUpload = 2 + cudaGraphInstantiateFlagDeviceLaunch = 4 + cudaGraphInstantiateFlagUseNodePriority = 8 + + cdef enum cudaDeviceNumaConfig: + cudaDeviceNumaConfigNone = 0 + cudaDeviceNumaConfigNumaNode = 1 + +cdef extern from "surface_types.h": + + ctypedef unsigned long long cudaSurfaceObject_t + + cdef enum cudaSurfaceBoundaryMode: + cudaBoundaryModeZero = 0 + cudaBoundaryModeClamp = 1 + cudaBoundaryModeTrap = 2 + + cdef enum cudaSurfaceFormatMode: + cudaFormatModeForced = 0 + cudaFormatModeAuto = 1 + +cdef extern from "texture_types.h": + + cdef struct cudaTextureDesc: + cudaTextureAddressMode addressMode[3] + cudaTextureFilterMode filterMode + cudaTextureReadMode readMode + int sRGB + float borderColor[4] + int normalizedCoords + unsigned int maxAnisotropy + cudaTextureFilterMode mipmapFilterMode + float mipmapLevelBias + float minMipmapLevelClamp + float maxMipmapLevelClamp + int disableTrilinearOptimization + int seamlessCubemap + + ctypedef unsigned long long cudaTextureObject_t + + cdef enum cudaTextureAddressMode: + cudaAddressModeWrap = 0 + cudaAddressModeClamp = 1 + cudaAddressModeMirror = 2 + cudaAddressModeBorder = 3 + + cdef enum cudaTextureFilterMode: + cudaFilterModePoint = 0 + cudaFilterModeLinear = 1 + + cdef enum cudaTextureReadMode: + cudaReadModeElementType = 0 + cudaReadModeNormalizedFloat = 1 + +cdef extern from "library_types.h": + + cdef enum cudaDataType_t: + CUDA_R_32F = 0 + CUDA_R_64F = 1 + CUDA_R_16F = 2 + CUDA_R_8I = 3 + CUDA_C_32F = 4 + CUDA_C_64F = 5 + CUDA_C_16F = 6 + CUDA_C_8I = 7 + CUDA_R_8U = 8 + CUDA_C_8U = 9 + CUDA_R_32I = 10 + CUDA_C_32I = 11 + CUDA_R_32U = 12 + CUDA_C_32U = 13 + CUDA_R_16BF = 14 + CUDA_C_16BF = 15 + CUDA_R_4I = 16 + CUDA_C_4I = 17 + CUDA_R_4U = 18 + CUDA_C_4U = 19 + CUDA_R_16I = 20 + CUDA_C_16I = 21 + CUDA_R_16U = 22 + CUDA_C_16U = 23 + CUDA_R_64I = 24 + CUDA_C_64I = 25 + CUDA_R_64U = 26 + CUDA_C_64U = 27 + CUDA_R_8F_E4M3 = 28 + CUDA_R_8F_UE4M3 = 28 + CUDA_R_8F_E5M2 = 29 + CUDA_R_8F_UE8M0 = 30 + CUDA_R_6F_E2M3 = 31 + CUDA_R_6F_E3M2 = 32 + CUDA_R_4F_E2M1 = 33 + + ctypedef cudaDataType_t cudaDataType + + cdef enum libraryPropertyType_t: + MAJOR_VERSION = 0 + MINOR_VERSION = 1 + PATCH_LEVEL = 2 + + ctypedef libraryPropertyType_t libraryPropertyType + +cdef extern from "cuda_runtime_api.h": + + ctypedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void* userData) + +cdef extern from "device_types.h": + + cdef enum cudaRoundMode: + cudaRoundNearest = 0 + cudaRoundZero = 1 + cudaRoundPosInf = 2 + cudaRoundMinInf = 3 + +ctypedef cudaLaunchAttributeID cudaStreamAttrID + +ctypedef cudaLaunchAttributeID cudaKernelNodeAttrID + +ctypedef cudaLaunchAttributeValue cudaStreamAttrValue + +ctypedef cudaLaunchAttributeValue cudaKernelNodeAttrValue diff --git a/cuda_bindings_12/cuda/bindings/driver.pxd b/cuda_bindings_12/cuda/bindings/driver.pxd new file mode 100644 index 00000000000..637ed4fe08e --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/driver.pxd @@ -0,0 +1,10030 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5739d4e34a7ac7d9fab129e5380ab9dfa7cfe983957b3b97d76d21a6ee2d710d +cimport cuda.bindings.cydriver as cydriver + +include "_lib/utils.pxd" + +cdef class CUcontext: + """ + + A regular context handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUcontext _pvt_val + cdef cydriver.CUcontext* _pvt_ptr + +cdef class CUmodule: + """ + + CUDA module + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmodule _pvt_val + cdef cydriver.CUmodule* _pvt_ptr + +cdef class CUfunction: + """ + + CUDA function + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUfunction _pvt_val + cdef cydriver.CUfunction* _pvt_ptr + +cdef class CUlibrary: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlibrary _pvt_val + cdef cydriver.CUlibrary* _pvt_ptr + +cdef class CUkernel: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUkernel _pvt_val + cdef cydriver.CUkernel* _pvt_ptr + +cdef class CUarray: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUarray _pvt_val + cdef cydriver.CUarray* _pvt_ptr + +cdef class CUmipmappedArray: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmipmappedArray _pvt_val + cdef cydriver.CUmipmappedArray* _pvt_ptr + +cdef class CUtexref: + """ + + CUDA texture reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexref _pvt_val + cdef cydriver.CUtexref* _pvt_ptr + +cdef class CUsurfref: + """ + + CUDA surface reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfref _pvt_val + cdef cydriver.CUsurfref* _pvt_ptr + +cdef class CUevent: + """ + + CUDA event + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUevent _pvt_val + cdef cydriver.CUevent* _pvt_ptr + +cdef class CUstream: + """ + + CUDA stream + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUstream _pvt_val + cdef cydriver.CUstream* _pvt_ptr + +cdef class CUgraphicsResource: + """ + + CUDA graphics interop resource + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphicsResource _pvt_val + cdef cydriver.CUgraphicsResource* _pvt_ptr + +cdef class CUexternalMemory: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUexternalMemory _pvt_val + cdef cydriver.CUexternalMemory* _pvt_ptr + +cdef class CUexternalSemaphore: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUexternalSemaphore _pvt_val + cdef cydriver.CUexternalSemaphore* _pvt_ptr + +cdef class CUgraph: + """ + + CUDA graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraph _pvt_val + cdef cydriver.CUgraph* _pvt_ptr + +cdef class CUgraphNode: + """ + + CUDA graph node + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphNode _pvt_val + cdef cydriver.CUgraphNode* _pvt_ptr + +cdef class CUgraphExec: + """ + + CUDA executable graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphExec _pvt_val + cdef cydriver.CUgraphExec* _pvt_ptr + +cdef class CUmemoryPool: + """ + + CUDA memory pool + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemoryPool _pvt_val + cdef cydriver.CUmemoryPool* _pvt_ptr + +cdef class CUuserObject: + """ + + CUDA user object for graphs + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUuserObject _pvt_val + cdef cydriver.CUuserObject* _pvt_ptr + +cdef class CUgraphDeviceNode: + """ + + CUDA graph device node handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphDeviceNode _pvt_val + cdef cydriver.CUgraphDeviceNode* _pvt_ptr + +cdef class CUasyncCallbackHandle: + """ + + CUDA async notification callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUasyncCallbackHandle _pvt_val + cdef cydriver.CUasyncCallbackHandle* _pvt_ptr + +cdef class CUgreenCtx: + """ + + A green context handle. This handle can be used safely from only one CPU thread at a time. Created via cuGreenCtxCreate + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgreenCtx _pvt_val + cdef cydriver.CUgreenCtx* _pvt_ptr + +cdef class CUlinkState: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlinkState _pvt_val + cdef cydriver.CUlinkState* _pvt_ptr + cdef list _keepalive + +cdef class CUdevResourceDesc: + """ + + An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via cuDevResourceGenerateDesc + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevResourceDesc _pvt_val + cdef cydriver.CUdevResourceDesc* _pvt_ptr + +cdef class CUlogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogsCallbackHandle _pvt_val + cdef cydriver.CUlogsCallbackHandle* _pvt_ptr + +cdef class CUeglStreamConnection: + """ + + CUDA EGLSream Connection + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUeglStreamConnection _pvt_val + cdef cydriver.CUeglStreamConnection* _pvt_ptr + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLImageKHR _pvt_val + cdef cydriver.EGLImageKHR* _pvt_ptr + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLStreamKHR _pvt_val + cdef cydriver.EGLStreamKHR* _pvt_ptr + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLSyncKHR _pvt_val + cdef cydriver.EGLSyncKHR* _pvt_ptr + +cdef class CUasyncCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUasyncCallback _pvt_val + cdef cydriver.CUasyncCallback* _pvt_ptr + +cdef class CUhostFn: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUhostFn _pvt_val + cdef cydriver.CUhostFn* _pvt_ptr + +cdef class CUstreamCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUstreamCallback _pvt_val + cdef cydriver.CUstreamCallback* _pvt_ptr + +cdef class CUoccupancyB2DSize: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUoccupancyB2DSize _pvt_val + cdef cydriver.CUoccupancyB2DSize* _pvt_ptr + +cdef class CUlogsCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogsCallback _pvt_val + cdef cydriver.CUlogsCallback* _pvt_ptr + +cdef class CUuuid_st: + """ + Attributes + ---------- + + bytes : bytes + < CUDA definition of UUID + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUuuid_st _pvt_val + cdef cydriver.CUuuid_st* _pvt_ptr + +cdef class CUmemFabricHandle_st: + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + + data : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemFabricHandle_st _pvt_val + cdef cydriver.CUmemFabricHandle_st* _pvt_ptr + +cdef class CUipcEventHandle_st: + """ + CUDA IPC event handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUipcEventHandle_st _pvt_val + cdef cydriver.CUipcEventHandle_st* _pvt_ptr + +cdef class CUipcMemHandle_st: + """ + CUDA IPC mem handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUipcMemHandle_st _pvt_val + cdef cydriver.CUipcMemHandle_st* _pvt_ptr + +cdef class CUstreamMemOpWaitValueParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + address : CUdeviceptr + + + + value : cuuint32_t + + + + value64 : cuuint64_t + + + + flags : unsigned int + + + + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + + cdef CUdeviceptr _address + + + cdef cuuint32_t _value + + + cdef cuuint64_t _value64 + + + cdef CUdeviceptr _alias + + +cdef class CUstreamMemOpWriteValueParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + address : CUdeviceptr + + + + value : cuuint32_t + + + + value64 : cuuint64_t + + + + flags : unsigned int + + + + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + + cdef CUdeviceptr _address + + + cdef cuuint32_t _value + + + cdef cuuint64_t _value64 + + + cdef CUdeviceptr _alias + + +cdef class CUstreamMemOpFlushRemoteWritesParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + flags : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + +cdef class CUstreamMemOpMemoryBarrierParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + < Only supported in the _v2 API + + + flags : unsigned int + See CUstreamMemoryBarrier_flags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + +cdef class CUstreamBatchMemOpParams_union: + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + waitValue : CUstreamMemOpWaitValueParams_st + + + + writeValue : CUstreamMemOpWriteValueParams_st + + + + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + + + + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + + + + pad : list[cuuint64_t] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUstreamBatchMemOpParams_union _pvt_val + cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr + + cdef CUstreamMemOpWaitValueParams_st _waitValue + + + cdef CUstreamMemOpWriteValueParams_st _writeValue + + + cdef CUstreamMemOpFlushRemoteWritesParams_st _flushRemoteWrites + + + cdef CUstreamMemOpMemoryBarrierParams_st _memoryBarrier + + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: + """ + Attributes + ---------- + + ctx : CUcontext + + + + count : unsigned int + + + + paramArray : CUstreamBatchMemOpParams + + + + flags : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st _pvt_val + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st* _pvt_ptr + + cdef CUcontext _ctx + + + cdef size_t _paramArray_length + cdef cydriver.CUstreamBatchMemOpParams* _paramArray + + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + """ + Batch memory operation node parameters + + Attributes + ---------- + + ctx : CUcontext + Context to use for the operations. + + + count : unsigned int + Number of operations in paramArray. + + + paramArray : CUstreamBatchMemOpParams + Array of batch memory operations. + + + flags : unsigned int + Flags to control the node. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st* _pvt_ptr + + cdef CUcontext _ctx + + + cdef size_t _paramArray_length + cdef cydriver.CUstreamBatchMemOpParams* _paramArray + + +cdef class anon_struct0: + """ + Attributes + ---------- + + bytesOverBudget : unsigned long long + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + +cdef class anon_union2: + """ + Attributes + ---------- + + overBudget : anon_struct0 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + + cdef anon_struct0 _overBudget + + +cdef class CUasyncNotificationInfo_st: + """ + Information passed to the user via the async notification callback + + Attributes + ---------- + + type : CUasyncNotificationType + The type of notification being sent + + + info : anon_union2 + Information about the notification. `typename` must be checked in + order to interpret this field. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUasyncNotificationInfo_st* _val_ptr + cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr + + cdef anon_union2 _info + + +cdef class CUdevprop_st: + """ + Legacy device properties + + Attributes + ---------- + + maxThreadsPerBlock : int + Maximum number of threads per block + + + maxThreadsDim : list[int] + Maximum size of each dimension of a block + + + maxGridSize : list[int] + Maximum size of each dimension of a grid + + + sharedMemPerBlock : int + Shared memory available per block in bytes + + + totalConstantMemory : int + Constant memory available on device in bytes + + + SIMDWidth : int + Warp size in threads + + + memPitch : int + Maximum pitch in bytes allowed by memory copies + + + regsPerBlock : int + 32-bit registers available per block + + + clockRate : int + Clock frequency in kilohertz + + + textureAlign : int + Alignment requirement for textures + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevprop_st _pvt_val + cdef cydriver.CUdevprop_st* _pvt_ptr + +cdef class CUaccessPolicyWindow_st: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + + + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + + + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + + + hitProp : CUaccessProperty + CUaccessProperty set for hit. + + + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUaccessPolicyWindow_st _pvt_val + cdef cydriver.CUaccessPolicyWindow_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cybase_ptr + + +cdef class CUDA_KERNEL_NODE_PARAMS_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st* _pvt_ptr + + cdef CUfunction _func + + + cdef _HelperKernelParams _cykernelParams + + +cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st* _pvt_ptr + + cdef CUfunction _func + + + cdef _HelperKernelParams _cykernelParams + + + cdef CUkernel _kern + + + cdef CUcontext _ctx + + +cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st _pvt_val + cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st* _pvt_ptr + + cdef CUfunction _func + + + cdef _HelperKernelParams _cykernelParams + + + cdef CUkernel _kern + + + cdef CUcontext _ctx + + +cdef class CUDA_MEMSET_NODE_PARAMS_st: + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st* _pvt_ptr + + cdef CUdeviceptr _dst + + +cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + ctx : CUcontext + Context on which to run the node + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st* _pvt_ptr + + cdef CUdeviceptr _dst + + + cdef CUcontext _ctx + + +cdef class CUDA_HOST_NODE_PARAMS_st: + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_HOST_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_HOST_NODE_PARAMS_st* _pvt_ptr + + cdef CUhostFn _fn + + + cdef _HelperInputVoidPtr _cyuserData + + +cdef class CUDA_HOST_NODE_PARAMS_v2_st: + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st* _pvt_ptr + + cdef CUhostFn _fn + + + cdef _HelperInputVoidPtr _cyuserData + + +cdef class CUDA_CONDITIONAL_NODE_PARAMS: + """ + Conditional node parameters + + Attributes + ---------- + + handle : CUgraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cuGraphConditionalHandleCreate. + + + type : CUgraphConditionalNodeType + Type of conditional node. + + + 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. + + + phGraph_out : CUgraph + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + CU_GRAPH_COND_TYPE_WHILE: phGraph_out[0] is executed as long as the + 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. + + + ctx : CUcontext + Context on which to run the node. Must match context used to create + the handle and all body nodes. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS _pvt_val + cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS* _pvt_ptr + + cdef CUgraphConditionalHandle _handle + + + cdef size_t _phGraph_out_length + cdef cydriver.CUgraph* _phGraph_out + + + cdef CUcontext _ctx + + +cdef class CUgraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + + 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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, + CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or + CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. + + + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + 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. + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphEdgeData_st _pvt_val + cdef cydriver.CUgraphEdgeData_st* _pvt_ptr + +cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: + """ + Graph instantiation parameters + + Attributes + ---------- + + flags : cuuint64_t + Instantiation flags + + + hUploadStream : CUstream + Upload stream + + + hErrNode_out : CUgraphNode + The node which caused instantiation to fail, if any + + + result_out : CUgraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st _pvt_val + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st* _pvt_ptr + + cdef cuuint64_t _flags + + + cdef CUstream _hUploadStream + + + cdef CUgraphNode _hErrNode_out + + +cdef class CUlaunchMemSyncDomainMap_st: + """ + Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. + By default, kernels are launched in domain 0. Kernel launched with + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. + User may also alter the domain ID with CUlaunchMemSyncDomainMap for + a specific stream / graph node / kernel launch. See + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is + available through CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT. + + Attributes + ---------- + + default_ : bytes + The default domain ID to use for designated kernels + + + remote : bytes + The remote domain ID to use for designated kernels + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchMemSyncDomainMap_st _pvt_val + cdef cydriver.CUlaunchMemSyncDomainMap_st* _pvt_ptr + +cdef class anon_struct1: + """ + Attributes + ---------- + + x : unsigned int + + + + y : unsigned int + + + + z : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + +cdef class anon_struct2: + """ + Attributes + ---------- + + event : CUevent + + + + flags : int + + + + triggerAtBlockStart : int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + + cdef CUevent _event + + +cdef class anon_struct3: + """ + Attributes + ---------- + + event : CUevent + + + + flags : int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + + cdef CUevent _event + + +cdef class anon_struct4: + """ + Attributes + ---------- + + x : unsigned int + + + + y : unsigned int + + + + z : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + +cdef class anon_struct5: + """ + Attributes + ---------- + + deviceUpdatable : int + + + + devNode : CUgraphDeviceNode + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + + cdef CUgraphDeviceNode _devNode + + +cdef class CUlaunchAttributeValue_union: + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttributeValue_union _pvt_val + cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr + + cdef CUaccessPolicyWindow _accessPolicyWindow + + + cdef anon_struct1 _clusterDim + + + cdef anon_struct2 _programmaticEvent + + + cdef anon_struct3 _launchCompletionEvent + + + cdef CUlaunchMemSyncDomainMap _memSyncDomainMap + + + cdef anon_struct4 _preferredClusterDim + + + cdef anon_struct5 _deviceUpdatableKernelNode + + +cdef class CUlaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + + id : CUlaunchAttributeID + Attribute to set + + + value : CUlaunchAttributeValue + Value of the attribute + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchAttribute_st _pvt_val + cdef cydriver.CUlaunchAttribute_st* _pvt_ptr + + cdef CUlaunchAttributeValue _value + + +cdef class CUlaunchConfig_st: + """ + CUDA extensible launch configuration + + Attributes + ---------- + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + attrs : CUlaunchAttribute + List of attributes; nullable if CUlaunchConfig::numAttrs == 0 + + + numAttrs : unsigned int + Number of attributes populated in CUlaunchConfig::attrs + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlaunchConfig_st _pvt_val + cdef cydriver.CUlaunchConfig_st* _pvt_ptr + + cdef CUstream _hStream + + + cdef size_t _attrs_length + cdef cydriver.CUlaunchAttribute* _attrs + + +cdef class CUexecAffinitySmCount_st: + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + + val : unsigned int + The number of SMs the context is limited to use. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinitySmCount_st _pvt_val + cdef cydriver.CUexecAffinitySmCount_st* _pvt_ptr + +cdef class anon_union3: + """ + Attributes + ---------- + + smCount : CUexecAffinitySmCount + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinityParam_st* _pvt_ptr + + cdef CUexecAffinitySmCount _smCount + + +cdef class CUexecAffinityParam_st: + """ + Execution Affinity Parameters + + Attributes + ---------- + + type : CUexecAffinityType + + + + param : anon_union3 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUexecAffinityParam_st* _val_ptr + cdef cydriver.CUexecAffinityParam_st* _pvt_ptr + + cdef anon_union3 _param + + +cdef class CUctxCigParam_st: + """ + CIG Context Create Params + + Attributes + ---------- + + sharedDataType : CUcigDataType + + + + sharedData : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUctxCigParam_st _pvt_val + cdef cydriver.CUctxCigParam_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cysharedData + + +cdef class CUctxCreateParams_st: + """ + Params for creating CUDA context Exactly one of execAffinityParams + and cigParams must be non-NULL. + + Attributes + ---------- + + execAffinityParams : CUexecAffinityParam + + + + numExecAffinityParams : int + + + + cigParams : CUctxCigParam + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUctxCreateParams_st _pvt_val + cdef cydriver.CUctxCreateParams_st* _pvt_ptr + + cdef size_t _execAffinityParams_length + cdef cydriver.CUexecAffinityParam* _execAffinityParams + + + cdef size_t _cigParams_length + cdef cydriver.CUctxCigParam* _cigParams + + +cdef class CUlibraryHostUniversalFunctionAndDataTable_st: + """ + Attributes + ---------- + + functionTable : Any + + + + functionWindowSize : size_t + + + + dataTable : Any + + + + dataWindowSize : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st _pvt_val + cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cyfunctionTable + + + cdef _HelperInputVoidPtr _cydataTable + + +cdef class CUDA_MEMCPY2D_st: + """ + 2D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + WidthInBytes : size_t + Width of 2D memory copy in bytes + + + Height : size_t + Height of 2D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY2D_st _pvt_val + cdef cydriver.CUDA_MEMCPY2D_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cysrcHost + + + cdef CUdeviceptr _srcDevice + + + cdef CUarray _srcArray + + + cdef _HelperInputVoidPtr _cydstHost + + + cdef CUdeviceptr _dstDevice + + + cdef CUarray _dstArray + + +cdef class CUDA_MEMCPY3D_st: + """ + 3D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cysrcHost + + + cdef CUdeviceptr _srcDevice + + + cdef CUarray _srcArray + + + cdef _HelperInputVoidPtr _cydstHost + + + cdef CUdeviceptr _dstDevice + + + cdef CUarray _dstArray + + +cdef class CUDA_MEMCPY3D_PEER_st: + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_PEER_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_PEER_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cysrcHost + + + cdef CUdeviceptr _srcDevice + + + cdef CUarray _srcArray + + + cdef CUcontext _srcContext + + + cdef _HelperInputVoidPtr _cydstHost + + + cdef CUdeviceptr _dstDevice + + + cdef CUarray _dstArray + + + cdef CUcontext _dstContext + + +cdef class CUDA_MEMCPY_NODE_PARAMS_st: + """ + Memcpy node parameters + + Attributes + ---------- + + flags : int + Must be zero + + + copyCtx : CUcontext + Context on which to run the node + + + copyParams : CUDA_MEMCPY3D + Parameters for the memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st* _pvt_ptr + + cdef CUcontext _copyCtx + + + cdef CUDA_MEMCPY3D _copyParams + + +cdef class CUDA_ARRAY_DESCRIPTOR_st: + """ + Array descriptor + + Attributes + ---------- + + Width : size_t + Width of array + + + Height : size_t + Height of array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st _pvt_val + cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st* _pvt_ptr + +cdef class CUDA_ARRAY3D_DESCRIPTOR_st: + """ + 3D array descriptor + + Attributes + ---------- + + Width : size_t + Width of 3D array + + + Height : size_t + Height of 3D array + + + Depth : size_t + Depth of 3D array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Flags : unsigned int + Flags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st _pvt_val + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st* _pvt_ptr + +cdef class anon_struct6: + """ + Attributes + ---------- + + width : unsigned int + + + + height : unsigned int + + + + depth : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: + """ + CUDA array sparse properties + + Attributes + ---------- + + tileExtent : anon_struct6 + + + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + + + miptailSize : unsigned long long + Total size of the mip tail. + + + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st _pvt_val + cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr + + cdef anon_struct6 _tileExtent + + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + """ + CUDA array memory requirements + + Attributes + ---------- + + size : size_t + Total required memory size + + + alignment : size_t + alignment requirement + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st _pvt_val + cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st* _pvt_ptr + +cdef class anon_struct7: + """ + Attributes + ---------- + + hArray : CUarray + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef CUarray _hArray + + +cdef class anon_struct8: + """ + Attributes + ---------- + + hMipmappedArray : CUmipmappedArray + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef CUmipmappedArray _hMipmappedArray + + +cdef class anon_struct9: + """ + Attributes + ---------- + + devPtr : CUdeviceptr + + + + format : CUarray_format + + + + numChannels : unsigned int + + + + sizeInBytes : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef CUdeviceptr _devPtr + + +cdef class anon_struct10: + """ + Attributes + ---------- + + devPtr : CUdeviceptr + + + + format : CUarray_format + + + + numChannels : unsigned int + + + + width : size_t + + + + height : size_t + + + + pitchInBytes : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef CUdeviceptr _devPtr + + +cdef class anon_struct11: + """ + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + +cdef class anon_union4: + """ + Attributes + ---------- + + array : anon_struct7 + + + + mipmap : anon_struct8 + + + + linear : anon_struct9 + + + + pitch2D : anon_struct10 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef anon_struct7 _array + + + cdef anon_struct8 _mipmap + + + cdef anon_struct9 _linear + + + cdef anon_struct10 _pitch2D + + +cdef class CUDA_RESOURCE_DESC_st: + """ + CUDA Resource descriptor + + Attributes + ---------- + + resType : CUresourcetype + Resource type + + + res : anon_union4 + + + + flags : unsigned int + Flags (must be zero) + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_DESC_st* _val_ptr + cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr + + cdef anon_union4 _res + + +cdef class CUDA_TEXTURE_DESC_st: + """ + Texture descriptor + + Attributes + ---------- + + addressMode : list[CUaddress_mode] + Address modes + + + filterMode : CUfilter_mode + Filter mode + + + flags : unsigned int + Flags + + + maxAnisotropy : unsigned int + Maximum anisotropy ratio + + + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + + + mipmapLevelBias : float + Mipmap level bias + + + minMipmapLevelClamp : float + Mipmap minimum level clamp + + + maxMipmapLevelClamp : float + Mipmap maximum level clamp + + + borderColor : list[float] + Border Color + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_TEXTURE_DESC_st _pvt_val + cdef cydriver.CUDA_TEXTURE_DESC_st* _pvt_ptr + +cdef class CUDA_RESOURCE_VIEW_DESC_st: + """ + Resource view descriptor + + Attributes + ---------- + + format : CUresourceViewFormat + Resource view format + + + width : size_t + Width of the resource view + + + height : size_t + Height of the resource view + + + depth : size_t + Depth of the resource view + + + firstMipmapLevel : unsigned int + First defined mipmap level + + + lastMipmapLevel : unsigned int + Last defined mipmap level + + + firstLayer : unsigned int + First layer index + + + lastLayer : unsigned int + Last layer index + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st _pvt_val + cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st* _pvt_ptr + +cdef class CUtensorMap_st: + """ + Tensor map descriptor. Requires compiler support for aligning to 64 + bytes. + + Attributes + ---------- + + opaque : list[cuuint64_t] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUtensorMap_st _pvt_val + cdef cydriver.CUtensorMap_st* _pvt_ptr + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + """ + GPU Direct v3 tokens + + Attributes + ---------- + + p2pToken : unsigned long long + + + + vaSpaceToken : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st _pvt_val + cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st* _pvt_ptr + +cdef class CUDA_LAUNCH_PARAMS_st: + """ + Kernel launch parameters + + Attributes + ---------- + + function : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + kernelParams : Any + Array of pointers to kernel parameters + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_LAUNCH_PARAMS_st _pvt_val + cdef cydriver.CUDA_LAUNCH_PARAMS_st* _pvt_ptr + + cdef CUfunction _function + + + cdef CUstream _hStream + + + cdef _HelperKernelParams _cykernelParams + + +cdef class anon_struct12: + """ + Attributes + ---------- + + handle : Any + + + + name : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cyhandle + + + cdef _HelperInputVoidPtr _cyname + + +cdef class anon_union5: + """ + Attributes + ---------- + + fd : int + + + + win32 : anon_struct12 + + + + nvSciBufObject : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + + cdef anon_struct12 _win32 + + + cdef _HelperInputVoidPtr _cynvSciBufObject + + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + """ + External memory handle descriptor + + Attributes + ---------- + + type : CUexternalMemoryHandleType + Type of the handle + + + handle : anon_union5 + + + + size : unsigned long long + Size of the memory allocation + + + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _val_ptr + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr + + cdef anon_union5 _handle + + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: + """ + External memory buffer descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the buffer's base is + + + size : unsigned long long + Size of the buffer + + + flags : unsigned int + Flags reserved for future use. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st* _pvt_ptr + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: + """ + External memory mipmap descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + + + numLevels : unsigned int + Total number of levels in the mipmap chain + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st* _pvt_ptr + + cdef CUDA_ARRAY3D_DESCRIPTOR _arrayDesc + + +cdef class anon_struct13: + """ + Attributes + ---------- + + handle : Any + + + + name : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cyhandle + + + cdef _HelperInputVoidPtr _cyname + + +cdef class anon_union6: + """ + Attributes + ---------- + + fd : int + + + + win32 : anon_struct13 + + + + nvSciSyncObj : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + + cdef anon_struct13 _win32 + + + cdef _HelperInputVoidPtr _cynvSciSyncObj + + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + """ + External semaphore handle descriptor + + Attributes + ---------- + + type : CUexternalSemaphoreHandleType + Type of the handle + + + handle : anon_union6 + + + + flags : unsigned int + Flags reserved for the future. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _val_ptr + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr + + cdef anon_union6 _handle + + +cdef class anon_struct14: + """ + Attributes + ---------- + + value : unsigned long long + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + +cdef class anon_union7: + """ + Attributes + ---------- + + fence : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cyfence + + +cdef class anon_struct15: + """ + Attributes + ---------- + + key : unsigned long long + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + +cdef class anon_struct16: + """ + Attributes + ---------- + + fence : anon_struct14 + + + + nvSciSync : anon_union7 + + + + keyedMutex : anon_struct15 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + + cdef anon_struct14 _fence + + + cdef anon_union7 _nvSciSync + + + cdef anon_struct15 _keyedMutex + + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: + """ + External semaphore signal parameters + + Attributes + ---------- + + params : anon_struct16 + + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr + + cdef anon_struct16 _params + + +cdef class anon_struct17: + """ + Attributes + ---------- + + value : unsigned long long + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + +cdef class anon_union8: + """ + Attributes + ---------- + + fence : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cyfence + + +cdef class anon_struct18: + """ + Attributes + ---------- + + key : unsigned long long + + + + timeoutMs : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + +cdef class anon_struct19: + """ + Attributes + ---------- + + fence : anon_struct17 + + + + nvSciSync : anon_union8 + + + + keyedMutex : anon_struct18 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + + cdef anon_struct17 _fence + + + cdef anon_union8 _nvSciSync + + + cdef anon_struct18 _keyedMutex + + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: + """ + External semaphore wait parameters + + Attributes + ---------- + + params : anon_struct19 + + + + flags : unsigned int + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr + + cdef anon_struct19 _params + + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st* _pvt_ptr + + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + + + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray + + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st* _pvt_ptr + + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + + + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray + + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st* _pvt_ptr + + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + + + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray + + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st* _pvt_ptr + + cdef size_t _extSemArray_length + cdef cydriver.CUexternalSemaphore* _extSemArray + + + cdef size_t _paramsArray_length + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray + + +cdef class anon_union9: + """ + Attributes + ---------- + + mipmap : CUmipmappedArray + + + + array : CUarray + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + + cdef CUmipmappedArray _mipmap + + + cdef CUarray _array + + +cdef class anon_struct20: + """ + Attributes + ---------- + + level : unsigned int + + + + layer : unsigned int + + + + offsetX : unsigned int + + + + offsetY : unsigned int + + + + offsetZ : unsigned int + + + + extentWidth : unsigned int + + + + extentHeight : unsigned int + + + + extentDepth : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + +cdef class anon_struct21: + """ + Attributes + ---------- + + layer : unsigned int + + + + offset : unsigned long long + + + + size : unsigned long long + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + +cdef class anon_union10: + """ + Attributes + ---------- + + sparseLevel : anon_struct20 + + + + miptail : anon_struct21 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + + cdef anon_struct20 _sparseLevel + + + cdef anon_struct21 _miptail + + +cdef class anon_union11: + """ + Attributes + ---------- + + memHandle : CUmemGenericAllocationHandle + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + + cdef CUmemGenericAllocationHandle _memHandle + + +cdef class CUarrayMapInfo_st: + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + + resourceType : CUresourcetype + Resource type + + + resource : anon_union9 + + + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + + + subresource : anon_union10 + + + + memOperationType : CUmemOperationType + Memory operation type + + + memHandleType : CUmemHandleType + Memory handle type + + + memHandle : anon_union11 + + + + offset : unsigned long long + Offset within mip tail Offset within the memory + + + deviceBitMask : unsigned int + Device ordinal bit mask + + + flags : unsigned int + flags for future use, must be zero now. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUarrayMapInfo_st* _val_ptr + cdef cydriver.CUarrayMapInfo_st* _pvt_ptr + + cdef anon_union9 _resource + + + cdef anon_union10 _subresource + + + cdef anon_union11 _memHandle + + +cdef class CUmemLocation_st: + """ + Specifies a memory location. + + Attributes + ---------- + + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + + + id : int + identifier for a given this location's CUmemLocationType. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemLocation_st _pvt_val + cdef cydriver.CUmemLocation_st* _pvt_ptr + +cdef class anon_struct22: + """ + Attributes + ---------- + + compressionType : bytes + + + + gpuDirectRDMACapable : bytes + + + + usage : unsigned short + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAllocationProp_st* _pvt_ptr + +cdef class CUmemAllocationProp_st: + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + + type : CUmemAllocationType + Allocation type + + + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + + + location : CUmemLocation + Location of allocation + + + 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. + + + allocFlags : anon_struct22 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAllocationProp_st _pvt_val + cdef cydriver.CUmemAllocationProp_st* _pvt_ptr + + cdef CUmemLocation _location + + + cdef _HelperInputVoidPtr _cywin32HandleMetaData + + + cdef anon_struct22 _allocFlags + + +cdef class CUmulticastObjectProp_st: + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + + + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + + + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + + + flags : unsigned long long + Flags for future use, must be zero now + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmulticastObjectProp_st _pvt_val + cdef cydriver.CUmulticastObjectProp_st* _pvt_ptr + +cdef class CUmemAccessDesc_st: + """ + Memory access descriptor + + Attributes + ---------- + + location : CUmemLocation + Location on which the request is to change it's accessibility + + + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemAccessDesc_st _pvt_val + cdef cydriver.CUmemAccessDesc_st* _pvt_ptr + + cdef CUmemLocation _location + + +cdef class CUgraphExecUpdateResultInfo_st: + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + + + 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. + + + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphExecUpdateResultInfo_st _pvt_val + cdef cydriver.CUgraphExecUpdateResultInfo_st* _pvt_ptr + + cdef CUgraphNode _errorNode + + + cdef CUgraphNode _errorFromNode + + +cdef class CUmemPoolProps_st: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + + + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + + + location : CUmemLocation + Location where allocations should reside. + + + 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. + + + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + + + usage : unsigned short + Bitmask indicating intended usage for the pool. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemPoolProps_st _pvt_val + cdef cydriver.CUmemPoolProps_st* _pvt_ptr + + cdef CUmemLocation _location + + + cdef _HelperInputVoidPtr _cywin32SecurityAttributes + + +cdef class CUmemPoolPtrExportData_st: + """ + Opaque data for exporting a pool allocation + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemPoolPtrExportData_st _pvt_val + cdef cydriver.CUmemPoolPtrExportData_st* _pvt_ptr + +cdef class CUmemcpyAttributes_st: + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + + + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + + + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpyAttributes_st _pvt_val + cdef cydriver.CUmemcpyAttributes_st* _pvt_ptr + + cdef CUmemLocation _srcLocHint + + + cdef CUmemLocation _dstLocHint + + +cdef class CUoffset3D_st: + """ + Struct representing offset into a CUarray in elements + + Attributes + ---------- + + x : size_t + + + + y : size_t + + + + z : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUoffset3D_st _pvt_val + cdef cydriver.CUoffset3D_st* _pvt_ptr + +cdef class CUextent3D_st: + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + + width : size_t + + + + height : size_t + + + + depth : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUextent3D_st _pvt_val + cdef cydriver.CUextent3D_st* _pvt_ptr + +cdef class anon_struct23: + """ + Attributes + ---------- + + ptr : CUdeviceptr + + + + rowLength : size_t + + + + layerHeight : size_t + + + + locHint : CUmemLocation + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + + cdef CUdeviceptr _ptr + + + cdef CUmemLocation _locHint + + +cdef class anon_struct24: + """ + Attributes + ---------- + + array : CUarray + + + + offset : CUoffset3D + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + + cdef CUarray _array + + + cdef CUoffset3D _offset + + +cdef class anon_union12: + """ + Attributes + ---------- + + ptr : anon_struct23 + + + + array : anon_struct24 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + + cdef anon_struct23 _ptr + + + cdef anon_struct24 _array + + +cdef class CUmemcpy3DOperand_st: + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + + type : CUmemcpy3DOperandType + + + + op : anon_union12 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemcpy3DOperand_st* _val_ptr + cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr + + cdef anon_union12 _op + + +cdef class CUDA_MEMCPY3D_BATCH_OP_st: + """ + Attributes + ---------- + + src : CUmemcpy3DOperand + Source memcpy operand. + + + dst : CUmemcpy3DOperand + Destination memcpy operand. + + + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st _pvt_val + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st* _pvt_ptr + + cdef CUmemcpy3DOperand _src + + + cdef CUmemcpy3DOperand _dst + + + cdef CUextent3D _extent + + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st _pvt_val + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st* _pvt_ptr + + cdef CUmemPoolProps _poolProps + + + cdef size_t _accessDescs_length + cdef cydriver.CUmemAccessDesc* _accessDescs + + + cdef CUdeviceptr _dptr + + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st* _pvt_ptr + + cdef CUmemPoolProps _poolProps + + + cdef size_t _accessDescs_length + cdef cydriver.CUmemAccessDesc* _accessDescs + + + cdef CUdeviceptr _dptr + + +cdef class CUDA_MEM_FREE_NODE_PARAMS_st: + """ + Memory free node parameters + + Attributes + ---------- + + dptr : CUdeviceptr + in: the pointer to free + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st* _pvt_ptr + + cdef CUdeviceptr _dptr + + +cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: + """ + Child graph node parameters + + Attributes + ---------- + + 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. + + + ownership : CUgraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st* _pvt_ptr + + cdef CUgraph _graph + + +cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: + """ + Event record node parameters + + Attributes + ---------- + + event : CUevent + The event to record when the node executes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st* _pvt_ptr + + cdef CUevent _event + + +cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: + """ + Event wait node parameters + + Attributes + ---------- + + event : CUevent + The event to wait on from the node + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st* _pvt_ptr + + cdef CUevent _event + + +cdef class CUgraphNodeParams_st: + """ + Graph node parameters. See cuGraphAddNode. + + Attributes + ---------- + + type : CUgraphNodeType + Type of the node + + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 + Kernel node parameters. + + + memcpy : CUDA_MEMCPY_NODE_PARAMS + Memcpy node parameters. + + + memset : CUDA_MEMSET_NODE_PARAMS_v2 + Memset node parameters. + + + host : CUDA_HOST_NODE_PARAMS_v2 + Host node parameters. + + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS + Child graph node parameters. + + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS + Event wait node parameters. + + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS + Event record node parameters. + + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + External semaphore signal node parameters. + + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + External semaphore wait node parameters. + + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 + Memory allocation node parameters. + + + free : CUDA_MEM_FREE_NODE_PARAMS + Memory free node parameters. + + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + MemOp node parameters. + + + conditional : CUDA_CONDITIONAL_NODE_PARAMS + Conditional node parameters. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUgraphNodeParams_st* _val_ptr + cdef cydriver.CUgraphNodeParams_st* _pvt_ptr + + cdef CUDA_KERNEL_NODE_PARAMS_v3 _kernel + + + cdef CUDA_MEMCPY_NODE_PARAMS _memcpy + + + cdef CUDA_MEMSET_NODE_PARAMS_v2 _memset + + + cdef CUDA_HOST_NODE_PARAMS_v2 _host + + + cdef CUDA_CHILD_GRAPH_NODE_PARAMS _graph + + + cdef CUDA_EVENT_WAIT_NODE_PARAMS _eventWait + + + cdef CUDA_EVENT_RECORD_NODE_PARAMS _eventRecord + + + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 _extSemSignal + + + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 _extSemWait + + + cdef CUDA_MEM_ALLOC_NODE_PARAMS_v2 _alloc + + + cdef CUDA_MEM_FREE_NODE_PARAMS _free + + + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 _memOp + + + cdef CUDA_CONDITIONAL_NODE_PARAMS _conditional + + +cdef class CUcheckpointLockArgs_st: + """ + CUDA checkpoint optional lock arguments + + Attributes + ---------- + + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointLockArgs_st _pvt_val + cdef cydriver.CUcheckpointLockArgs_st* _pvt_ptr + +cdef class CUcheckpointCheckpointArgs_st: + """ + CUDA checkpoint optional checkpoint arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointCheckpointArgs_st _pvt_val + cdef cydriver.CUcheckpointCheckpointArgs_st* _pvt_ptr + +cdef class CUcheckpointRestoreArgs_st: + """ + CUDA checkpoint optional restore arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointRestoreArgs_st _pvt_val + cdef cydriver.CUcheckpointRestoreArgs_st* _pvt_ptr + +cdef class CUcheckpointUnlockArgs_st: + """ + CUDA checkpoint optional unlock arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointUnlockArgs_st _pvt_val + cdef cydriver.CUcheckpointUnlockArgs_st* _pvt_ptr + +cdef class CUmemDecompressParams_st: + """ + Structure describing the parameters that compose a single + decompression operation. + + Attributes + ---------- + + srcNumBytes : size_t + The number of bytes to be read and decompressed from + CUmemDecompressParams_st.src. + + + 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. + + + 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. + + + src : Any + Pointer to a buffer of at least + CUmemDecompressParams_st.srcNumBytes compressed bytes. + + + 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 + + + algo : CUmemDecompressAlgorithm + The decompression algorithm to use. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemDecompressParams_st _pvt_val + cdef cydriver.CUmemDecompressParams_st* _pvt_ptr + + cdef _HelperInputVoidPtr _cysrc + + + cdef _HelperInputVoidPtr _cydst + + +cdef class CUdevSmResource_st: + """ + Attributes + ---------- + + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + This is an output parameter only, do not write to this field. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevSmResource_st _pvt_val + cdef cydriver.CUdevSmResource_st* _pvt_ptr + +cdef class CUdevResource_st: + """ + Attributes + ---------- + + type : CUdevResourceType + Type of resource, dictates which union field was last set + + + _internal_padding : bytes + + + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + + + _oversize : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevResource_st* _val_ptr + cdef cydriver.CUdevResource_st* _pvt_ptr + + cdef CUdevSmResource _sm + + +cdef class anon_union15: + """ + Attributes + ---------- + + pArray : list[CUarray] + + + + pPitch : list[Any] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUeglFrame_st* _pvt_ptr + +cdef class CUeglFrame_st: + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + + frame : anon_union15 + + + + width : unsigned int + Width of first plane + + + height : unsigned int + Height of first plane + + + depth : unsigned int + Depth of first plane + + + pitch : unsigned int + Pitch of first plane + + + planeCount : unsigned int + Number of planes + + + numChannels : unsigned int + Number of channels for the plane + + + frameType : CUeglFrameType + Array or Pitch + + + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + + + cuFormat : CUarray_format + CUDA Array Format + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUeglFrame_st* _val_ptr + cdef cydriver.CUeglFrame_st* _pvt_ptr + + cdef anon_union15 _frame + + +cdef class CUdeviceptr: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdeviceptr _pvt_val + cdef cydriver.CUdeviceptr* _pvt_ptr + +cdef class CUdevice: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevice _pvt_val + cdef cydriver.CUdevice* _pvt_ptr + +cdef class CUtexObject: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexObject _pvt_val + cdef cydriver.CUtexObject* _pvt_ptr + +cdef class CUsurfObject: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfObject _pvt_val + cdef cydriver.CUsurfObject* _pvt_ptr + +cdef class CUgraphConditionalHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphConditionalHandle _pvt_val + cdef cydriver.CUgraphConditionalHandle* _pvt_ptr + +cdef class CUuuid(CUuuid_st): + """ + Attributes + ---------- + + bytes : bytes + < CUDA definition of UUID + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemFabricHandle_v1(CUmemFabricHandle_st): + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + + data : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemFabricHandle(CUmemFabricHandle_v1): + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + Attributes + ---------- + + data : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcEventHandle_v1(CUipcEventHandle_st): + """ + CUDA IPC event handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcEventHandle(CUipcEventHandle_v1): + """ + CUDA IPC event handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcMemHandle_v1(CUipcMemHandle_st): + """ + CUDA IPC mem handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUipcMemHandle(CUipcMemHandle_v1): + """ + CUDA IPC mem handle + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + waitValue : CUstreamMemOpWaitValueParams_st + + + + writeValue : CUstreamMemOpWriteValueParams_st + + + + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + + + + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + + + + pad : list[cuuint64_t] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + waitValue : CUstreamMemOpWaitValueParams_st + + + + writeValue : CUstreamMemOpWriteValueParams_st + + + + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + + + + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + + + + pad : list[cuuint64_t] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st): + """ + Attributes + ---------- + + ctx : CUcontext + + + + count : unsigned int + + + + paramArray : CUstreamBatchMemOpParams + + + + flags : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): + """ + Attributes + ---------- + + ctx : CUcontext + + + + count : unsigned int + + + + paramArray : CUstreamBatchMemOpParams + + + + flags : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st): + """ + Batch memory operation node parameters + + Attributes + ---------- + + ctx : CUcontext + Context to use for the operations. + + + count : unsigned int + Number of operations in paramArray. + + + paramArray : CUstreamBatchMemOpParams + Array of batch memory operations. + + + flags : unsigned int + Flags to control the node. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUasyncNotificationInfo(CUasyncNotificationInfo_st): + """ + Information passed to the user via the async notification callback + + Attributes + ---------- + + type : CUasyncNotificationType + The type of notification being sent + + + info : anon_union2 + Information about the notification. `typename` must be checked in + order to interpret this field. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevprop_v1(CUdevprop_st): + """ + Legacy device properties + + Attributes + ---------- + + maxThreadsPerBlock : int + Maximum number of threads per block + + + maxThreadsDim : list[int] + Maximum size of each dimension of a block + + + maxGridSize : list[int] + Maximum size of each dimension of a grid + + + sharedMemPerBlock : int + Shared memory available per block in bytes + + + totalConstantMemory : int + Constant memory available on device in bytes + + + SIMDWidth : int + Warp size in threads + + + memPitch : int + Maximum pitch in bytes allowed by memory copies + + + regsPerBlock : int + 32-bit registers available per block + + + clockRate : int + Clock frequency in kilohertz + + + textureAlign : int + Alignment requirement for textures + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevprop(CUdevprop_v1): + """ + Legacy device properties + + Attributes + ---------- + + maxThreadsPerBlock : int + Maximum number of threads per block + + + maxThreadsDim : list[int] + Maximum size of each dimension of a block + + + maxGridSize : list[int] + Maximum size of each dimension of a grid + + + sharedMemPerBlock : int + Shared memory available per block in bytes + + + totalConstantMemory : int + Constant memory available on device in bytes + + + SIMDWidth : int + Warp size in threads + + + memPitch : int + Maximum pitch in bytes allowed by memory copies + + + regsPerBlock : int + 32-bit registers available per block + + + clockRate : int + Clock frequency in kilohertz + + + textureAlign : int + Alignment requirement for textures + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUaccessPolicyWindow_v1(CUaccessPolicyWindow_st): + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + + + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + + + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + + + hitProp : CUaccessProperty + CUaccessProperty set for hit. + + + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUaccessPolicyWindow(CUaccessPolicyWindow_v1): + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + + + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + + + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + + + hitProp : CUaccessProperty + CUaccessProperty set for hit. + + + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v1(CUDA_KERNEL_NODE_PARAMS_st): + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v2(CUDA_KERNEL_NODE_PARAMS_v2_st): + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS(CUDA_KERNEL_NODE_PARAMS_v2): + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_KERNEL_NODE_PARAMS_v3(CUDA_KERNEL_NODE_PARAMS_v3_st): + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS_v1(CUDA_MEMSET_NODE_PARAMS_st): + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS(CUDA_MEMSET_NODE_PARAMS_v1): + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMSET_NODE_PARAMS_v2(CUDA_MEMSET_NODE_PARAMS_v2_st): + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + ctx : CUcontext + Context on which to run the node + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS_v1(CUDA_HOST_NODE_PARAMS_st): + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS(CUDA_HOST_NODE_PARAMS_v1): + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphEdgeData(CUgraphEdgeData_st): + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + + 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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, + CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or + CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. + + + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + 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. + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_GRAPH_INSTANTIATE_PARAMS(CUDA_GRAPH_INSTANTIATE_PARAMS_st): + """ + Graph instantiation parameters + + Attributes + ---------- + + flags : cuuint64_t + Instantiation flags + + + hUploadStream : CUstream + Upload stream + + + hErrNode_out : CUgraphNode + The node which caused instantiation to fail, if any + + + result_out : CUgraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchMemSyncDomainMap(CUlaunchMemSyncDomainMap_st): + """ + Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. + By default, kernels are launched in domain 0. Kernel launched with + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. + User may also alter the domain ID with CUlaunchMemSyncDomainMap for + a specific stream / graph node / kernel launch. See + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is + available through CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT. + + Attributes + ---------- + + default_ : bytes + The default domain ID to use for designated kernels + + + remote : bytes + The remote domain ID to use for designated kernels + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchAttribute(CUlaunchAttribute_st): + """ + Launch attribute + + Attributes + ---------- + + id : CUlaunchAttributeID + Attribute to set + + + value : CUlaunchAttributeValue + Value of the attribute + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlaunchConfig(CUlaunchConfig_st): + """ + CUDA extensible launch configuration + + Attributes + ---------- + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + attrs : CUlaunchAttribute + List of attributes; nullable if CUlaunchConfig::numAttrs == 0 + + + numAttrs : unsigned int + Number of attributes populated in CUlaunchConfig::attrs + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUstreamAttrValue(CUstreamAttrValue_v1): + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinitySmCount_v1(CUexecAffinitySmCount_st): + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + + val : unsigned int + The number of SMs the context is limited to use. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinitySmCount(CUexecAffinitySmCount_v1): + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + + val : unsigned int + The number of SMs the context is limited to use. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): + """ + Execution Affinity Parameters + + Attributes + ---------- + + type : CUexecAffinityType + + + + param : anon_union3 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUexecAffinityParam(CUexecAffinityParam_v1): + """ + Execution Affinity Parameters + + Attributes + ---------- + + type : CUexecAffinityType + + + + param : anon_union3 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUctxCigParam(CUctxCigParam_st): + """ + CIG Context Create Params + + Attributes + ---------- + + sharedDataType : CUcigDataType + + + + sharedData : Any + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUctxCreateParams(CUctxCreateParams_st): + """ + Params for creating CUDA context Exactly one of execAffinityParams + and cigParams must be non-NULL. + + Attributes + ---------- + + execAffinityParams : CUexecAffinityParam + + + + numExecAffinityParams : int + + + + cigParams : CUctxCigParam + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlibraryHostUniversalFunctionAndDataTable(CUlibraryHostUniversalFunctionAndDataTable_st): + """ + Attributes + ---------- + + functionTable : Any + + + + functionWindowSize : size_t + + + + dataTable : Any + + + + dataWindowSize : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY2D_v2(CUDA_MEMCPY2D_st): + """ + 2D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + WidthInBytes : size_t + Width of 2D memory copy in bytes + + + Height : size_t + Height of 2D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY2D(CUDA_MEMCPY2D_v2): + """ + 2D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + WidthInBytes : size_t + Width of 2D memory copy in bytes + + + Height : size_t + Height of 2D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): + """ + 3D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): + """ + 3D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_PEER_v1(CUDA_MEMCPY3D_PEER_st): + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_PEER(CUDA_MEMCPY3D_PEER_v1): + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): + """ + Memcpy node parameters + + Attributes + ---------- + + flags : int + Must be zero + + + copyCtx : CUcontext + Context on which to run the node + + + copyParams : CUDA_MEMCPY3D + Parameters for the memory copy + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_DESCRIPTOR_v2(CUDA_ARRAY_DESCRIPTOR_st): + """ + Array descriptor + + Attributes + ---------- + + Width : size_t + Width of array + + + Height : size_t + Height of array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_DESCRIPTOR(CUDA_ARRAY_DESCRIPTOR_v2): + """ + Array descriptor + + Attributes + ---------- + + Width : size_t + Width of array + + + Height : size_t + Height of array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY3D_DESCRIPTOR_v2(CUDA_ARRAY3D_DESCRIPTOR_st): + """ + 3D array descriptor + + Attributes + ---------- + + Width : size_t + Width of 3D array + + + Height : size_t + Height of 3D array + + + Depth : size_t + Depth of 3D array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Flags : unsigned int + Flags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY3D_DESCRIPTOR(CUDA_ARRAY3D_DESCRIPTOR_v2): + """ + 3D array descriptor + + Attributes + ---------- + + Width : size_t + Width of 3D array + + + Height : size_t + Height of 3D array + + + Depth : size_t + Depth of 3D array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Flags : unsigned int + Flags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): + """ + CUDA array sparse properties + + Attributes + ---------- + + tileExtent : anon_struct6 + + + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + + + miptailSize : unsigned long long + Total size of the mip tail. + + + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): + """ + CUDA array sparse properties + + Attributes + ---------- + + tileExtent : anon_struct6 + + + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + + + miptailSize : unsigned long long + Total size of the mip tail. + + + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): + """ + CUDA array memory requirements + + Attributes + ---------- + + size : size_t + Total required memory size + + + alignment : size_t + alignment requirement + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): + """ + CUDA array memory requirements + + Attributes + ---------- + + size : size_t + Total required memory size + + + alignment : size_t + alignment requirement + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): + """ + CUDA Resource descriptor + + Attributes + ---------- + + resType : CUresourcetype + Resource type + + + res : anon_union4 + + + + flags : unsigned int + Flags (must be zero) + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): + """ + CUDA Resource descriptor + + Attributes + ---------- + + resType : CUresourcetype + Resource type + + + res : anon_union4 + + + + flags : unsigned int + Flags (must be zero) + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): + """ + Texture descriptor + + Attributes + ---------- + + addressMode : list[CUaddress_mode] + Address modes + + + filterMode : CUfilter_mode + Filter mode + + + flags : unsigned int + Flags + + + maxAnisotropy : unsigned int + Maximum anisotropy ratio + + + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + + + mipmapLevelBias : float + Mipmap level bias + + + minMipmapLevelClamp : float + Mipmap minimum level clamp + + + maxMipmapLevelClamp : float + Mipmap maximum level clamp + + + borderColor : list[float] + Border Color + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): + """ + Texture descriptor + + Attributes + ---------- + + addressMode : list[CUaddress_mode] + Address modes + + + filterMode : CUfilter_mode + Filter mode + + + flags : unsigned int + Flags + + + maxAnisotropy : unsigned int + Maximum anisotropy ratio + + + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + + + mipmapLevelBias : float + Mipmap level bias + + + minMipmapLevelClamp : float + Mipmap minimum level clamp + + + maxMipmapLevelClamp : float + Mipmap maximum level clamp + + + borderColor : list[float] + Border Color + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): + """ + Resource view descriptor + + Attributes + ---------- + + format : CUresourceViewFormat + Resource view format + + + width : size_t + Width of the resource view + + + height : size_t + Height of the resource view + + + depth : size_t + Depth of the resource view + + + firstMipmapLevel : unsigned int + First defined mipmap level + + + lastMipmapLevel : unsigned int + Last defined mipmap level + + + firstLayer : unsigned int + First layer index + + + lastLayer : unsigned int + Last layer index + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): + """ + Resource view descriptor + + Attributes + ---------- + + format : CUresourceViewFormat + Resource view format + + + width : size_t + Width of the resource view + + + height : size_t + Height of the resource view + + + depth : size_t + Depth of the resource view + + + firstMipmapLevel : unsigned int + First defined mipmap level + + + lastMipmapLevel : unsigned int + Last defined mipmap level + + + firstLayer : unsigned int + First layer index + + + lastLayer : unsigned int + Last layer index + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUtensorMap(CUtensorMap_st): + """ + Tensor map descriptor. Requires compiler support for aligning to 64 + bytes. + + Attributes + ---------- + + opaque : list[cuuint64_t] + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st): + """ + GPU Direct v3 tokens + + Attributes + ---------- + + p2pToken : unsigned long long + + + + vaSpaceToken : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1): + """ + GPU Direct v3 tokens + + Attributes + ---------- + + p2pToken : unsigned long long + + + + vaSpaceToken : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_LAUNCH_PARAMS_v1(CUDA_LAUNCH_PARAMS_st): + """ + Kernel launch parameters + + Attributes + ---------- + + function : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + kernelParams : Any + Array of pointers to kernel parameters + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_LAUNCH_PARAMS(CUDA_LAUNCH_PARAMS_v1): + """ + Kernel launch parameters + + Attributes + ---------- + + function : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + kernelParams : Any + Array of pointers to kernel parameters + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st): + """ + External memory handle descriptor + + Attributes + ---------- + + type : CUexternalMemoryHandleType + Type of the handle + + + handle : anon_union5 + + + + size : unsigned long long + Size of the memory allocation + + + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1): + """ + External memory handle descriptor + + Attributes + ---------- + + type : CUexternalMemoryHandleType + Type of the handle + + + handle : anon_union5 + + + + size : unsigned long long + Size of the memory allocation + + + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st): + """ + External memory buffer descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the buffer's base is + + + size : unsigned long long + Size of the buffer + + + flags : unsigned int + Flags reserved for future use. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1): + """ + External memory buffer descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the buffer's base is + + + size : unsigned long long + Size of the buffer + + + flags : unsigned int + Flags reserved for future use. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st): + """ + External memory mipmap descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + + + numLevels : unsigned int + Total number of levels in the mipmap chain + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1): + """ + External memory mipmap descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + + + numLevels : unsigned int + Total number of levels in the mipmap chain + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st): + """ + External semaphore handle descriptor + + Attributes + ---------- + + type : CUexternalSemaphoreHandleType + Type of the handle + + + handle : anon_union6 + + + + flags : unsigned int + Flags reserved for the future. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1): + """ + External semaphore handle descriptor + + Attributes + ---------- + + type : CUexternalSemaphoreHandleType + Type of the handle + + + handle : anon_union6 + + + + flags : unsigned int + Flags reserved for the future. Must be zero. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st): + """ + External semaphore signal parameters + + Attributes + ---------- + + params : anon_struct16 + + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1): + """ + External semaphore signal parameters + + Attributes + ---------- + + params : anon_struct16 + + + + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st): + """ + External semaphore wait parameters + + Attributes + ---------- + + params : anon_struct19 + + + + flags : unsigned int + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1): + """ + External semaphore wait parameters + + Attributes + ---------- + + params : anon_struct19 + + + + flags : unsigned int + 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. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st): + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1): + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st): + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st): + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1): + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st): + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemGenericAllocationHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemGenericAllocationHandle _pvt_val + cdef cydriver.CUmemGenericAllocationHandle* _pvt_ptr + +cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + + resourceType : CUresourcetype + Resource type + + + resource : anon_union9 + + + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + + + subresource : anon_union10 + + + + memOperationType : CUmemOperationType + Memory operation type + + + memHandleType : CUmemHandleType + Memory handle type + + + memHandle : anon_union11 + + + + offset : unsigned long long + Offset within mip tail Offset within the memory + + + deviceBitMask : unsigned int + Device ordinal bit mask + + + flags : unsigned int + flags for future use, must be zero now. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUarrayMapInfo(CUarrayMapInfo_v1): + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + + resourceType : CUresourcetype + Resource type + + + resource : anon_union9 + + + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + + + subresource : anon_union10 + + + + memOperationType : CUmemOperationType + Memory operation type + + + memHandleType : CUmemHandleType + Memory handle type + + + memHandle : anon_union11 + + + + offset : unsigned long long + Offset within mip tail Offset within the memory + + + deviceBitMask : unsigned int + Device ordinal bit mask + + + flags : unsigned int + flags for future use, must be zero now. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemLocation_v1(CUmemLocation_st): + """ + Specifies a memory location. + + Attributes + ---------- + + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + + + id : int + identifier for a given this location's CUmemLocationType. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemLocation(CUmemLocation_v1): + """ + Specifies a memory location. + + Attributes + ---------- + + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + + + id : int + identifier for a given this location's CUmemLocationType. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + + type : CUmemAllocationType + Allocation type + + + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + + + location : CUmemLocation + Location of allocation + + + 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. + + + allocFlags : anon_struct22 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAllocationProp(CUmemAllocationProp_v1): + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + + type : CUmemAllocationType + Allocation type + + + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + + + location : CUmemLocation + Location of allocation + + + 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. + + + allocFlags : anon_struct22 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmulticastObjectProp_v1(CUmulticastObjectProp_st): + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + + + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + + + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + + + flags : unsigned long long + Flags for future use, must be zero now + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmulticastObjectProp(CUmulticastObjectProp_v1): + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + + + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + + + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + + + flags : unsigned long long + Flags for future use, must be zero now + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAccessDesc_v1(CUmemAccessDesc_st): + """ + Memory access descriptor + + Attributes + ---------- + + location : CUmemLocation + Location on which the request is to change it's accessibility + + + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemAccessDesc(CUmemAccessDesc_v1): + """ + Memory access descriptor + + Attributes + ---------- + + location : CUmemLocation + Location on which the request is to change it's accessibility + + + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphExecUpdateResultInfo_v1(CUgraphExecUpdateResultInfo_st): + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + + + 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. + + + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphExecUpdateResultInfo(CUgraphExecUpdateResultInfo_v1): + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + + + 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. + + + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolProps_v1(CUmemPoolProps_st): + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + + + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + + + location : CUmemLocation + Location where allocations should reside. + + + 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. + + + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + + + usage : unsigned short + Bitmask indicating intended usage for the pool. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolProps(CUmemPoolProps_v1): + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + + + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + + + location : CUmemLocation + Location where allocations should reside. + + + 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. + + + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + + + usage : unsigned short + Bitmask indicating intended usage for the pool. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): + """ + Opaque data for exporting a pool allocation + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): + """ + Opaque data for exporting a pool allocation + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpyAttributes_v1(CUmemcpyAttributes_st): + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + + + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + + + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpyAttributes(CUmemcpyAttributes_v1): + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + + + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + + + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUoffset3D_v1(CUoffset3D_st): + """ + Struct representing offset into a CUarray in elements + + Attributes + ---------- + + x : size_t + + + + y : size_t + + + + z : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUoffset3D(CUoffset3D_v1): + """ + Struct representing offset into a CUarray in elements + + Attributes + ---------- + + x : size_t + + + + y : size_t + + + + z : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUextent3D_v1(CUextent3D_st): + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + + width : size_t + + + + height : size_t + + + + depth : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUextent3D(CUextent3D_v1): + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + + width : size_t + + + + height : size_t + + + + depth : size_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + + type : CUmemcpy3DOperandType + + + + op : anon_union12 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + + type : CUmemcpy3DOperandType + + + + op : anon_union12 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_BATCH_OP_v1(CUDA_MEMCPY3D_BATCH_OP_st): + """ + Attributes + ---------- + + src : CUmemcpy3DOperand + Source memcpy operand. + + + dst : CUmemcpy3DOperand + Destination memcpy operand. + + + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY3D_BATCH_OP(CUDA_MEMCPY3D_BATCH_OP_v1): + """ + Attributes + ---------- + + src : CUmemcpy3DOperand + Source memcpy operand. + + + dst : CUmemcpy3DOperand + Destination memcpy operand. + + + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1(CUDA_MEM_ALLOC_NODE_PARAMS_v1_st): + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS(CUDA_MEM_ALLOC_NODE_PARAMS_v1): + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2(CUDA_MEM_ALLOC_NODE_PARAMS_v2_st): + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEM_FREE_NODE_PARAMS(CUDA_MEM_FREE_NODE_PARAMS_st): + """ + Memory free node parameters + + Attributes + ---------- + + dptr : CUdeviceptr + in: the pointer to free + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_CHILD_GRAPH_NODE_PARAMS(CUDA_CHILD_GRAPH_NODE_PARAMS_st): + """ + Child graph node parameters + + Attributes + ---------- + + 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. + + + ownership : CUgraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): + """ + Event record node parameters + + Attributes + ---------- + + event : CUevent + The event to record when the node executes + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): + """ + Event wait node parameters + + Attributes + ---------- + + event : CUevent + The event to wait on from the node + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUgraphNodeParams(CUgraphNodeParams_st): + """ + Graph node parameters. See cuGraphAddNode. + + Attributes + ---------- + + type : CUgraphNodeType + Type of the node + + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 + Kernel node parameters. + + + memcpy : CUDA_MEMCPY_NODE_PARAMS + Memcpy node parameters. + + + memset : CUDA_MEMSET_NODE_PARAMS_v2 + Memset node parameters. + + + host : CUDA_HOST_NODE_PARAMS_v2 + Host node parameters. + + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS + Child graph node parameters. + + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS + Event wait node parameters. + + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS + Event record node parameters. + + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + External semaphore signal node parameters. + + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + External semaphore wait node parameters. + + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 + Memory allocation node parameters. + + + free : CUDA_MEM_FREE_NODE_PARAMS + Memory free node parameters. + + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + MemOp node parameters. + + + conditional : CUDA_CONDITIONAL_NODE_PARAMS + Conditional node parameters. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): + """ + CUDA checkpoint optional lock arguments + + Attributes + ---------- + + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): + """ + CUDA checkpoint optional checkpoint arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): + """ + CUDA checkpoint optional restore arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): + """ + CUDA checkpoint optional unlock arguments + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUmemDecompressParams(CUmemDecompressParams_st): + """ + Structure describing the parameters that compose a single + decompression operation. + + Attributes + ---------- + + srcNumBytes : size_t + The number of bytes to be read and decompressed from + CUmemDecompressParams_st.src. + + + 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. + + + 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. + + + src : Any + Pointer to a buffer of at least + CUmemDecompressParams_st.srcNumBytes compressed bytes. + + + 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 + + + algo : CUmemDecompressAlgorithm + The decompression algorithm to use. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevSmResource(CUdevSmResource_st): + """ + Attributes + ---------- + + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + This is an output parameter only, do not write to this field. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevResource_v1(CUdevResource_st): + """ + Attributes + ---------- + + type : CUdevResourceType + Type of resource, dictates which union field was last set + + + _internal_padding : bytes + + + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + + + _oversize : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUdevResource(CUdevResource_v1): + """ + Attributes + ---------- + + type : CUdevResourceType + Type of resource, dictates which union field was last set + + + _internal_padding : bytes + + + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + + + _oversize : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUeglFrame_v1(CUeglFrame_st): + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + + frame : anon_union15 + + + + width : unsigned int + Width of first plane + + + height : unsigned int + Height of first plane + + + depth : unsigned int + Depth of first plane + + + pitch : unsigned int + Pitch of first plane + + + planeCount : unsigned int + Number of planes + + + numChannels : unsigned int + Number of channels for the plane + + + frameType : CUeglFrameType + Array or Pitch + + + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + + + cuFormat : CUarray_format + CUDA Array Format + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUeglFrame(CUeglFrame_v1): + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + + frame : anon_union15 + + + + width : unsigned int + Width of first plane + + + height : unsigned int + Height of first plane + + + depth : unsigned int + Depth of first plane + + + pitch : unsigned int + Pitch of first plane + + + planeCount : unsigned int + Number of planes + + + numChannels : unsigned int + Number of channels for the plane + + + frameType : CUeglFrameType + Array or Pitch + + + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + + + cuFormat : CUarray_format + CUDA Array Format + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class cuuint32_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.cuuint32_t _pvt_val + cdef cydriver.cuuint32_t* _pvt_ptr + +cdef class cuuint64_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.cuuint64_t _pvt_val + cdef cydriver.cuuint64_t* _pvt_ptr + +cdef class CUdeviceptr_v2: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdeviceptr_v2 _pvt_val + cdef cydriver.CUdeviceptr_v2* _pvt_ptr + +cdef class CUdevice_v1: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUdevice_v1 _pvt_val + cdef cydriver.CUdevice_v1* _pvt_ptr + +cdef class CUtexObject_v1: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUtexObject_v1 _pvt_val + cdef cydriver.CUtexObject_v1* _pvt_ptr + +cdef class CUsurfObject_v1: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUsurfObject_v1 _pvt_val + cdef cydriver.CUsurfObject_v1* _pvt_ptr + +cdef class CUmemGenericAllocationHandle_v1: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUmemGenericAllocationHandle_v1 _pvt_val + cdef cydriver.CUmemGenericAllocationHandle_v1* _pvt_ptr + +cdef class CUlogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogIterator _pvt_val + cdef cydriver.CUlogIterator* _pvt_ptr + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.GLenum _pvt_val + cdef cydriver.GLenum* _pvt_ptr + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.GLuint _pvt_val + cdef cydriver.GLuint* _pvt_ptr + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.EGLint _pvt_val + cdef cydriver.EGLint* _pvt_ptr + +cdef class VdpDevice: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpDevice _pvt_val + cdef cydriver.VdpDevice* _pvt_ptr + +cdef class VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpGetProcAddress _pvt_val + cdef cydriver.VdpGetProcAddress* _pvt_ptr + +cdef class VdpVideoSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpVideoSurface _pvt_val + cdef cydriver.VdpVideoSurface* _pvt_ptr + +cdef class VdpOutputSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.VdpOutputSurface _pvt_val + cdef cydriver.VdpOutputSurface* _pvt_ptr diff --git a/cuda_bindings_12/cuda/bindings/driver.pyx b/cuda_bindings_12/cuda/bindings/driver.pyx new file mode 100644 index 00000000000..981da233384 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/driver.pyx @@ -0,0 +1,53465 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=faf8de1cd4a99bbf9a812ae8b7cfb742b4d6abd0ade517b9ac7ce5335a8864ef +from typing import Any, Optional +import cython +import ctypes +from libc.stdlib cimport calloc, malloc, free +from libc cimport string +from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t, uintptr_t +from libc.stddef cimport wchar_t +from libc.limits cimport CHAR_MIN +from libcpp.vector cimport vector +from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS +from cpython.bytes cimport PyBytes_FromStringAndSize +from ._internal._fast_enum import FastEnum as _FastEnum +import cuda.bindings.driver +from libcpp.map cimport map + +_driver = globals() +include "_lib/utils.pxi" + +ctypedef unsigned long long signed_char_ptr +ctypedef unsigned long long unsigned_char_ptr +ctypedef unsigned long long char_ptr +ctypedef unsigned long long short_ptr +ctypedef unsigned long long unsigned_short_ptr +ctypedef unsigned long long int_ptr +ctypedef unsigned long long long_int_ptr +ctypedef unsigned long long long_long_int_ptr +ctypedef unsigned long long unsigned_int_ptr +ctypedef unsigned long long unsigned_long_int_ptr +ctypedef unsigned long long unsigned_long_long_int_ptr +ctypedef unsigned long long uint32_t_ptr +ctypedef unsigned long long uint64_t_ptr +ctypedef unsigned long long int32_t_ptr +ctypedef unsigned long long int64_t_ptr +ctypedef unsigned long long unsigned_ptr +ctypedef unsigned long long unsigned_long_long_ptr +ctypedef unsigned long long long_long_ptr +ctypedef unsigned long long size_t_ptr +ctypedef unsigned long long long_ptr +ctypedef unsigned long long float_ptr +ctypedef unsigned long long double_ptr +ctypedef unsigned long long void_ptr + +#: CUDA API version number +CUDA_VERSION = cydriver.CUDA_VERSION + +#: CUDA IPC handle size +CU_IPC_HANDLE_SIZE = cydriver.CU_IPC_HANDLE_SIZE + +#: Legacy stream handle +#: +#: 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 :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 + +CU_COMPUTE_ACCELERATED_TARGET_BASE = cydriver.CU_COMPUTE_ACCELERATED_TARGET_BASE + +CU_COMPUTE_FAMILY_TARGET_BASE = cydriver.CU_COMPUTE_FAMILY_TARGET_BASE + +#: Conditional node handle flags Default value is applied when graph is +#: launched. +CU_GRAPH_COND_ASSIGN_DEFAULT = cydriver.CU_GRAPH_COND_ASSIGN_DEFAULT + +#: This port activates when the kernel has finished executing. +CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = cydriver.CU_GRAPH_KERNEL_NODE_PORT_DEFAULT + +#: This port activates when all blocks of the kernel have performed +#: cudaTriggerProgrammaticLaunchCompletion() or have terminated. It must be +#: used with edge type :py:obj:`~.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC`. +#: See also :py:obj:`~.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`. +CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = cydriver.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC + +#: This port activates when all blocks of the kernel have begun execution. +#: See also :py:obj:`~.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`. +CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = cydriver.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER + +CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = cydriver.CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW + +CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = cydriver.CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE + +CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION = cydriver.CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION + +CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = cydriver.CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE + +CU_KERNEL_NODE_ATTRIBUTE_PRIORITY = cydriver.CU_KERNEL_NODE_ATTRIBUTE_PRIORITY + +CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = cydriver.CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP + +CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = cydriver.CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN + +CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = cydriver.CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION + +CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = cydriver.CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE + +CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = cydriver.CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + +CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = cydriver.CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW + +CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = cydriver.CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY + +CU_STREAM_ATTRIBUTE_PRIORITY = cydriver.CU_STREAM_ATTRIBUTE_PRIORITY + +CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = cydriver.CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP + +CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN = cydriver.CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN + +#: If set, host memory is portable between CUDA contexts. Flag for +#: :py:obj:`~.cuMemHostAlloc()` +CU_MEMHOSTALLOC_PORTABLE = cydriver.CU_MEMHOSTALLOC_PORTABLE + +#: If set, host memory is mapped into CUDA address space and +#: :py:obj:`~.cuMemHostGetDevicePointer()` may be called on the host +#: pointer. Flag for :py:obj:`~.cuMemHostAlloc()` +CU_MEMHOSTALLOC_DEVICEMAP = cydriver.CU_MEMHOSTALLOC_DEVICEMAP + +#: If set, host memory is allocated as write-combined - fast to write, +#: faster to DMA, slow to read except via SSE4 streaming load instruction +#: (MOVNTDQA). Flag for :py:obj:`~.cuMemHostAlloc()` +CU_MEMHOSTALLOC_WRITECOMBINED = cydriver.CU_MEMHOSTALLOC_WRITECOMBINED + +#: If set, host memory is portable between CUDA contexts. Flag for +#: :py:obj:`~.cuMemHostRegister()` +CU_MEMHOSTREGISTER_PORTABLE = cydriver.CU_MEMHOSTREGISTER_PORTABLE + +#: If set, host memory is mapped into CUDA address space and +#: :py:obj:`~.cuMemHostGetDevicePointer()` may be called on the host +#: pointer. Flag for :py:obj:`~.cuMemHostRegister()` +CU_MEMHOSTREGISTER_DEVICEMAP = cydriver.CU_MEMHOSTREGISTER_DEVICEMAP + +#: If set, the passed memory pointer is treated as pointing to some memory- +#: mapped I/O space, e.g. belonging to a third-party PCIe device. On +#: Windows the flag is a no-op. On Linux that memory is marked as non +#: cache-coherent for the GPU and is expected to be physically contiguous. +#: It may return :py:obj:`~.CUDA_ERROR_NOT_PERMITTED` if run as an +#: unprivileged user, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` on older Linux +#: kernel versions. On all other platforms, it is not supported and +#: :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` is returned. Flag for +#: :py:obj:`~.cuMemHostRegister()` +CU_MEMHOSTREGISTER_IOMEMORY = cydriver.CU_MEMHOSTREGISTER_IOMEMORY + +#: If set, the passed memory pointer is treated as pointing to memory that +#: is considered read-only by the device. On platforms without +#: :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, +#: this flag is required in order to register memory mapped to the CPU as +#: read-only. Support for the use of this flag can be queried from the +#: device attribute +#: :py:obj:`~.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`. Using +#: this flag with a current context associated with a device that does not +#: have this attribute set will cause :py:obj:`~.cuMemHostRegister` to +#: error with :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`. +CU_MEMHOSTREGISTER_READ_ONLY = cydriver.CU_MEMHOSTREGISTER_READ_ONLY + +#: Indicates that the layered sparse CUDA array or CUDA mipmapped array has +#: a single mip tail region for all layers +CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL = cydriver.CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + +#: Size of tensor map descriptor +CU_TENSOR_MAP_NUM_QWORDS = cydriver.CU_TENSOR_MAP_NUM_QWORDS + +#: Indicates that the external memory object is a dedicated resource +CUDA_EXTERNAL_MEMORY_DEDICATED = cydriver.CUDA_EXTERNAL_MEMORY_DEDICATED + +#: 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. +CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC = cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_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. +CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC = cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC + +#: 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`. +CUDA_NVSCISYNC_ATTR_SIGNAL = cydriver.CUDA_NVSCISYNC_ATTR_SIGNAL + +#: 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`. +CUDA_NVSCISYNC_ATTR_WAIT = cydriver.CUDA_NVSCISYNC_ATTR_WAIT + +#: This flag if set indicates that the memory will be used as a tile pool. +CU_MEM_CREATE_USAGE_TILE_POOL = cydriver.CU_MEM_CREATE_USAGE_TILE_POOL + +#: This flag, if set, indicates that the memory will be used as a buffer +#: for hardware accelerated decompression. +CU_MEM_CREATE_USAGE_HW_DECOMPRESS = cydriver.CU_MEM_CREATE_USAGE_HW_DECOMPRESS + +#: This flag, if set, indicates that the memory will be used as a buffer +#: for hardware accelerated decompression. +CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS = cydriver.CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS + +#: If set, each kernel launched as part of +#: :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` only waits for prior +#: work in the stream corresponding to that GPU to complete before the +#: kernel begins execution. +CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = cydriver.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC + +#: If set, any subsequent work pushed in a stream that participated in a +#: call to :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` will only wait +#: for the kernel launched on the GPU corresponding to that stream to +#: complete before it begins execution. +CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = cydriver.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC + +#: 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. +CUDA_ARRAY3D_LAYERED = cydriver.CUDA_ARRAY3D_LAYERED + +#: Deprecated, use CUDA_ARRAY3D_LAYERED +CUDA_ARRAY3D_2DARRAY = cydriver.CUDA_ARRAY3D_2DARRAY + +#: This flag must be set in order to bind a surface reference to the CUDA +#: array +CUDA_ARRAY3D_SURFACE_LDST = cydriver.CUDA_ARRAY3D_SURFACE_LDST + +#: If set, the CUDA array is a collection of six 2D arrays, representing +#: faces of a cube. The width of such a CUDA array must be equal to its +#: height, and Depth must be six. If :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag +#: is also set, then the CUDA array is a collection of cubemaps and Depth +#: must be a multiple of six. +CUDA_ARRAY3D_CUBEMAP = cydriver.CUDA_ARRAY3D_CUBEMAP + +#: This flag must be set in order to perform texture gather operations on a +#: CUDA array. +CUDA_ARRAY3D_TEXTURE_GATHER = cydriver.CUDA_ARRAY3D_TEXTURE_GATHER + +#: This flag if set indicates that the CUDA array is a DEPTH_TEXTURE. +CUDA_ARRAY3D_DEPTH_TEXTURE = cydriver.CUDA_ARRAY3D_DEPTH_TEXTURE + +#: This flag indicates that the CUDA array may be bound as a color target +#: in an external graphics API +CUDA_ARRAY3D_COLOR_ATTACHMENT = cydriver.CUDA_ARRAY3D_COLOR_ATTACHMENT + +#: This flag if set indicates that the CUDA array or CUDA mipmapped array +#: is a sparse CUDA array or CUDA mipmapped array respectively +CUDA_ARRAY3D_SPARSE = cydriver.CUDA_ARRAY3D_SPARSE + +#: This flag if set indicates that the CUDA array or CUDA mipmapped array +#: will allow deferred memory mapping +CUDA_ARRAY3D_DEFERRED_MAPPING = cydriver.CUDA_ARRAY3D_DEFERRED_MAPPING + +#: This flag indicates that the CUDA array will be used for hardware +#: accelerated video encode/decode operations. +CUDA_ARRAY3D_VIDEO_ENCODE_DECODE = cydriver.CUDA_ARRAY3D_VIDEO_ENCODE_DECODE + +#: Override the texref format with a format inferred from the array. Flag +#: for :py:obj:`~.cuTexRefSetArray()` +CU_TRSA_OVERRIDE_FORMAT = cydriver.CU_TRSA_OVERRIDE_FORMAT + +#: Read the texture as integers rather than promoting the values to floats +#: in the range [0,1]. Flag for :py:obj:`~.cuTexRefSetFlags()` and +#: :py:obj:`~.cuTexObjectCreate()` +CU_TRSF_READ_AS_INTEGER = cydriver.CU_TRSF_READ_AS_INTEGER + +#: Use normalized texture coordinates in the range [0,1) instead of +#: [0,dim). Flag for :py:obj:`~.cuTexRefSetFlags()` and +#: :py:obj:`~.cuTexObjectCreate()` +CU_TRSF_NORMALIZED_COORDINATES = cydriver.CU_TRSF_NORMALIZED_COORDINATES + +#: Perform sRGB->linear conversion during texture read. Flag for +#: :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` +CU_TRSF_SRGB = cydriver.CU_TRSF_SRGB + +#: Disable any trilinear filtering optimizations. Flag for +#: :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` +CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = cydriver.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION + +#: Enable seamless cube map filtering. Flag for +#: :py:obj:`~.cuTexObjectCreate()` +CU_TRSF_SEAMLESS_CUBEMAP = cydriver.CU_TRSF_SEAMLESS_CUBEMAP + +#: Launch with the required block dimension. +CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM = cydriver.CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM + +#: C++ compile time constant for CU_LAUNCH_PARAM_END +CU_LAUNCH_PARAM_END_AS_INT = cydriver.CU_LAUNCH_PARAM_END_AS_INT + +#: End of array terminator for the `extra` parameter to +#: :py:obj:`~.cuLaunchKernel` +CU_LAUNCH_PARAM_END = cydriver.CU_LAUNCH_PARAM_END + +#: C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_POINTER +CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT = cydriver.CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT + +#: 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. +CU_LAUNCH_PARAM_BUFFER_POINTER = cydriver.CU_LAUNCH_PARAM_BUFFER_POINTER + +#: C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_SIZE +CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT = cydriver.CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT + +#: 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. +CU_LAUNCH_PARAM_BUFFER_SIZE = cydriver.CU_LAUNCH_PARAM_BUFFER_SIZE + +#: For texture references loaded into the module, use default texunit from +#: texture reference. +CU_PARAM_TR_DEFAULT = cydriver.CU_PARAM_TR_DEFAULT + +#: Device that represents the CPU +CU_DEVICE_CPU = cydriver.CU_DEVICE_CPU + +#: Device that represents an invalid device +CU_DEVICE_INVALID = cydriver.CU_DEVICE_INVALID + +RESOURCE_ABI_VERSION = cydriver.RESOURCE_ABI_VERSION + +RESOURCE_ABI_EXTERNAL_BYTES = cydriver.RESOURCE_ABI_EXTERNAL_BYTES + +#: Maximum number of planes per frame +MAX_PLANES = cydriver.MAX_PLANES + +#: Indicates that timeout for :py:obj:`~.cuEGLStreamConsumerAcquireFrame` +#: is infinite. +CUDA_EGL_INFINITE_TIMEOUT = cydriver.CUDA_EGL_INFINITE_TIMEOUT + +class CUipcMem_flags(_FastEnum): + """ + CUDA Ipc Mem Flags + """ + + + 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' + ) + +class CUmemAttach_flags(_FastEnum): + """ + CUDA Mem Attach Flags + """ + + + CU_MEM_ATTACH_GLOBAL = ( + cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_GLOBAL, + 'Memory can be accessed by any stream on any device\n' + ) + + + CU_MEM_ATTACH_HOST = ( + cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_HOST, + 'Memory cannot be accessed by any stream on any device\n' + ) + + + 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' + ) + +class CUctx_flags(_FastEnum): + """ + Context creation flags + """ + + + CU_CTX_SCHED_AUTO = ( + cydriver.CUctx_flags_enum.CU_CTX_SCHED_AUTO, + 'Automatic scheduling\n' + ) + + + CU_CTX_SCHED_SPIN = ( + cydriver.CUctx_flags_enum.CU_CTX_SCHED_SPIN, + 'Set spin as default scheduling\n' + ) + + + CU_CTX_SCHED_YIELD = ( + cydriver.CUctx_flags_enum.CU_CTX_SCHED_YIELD, + 'Set yield as default scheduling\n' + ) + + + CU_CTX_SCHED_BLOCKING_SYNC = ( + cydriver.CUctx_flags_enum.CU_CTX_SCHED_BLOCKING_SYNC, + 'Set blocking synchronization as default scheduling\n' + ) + + + CU_CTX_BLOCKING_SYNC = ( + cydriver.CUctx_flags_enum.CU_CTX_BLOCKING_SYNC, + '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' + ) + + + CU_CTX_LMEM_RESIZE_TO_MAX = ( + cydriver.CUctx_flags_enum.CU_CTX_LMEM_RESIZE_TO_MAX, + 'Keep local memory allocation after launch\n' + ) + + + CU_CTX_COREDUMP_ENABLE = ( + cydriver.CUctx_flags_enum.CU_CTX_COREDUMP_ENABLE, + 'Trigger coredumps from exceptions in this context\n' + ) + + + CU_CTX_USER_COREDUMP_ENABLE = ( + cydriver.CUctx_flags_enum.CU_CTX_USER_COREDUMP_ENABLE, + 'Enable user pipe to trigger coredumps in this context\n' + ) + + + CU_CTX_SYNC_MEMOPS = ( + cydriver.CUctx_flags_enum.CU_CTX_SYNC_MEMOPS, + 'Ensure synchronous memory operations on this context will synchronize\n' + ) + + CU_CTX_FLAGS_MASK = cydriver.CUctx_flags_enum.CU_CTX_FLAGS_MASK + +class CUevent_sched_flags(_FastEnum): + """ + Event sched flags + """ + + + CU_EVENT_SCHED_AUTO = ( + cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_AUTO, + 'Automatic scheduling\n' + ) + + + CU_EVENT_SCHED_SPIN = ( + cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_SPIN, + 'Set spin as default scheduling\n' + ) + + + CU_EVENT_SCHED_YIELD = ( + cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_YIELD, + 'Set yield as default scheduling\n' + ) + + + CU_EVENT_SCHED_BLOCKING_SYNC = ( + cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_BLOCKING_SYNC, + 'Set blocking synchronization as default scheduling\n' + ) + +class cl_event_flags(_FastEnum): + """ + NVCL event scheduling flags + """ + + + NVCL_EVENT_SCHED_AUTO = ( + cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_AUTO, + 'Automatic scheduling\n' + ) + + + NVCL_EVENT_SCHED_SPIN = ( + cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_SPIN, + 'Set spin as default scheduling\n' + ) + + + NVCL_EVENT_SCHED_YIELD = ( + cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_YIELD, + 'Set yield as default scheduling\n' + ) + + + NVCL_EVENT_SCHED_BLOCKING_SYNC = ( + cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_BLOCKING_SYNC, + 'Set blocking synchronization as default scheduling\n' + ) + +class cl_context_flags(_FastEnum): + """ + NVCL context scheduling flags + """ + + + NVCL_CTX_SCHED_AUTO = ( + cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_AUTO, + 'Automatic scheduling\n' + ) + + + NVCL_CTX_SCHED_SPIN = ( + cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_SPIN, + 'Set spin as default scheduling\n' + ) + + + NVCL_CTX_SCHED_YIELD = ( + cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_YIELD, + 'Set yield as default scheduling\n' + ) + + + NVCL_CTX_SCHED_BLOCKING_SYNC = ( + cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_BLOCKING_SYNC, + 'Set blocking synchronization as default scheduling\n' + ) + +class CUstream_flags(_FastEnum): + """ + Stream creation flags + """ + + + CU_STREAM_DEFAULT = ( + cydriver.CUstream_flags_enum.CU_STREAM_DEFAULT, + 'Default stream flag\n' + ) + + + CU_STREAM_NON_BLOCKING = ( + cydriver.CUstream_flags_enum.CU_STREAM_NON_BLOCKING, + 'Stream does not synchronize with stream 0 (the NULL stream)\n' + ) + +class CUevent_flags(_FastEnum): + """ + Event creation flags + """ + + + CU_EVENT_DEFAULT = ( + cydriver.CUevent_flags_enum.CU_EVENT_DEFAULT, + 'Default event flag\n' + ) + + + CU_EVENT_BLOCKING_SYNC = ( + cydriver.CUevent_flags_enum.CU_EVENT_BLOCKING_SYNC, + 'Event uses blocking synchronization\n' + ) + + + CU_EVENT_DISABLE_TIMING = ( + cydriver.CUevent_flags_enum.CU_EVENT_DISABLE_TIMING, + 'Event will not record timing data\n' + ) + + + CU_EVENT_INTERPROCESS = ( + cydriver.CUevent_flags_enum.CU_EVENT_INTERPROCESS, + 'Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set\n' + ) + +class CUevent_record_flags(_FastEnum): + """ + Event record flags + """ + + + CU_EVENT_RECORD_DEFAULT = ( + cydriver.CUevent_record_flags_enum.CU_EVENT_RECORD_DEFAULT, + 'Default event record flag\n' + ) + + + 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' + ) + +class CUevent_wait_flags(_FastEnum): + """ + Event wait flags + """ + + + CU_EVENT_WAIT_DEFAULT = ( + cydriver.CUevent_wait_flags_enum.CU_EVENT_WAIT_DEFAULT, + 'Default event wait flag\n' + ) + + + 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' + ) + +class CUstreamWaitValue_flags(_FastEnum): + """ + Flags for :py:obj:`~.cuStreamWaitValue32` and + :py:obj:`~.cuStreamWaitValue64` + """ + + + 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' + ) + + + CU_STREAM_WAIT_VALUE_EQ = ( + cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_EQ, + 'Wait until *addr == value.\n' + ) + + + CU_STREAM_WAIT_VALUE_AND = ( + cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_AND, + 'Wait until (*addr & value) != 0.\n' + ) + + + 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' + ) + + + CU_STREAM_WAIT_VALUE_FLUSH = ( + cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_FLUSH, + 'Follow the wait operation with a flush of outstanding remote writes. This\n' + 'means that, if a remote write operation is guaranteed to have reached the\n' + 'device before the wait can be satisfied, that write is guaranteed to be\n' + 'visible to downstream device work. The device is permitted to reorder\n' + 'remote writes internally. For example, this flag would be required if two\n' + 'remote writes arrive in a defined order, the wait is satisfied by the\n' + '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' + ) + +class CUstreamWriteValue_flags(_FastEnum): + """ + Flags for :py:obj:`~.cuStreamWriteValue32` + """ + + + CU_STREAM_WRITE_VALUE_DEFAULT = ( + cydriver.CUstreamWriteValue_flags_enum.CU_STREAM_WRITE_VALUE_DEFAULT, + 'Default behavior\n' + ) + + + CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = ( + cydriver.CUstreamWriteValue_flags_enum.CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER, + 'Permits the write to be reordered with writes which were issued before it,\n' + 'as a performance optimization. Normally, :py:obj:`~.cuStreamWriteValue32`\n' + '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' + ) + +class CUstreamBatchMemOpType(_FastEnum): + """ + Operations for :py:obj:`~.cuStreamBatchMemOp` + """ + + + CU_STREAM_MEM_OP_WAIT_VALUE_32 = ( + cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WAIT_VALUE_32, + 'Represents a :py:obj:`~.cuStreamWaitValue32` operation\n' + ) + + + CU_STREAM_MEM_OP_WRITE_VALUE_32 = ( + cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WRITE_VALUE_32, + 'Represents a :py:obj:`~.cuStreamWriteValue32` operation\n' + ) + + + 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' + ) + + + CU_STREAM_MEM_OP_WAIT_VALUE_64 = ( + cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WAIT_VALUE_64, + 'Represents a :py:obj:`~.cuStreamWaitValue64` operation\n' + ) + + + CU_STREAM_MEM_OP_WRITE_VALUE_64 = ( + cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WRITE_VALUE_64, + 'Represents a :py:obj:`~.cuStreamWriteValue64` operation\n' + ) + + + CU_STREAM_MEM_OP_BARRIER = ( + cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_BARRIER, + 'Insert a memory barrier of the specified type\n' + ) + +class CUstreamMemoryBarrier_flags(_FastEnum): + """ + Flags for :py:obj:`~.CUstreamBatchMemOpParams.memoryBarrier` + """ + + + CU_STREAM_MEMORY_BARRIER_TYPE_SYS = ( + cydriver.CUstreamMemoryBarrier_flags_enum.CU_STREAM_MEMORY_BARRIER_TYPE_SYS, + 'System-wide memory barrier.\n' + ) + + + CU_STREAM_MEMORY_BARRIER_TYPE_GPU = ( + cydriver.CUstreamMemoryBarrier_flags_enum.CU_STREAM_MEMORY_BARRIER_TYPE_GPU, + 'Limit memory barrier scope to the GPU.\n' + ) + +class CUoccupancy_flags(_FastEnum): + """ + Occupancy calculator flag + """ + + + CU_OCCUPANCY_DEFAULT = ( + cydriver.CUoccupancy_flags_enum.CU_OCCUPANCY_DEFAULT, + 'Default behavior\n' + ) + + + 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' + ) + +class CUstreamUpdateCaptureDependencies_flags(_FastEnum): + """ + Flags for :py:obj:`~.cuStreamUpdateCaptureDependencies` + """ + + + CU_STREAM_ADD_CAPTURE_DEPENDENCIES = ( + cydriver.CUstreamUpdateCaptureDependencies_flags_enum.CU_STREAM_ADD_CAPTURE_DEPENDENCIES, + 'Add new nodes to the dependency set\n' + ) + + + CU_STREAM_SET_CAPTURE_DEPENDENCIES = ( + cydriver.CUstreamUpdateCaptureDependencies_flags_enum.CU_STREAM_SET_CAPTURE_DEPENDENCIES, + 'Replace the dependency set with the new nodes\n' + ) + +class CUasyncNotificationType(_FastEnum): + """ + Types of async notification that can be sent + """ + + + 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' + ) + +class CUarray_format(_FastEnum): + """ + Array formats + """ + + + CU_AD_FORMAT_UNSIGNED_INT8 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8, + 'Unsigned 8-bit integers\n' + ) + + + CU_AD_FORMAT_UNSIGNED_INT16 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16, + 'Unsigned 16-bit integers\n' + ) + + + CU_AD_FORMAT_UNSIGNED_INT32 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32, + 'Unsigned 32-bit integers\n' + ) + + + CU_AD_FORMAT_SIGNED_INT8 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8, + 'Signed 8-bit integers\n' + ) + + + CU_AD_FORMAT_SIGNED_INT16 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16, + 'Signed 16-bit integers\n' + ) + + + CU_AD_FORMAT_SIGNED_INT32 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32, + 'Signed 32-bit integers\n' + ) + + + CU_AD_FORMAT_HALF = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF, + '16-bit floating point\n' + ) + + + CU_AD_FORMAT_FLOAT = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT, + '32-bit floating point\n' + ) + + + 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' + ) + + + CU_AD_FORMAT_BC1_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM, + '4 channel unsigned normalized block-compressed (BC1 compression) format\n' + ) + + + 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' + ) + + + CU_AD_FORMAT_BC2_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM, + '4 channel unsigned normalized block-compressed (BC2 compression) format\n' + ) + + + 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' + ) + + + CU_AD_FORMAT_BC3_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM, + '4 channel unsigned normalized block-compressed (BC3 compression) format\n' + ) + + + 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' + ) + + + CU_AD_FORMAT_BC4_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM, + '1 channel unsigned normalized block-compressed (BC4 compression) format\n' + ) + + + CU_AD_FORMAT_BC4_SNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM, + '1 channel signed normalized block-compressed (BC4 compression) format\n' + ) + + + CU_AD_FORMAT_BC5_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM, + '2 channel unsigned normalized block-compressed (BC5 compression) format\n' + ) + + + CU_AD_FORMAT_BC5_SNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM, + '2 channel signed normalized block-compressed (BC5 compression) format\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_AD_FORMAT_BC7_UNORM = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM, + '4 channel unsigned normalized block-compressed (BC7 compression) format\n' + ) + + + 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' + ) + + + CU_AD_FORMAT_P010 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_P010, + '10-bit YUV planar format, with 4:2:0 sampling\n' + ) + + + CU_AD_FORMAT_P016 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_P016, + '16-bit YUV planar format, with 4:2:0 sampling\n' + ) + + + CU_AD_FORMAT_NV16 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_NV16, + '8-bit YUV planar format, with 4:2:2 sampling\n' + ) + + + CU_AD_FORMAT_P210 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_P210, + '10-bit YUV planar format, with 4:2:2 sampling\n' + ) + + + CU_AD_FORMAT_P216 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_P216, + '16-bit YUV planar format, with 4:2:2 sampling\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_AD_FORMAT_Y410 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_Y410, + '10-bit YUV packed planar format, with 4:4:4 sampling\n' + ) + + + CU_AD_FORMAT_NV12 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_NV12, + '8-bit YUV planar format, with 4:2:0 sampling\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_AD_FORMAT_UNORM_INT8X1 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X1, + '1 channel unsigned 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_UNORM_INT8X2 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X2, + '2 channel unsigned 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_UNORM_INT8X4 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X4, + '4 channel unsigned 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_UNORM_INT16X1 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X1, + '1 channel unsigned 16-bit normalized integer\n' + ) + + + CU_AD_FORMAT_UNORM_INT16X2 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X2, + '2 channel unsigned 16-bit normalized integer\n' + ) + + + CU_AD_FORMAT_UNORM_INT16X4 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X4, + '4 channel unsigned 16-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT8X1 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X1, + '1 channel signed 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT8X2 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X2, + '2 channel signed 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT8X4 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X4, + '4 channel signed 8-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT16X1 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X1, + '1 channel signed 16-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT16X2 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X2, + '2 channel signed 16-bit normalized integer\n' + ) + + + CU_AD_FORMAT_SNORM_INT16X4 = ( + cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X4, + '4 channel signed 16-bit normalized integer\n' + ) + + CU_AD_FORMAT_MAX = cydriver.CUarray_format_enum.CU_AD_FORMAT_MAX + +class CUaddress_mode(_FastEnum): + """ + Texture reference addressing modes + """ + + + CU_TR_ADDRESS_MODE_WRAP = ( + cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_WRAP, + 'Wrapping address mode\n' + ) + + + CU_TR_ADDRESS_MODE_CLAMP = ( + cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_CLAMP, + 'Clamp to edge address mode\n' + ) + + + CU_TR_ADDRESS_MODE_MIRROR = ( + cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_MIRROR, + 'Mirror address mode\n' + ) + + + CU_TR_ADDRESS_MODE_BORDER = ( + cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_BORDER, + 'Border address mode\n' + ) + +class CUfilter_mode(_FastEnum): + """ + Texture reference filtering modes + """ + + + CU_TR_FILTER_MODE_POINT = ( + cydriver.CUfilter_mode_enum.CU_TR_FILTER_MODE_POINT, + 'Point filter mode\n' + ) + + + CU_TR_FILTER_MODE_LINEAR = ( + cydriver.CUfilter_mode_enum.CU_TR_FILTER_MODE_LINEAR, + 'Linear filter mode\n' + ) + +class CUdevice_attribute(_FastEnum): + """ + Device properties + """ + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, + 'Maximum block dimension X\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, + 'Maximum block dimension Y\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, + 'Maximum block dimension Z\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, + 'Maximum grid dimension X\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, + 'Maximum grid dimension Y\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, + 'Maximum grid dimension Z\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_WARP_SIZE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_WARP_SIZE, + 'Warp size in threads\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_PITCH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_PITCH, + 'Maximum pitch in bytes allowed by memory copies\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_CLOCK_RATE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, + 'Typical clock frequency in kilohertz\n' + ) + + + CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, + 'Alignment requirement for textures\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, + 'Number of multiprocessors on device\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_INTEGRATED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_INTEGRATED, + 'Device is integrated with host memory\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, + 'Compute mode (See :py:obj:`~.CUcomputemode` for details)\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, + 'Maximum 1D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, + 'Maximum 2D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, + 'Maximum 2D texture height\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, + 'Maximum 3D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, + 'Maximum 3D texture height\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, + 'Maximum 3D texture depth\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, + 'Maximum 2D layered texture width\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, + 'Maximum 2D layered texture height\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, + 'Alignment requirement for surfaces\n' + ) + + + CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, + 'Device can possibly execute multiple kernels concurrently\n' + ) + + + CU_DEVICE_ATTRIBUTE_ECC_ENABLED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, + 'Device has ECC support enabled\n' + ) + + + CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, + 'PCI bus ID of the device\n' + ) + + + CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, + 'PCI device ID of the device\n' + ) + + + CU_DEVICE_ATTRIBUTE_TCC_DRIVER = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, + 'Device is using TCC driver model\n' + ) + + + CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, + 'Peak memory clock frequency in kilohertz\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, + 'Size of L2 cache in bytes\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, + 'Maximum resident threads per multiprocessor\n' + ) + + + CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, + 'Number of asynchronous engines\n' + ) + + + CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, + 'Device shares a unified address space with the host\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, + 'Maximum 1D layered texture width\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER, + 'Deprecated, do not use.\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, + 'Alternate maximum 3D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, + 'Alternate maximum 3D texture height\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, + 'Alternate maximum 3D texture depth\n' + ) + + + CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, + 'PCI domain ID of the device\n' + ) + + + CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, + 'Pitch alignment requirement for textures\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, + 'Maximum cubemap texture width/height\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, + 'Maximum 1D surface width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, + 'Maximum 2D surface width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, + 'Maximum 2D surface height\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, + 'Maximum 3D surface width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, + 'Maximum 3D surface height\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, + 'Maximum 3D surface depth\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, + 'Maximum 1D layered surface width\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, + 'Maximum 2D layered surface width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, + 'Maximum 2D layered surface height\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, + 'Maximum cubemap surface width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, + 'Maximum cubemap layered surface width\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, + 'Maximum 2D linear texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, + 'Maximum 2D linear texture height\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, + 'Maximum mipmapped 2D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, + 'Maximum mipmapped 2D texture height\n' + ) + + + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, + 'Major compute capability version number\n' + ) + + + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, + 'Minor compute capability version number\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, + 'Maximum mipmapped 1D texture width\n' + ) + + + CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, + 'Device supports stream priorities\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, + 'Device can allocate managed memory on this system\n' + ) + + + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, + 'Device is on a multi-GPU board\n' + ) + + + 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' + ) + + + 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 native atomic operations\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, + 'Device supports compute preemption.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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" + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED, + 'Device supports compression of memory\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING, + 'GPUDirect RDMA writes to the device do not need to be flushed for consumers\n' + 'within the scope indicated by the returned attribute. See\n' + ':py:obj:`~.CUGPUDirectRDMAWritesOrdering` for the numerical values returned\n' + 'here.\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH, + 'Indicates device supports cluster launch\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED, + 'Device supports IPC Events.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS, + 'Device supports unified function pointers.\n' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_NUMA_ID = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_NUMA_ID, + 'NUMA node ID of the GPU memory\n' + ) + + + CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED, + 'Device supports switch multicast and reduction operations.\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED, + 'Device supports CIG with D3D12.\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED, + 'Device supports CIG with Vulkan.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX + +class CUpointer_attribute(_FastEnum): + """ + Pointer information + """ + + + 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' + ) + + + 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' + ) + + + 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" + ) + + + 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" + ) + + + 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' + ) + + + CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = ( + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + 'Synchronize every synchronous memory operation initiated on this region\n' + ) + + + 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' + ) + + + CU_POINTER_ATTRIBUTE_IS_MANAGED = ( + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, + 'Indicates if the pointer points to managed memory\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = ( + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR, + 'Starting address for this requested pointer\n' + ) + + + CU_POINTER_ATTRIBUTE_RANGE_SIZE = ( + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE, + 'Size of the address range for this requested pointer\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUfunction_attribute(_FastEnum): + """ + Function properties + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_FUNC_ATTRIBUTE_PTX_VERSION = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, + 'The PTX virtual architecture version for which the function was compiled.\n' + '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' + ) + + + CU_FUNC_ATTRIBUTE_BINARY_VERSION = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, + 'The binary architecture version for which the function was compiled. This\n' + 'value is the major binary version * 10 + the minor binary version, so a\n' + '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' + ) + + + 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' + ) + + + CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, + 'The maximum size in bytes of dynamically-allocated shared memory that can\n' + 'be used by this function. If the user-specified dynamic shared memory size\n' + 'is larger than this value, the launch will fail. See\n' + ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + ) + + + CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, + 'On devices where the L1 cache and shared memory use the same hardware\n' + 'resources, this sets the shared memory carveout preference, in percent of\n' + 'the total shared memory. Refer to\n' + ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`. This\n' + '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' + ) + + + 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' + ) + + + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH, + 'The required cluster width in blocks. The values must either all be 0 or\n' + 'all be positive. The validity of the cluster dimensions is otherwise\n' + 'checked at launch time.\n' + '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' + ) + + + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT, + 'The required cluster height in blocks. The values must either all be 0 or\n' + 'all be positive. The validity of the cluster dimensions is otherwise\n' + 'checked at launch time.\n' + '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' + ) + + + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH, + 'The required cluster depth in blocks. The values must either all be 0 or\n' + 'all be positive. The validity of the cluster dimensions is otherwise\n' + 'checked at launch time.\n' + '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' + ) + + + CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED, + 'Whether the function can be launched with non-portable cluster size. 1 is\n' + 'allowed, 0 is disallowed. A non-portable cluster size may only function on\n' + 'the specific SKUs the program is tested on. The launch might fail if the\n' + 'program is run on a different hardware platform.\n' + 'CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking\n' + 'whether the desired size can be launched on the current device.\n' + 'Portable Cluster Size\n' + 'A portable cluster size is guaranteed to be functional on all compute\n' + 'capabilities higher than the target compute capability. The portable\n' + 'cluster size for sm_90 is 8 blocks per cluster. This value may increase for\n' + 'future compute capabilities.\n' + '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' + ) + + + 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' + ':py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. See\n' + ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + ) + + CU_FUNC_ATTRIBUTE_MAX = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX + +class CUfunc_cache(_FastEnum): + """ + Function cache configurations + """ + + + CU_FUNC_CACHE_PREFER_NONE = ( + cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_NONE, + 'no preference for shared memory or L1 (default)\n' + ) + + + CU_FUNC_CACHE_PREFER_SHARED = ( + cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_SHARED, + 'prefer larger shared memory and smaller L1 cache\n' + ) + + + CU_FUNC_CACHE_PREFER_L1 = ( + cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_L1, + 'prefer larger L1 cache and smaller shared memory\n' + ) + + + CU_FUNC_CACHE_PREFER_EQUAL = ( + cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_EQUAL, + 'prefer equal sized L1 cache and shared memory\n' + ) + +class CUsharedconfig(_FastEnum): + """ + [Deprecated] Shared memory configurations + """ + + + CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = ( + cydriver.CUsharedconfig_enum.CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE, + 'set default shared memory bank size\n' + ) + + + 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' + ) + + + 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' + ) + +class CUshared_carveout(_FastEnum): + """ + Shared memory carveout configurations. These may be passed to + :py:obj:`~.cuFuncSetAttribute` or :py:obj:`~.cuKernelSetAttribute` + """ + + + CU_SHAREDMEM_CARVEOUT_DEFAULT = ( + cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_DEFAULT, + 'No preference for shared memory or L1 (default)\n' + ) + + + CU_SHAREDMEM_CARVEOUT_MAX_L1 = ( + cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_MAX_L1, + 'Prefer maximum available L1 cache, minimum shared memory\n' + ) + + + CU_SHAREDMEM_CARVEOUT_MAX_SHARED = ( + cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_MAX_SHARED, + 'Prefer maximum available shared memory, minimum L1 cache\n' + ) + +class CUmemorytype(_FastEnum): + """ + Memory types + """ + + + CU_MEMORYTYPE_HOST = ( + cydriver.CUmemorytype_enum.CU_MEMORYTYPE_HOST, + 'Host memory\n' + ) + + + CU_MEMORYTYPE_DEVICE = ( + cydriver.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, + 'Device memory\n' + ) + + + CU_MEMORYTYPE_ARRAY = ( + cydriver.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, + 'Array memory\n' + ) + + + CU_MEMORYTYPE_UNIFIED = ( + cydriver.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, + 'Unified device or host memory\n' + ) + +class CUcomputemode(_FastEnum): + """ + Compute Modes + """ + + + CU_COMPUTEMODE_DEFAULT = ( + cydriver.CUcomputemode_enum.CU_COMPUTEMODE_DEFAULT, + 'Default compute mode (Multiple contexts allowed per device)\n' + ) + + + 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' + ) + + + 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' + ) + +class CUmem_advise(_FastEnum): + """ + Memory advise 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = ( + cydriver.CUmem_advise_enum.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION, + 'Clear the preferred location for the data\n' + ) + + + 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' + ) + + + 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' + ) + +class CUmem_range_attribute(_FastEnum): + """ + + """ + + + 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' + ) + + + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = ( + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + 'The preferred location of the range\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUjit_option(_FastEnum): + """ + Online compiler and linker options + """ + + + 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' + ) + + + CU_JIT_THREADS_PER_BLOCK = ( + cydriver.CUjit_option_enum.CU_JIT_THREADS_PER_BLOCK, + 'IN: Specifies minimum number of threads per block to target compilation for\n' + 'OUT: Returns the number of threads the compiler actually targeted. This\n' + 'restricts the resource utilization of the compiler (e.g. max registers)\n' + 'such that a block with the given number of threads should be able to launch\n' + 'based on register limitations. Note, this option does not currently take\n' + 'into account any other resource limitations, such as shared memory\n' + 'utilization.\n' + 'Cannot be combined with :py:obj:`~.CU_JIT_TARGET`.\n' + 'Option type: unsigned int\n' + 'Applies to: compiler only\n' + ) + + + CU_JIT_WALL_TIME = ( + cydriver.CUjit_option_enum.CU_JIT_WALL_TIME, + 'Overwrites the option value with the total wall clock time, in\n' + 'milliseconds, spent in the compiler and linker\n' + 'Option type: float\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_INFO_LOG_BUFFER = ( + cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER, + 'Pointer to a buffer in which to print any log messages that are\n' + 'informational in nature (the buffer size is specified via option\n' + ':py:obj:`~.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`)\n' + 'Option type: char *\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = ( + cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, + 'IN: Log buffer size in bytes. Log messages will be capped at this size\n' + '(including null terminator)\n' + 'OUT: Amount of log buffer filled with messages\n' + 'Option type: unsigned int\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_ERROR_LOG_BUFFER = ( + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER, + 'Pointer to a buffer in which to print any log messages that reflect errors\n' + '(the buffer size is specified via option\n' + ':py:obj:`~.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`)\n' + 'Option type: char *\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = ( + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES, + 'IN: Log buffer size in bytes. Log messages will be capped at this size\n' + '(including null terminator)\n' + 'OUT: Amount of log buffer filled with messages\n' + 'Option type: unsigned int\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_OPTIMIZATION_LEVEL = ( + cydriver.CUjit_option_enum.CU_JIT_OPTIMIZATION_LEVEL, + 'Level of optimizations to apply to generated code (0 - 4), with 4 being the\n' + 'default and highest level of optimizations.\n' + 'Option type: unsigned int\n' + 'Applies to: compiler only\n' + ) + + + CU_JIT_TARGET_FROM_CUCONTEXT = ( + cydriver.CUjit_option_enum.CU_JIT_TARGET_FROM_CUCONTEXT, + 'No option value required. Determines the target based on the current\n' + 'attached context (default)\n' + 'Option type: No option value needed\n' + 'Applies to: compiler and linker\n' + ) + + + CU_JIT_TARGET = ( + cydriver.CUjit_option_enum.CU_JIT_TARGET, + 'Target is chosen based on supplied :py:obj:`~.CUjit_target`. Cannot be\n' + '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' + ) + + + CU_JIT_FALLBACK_STRATEGY = ( + cydriver.CUjit_option_enum.CU_JIT_FALLBACK_STRATEGY, + 'Specifies choice of fallback strategy if matching cubin is not found.\n' + 'Choice is based on supplied :py:obj:`~.CUjit_fallback`. This option cannot\n' + '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' + ) + + + CU_JIT_GENERATE_DEBUG_INFO = ( + cydriver.CUjit_option_enum.CU_JIT_GENERATE_DEBUG_INFO, + 'Specifies whether to create debug information in output (-g) (0: false,\n' + 'default)\n' + 'Option type: int\n' + 'Applies to: compiler and linker\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_JIT_CACHE_MODE = ( + cydriver.CUjit_option_enum.CU_JIT_CACHE_MODE, + 'Specifies whether to enable caching explicitly (-dlcm)\n' + 'Choice is based on supplied :py:obj:`~.CUjit_cacheMode_enum`.\n' + 'Option type: unsigned int for enumerated type\n' + ':py:obj:`~.CUjit_cacheMode_enum`\n' + 'Applies to: compiler only\n' + ) + + + CU_JIT_NEW_SM3X_OPT = ( + cydriver.CUjit_option_enum.CU_JIT_NEW_SM3X_OPT, + '[Deprecated]\n' + ) + + + CU_JIT_FAST_COMPILE = ( + cydriver.CUjit_option_enum.CU_JIT_FAST_COMPILE, + 'This jit option is used for internal purpose only.\n' + ) + + + CU_JIT_GLOBAL_SYMBOL_NAMES = ( + cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_NAMES, + 'Array of device symbol names that will be relocated to the corresponding\n' + 'host addresses stored in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_ADDRESSES`.\n' + 'Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries.\n' + 'When loading a device module, driver will relocate all encountered\n' + 'unresolved symbols to the host addresses.\n' + 'It is only allowed to register symbols that correspond to unresolved global\n' + 'variables.\n' + 'It is illegal to register the same device symbol at multiple addresses.\n' + 'Option type: const char **\n' + 'Applies to: dynamic linker only\n' + ) + + + CU_JIT_GLOBAL_SYMBOL_ADDRESSES = ( + cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES, + 'Array of host addresses that will be used to relocate corresponding device\n' + 'symbols stored in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_NAMES`.\n' + 'Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries.\n' + 'Option type: void **\n' + 'Applies to: dynamic linker only\n' + ) + + + CU_JIT_GLOBAL_SYMBOL_COUNT = ( + cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_COUNT, + 'Number of entries in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_NAMES` and\n' + ':py:obj:`~.CU_JIT_GLOBAL_SYMBOL_ADDRESSES` arrays.\n' + 'Option type: unsigned int\n' + 'Applies to: dynamic linker only\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_JIT_MIN_CTA_PER_SM = ( + cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM, + 'This option hints to the JIT compiler the minimum number of CTAs from the\n' + 'kernel’s grid to be mapped to a SM. This option is ignored when used\n' + 'together with :py:obj:`~.CU_JIT_MAX_REGISTERS` or\n' + ':py:obj:`~.CU_JIT_THREADS_PER_BLOCK`. Optimizations based on this option\n' + 'need :py:obj:`~.CU_JIT_MAX_THREADS_PER_BLOCK` to be specified as well. For\n' + 'kernels already using PTX directive .minnctapersm, this option will be\n' + 'ignored by default. Use :py:obj:`~.CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to let\n' + 'this option take precedence over the PTX directive. Option type: unsigned\n' + 'int\n' + 'Applies to: compiler only\n' + ) + + + CU_JIT_MAX_THREADS_PER_BLOCK = ( + cydriver.CUjit_option_enum.CU_JIT_MAX_THREADS_PER_BLOCK, + 'Maximum number threads in a thread block, computed as the product of the\n' + 'maximum extent specifed for each dimension of the block. This limit is\n' + 'guaranteed not to be exeeded in any invocation of the kernel. Exceeding the\n' + 'the maximum number of threads results in runtime error or kernel launch\n' + 'failure. For kernels already using PTX directive .maxntid, this option will\n' + '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' + ) + + + CU_JIT_OVERRIDE_DIRECTIVE_VALUES = ( + cydriver.CUjit_option_enum.CU_JIT_OVERRIDE_DIRECTIVE_VALUES, + 'This option lets the values specified using\n' + ':py:obj:`~.CU_JIT_MAX_REGISTERS`, :py:obj:`~.CU_JIT_THREADS_PER_BLOCK`,\n' + ':py:obj:`~.CU_JIT_MAX_THREADS_PER_BLOCK` and\n' + ':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' + ) + + CU_JIT_NUM_OPTIONS = cydriver.CUjit_option_enum.CU_JIT_NUM_OPTIONS + +class CUjit_target(_FastEnum): + """ + Online compilation targets + """ + + + CU_TARGET_COMPUTE_30 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_30, + 'Compute device class 3.0\n' + ) + + + CU_TARGET_COMPUTE_32 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_32, + 'Compute device class 3.2\n' + ) + + + CU_TARGET_COMPUTE_35 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_35, + 'Compute device class 3.5\n' + ) + + + CU_TARGET_COMPUTE_37 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_37, + 'Compute device class 3.7\n' + ) + + + CU_TARGET_COMPUTE_50 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_50, + 'Compute device class 5.0\n' + ) + + + CU_TARGET_COMPUTE_52 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_52, + 'Compute device class 5.2\n' + ) + + + CU_TARGET_COMPUTE_53 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_53, + 'Compute device class 5.3\n' + ) + + + CU_TARGET_COMPUTE_60 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_60, + 'Compute device class 6.0.\n' + ) + + + CU_TARGET_COMPUTE_61 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_61, + 'Compute device class 6.1.\n' + ) + + + CU_TARGET_COMPUTE_62 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_62, + 'Compute device class 6.2.\n' + ) + + + CU_TARGET_COMPUTE_70 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_70, + 'Compute device class 7.0.\n' + ) + + + CU_TARGET_COMPUTE_72 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_72, + 'Compute device class 7.2.\n' + ) + + + CU_TARGET_COMPUTE_75 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_75, + 'Compute device class 7.5.\n' + ) + + + CU_TARGET_COMPUTE_80 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_80, + 'Compute device class 8.0.\n' + ) + + + CU_TARGET_COMPUTE_86 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_86, + 'Compute device class 8.6.\n' + ) + + + CU_TARGET_COMPUTE_87 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_87, + 'Compute device class 8.7.\n' + ) + + + CU_TARGET_COMPUTE_89 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_89, + 'Compute device class 8.9.\n' + ) + + + CU_TARGET_COMPUTE_90 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_90, + 'Compute device class 9.0.\n' + ) + + + CU_TARGET_COMPUTE_100 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100, + 'Compute device class 10.0.\n' + ) + + + CU_TARGET_COMPUTE_101 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101, + 'Compute device class 10.1.\n' + ) + + + CU_TARGET_COMPUTE_103 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103, + 'Compute device class 10.3.\n' + ) + + + CU_TARGET_COMPUTE_120 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120, + 'Compute device class 12.0.\n' + ) + + + 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' + ) + + + CU_TARGET_COMPUTE_90A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_90A, + 'Compute device class 10.0. with accelerated features.\n' + ) + + + CU_TARGET_COMPUTE_100A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100A, + 'Compute device class 10.1 with accelerated features.\n' + ) + + + CU_TARGET_COMPUTE_101A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101A, + 'Compute device class 10.3. with accelerated features.\n' + ) + + + CU_TARGET_COMPUTE_103A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103A, + 'Compute device class 12.0. with accelerated features.\n' + ) + + + CU_TARGET_COMPUTE_120A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120A, + 'Compute device class 12.1. with accelerated features.\n' + ) + + + CU_TARGET_COMPUTE_121A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121A, + 'Compute device class 10.x with family features.\n' + ) + + + CU_TARGET_COMPUTE_100F = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100F, + 'Compute device class 10.1 with family features.\n' + ) + + + CU_TARGET_COMPUTE_101F = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_101F, + 'Compute device class 10.3. with family features.\n' + ) + + + CU_TARGET_COMPUTE_103F = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103F, + 'Compute device class 12.0. with family features.\n' + ) + + + CU_TARGET_COMPUTE_120F = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120F, + 'Compute device class 12.1. with family features.\n' + ) + + CU_TARGET_COMPUTE_121F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121F + +class CUjit_fallback(_FastEnum): + """ + Cubin matching fallback strategies + """ + + + CU_PREFER_PTX = ( + cydriver.CUjit_fallback_enum.CU_PREFER_PTX, + 'Prefer to compile ptx if exact binary match not found\n' + ) + + + CU_PREFER_BINARY = ( + cydriver.CUjit_fallback_enum.CU_PREFER_BINARY, + 'Prefer to fall back to compatible binary code if exact match not found\n' + ) + +class CUjit_cacheMode(_FastEnum): + """ + Caching modes for dlcm + """ + + + CU_JIT_CACHE_OPTION_NONE = ( + cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_NONE, + 'Compile with no -dlcm flag specified\n' + ) + + + CU_JIT_CACHE_OPTION_CG = ( + cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_CG, + 'Compile with L1 cache disabled\n' + ) + + + CU_JIT_CACHE_OPTION_CA = ( + cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_CA, + 'Compile with L1 cache enabled\n' + ) + +class CUjitInputType(_FastEnum): + """ + Device code formats + """ + + + CU_JIT_INPUT_CUBIN = ( + cydriver.CUjitInputType_enum.CU_JIT_INPUT_CUBIN, + 'Compiled device-class-specific device code\n' + 'Applicable options: none\n' + ) + + + CU_JIT_INPUT_PTX = ( + cydriver.CUjitInputType_enum.CU_JIT_INPUT_PTX, + 'PTX source code\n' + 'Applicable options: PTX compiler options\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + CU_JIT_NUM_INPUT_TYPES = cydriver.CUjitInputType_enum.CU_JIT_NUM_INPUT_TYPES + +class CUgraphicsRegisterFlags(_FastEnum): + """ + Flags to register a graphics resource + """ + + 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 + """ + + 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 + """ + + + CU_CUBEMAP_FACE_POSITIVE_X = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_X, + 'Positive X face of cubemap\n' + ) + + + CU_CUBEMAP_FACE_NEGATIVE_X = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_X, + 'Negative X face of cubemap\n' + ) + + + CU_CUBEMAP_FACE_POSITIVE_Y = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_Y, + 'Positive Y face of cubemap\n' + ) + + + CU_CUBEMAP_FACE_NEGATIVE_Y = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_Y, + 'Negative Y face of cubemap\n' + ) + + + CU_CUBEMAP_FACE_POSITIVE_Z = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_Z, + 'Positive Z face of cubemap\n' + ) + + + CU_CUBEMAP_FACE_NEGATIVE_Z = ( + cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_Z, + 'Negative Z face of cubemap\n' + ) + +class CUlimit(_FastEnum): + """ + Limits + """ + + + CU_LIMIT_STACK_SIZE = ( + cydriver.CUlimit_enum.CU_LIMIT_STACK_SIZE, + 'GPU thread stack size\n' + ) + + + CU_LIMIT_PRINTF_FIFO_SIZE = ( + cydriver.CUlimit_enum.CU_LIMIT_PRINTF_FIFO_SIZE, + 'GPU printf FIFO size\n' + ) + + + CU_LIMIT_MALLOC_HEAP_SIZE = ( + cydriver.CUlimit_enum.CU_LIMIT_MALLOC_HEAP_SIZE, + 'GPU malloc heap size\n' + ) + + + CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = ( + cydriver.CUlimit_enum.CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH, + 'GPU device runtime launch synchronize depth\n' + ) + + + CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = ( + cydriver.CUlimit_enum.CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT, + 'GPU device runtime pending launch count\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + CU_LIMIT_MAX = cydriver.CUlimit_enum.CU_LIMIT_MAX + +class CUresourcetype(_FastEnum): + """ + Resource types + """ + + + CU_RESOURCE_TYPE_ARRAY = ( + cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY, + 'Array resource\n' + ) + + + CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = ( + cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY, + 'Mipmapped array resource\n' + ) + + + CU_RESOURCE_TYPE_LINEAR = ( + cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR, + 'Linear resource\n' + ) + + + CU_RESOURCE_TYPE_PITCH2D = ( + cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D, + 'Pitch 2D resource\n' + ) + +class CUaccessProperty(_FastEnum): + """ + Specifies performance hint with :py:obj:`~.CUaccessPolicyWindow` + for hitProp and missProp members. + """ + + + CU_ACCESS_PROPERTY_NORMAL = ( + cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_NORMAL, + 'Normal cache persistence.\n' + ) + + + CU_ACCESS_PROPERTY_STREAMING = ( + cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_STREAMING, + 'Streaming access is less likely to persit from cache.\n' + ) + + + CU_ACCESS_PROPERTY_PERSISTING = ( + cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_PERSISTING, + 'Persisting access is more likely to persist in cache.\n' + ) + +class CUgraphConditionalNodeType(_FastEnum): + """ + Conditional node types + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUgraphNodeType(_FastEnum): + """ + Graph node types + """ + + + CU_GRAPH_NODE_TYPE_KERNEL = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL, + 'GPU kernel node\n' + ) + + + CU_GRAPH_NODE_TYPE_MEMCPY = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY, + 'Memcpy node\n' + ) + + + CU_GRAPH_NODE_TYPE_MEMSET = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET, + 'Memset node\n' + ) + + + CU_GRAPH_NODE_TYPE_HOST = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST, + 'Host (executable) node\n' + ) + + + CU_GRAPH_NODE_TYPE_GRAPH = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH, + 'Node which executes an embedded graph\n' + ) + + + CU_GRAPH_NODE_TYPE_EMPTY = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY, + 'Empty (no-op) node\n' + ) + + + CU_GRAPH_NODE_TYPE_WAIT_EVENT = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT, + 'External event wait node\n' + ) + + + CU_GRAPH_NODE_TYPE_EVENT_RECORD = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD, + 'External event record node\n' + ) + + + CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL, + 'External semaphore signal node\n' + ) + + + CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT, + 'External semaphore wait node\n' + ) + + + CU_GRAPH_NODE_TYPE_MEM_ALLOC = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC, + 'Memory Allocation Node\n' + ) + + + CU_GRAPH_NODE_TYPE_MEM_FREE = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE, + 'Memory Free Node\n' + ) + + + CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP, + 'Batch MemOp Node\n' + ) + + + CU_GRAPH_NODE_TYPE_CONDITIONAL = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL, + 'Conditional Node May be used to\n' + 'implement a conditional execution path or loop\n' + ' inside of a graph. The graph(s)\n' + 'contained within the body of the conditional node\n' + ' can be selectively executed or\n' + 'iterated upon based on the value of a conditional\n' + ' variable.\n' + ' Handles must be created in advance\n' + 'of creating the node\n' + ' using\n' + ':py:obj:`~.cuGraphConditionalHandleCreate`.\n' + ' The following restrictions apply to\n' + 'graphs which contain conditional nodes:\n' + ' The graph cannot be used in a\n' + 'child node.\n' + ' Only one instantiation of the\n' + 'graph may exist at any point in time.\n' + ' The graph cannot be cloned.\n' + ' To set the control value, supply a\n' + 'default value when creating the handle and/or\n' + ' call\n' + ':py:obj:`~.cudaGraphSetConditional` from device code.\n' + ) + +class CUgraphDependencyType(_FastEnum): + """ + Type annotations that can be applied to graph edges as part of + :py:obj:`~.CUgraphEdgeData`. + """ + + + CU_GRAPH_DEPENDENCY_TYPE_DEFAULT = ( + cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_DEFAULT, + 'This is an ordinary dependency.\n' + ) + + + CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = ( + cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC, + 'This dependency type allows the downstream node to use\n' + '`cudaGridDependencySynchronize()`. It may only be used between kernel\n' + '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' + ) + +class CUgraphInstantiateResult(_FastEnum): + """ + Graph instantiation results + """ + + + CUDA_GRAPH_INSTANTIATE_SUCCESS = ( + cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_SUCCESS, + 'Instantiation succeeded\n' + ) + + + 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' + ) + + + CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE = ( + cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE, + 'Instantiation failed due to invalid structure, such as cycles\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUsynchronizationPolicy(_FastEnum): + """ + + """ + + 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` + """ + + + CU_CLUSTER_SCHEDULING_POLICY_DEFAULT = ( + cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_DEFAULT, + 'the default policy\n' + ) + + + CU_CLUSTER_SCHEDULING_POLICY_SPREAD = ( + cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_SPREAD, + 'spread the blocks within a cluster to the SMs\n' + ) + + + 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' + ) + +class CUlaunchMemSyncDomain(_FastEnum): + """ + Memory Synchronization Domain A kernel can be launched in a + specified memory synchronization domain that affects all memory + operations issued by that kernel. A memory barrier issued in one + domain will only order memory operations in that domain, thus + eliminating latency increase from memory barriers ordering + unrelated traffic. By default, kernels are launched in domain 0. + Kernel launched with :py:obj:`~.CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE` + will have a different domain ID. User may also alter the domain ID + with :py:obj:`~.CUlaunchMemSyncDomainMap` for a specific stream / + graph node / kernel launch. See + :py:obj:`~.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN`, + :py:obj:`~.cuStreamSetAttribute`, :py:obj:`~.cuLaunchKernelEx`, + :py:obj:`~.cuGraphKernelNodeSetAttribute`. Memory operations done + in kernels launched in different domains are considered system- + scope distanced. In other words, a GPU scoped memory + synchronization is not sufficient for memory order to be observed + by kernels in another memory synchronization domain even if they + are on the same GPU. + """ + + + CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT = ( + cydriver.CUlaunchMemSyncDomain_enum.CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT, + 'Launch kernels in the default domain\n' + ) + + + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = ( + cydriver.CUlaunchMemSyncDomain_enum.CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE, + 'Launch kernels in the remote domain\n' + ) + +class CUlaunchAttributeID(_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' + ) + +class CUstreamCaptureStatus(_FastEnum): + """ + Possible stream capture statuses returned by + :py:obj:`~.cuStreamIsCapturing` + """ + + + CU_STREAM_CAPTURE_STATUS_NONE = ( + cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE, + 'Stream is not capturing\n' + ) + + + CU_STREAM_CAPTURE_STATUS_ACTIVE = ( + cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE, + 'Stream is actively capturing\n' + ) + + + 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' + ) + +class CUstreamCaptureMode(_FastEnum): + """ + Possible modes for stream capture thread interactions. For more + details see :py:obj:`~.cuStreamBeginCapture` and + :py:obj:`~.cuThreadExchangeStreamCaptureMode` + """ + + 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` + """ + + + CU_GET_PROC_ADDRESS_DEFAULT = ( + cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_DEFAULT, + 'Default search mode for driver symbols.\n' + ) + + + CU_GET_PROC_ADDRESS_LEGACY_STREAM = ( + cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_LEGACY_STREAM, + 'Search for legacy versions of driver symbols.\n' + ) + + + 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' + ) + +class CUdriverProcAddressQueryResult(_FastEnum): + """ + Flags to indicate search status. For more details see + :py:obj:`~.cuGetProcAddress` + """ + + + CU_GET_PROC_ADDRESS_SUCCESS = ( + cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_SUCCESS, + 'Symbol was succesfully found\n' + ) + + + CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND = ( + cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND, + 'Symbol was not found in search\n' + ) + + + 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' + ) + +class CUexecAffinityType(_FastEnum): + """ + Execution Affinity Types + """ + + + CU_EXEC_AFFINITY_TYPE_SM_COUNT = ( + cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_SM_COUNT, + 'Create a context with limited SMs.\n' + ) + + CU_EXEC_AFFINITY_TYPE_MAX = cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_MAX + +class CUcigDataType(_FastEnum): + """ + + """ + + CIG_DATA_TYPE_D3D12_COMMAND_QUEUE = cydriver.CUcigDataType_enum.CIG_DATA_TYPE_D3D12_COMMAND_QUEUE + + + CIG_DATA_TYPE_NV_BLOB = ( + cydriver.CUcigDataType_enum.CIG_DATA_TYPE_NV_BLOB, + 'D3D12 Command Queue Handle\n' + ) + +class CUlibraryOption(_FastEnum): + """ + Library options to be specified with + :py:obj:`~.cuLibraryLoadData()` or + :py:obj:`~.cuLibraryLoadFromFile()` + """ + + 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, + 'Specifes that the argument `code` passed to :py:obj:`~.cuLibraryLoadData()`\n' + 'will be preserved. Specifying this option will let the driver know that\n' + '`code` can be accessed at any point until :py:obj:`~.cuLibraryUnload()`.\n' + 'The default behavior is for the driver to allocate and maintain its own\n' + 'copy of `code`. Note that this is only a memory usage optimization hint and\n' + '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' + ) + + CU_LIBRARY_NUM_OPTIONS = cydriver.CUlibraryOption_enum.CU_LIBRARY_NUM_OPTIONS + +class CUresult(_FastEnum): + """ + Error codes + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_DEINITIALIZED = ( + cydriver.cudaError_enum.CUDA_ERROR_DEINITIALIZED, + 'This indicates that the CUDA driver is in the process of shutting down.\n' + ) + + + 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' + ) + + + CUDA_ERROR_PROFILER_NOT_INITIALIZED = ( + cydriver.cudaError_enum.CUDA_ERROR_PROFILER_NOT_INITIALIZED, + '[Deprecated]\n' + ) + + + CUDA_ERROR_PROFILER_ALREADY_STARTED = ( + cydriver.cudaError_enum.CUDA_ERROR_PROFILER_ALREADY_STARTED, + '[Deprecated]\n' + ) + + + CUDA_ERROR_PROFILER_ALREADY_STOPPED = ( + cydriver.cudaError_enum.CUDA_ERROR_PROFILER_ALREADY_STOPPED, + '[Deprecated]\n' + ) + + + 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' + ) + + + CUDA_ERROR_DEVICE_UNAVAILABLE = ( + cydriver.cudaError_enum.CUDA_ERROR_DEVICE_UNAVAILABLE, + 'This indicates that requested CUDA device is unavailable at the current\n' + 'time. Devices are often unavailable due to use of\n' + ':py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS` or\n' + ':py:obj:`~.CU_COMPUTEMODE_PROHIBITED`.\n' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_DEVICE_NOT_LICENSED = ( + cydriver.cudaError_enum.CUDA_ERROR_DEVICE_NOT_LICENSED, + 'This error indicates that the Grid license is not applied.\n' + ) + + + 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' + ) + + + CUDA_ERROR_INVALID_CONTEXT = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT, + 'This most frequently indicates that there is no context bound to the\n' + 'current thread. This can also be returned if the context passed to an API\n' + 'call is not a valid handle (such as a context that has had\n' + ':py:obj:`~.cuCtxDestroy()` invoked on it). This can also be returned if a\n' + 'user mixes different API versions (i.e. 3010 context with 3020 API calls).\n' + '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' + ) + + + 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.\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' + ) + + + CUDA_ERROR_UNMAP_FAILED = ( + cydriver.cudaError_enum.CUDA_ERROR_UNMAP_FAILED, + 'This indicates that an unmap or unregister operation has failed.\n' + ) + + + 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' + ) + + + CUDA_ERROR_ALREADY_MAPPED = ( + cydriver.cudaError_enum.CUDA_ERROR_ALREADY_MAPPED, + 'This indicates that the resource is already mapped.\n' + ) + + + CUDA_ERROR_NO_BINARY_FOR_GPU = ( + cydriver.cudaError_enum.CUDA_ERROR_NO_BINARY_FOR_GPU, + 'This indicates that there is no kernel image available that is suitable for\n' + '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' + ) + + + CUDA_ERROR_ALREADY_ACQUIRED = ( + cydriver.cudaError_enum.CUDA_ERROR_ALREADY_ACQUIRED, + 'This indicates that a resource has already been acquired.\n' + ) + + + CUDA_ERROR_NOT_MAPPED = ( + cydriver.cudaError_enum.CUDA_ERROR_NOT_MAPPED, + 'This indicates that a resource is not mapped.\n' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_ECC_UNCORRECTABLE = ( + cydriver.cudaError_enum.CUDA_ERROR_ECC_UNCORRECTABLE, + 'This indicates that an uncorrectable ECC error was detected during\n' + 'execution.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_INVALID_PTX = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_PTX, + 'This indicates that a PTX JIT compilation failed.\n' + ) + + + CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_GRAPHICS_CONTEXT, + 'This indicates an error with OpenGL or DirectX context.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_JIT_COMPILATION_DISABLED = ( + cydriver.cudaError_enum.CUDA_ERROR_JIT_COMPILATION_DISABLED, + 'This indicates that the PTX JIT compilation was disabled.\n' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_CONTAINED = ( + cydriver.cudaError_enum.CUDA_ERROR_CONTAINED, + 'This indicates that an exception occurred on the device that is now\n' + "contained by the GPU's error containment capability. Common causes are - a.\n" + 'Certain types of invalid accesses of peer GPU memory over nvlink b. Certain\n' + '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' + ) + + + 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' + ) + + + CUDA_ERROR_FILE_NOT_FOUND = ( + cydriver.cudaError_enum.CUDA_ERROR_FILE_NOT_FOUND, + 'This indicates that the file specified was not found.\n' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_OPERATING_SYSTEM = ( + cydriver.cudaError_enum.CUDA_ERROR_OPERATING_SYSTEM, + 'This indicates that an OS call failed.\n' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_LOSSY_QUERY = ( + cydriver.cudaError_enum.CUDA_ERROR_LOSSY_QUERY, + 'This indicates an attempt was made to introspect an object in a way that\n' + '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' + ) + + + 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' + ) + + + CUDA_ERROR_NOT_READY = ( + cydriver.cudaError_enum.CUDA_ERROR_NOT_READY, + 'This indicates that asynchronous operations issued previously have not\n' + 'completed yet. This result is not actually an error, but must be indicated\n' + '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' + ) + + + CUDA_ERROR_ILLEGAL_ADDRESS = ( + cydriver.cudaError_enum.CUDA_ERROR_ILLEGAL_ADDRESS, + 'While executing a kernel, the device encountered a load or store\n' + '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' + ) + + + CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = ( + cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, + 'This indicates that a launch did not occur because it did not have\n' + 'appropriate resources. This error usually indicates that the user has\n' + 'attempted to pass too many arguments to the device kernel, or the kernel\n' + "launch specifies too many threads for the kernel's register count. Passing\n" + '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' + ) + + + CUDA_ERROR_LAUNCH_TIMEOUT = ( + cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_TIMEOUT, + 'This indicates that the device kernel took too long to execute. This can\n' + 'only occur if timeouts are enabled - see the device attribute\n' + ':py:obj:`~.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT` for more information.\n' + '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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_ASSERT = ( + cydriver.cudaError_enum.CUDA_ERROR_ASSERT, + 'A device-side assert triggered during kernel execution. The context cannot\n' + '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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_HARDWARE_STACK_ERROR = ( + cydriver.cudaError_enum.CUDA_ERROR_HARDWARE_STACK_ERROR, + 'While executing a kernel, the device encountered a stack error. This can be\n' + 'due to stack corruption or exceeding the stack size limit. This leaves the\n' + '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' + ) + + + CUDA_ERROR_ILLEGAL_INSTRUCTION = ( + cydriver.cudaError_enum.CUDA_ERROR_ILLEGAL_INSTRUCTION, + 'While executing a kernel, the device encountered an illegal instruction.\n' + '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' + ) + + + CUDA_ERROR_MISALIGNED_ADDRESS = ( + cydriver.cudaError_enum.CUDA_ERROR_MISALIGNED_ADDRESS, + 'While executing a kernel, the device encountered a load or store\n' + 'instruction on a memory address which is not aligned. This leaves the\n' + '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' + ) + + + CUDA_ERROR_INVALID_ADDRESS_SPACE = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_ADDRESS_SPACE, + 'While executing a kernel, the device encountered an instruction which can\n' + 'only operate on memory locations in certain address spaces (global, shared,\n' + 'or local), but was supplied a memory address not belonging to an allowed\n' + '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' + ) + + + CUDA_ERROR_INVALID_PC = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_PC, + 'While executing a kernel, the device program counter wrapped its address\n' + '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' + ) + + + CUDA_ERROR_LAUNCH_FAILED = ( + cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_FAILED, + 'An exception occurred on the device while executing a kernel. Common causes\n' + 'include dereferencing an invalid device pointer and accessing out of bounds\n' + 'shared memory. Less common cases can be system specific - more information\n' + 'about these cases can be found in the system specific user guide. This\n' + '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' + ) + + + CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = ( + cydriver.cudaError_enum.CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE, + 'This error indicates that the number of blocks launched per grid for a\n' + 'kernel that was launched via either :py:obj:`~.cuLaunchCooperativeKernel`\n' + 'or :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` exceeds the maximum\n' + 'number of blocks as allowed by\n' + ':py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` or\n' + ':py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times the\n' + 'number of multiprocessors as specified by the device attribute\n' + ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`.\n' + ) + + + CUDA_ERROR_TENSOR_MEMORY_LEAK = ( + cydriver.cudaError_enum.CUDA_ERROR_TENSOR_MEMORY_LEAK, + 'An exception occurred on the device while exiting a kernel using tensor\n' + 'memory: the tensor memory was not completely deallocated. This leaves the\n' + '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' + ) + + + CUDA_ERROR_NOT_PERMITTED = ( + cydriver.cudaError_enum.CUDA_ERROR_NOT_PERMITTED, + 'This error indicates that the attempted operation is not permitted.\n' + ) + + + 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' + ) + + + CUDA_ERROR_SYSTEM_NOT_READY = ( + cydriver.cudaError_enum.CUDA_ERROR_SYSTEM_NOT_READY, + 'This error indicates that the system is not yet ready to start any CUDA\n' + 'work. To continue using CUDA, verify the system configuration is in a valid\n' + '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' + ) + + + 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' + ) + + + CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = ( + cydriver.cudaError_enum.CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE, + 'This error indicates that the system was upgraded to run with forward\n' + 'compatibility but the visible hardware detected by CUDA does not support\n' + '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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = ( + cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD, + 'A stream capture sequence not initiated with the\n' + ':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' + ) + + + CUDA_ERROR_TIMEOUT = ( + cydriver.cudaError_enum.CUDA_ERROR_TIMEOUT, + 'This error indicates that the timeout specified for the wait operation has\n' + 'lapsed.\n' + ) + + + 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' + ) + + + CUDA_ERROR_EXTERNAL_DEVICE = ( + cydriver.cudaError_enum.CUDA_ERROR_EXTERNAL_DEVICE, + 'This indicates that an async error has occurred in a device outside of\n' + "CUDA. If CUDA was waiting for an external device's signal before consuming\n" + 'shared data, the external device signaled an error indicating that the data\n' + 'is not valid for consumption. This leaves the process in an inconsistent\n' + 'state and any further CUDA work will return the same error. To continue\n' + 'using CUDA, the process must be terminated and relaunched.\n' + ) + + + CUDA_ERROR_INVALID_CLUSTER_SIZE = ( + cydriver.cudaError_enum.CUDA_ERROR_INVALID_CLUSTER_SIZE, + 'Indicates a kernel launch error due to cluster misconfiguration.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CUDA_ERROR_UNKNOWN = ( + cydriver.cudaError_enum.CUDA_ERROR_UNKNOWN, + 'This indicates that an unknown internal error has occurred.\n' + ) + +class CUdevice_P2PAttribute(_FastEnum): + """ + P2P Attributes + """ + + + 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' + ) + + + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = ( + cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED, + 'P2P Access is enable\n' + ) + + + CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = ( + cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED, + 'Atomic operation over the link supported\n' + ) + + + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = ( + cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED, + '[Deprecated]\n' + ) + + + 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' + ) + +class CUresourceViewFormat(_FastEnum): + """ + Resource view format + """ + + + CU_RES_VIEW_FORMAT_NONE = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_NONE, + 'No resource view format (use underlying resource format)\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_1X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X8, + '1 channel unsigned 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_2X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X8, + '2 channel unsigned 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_4X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X8, + '4 channel unsigned 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_1X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X8, + '1 channel signed 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_2X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X8, + '2 channel signed 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_4X8 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X8, + '4 channel signed 8-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_1X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X16, + '1 channel unsigned 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_2X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X16, + '2 channel unsigned 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_4X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X16, + '4 channel unsigned 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_1X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X16, + '1 channel signed 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_2X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X16, + '2 channel signed 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_4X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X16, + '4 channel signed 16-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_1X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X32, + '1 channel unsigned 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_2X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X32, + '2 channel unsigned 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_UINT_4X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X32, + '4 channel unsigned 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_1X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X32, + '1 channel signed 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_2X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X32, + '2 channel signed 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_SINT_4X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X32, + '4 channel signed 32-bit integers\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_1X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_1X16, + '1 channel 16-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_2X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_2X16, + '2 channel 16-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_4X16 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_4X16, + '4 channel 16-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_1X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_1X32, + '1 channel 32-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_2X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_2X32, + '2 channel 32-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_FLOAT_4X32 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_4X32, + '4 channel 32-bit floating point\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC1, + 'Block compressed 1\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC2, + 'Block compressed 2\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC3, + 'Block compressed 3\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC4, + 'Block compressed 4 unsigned\n' + ) + + + CU_RES_VIEW_FORMAT_SIGNED_BC4 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC4, + 'Block compressed 4 signed\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC5, + 'Block compressed 5 unsigned\n' + ) + + + CU_RES_VIEW_FORMAT_SIGNED_BC5 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC5, + 'Block compressed 5 signed\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC6H, + 'Block compressed 6 unsigned half-float\n' + ) + + + CU_RES_VIEW_FORMAT_SIGNED_BC6H = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC6H, + 'Block compressed 6 signed half-float\n' + ) + + + CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = ( + cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC7, + 'Block compressed 7\n' + ) + +class CUtensorMapDataType(_FastEnum): + """ + Tensor map data type + """ + + 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 + """ + + 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 + """ + + 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 + """ + + 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 + """ + + 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 + """ + + 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. + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUexternalMemoryHandleType(_FastEnum): + """ + External memory handle types + """ + + + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = ( + cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD, + 'Handle is an opaque file descriptor\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = ( + cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP, + 'Handle is a D3D12 heap object\n' + ) + + + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = ( + cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE, + 'Handle is a D3D12 committed resource\n' + ) + + + 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' + ) + + + 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' + ) + + + CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = ( + cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, + 'Handle is an NvSciBuf object\n' + ) + +class CUexternalSemaphoreHandleType(_FastEnum): + """ + External semaphore handle types + """ + + + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = ( + cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD, + 'Handle is an opaque file descriptor\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = ( + cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, + 'Opaque handle to NvSciSync Object\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUmemAllocationHandleType(_FastEnum): + """ + Flags for specifying particular handle types + """ + + + CU_MEM_HANDLE_TYPE_NONE = ( + cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE, + 'Does not allow any export mechanism. >\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_MEM_HANDLE_TYPE_FABRIC = ( + cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC, + 'Allows a fabric handle to be used for exporting.\n' + '(:py:obj:`~.CUmemFabricHandle`)\n' + ) + + CU_MEM_HANDLE_TYPE_MAX = cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_MAX + +class CUmemAccess_flags(_FastEnum): + """ + Specifies the memory protection flags for mapping. + """ + + + CU_MEM_ACCESS_FLAGS_PROT_NONE = ( + cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_NONE, + 'Default, make the address range not accessible\n' + ) + + + CU_MEM_ACCESS_FLAGS_PROT_READ = ( + cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_READ, + 'Make the address range read accessible\n' + ) + + + CU_MEM_ACCESS_FLAGS_PROT_READWRITE = ( + cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_READWRITE, + 'Make the address range read-write accessible\n' + ) + + CU_MEM_ACCESS_FLAGS_PROT_MAX = cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_MAX + +class CUmemLocationType(_FastEnum): + """ + Specifies the type of location + """ + + CU_MEM_LOCATION_TYPE_INVALID = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_INVALID + + + 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' + ) + + + CU_MEM_LOCATION_TYPE_HOST = ( + cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_HOST, + 'Location is host, id is ignored\n' + ) + + + 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' + ) + + + 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' + ) + + CU_MEM_LOCATION_TYPE_MAX = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_MAX + +class CUmemAllocationType(_FastEnum): + """ + Defines the allocation types available + """ + + 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' + ) + + 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. + """ + + + CU_MEM_ALLOC_GRANULARITY_MINIMUM = ( + cydriver.CUmemAllocationGranularity_flags_enum.CU_MEM_ALLOC_GRANULARITY_MINIMUM, + 'Minimum required granularity for allocation\n' + ) + + + CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = ( + cydriver.CUmemAllocationGranularity_flags_enum.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED, + 'Recommended granularity for allocation for best performance\n' + ) + +class CUmemRangeHandleType(_FastEnum): + """ + Specifies the handle type for address range + """ + + 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. + """ + + + 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' + ) + +class CUarraySparseSubresourceType(_FastEnum): + """ + Sparse subresource 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 + """ + + 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 + """ + + CU_MEM_HANDLE_TYPE_GENERIC = cydriver.CUmemHandleType_enum.CU_MEM_HANDLE_TYPE_GENERIC + +class CUmemAllocationCompType(_FastEnum): + """ + Specifies compression attribute for an allocation. + """ + + + CU_MEM_ALLOCATION_COMP_NONE = ( + cydriver.CUmemAllocationCompType_enum.CU_MEM_ALLOCATION_COMP_NONE, + 'Allocating non-compressible memory\n' + ) + + + CU_MEM_ALLOCATION_COMP_GENERIC = ( + cydriver.CUmemAllocationCompType_enum.CU_MEM_ALLOCATION_COMP_GENERIC, + 'Allocating compressible memory\n' + ) + +class CUmulticastGranularity_flags(_FastEnum): + """ + Flags for querying different granularities for a multicast object + """ + + + CU_MULTICAST_GRANULARITY_MINIMUM = ( + cydriver.CUmulticastGranularity_flags_enum.CU_MULTICAST_GRANULARITY_MINIMUM, + 'Minimum required granularity\n' + ) + + + CU_MULTICAST_GRANULARITY_RECOMMENDED = ( + cydriver.CUmulticastGranularity_flags_enum.CU_MULTICAST_GRANULARITY_RECOMMENDED, + 'Recommended granularity for best performance\n' + ) + +class CUgraphExecUpdateResult(_FastEnum): + """ + CUDA Graph Update error types + """ + + + CU_GRAPH_EXEC_UPDATE_SUCCESS = ( + cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_SUCCESS, + 'The update succeeded\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUmemPool_attribute(_FastEnum): + """ + CUDA memory pool attributes + """ + + + CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = ( + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + '(value type = int) Allow cuMemAllocAsync to use memory asynchronously freed\n' + 'in another streams as long as a stream ordering dependency of the\n' + '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' + ) + + + 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' + ) + + + 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 cuFreeAsync (default enabled).\n' + ) + + + CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = ( + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + '(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 = :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 = :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 = :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 = :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' + ) + +class CUmemcpyFlags(_FastEnum): + """ + Flags to specify for copies within a batch. For more details see + :py:obj:`~.cuMemcpyBatchAsync`. + """ + + 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' + ) + +class CUmemcpySrcAccessOrder(_FastEnum): + """ + These flags allow applications to convey the source access ordering + CUDA must maintain. The destination will always be accessed in + stream order. + """ + + + CU_MEMCPY_SRC_ACCESS_ORDER_INVALID = ( + cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_INVALID, + 'Default invalid.\n' + ) + + + 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' + ) + + + CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL = ( + cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL, + 'Indicates that access to the source pointer can be out of stream order and\n' + 'all accesses must be complete before the API call returns. This flag is\n' + "suited for ephemeral sources (ex., stack variables) when it's known that no\n" + 'prior operations in the stream can be accessing the memory and also that\n' + 'the lifetime of the memory is limited to the scope that the source variable\n' + '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' + ) + + + CU_MEMCPY_SRC_ACCESS_ORDER_ANY = ( + cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_ANY, + 'Indicates that access to the source pointer can be out of stream order and\n' + 'the accesses can happen even after the API call returns. This flag is\n' + "suited for host pointers allocated outside CUDA (ex., via malloc) when it's\n" + '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' + ) + + 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`. + """ + + + CU_MEMCPY_OPERAND_TYPE_POINTER = ( + cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_POINTER, + 'Memcpy operand is a valid pointer.\n' + ) + + + CU_MEMCPY_OPERAND_TYPE_ARRAY = ( + cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_ARRAY, + 'Memcpy operand is a :py:obj:`~.CUarray`.\n' + ) + + CU_MEMCPY_OPERAND_TYPE_MAX = cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_MAX + +class CUgraphMem_attribute(_FastEnum): + """ + + """ + + + CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT = ( + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, + '(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 = :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 = :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 = :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 + """ + + + 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' + ) + + + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = ( + cydriver.CUgraphChildGraphNodeOwnership_enum.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE, + 'The child graph is moved to the parent. The handle to the child graph is\n' + 'owned by the parent and will be destroyed when the parent is destroyed.\n' + 'The following restrictions apply to child graphs after they have been\n' + 'moved: Cannot be independently instantiated or destroyed; Cannot be added\n' + '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' + ) + +class CUflushGPUDirectRDMAWritesOptions(_FastEnum): + """ + Bitmasks for + :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS` + """ + + + 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' + ) + + + 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' + ) + +class CUGPUDirectRDMAWritesOrdering(_FastEnum): + """ + Platform native ordering for GPUDirect RDMA writes + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUflushGPUDirectRDMAWritesScope(_FastEnum): + """ + The scopes for :py:obj:`~.cuFlushGPUDirectRDMAWrites` + """ + + + 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' + ) + + + 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' + ) + +class CUflushGPUDirectRDMAWritesTarget(_FastEnum): + """ + The targets for :py:obj:`~.cuFlushGPUDirectRDMAWrites` + """ + + + 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' + ) + +class CUgraphDebugDot_flags(_FastEnum): + """ + The additional write options for :py:obj:`~.cuGraphDebugDotPrint` + """ + + + 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' + ) + + + 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' + ) + + + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = ( + cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS, + '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 :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 :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 :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 :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 :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 :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 :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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUuserObject_flags(_FastEnum): + """ + Flags for user objects for graphs + """ + + + 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' + ) + +class CUuserObjectRetain_flags(_FastEnum): + """ + Flags for retaining user object references for graphs + """ + + + 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' + ) + +class CUgraphInstantiate_flags(_FastEnum): + """ + Flags for instantiating a graph + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUdeviceNumaConfig(_FastEnum): + """ + CUDA device NUMA configuration + """ + + + CU_DEVICE_NUMA_CONFIG_NONE = ( + cydriver.CUdeviceNumaConfig_enum.CU_DEVICE_NUMA_CONFIG_NONE, + 'The GPU is not a NUMA node\n' + ) + + + 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' + ) + +class CUprocessState(_FastEnum): + """ + CUDA Process States + """ + + + CU_PROCESS_STATE_RUNNING = ( + cydriver.CUprocessState_enum.CU_PROCESS_STATE_RUNNING, + 'Default process state\n' + ) + + + CU_PROCESS_STATE_LOCKED = ( + cydriver.CUprocessState_enum.CU_PROCESS_STATE_LOCKED, + 'CUDA API locks are taken so further CUDA API calls will block\n' + ) + + + 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' + ) + + + CU_PROCESS_STATE_FAILED = ( + cydriver.CUprocessState_enum.CU_PROCESS_STATE_FAILED, + 'Application entered an uncorrectable error during the checkpoint/restore\n' + 'process\n' + ) + +class CUmoduleLoadingMode(_FastEnum): + """ + CUDA Lazy Loading status + """ + + + CU_MODULE_EAGER_LOADING = ( + cydriver.CUmoduleLoadingMode_enum.CU_MODULE_EAGER_LOADING, + 'Lazy Kernel Loading is not enabled\n' + ) + + + CU_MODULE_LAZY_LOADING = ( + cydriver.CUmoduleLoadingMode_enum.CU_MODULE_LAZY_LOADING, + 'Lazy Kernel Loading is enabled\n' + ) + +class CUmemDecompressAlgorithm(_FastEnum): + """ + Bitmasks for CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK. + """ + + + CU_MEM_DECOMPRESS_UNSUPPORTED = ( + cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_UNSUPPORTED, + 'Decompression is unsupported.\n' + ) + + + CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE = ( + cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE, + 'Deflate is supported.\n' + ) + + + CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY = ( + cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY, + 'Snappy is supported.\n' + ) + + + CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = ( + cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_LZ4, + 'LZ4 is supported.\n' + ) + +class CUfunctionLoadingState(_FastEnum): + """ + + """ + + 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 + """ + + 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 + """ + + 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 + +class CUgreenCtxCreate_flags(_FastEnum): + """ + + """ + + + 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' + ) + +class CUdevSmResourceSplit_flags(_FastEnum): + """ + + """ + + CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = cydriver.CUdevSmResourceSplit_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING + + CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = cydriver.CUdevSmResourceSplit_flags.CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE + +class CUdevResourceType(_FastEnum): + """ + Type of resource + """ + + 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' + ) + +class CUlogLevel(_FastEnum): + """ + + """ + + 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 + """ + + + CU_OUT_KEY_VALUE_PAIR = ( + cydriver.CUoutput_mode_enum.CU_OUT_KEY_VALUE_PAIR, + 'Output mode Key-Value pair format.\n' + ) + + + CU_OUT_CSV = ( + cydriver.CUoutput_mode_enum.CU_OUT_CSV, + 'Output mode Comma separated values format.\n' + ) + +class CUeglFrameType(_FastEnum): + """ + CUDA EglFrame type - array or pointer + """ + + + CU_EGL_FRAME_TYPE_ARRAY = ( + cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY, + 'Frame type CUDA array\n' + ) + + + CU_EGL_FRAME_TYPE_PITCH = ( + cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH, + 'Frame type pointer\n' + ) + +class CUeglResourceLocationFlags(_FastEnum): + """ + Resource location flags- sysmem or vidmem For CUDA context on + iGPU, since video and system memory are equivalent - these flags + will not have an effect on the execution. For CUDA context on + dGPU, applications can use the flag + :py:obj:`~.CUeglResourceLocationFlags` to give a hint about the + desired location. :py:obj:`~.CU_EGL_RESOURCE_LOCATION_SYSMEM` - + the frame data is made resident on the system memory to be accessed + by CUDA. :py:obj:`~.CU_EGL_RESOURCE_LOCATION_VIDMEM` - the frame + data is made resident on the dedicated video memory to be accessed + by CUDA. There may be an additional latency due to new allocation + and data migration, if the frame is produced on a different memory. + """ + + + CU_EGL_RESOURCE_LOCATION_SYSMEM = ( + cydriver.CUeglResourceLocationFlags_enum.CU_EGL_RESOURCE_LOCATION_SYSMEM, + 'Resource location sysmem\n' + ) + + + CU_EGL_RESOURCE_LOCATION_VIDMEM = ( + cydriver.CUeglResourceLocationFlags_enum.CU_EGL_RESOURCE_LOCATION_VIDMEM, + 'Resource location vidmem\n' + ) + +class CUeglColorFormat(_FastEnum): + """ + CUDA EGL Color Format - The different planar and multiplanar + formats currently supported for CUDA_EGL interops. Three channel + formats are currently not supported for + :py:obj:`~.CU_EGL_FRAME_TYPE_ARRAY` + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_L = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L, + 'single luminance channel in one surface.\n' + ) + + + CU_EGL_COLOR_FORMAT_R = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R, + 'single color channel in one surface.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_A = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A, + 'Alpha color format - one channel in one surface.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_Y = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y, + 'Color format for single Y plane.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_Y_ER = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER, + 'Extended Range Color format for single Y plane.\n' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_Y10_ER = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER, + 'Extended Range Color format for single Y10 plane.\n' + ) + + + 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' + ) + + + CU_EGL_COLOR_FORMAT_Y12_ER = ( + cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER, + 'Extended Range Color format for single Y12 plane.\n' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + + 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' + ) + + CU_EGL_COLOR_FORMAT_MAX = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_MAX + +class CUGLDeviceList(_FastEnum): + """ + CUDA devices corresponding to an OpenGL device + """ + + + 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' + ) + + + 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' + ) + + + 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' + ) + +class CUGLmap_flags(_FastEnum): + """ + Flags to map or unmap a resource + """ + + CU_GL_MAP_RESOURCE_FLAGS_NONE = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_NONE + + 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 + +cdef object _CUresult = CUresult +cdef object _CUresult_SUCCESS = CUresult.CUDA_SUCCESS + +cdef class CUdeviceptr: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUdevice: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUtexObject: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUsurfObject: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUgraphConditionalHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, uint64_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 + +class CUkernelNodeAttrID(_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' + ) + +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' + ) + +cdef class CUmemGenericAllocationHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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: + """ + + A regular context handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUcontext): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUmodule: + """ + + CUDA module + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUmodule): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUfunction: + """ + + CUDA function + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUfunction): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUlibrary: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUlibrary): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUkernel: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUkernel): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUarray: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUarray): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUmipmappedArray: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUmipmappedArray): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUtexref: + """ + + CUDA texture reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUtexref): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUsurfref: + """ + + CUDA surface reference + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUsurfref): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUevent: + """ + + CUDA event + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUevent): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUstream: + """ + + CUDA stream + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUstream): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + def __cuda_stream__(self): + return (0, (self._pvt_ptr[0])) + +cdef class CUgraphicsResource: + """ + + CUDA graphics interop resource + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgraphicsResource): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUexternalMemory: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUexternalMemory): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUexternalSemaphore: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUexternalSemaphore): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUgraph: + """ + + CUDA graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgraph): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUgraphNode: + """ + + CUDA graph node + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgraphNode): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUgraphExec: + """ + + CUDA executable graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgraphExec): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUmemoryPool: + """ + + CUDA memory pool + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUmemoryPool): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUuserObject: + """ + + CUDA user object for graphs + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUuserObject): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUgraphDeviceNode: + """ + + CUDA graph device node handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgraphDeviceNode): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUasyncCallbackHandle: + """ + + CUDA async notification callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUasyncCallbackHandle): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUgreenCtx: + """ + + A green context handle. This handle can be used safely from only one CPU thread at a time. Created via cuGreenCtxCreate + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUgreenCtx): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUlinkState: + """ + + 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): + self._keepalive = [] + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUlinkState): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUdevResourceDesc: + """ + + An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via cuDevResourceGenerateDesc + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUdevResourceDesc): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUlogsCallbackHandle: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUlogsCallbackHandle): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUeglStreamConnection: + """ + + CUDA EGLSream Connection + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUeglStreamConnection): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLImageKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLStreamKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLSyncKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUasyncCallback: + """ + + 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 CUhostFn: + """ + + 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 CUstreamCallback: + """ + + 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 CUoccupancyB2DSize: + """ + + 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 CUlogsCallback: + """ + + 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 CUuuid_st: + """ + Attributes + ---------- + + bytes : bytes + < CUDA definition of UUID + + + 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 += ['bytes : ' + str(self.bytes.hex())] + except ValueError: + str_list += ['bytes : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def bytes(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].bytes, 16) + + +cdef class CUmemFabricHandle_st: + """ + Fabric handle - An opaque handle representing a memory allocation + that can be exported to processes in same or different nodes. For + IPC between processes on different nodes they must be connected via + the NVSwitch fabric. + + 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 CUipcEventHandle_st: + """ + CUDA IPC event handle + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUipcMemHandle_st: + """ + CUDA IPC mem handle + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUstreamMemOpWaitValueParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + address : CUdeviceptr + + + + value : cuuint32_t + + + + value64 : cuuint64_t + + + + flags : unsigned int + + + + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + + 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._address = CUdeviceptr(_ptr=&self._pvt_ptr[0].waitValue.address) + + + self._value = cuuint32_t(_ptr=&self._pvt_ptr[0].waitValue.value) + + + self._value64 = cuuint64_t(_ptr=&self._pvt_ptr[0].waitValue.value64) + + + self._alias = CUdeviceptr(_ptr=&self._pvt_ptr[0].waitValue.alias) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].waitValue + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['operation : ' + str(self.operation)] + except ValueError: + str_list += ['operation : '] + + + try: + str_list += ['address : ' + str(self.address)] + except ValueError: + str_list += ['address : '] + + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + + try: + str_list += ['value64 : ' + str(self.value64)] + except ValueError: + str_list += ['value64 : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['alias : ' + str(self.alias)] + except ValueError: + str_list += ['alias : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def address(self): + return self._address + @address.setter + def address(self, address): + cdef cydriver.CUdeviceptr cyaddress + if address is None: + cyaddress = 0 + elif isinstance(address, (CUdeviceptr)): + paddress = int(address) + cyaddress = paddress + else: + paddress = int(CUdeviceptr(address)) + cyaddress = paddress + self._address._pvt_ptr[0] = cyaddress + + + + @property + def value(self): + return self._value + @value.setter + def value(self, value): + cdef cydriver.cuuint32_t cyvalue + if value is None: + cyvalue = 0 + elif isinstance(value, (cuuint32_t)): + pvalue = int(value) + cyvalue = pvalue + else: + pvalue = int(cuuint32_t(value)) + cyvalue = pvalue + self._value._pvt_ptr[0] = cyvalue + + + + @property + def value64(self): + return self._value64 + @value64.setter + def value64(self, value64): + cdef cydriver.cuuint64_t cyvalue64 + if value64 is None: + cyvalue64 = 0 + elif isinstance(value64, (cuuint64_t)): + pvalue64 = int(value64) + cyvalue64 = pvalue64 + else: + pvalue64 = int(cuuint64_t(value64)) + cyvalue64 = pvalue64 + self._value64._pvt_ptr[0] = cyvalue64 + + + + @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 + + + @property + def alias(self): + return self._alias + @alias.setter + def alias(self, alias): + cdef cydriver.CUdeviceptr cyalias + if alias is None: + cyalias = 0 + elif isinstance(alias, (CUdeviceptr)): + palias = int(alias) + cyalias = palias + else: + palias = int(CUdeviceptr(alias)) + cyalias = palias + self._alias._pvt_ptr[0] = cyalias + + + +cdef class CUstreamMemOpWriteValueParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + address : CUdeviceptr + + + + value : cuuint32_t + + + + value64 : cuuint64_t + + + + flags : unsigned int + + + + alias : CUdeviceptr + For driver internal use. Initial value is unimportant. + + + 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._address = CUdeviceptr(_ptr=&self._pvt_ptr[0].writeValue.address) + + + self._value = cuuint32_t(_ptr=&self._pvt_ptr[0].writeValue.value) + + + self._value64 = cuuint64_t(_ptr=&self._pvt_ptr[0].writeValue.value64) + + + self._alias = CUdeviceptr(_ptr=&self._pvt_ptr[0].writeValue.alias) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].writeValue + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['operation : ' + str(self.operation)] + except ValueError: + str_list += ['operation : '] + + + try: + str_list += ['address : ' + str(self.address)] + except ValueError: + str_list += ['address : '] + + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + + try: + str_list += ['value64 : ' + str(self.value64)] + except ValueError: + str_list += ['value64 : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['alias : ' + str(self.alias)] + except ValueError: + str_list += ['alias : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def address(self): + return self._address + @address.setter + def address(self, address): + cdef cydriver.CUdeviceptr cyaddress + if address is None: + cyaddress = 0 + elif isinstance(address, (CUdeviceptr)): + paddress = int(address) + cyaddress = paddress + else: + paddress = int(CUdeviceptr(address)) + cyaddress = paddress + self._address._pvt_ptr[0] = cyaddress + + + + @property + def value(self): + return self._value + @value.setter + def value(self, value): + cdef cydriver.cuuint32_t cyvalue + if value is None: + cyvalue = 0 + elif isinstance(value, (cuuint32_t)): + pvalue = int(value) + cyvalue = pvalue + else: + pvalue = int(cuuint32_t(value)) + cyvalue = pvalue + self._value._pvt_ptr[0] = cyvalue + + + + @property + def value64(self): + return self._value64 + @value64.setter + def value64(self, value64): + cdef cydriver.cuuint64_t cyvalue64 + if value64 is None: + cyvalue64 = 0 + elif isinstance(value64, (cuuint64_t)): + pvalue64 = int(value64) + cyvalue64 = pvalue64 + else: + pvalue64 = int(cuuint64_t(value64)) + cyvalue64 = pvalue64 + self._value64._pvt_ptr[0] = cyvalue64 + + + + @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 + + + @property + def alias(self): + return self._alias + @alias.setter + def alias(self, alias): + cdef cydriver.CUdeviceptr cyalias + if alias is None: + cyalias = 0 + elif isinstance(alias, (CUdeviceptr)): + palias = int(alias) + cyalias = palias + else: + palias = int(CUdeviceptr(alias)) + cyalias = palias + self._alias._pvt_ptr[0] = cyalias + + + +cdef class CUstreamMemOpFlushRemoteWritesParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + flags : 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].flushRemoteWrites + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['operation : ' + str(self.operation)] + except ValueError: + str_list += ['operation : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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 + + +cdef class CUstreamMemOpMemoryBarrierParams_st: + """ + Attributes + ---------- + + operation : CUstreamBatchMemOpType + < Only supported in the _v2 API + + + flags : unsigned int + See CUstreamMemoryBarrier_flags + + + 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].memoryBarrier + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['operation : ' + str(self.operation)] + except ValueError: + str_list += ['operation : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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 + + +cdef class CUstreamBatchMemOpParams_union: + """ + Per-operation parameters for cuStreamBatchMemOp + + Attributes + ---------- + + operation : CUstreamBatchMemOpType + + + + waitValue : CUstreamMemOpWaitValueParams_st + + + + writeValue : CUstreamMemOpWriteValueParams_st + + + + flushRemoteWrites : CUstreamMemOpFlushRemoteWritesParams_st + + + + memoryBarrier : CUstreamMemOpMemoryBarrierParams_st + + + + pad : list[cuuint64_t] + + + + 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 + + self._waitValue = CUstreamMemOpWaitValueParams_st(_ptr=self._pvt_ptr) + + + self._writeValue = CUstreamMemOpWriteValueParams_st(_ptr=self._pvt_ptr) + + + self._flushRemoteWrites = CUstreamMemOpFlushRemoteWritesParams_st(_ptr=self._pvt_ptr) + + + self._memoryBarrier = CUstreamMemOpMemoryBarrierParams_st(_ptr=self._pvt_ptr) + + 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 += ['operation : ' + str(self.operation)] + except ValueError: + str_list += ['operation : '] + + + try: + str_list += ['waitValue :\n' + '\n'.join([' ' + line for line in str(self.waitValue).splitlines()])] + except ValueError: + str_list += ['waitValue : '] + + + try: + str_list += ['writeValue :\n' + '\n'.join([' ' + line for line in str(self.writeValue).splitlines()])] + except ValueError: + str_list += ['writeValue : '] + + + try: + str_list += ['flushRemoteWrites :\n' + '\n'.join([' ' + line for line in str(self.flushRemoteWrites).splitlines()])] + except ValueError: + str_list += ['flushRemoteWrites : '] + + + try: + str_list += ['memoryBarrier :\n' + '\n'.join([' ' + line for line in str(self.memoryBarrier).splitlines()])] + except ValueError: + str_list += ['memoryBarrier : '] + + + try: + str_list += ['pad : ' + str(self.pad)] + except ValueError: + str_list += ['pad : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @property + def pad(self): + return [cuuint64_t(init_value=_pad) for _pad in self._pvt_ptr[0].pad] + @pad.setter + def pad(self, pad): + self._pvt_ptr[0].pad = pad + + + +cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: + """ + Attributes + ---------- + + ctx : CUcontext + + + + count : unsigned int + + + + paramArray : CUstreamBatchMemOpParams + + + + flags : 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 + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + def __dealloc__(self): + pass + + if self._paramArray is not NULL: + free(self._paramArray) + 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 = [] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['count : ' + str(self.count)] + except ValueError: + str_list += ['count : '] + + + try: + str_list += ['paramArray : ' + str(self.paramArray)] + except ValueError: + str_list += ['paramArray : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def count(self): + return self._pvt_ptr[0].count + @count.setter + def count(self, unsigned int count): + self._pvt_ptr[0].count = count + + + @property + def paramArray(self): + arrs = [self._pvt_ptr[0].paramArray + x*sizeof(cydriver.CUstreamBatchMemOpParams) for x in range(self._paramArray_length)] + return [CUstreamBatchMemOpParams(_ptr=arr) for arr in arrs] + @paramArray.setter + def paramArray(self, val): + cdef cydriver.CUstreamBatchMemOpParams* _paramArray_new + if len(val) == 0: + free(self._paramArray) + self._paramArray = NULL + self._paramArray_length = 0 + self._pvt_ptr[0].paramArray = NULL + else: + if self._paramArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramArray_new = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) + if _paramArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUstreamBatchMemOpParams))) + for idx in range(len(val)): + string.memcpy(&_paramArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + free(self._paramArray) + self._paramArray = _paramArray_new + self._paramArray_length = len(val) + self._pvt_ptr[0].paramArray = _paramArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + + + + @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 CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + """ + Batch memory operation node parameters + + Attributes + ---------- + + ctx : CUcontext + Context to use for the operations. + + + count : unsigned int + Number of operations in paramArray. + + + paramArray : CUstreamBatchMemOpParams + Array of batch memory operations. + + + flags : unsigned int + Flags to control the node. + + + 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 + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + def __dealloc__(self): + pass + + if self._paramArray is not NULL: + free(self._paramArray) + 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 = [] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['count : ' + str(self.count)] + except ValueError: + str_list += ['count : '] + + + try: + str_list += ['paramArray : ' + str(self.paramArray)] + except ValueError: + str_list += ['paramArray : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def count(self): + return self._pvt_ptr[0].count + @count.setter + def count(self, unsigned int count): + self._pvt_ptr[0].count = count + + + @property + def paramArray(self): + arrs = [self._pvt_ptr[0].paramArray + x*sizeof(cydriver.CUstreamBatchMemOpParams) for x in range(self._paramArray_length)] + return [CUstreamBatchMemOpParams(_ptr=arr) for arr in arrs] + @paramArray.setter + def paramArray(self, val): + cdef cydriver.CUstreamBatchMemOpParams* _paramArray_new + if len(val) == 0: + free(self._paramArray) + self._paramArray = NULL + self._paramArray_length = 0 + self._pvt_ptr[0].paramArray = NULL + else: + if self._paramArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramArray_new = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) + if _paramArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUstreamBatchMemOpParams))) + for idx in range(len(val)): + string.memcpy(&_paramArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + free(self._paramArray) + self._paramArray = _paramArray_new + self._paramArray_length = len(val) + self._pvt_ptr[0].paramArray = _paramArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + + + + @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 anon_struct0: + """ + Attributes + ---------- + + bytesOverBudget : unsigned long long + + + + 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].info.overBudget + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['bytesOverBudget : ' + str(self.bytesOverBudget)] + except ValueError: + str_list += ['bytesOverBudget : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + +cdef class anon_union2: + """ + Attributes + ---------- + + overBudget : anon_struct0 + + + + 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._overBudget = anon_struct0(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].info + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['overBudget :\n' + '\n'.join([' ' + line for line in str(self.overBudget).splitlines()])] + except ValueError: + str_list += ['overBudget : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + +cdef class CUasyncNotificationInfo_st: + """ + Information passed to the user via the async notification callback + + Attributes + ---------- + + type : CUasyncNotificationType + The type of notification being sent + + + info : anon_union2 + Information about the notification. `typename` must be checked in + order to interpret this field. + + + 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.CUasyncNotificationInfo_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._info = anon_union2(_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 += ['info :\n' + '\n'.join([' ' + line for line in str(self.info).splitlines()])] + except ValueError: + str_list += ['info : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + +cdef class CUdevprop_st: + """ + Legacy device properties + + Attributes + ---------- + + maxThreadsPerBlock : int + Maximum number of threads per block + + + maxThreadsDim : list[int] + Maximum size of each dimension of a block + + + maxGridSize : list[int] + Maximum size of each dimension of a grid + + + sharedMemPerBlock : int + Shared memory available per block in bytes + + + totalConstantMemory : int + Constant memory available on device in bytes + + + SIMDWidth : int + Warp size in threads + + + memPitch : int + Maximum pitch in bytes allowed by memory copies + + + regsPerBlock : int + 32-bit registers available per block + + + clockRate : int + Clock frequency in kilohertz + + + textureAlign : int + Alignment requirement for textures + + + 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 += ['maxThreadsPerBlock : ' + str(self.maxThreadsPerBlock)] + except ValueError: + str_list += ['maxThreadsPerBlock : '] + + + try: + str_list += ['maxThreadsDim : ' + str(self.maxThreadsDim)] + except ValueError: + str_list += ['maxThreadsDim : '] + + + try: + str_list += ['maxGridSize : ' + str(self.maxGridSize)] + except ValueError: + str_list += ['maxGridSize : '] + + + try: + str_list += ['sharedMemPerBlock : ' + str(self.sharedMemPerBlock)] + except ValueError: + str_list += ['sharedMemPerBlock : '] + + + try: + str_list += ['totalConstantMemory : ' + str(self.totalConstantMemory)] + except ValueError: + str_list += ['totalConstantMemory : '] + + + try: + str_list += ['SIMDWidth : ' + str(self.SIMDWidth)] + except ValueError: + str_list += ['SIMDWidth : '] + + + try: + str_list += ['memPitch : ' + str(self.memPitch)] + except ValueError: + str_list += ['memPitch : '] + + + try: + str_list += ['regsPerBlock : ' + str(self.regsPerBlock)] + except ValueError: + str_list += ['regsPerBlock : '] + + + try: + str_list += ['clockRate : ' + str(self.clockRate)] + except ValueError: + str_list += ['clockRate : '] + + + try: + str_list += ['textureAlign : ' + str(self.textureAlign)] + except ValueError: + str_list += ['textureAlign : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def maxThreadsPerBlock(self): + return self._pvt_ptr[0].maxThreadsPerBlock + @maxThreadsPerBlock.setter + def maxThreadsPerBlock(self, int maxThreadsPerBlock): + self._pvt_ptr[0].maxThreadsPerBlock = maxThreadsPerBlock + + + @property + def maxThreadsDim(self): + return self._pvt_ptr[0].maxThreadsDim + @maxThreadsDim.setter + def maxThreadsDim(self, maxThreadsDim): + self._pvt_ptr[0].maxThreadsDim = maxThreadsDim + + + @property + def maxGridSize(self): + return self._pvt_ptr[0].maxGridSize + @maxGridSize.setter + def maxGridSize(self, maxGridSize): + self._pvt_ptr[0].maxGridSize = maxGridSize + + + @property + def sharedMemPerBlock(self): + return self._pvt_ptr[0].sharedMemPerBlock + @sharedMemPerBlock.setter + def sharedMemPerBlock(self, int sharedMemPerBlock): + self._pvt_ptr[0].sharedMemPerBlock = sharedMemPerBlock + + + @property + def totalConstantMemory(self): + return self._pvt_ptr[0].totalConstantMemory + @totalConstantMemory.setter + def totalConstantMemory(self, int totalConstantMemory): + self._pvt_ptr[0].totalConstantMemory = totalConstantMemory + + + @property + def SIMDWidth(self): + return self._pvt_ptr[0].SIMDWidth + @SIMDWidth.setter + def SIMDWidth(self, int SIMDWidth): + self._pvt_ptr[0].SIMDWidth = SIMDWidth + + + @property + def memPitch(self): + return self._pvt_ptr[0].memPitch + @memPitch.setter + def memPitch(self, int memPitch): + self._pvt_ptr[0].memPitch = memPitch + + + @property + def regsPerBlock(self): + return self._pvt_ptr[0].regsPerBlock + @regsPerBlock.setter + def regsPerBlock(self, int regsPerBlock): + self._pvt_ptr[0].regsPerBlock = regsPerBlock + + + @property + def clockRate(self): + return self._pvt_ptr[0].clockRate + @clockRate.setter + def clockRate(self, int clockRate): + self._pvt_ptr[0].clockRate = clockRate + + + @property + def textureAlign(self): + return self._pvt_ptr[0].textureAlign + @textureAlign.setter + def textureAlign(self, int textureAlign): + self._pvt_ptr[0].textureAlign = textureAlign + + +cdef class CUaccessPolicyWindow_st: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + num_bytes is limited by + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into + many segments and assign segments such that: sum of "hit segments" + / window == approx. ratio. sum of "miss segments" / window == + approx 1-ratio. Segments and ratio specifications are fitted to the + capabilities of the architecture. Accesses in a hit segment apply + the hitProp access policy. Accesses in a miss segment apply the + missProp access policy. + + Attributes + ---------- + + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + + + num_bytes : size_t + Size in bytes of the window policy. CUDA driver may restrict the + maximum size and alignment. + + + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + + + hitProp : CUaccessProperty + CUaccessProperty set for hit. + + + missProp : CUaccessProperty + CUaccessProperty set for miss. Must be either NORMAL or STREAMING + + + 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 += ['base_ptr : ' + hex(self.base_ptr)] + except ValueError: + str_list += ['base_ptr : '] + + + try: + str_list += ['num_bytes : ' + str(self.num_bytes)] + except ValueError: + str_list += ['num_bytes : '] + + + try: + str_list += ['hitRatio : ' + str(self.hitRatio)] + except ValueError: + str_list += ['hitRatio : '] + + + try: + str_list += ['hitProp : ' + str(self.hitProp)] + except ValueError: + str_list += ['hitProp : '] + + + try: + str_list += ['missProp : ' + str(self.missProp)] + except ValueError: + str_list += ['missProp : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def base_ptr(self): + return self._pvt_ptr[0].base_ptr + @base_ptr.setter + def base_ptr(self, base_ptr): + self._cybase_ptr = _HelperInputVoidPtr(base_ptr) + self._pvt_ptr[0].base_ptr = self._cybase_ptr.cptr + + + @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 + + + @property + def hitRatio(self): + return self._pvt_ptr[0].hitRatio + @hitRatio.setter + def hitRatio(self, float hitRatio): + self._pvt_ptr[0].hitRatio = hitRatio + + + @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) + + + @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) + + +cdef class CUDA_KERNEL_NODE_PARAMS_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + 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 + + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) + + 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 += ['func : ' + str(self.func)] + except ValueError: + str_list += ['func : '] + + + try: + str_list += ['gridDimX : ' + str(self.gridDimX)] + except ValueError: + str_list += ['gridDimX : '] + + + try: + str_list += ['gridDimY : ' + str(self.gridDimY)] + except ValueError: + str_list += ['gridDimY : '] + + + try: + str_list += ['gridDimZ : ' + str(self.gridDimZ)] + except ValueError: + str_list += ['gridDimZ : '] + + + try: + str_list += ['blockDimX : ' + str(self.blockDimX)] + except ValueError: + str_list += ['blockDimX : '] + + + try: + str_list += ['blockDimY : ' + str(self.blockDimY)] + except ValueError: + str_list += ['blockDimY : '] + + + try: + str_list += ['blockDimZ : ' + str(self.blockDimZ)] + except ValueError: + str_list += ['blockDimZ : '] + + + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + + + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + + + try: + str_list += ['extra : ' + str(self.extra)] + except ValueError: + str_list += ['extra : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def func(self): + return self._func + @func.setter + def func(self, func): + cdef cydriver.CUfunction cyfunc + if func is None: + cyfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + cyfunc = pfunc + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + self._func._pvt_ptr[0] = cyfunc + + + @property + def gridDimX(self): + return self._pvt_ptr[0].gridDimX + @gridDimX.setter + def gridDimX(self, unsigned int gridDimX): + self._pvt_ptr[0].gridDimX = gridDimX + + + @property + def gridDimY(self): + return self._pvt_ptr[0].gridDimY + @gridDimY.setter + def gridDimY(self, unsigned int gridDimY): + self._pvt_ptr[0].gridDimY = gridDimY + + + @property + def gridDimZ(self): + return self._pvt_ptr[0].gridDimZ + @gridDimZ.setter + def gridDimZ(self, unsigned int gridDimZ): + self._pvt_ptr[0].gridDimZ = gridDimZ + + + @property + def blockDimX(self): + return self._pvt_ptr[0].blockDimX + @blockDimX.setter + def blockDimX(self, unsigned int blockDimX): + self._pvt_ptr[0].blockDimX = blockDimX + + + @property + def blockDimY(self): + return self._pvt_ptr[0].blockDimY + @blockDimY.setter + def blockDimY(self, unsigned int blockDimY): + self._pvt_ptr[0].blockDimY = blockDimY + + + @property + def blockDimZ(self): + return self._pvt_ptr[0].blockDimZ + @blockDimZ.setter + def blockDimZ(self, unsigned int blockDimZ): + self._pvt_ptr[0].blockDimZ = blockDimZ + + + @property + def sharedMemBytes(self): + return self._pvt_ptr[0].sharedMemBytes + @sharedMemBytes.setter + def sharedMemBytes(self, unsigned int sharedMemBytes): + self._pvt_ptr[0].sharedMemBytes = sharedMemBytes + + + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + + + @property + def extra(self): + return self._pvt_ptr[0].extra + @extra.setter + def extra(self, void_ptr extra): + self._pvt_ptr[0].extra = extra + + +cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + 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 + + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) + + + self._kern = CUkernel(_ptr=&self._pvt_ptr[0].kern) + + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + 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 += ['func : ' + str(self.func)] + except ValueError: + str_list += ['func : '] + + + try: + str_list += ['gridDimX : ' + str(self.gridDimX)] + except ValueError: + str_list += ['gridDimX : '] + + + try: + str_list += ['gridDimY : ' + str(self.gridDimY)] + except ValueError: + str_list += ['gridDimY : '] + + + try: + str_list += ['gridDimZ : ' + str(self.gridDimZ)] + except ValueError: + str_list += ['gridDimZ : '] + + + try: + str_list += ['blockDimX : ' + str(self.blockDimX)] + except ValueError: + str_list += ['blockDimX : '] + + + try: + str_list += ['blockDimY : ' + str(self.blockDimY)] + except ValueError: + str_list += ['blockDimY : '] + + + try: + str_list += ['blockDimZ : ' + str(self.blockDimZ)] + except ValueError: + str_list += ['blockDimZ : '] + + + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + + + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + + + try: + str_list += ['extra : ' + str(self.extra)] + except ValueError: + str_list += ['extra : '] + + + try: + str_list += ['kern : ' + str(self.kern)] + except ValueError: + str_list += ['kern : '] + + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def func(self): + return self._func + @func.setter + def func(self, func): + cdef cydriver.CUfunction cyfunc + if func is None: + cyfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + cyfunc = pfunc + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + self._func._pvt_ptr[0] = cyfunc + + + @property + def gridDimX(self): + return self._pvt_ptr[0].gridDimX + @gridDimX.setter + def gridDimX(self, unsigned int gridDimX): + self._pvt_ptr[0].gridDimX = gridDimX + + + @property + def gridDimY(self): + return self._pvt_ptr[0].gridDimY + @gridDimY.setter + def gridDimY(self, unsigned int gridDimY): + self._pvt_ptr[0].gridDimY = gridDimY + + + @property + def gridDimZ(self): + return self._pvt_ptr[0].gridDimZ + @gridDimZ.setter + def gridDimZ(self, unsigned int gridDimZ): + self._pvt_ptr[0].gridDimZ = gridDimZ + + + @property + def blockDimX(self): + return self._pvt_ptr[0].blockDimX + @blockDimX.setter + def blockDimX(self, unsigned int blockDimX): + self._pvt_ptr[0].blockDimX = blockDimX + + + @property + def blockDimY(self): + return self._pvt_ptr[0].blockDimY + @blockDimY.setter + def blockDimY(self, unsigned int blockDimY): + self._pvt_ptr[0].blockDimY = blockDimY + + + @property + def blockDimZ(self): + return self._pvt_ptr[0].blockDimZ + @blockDimZ.setter + def blockDimZ(self, unsigned int blockDimZ): + self._pvt_ptr[0].blockDimZ = blockDimZ + + + @property + def sharedMemBytes(self): + return self._pvt_ptr[0].sharedMemBytes + @sharedMemBytes.setter + def sharedMemBytes(self, unsigned int sharedMemBytes): + self._pvt_ptr[0].sharedMemBytes = sharedMemBytes + + + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + + + @property + def extra(self): + return self._pvt_ptr[0].extra + @extra.setter + def extra(self, void_ptr extra): + self._pvt_ptr[0].extra = extra + + + @property + def kern(self): + return self._kern + @kern.setter + def kern(self, kern): + cdef cydriver.CUkernel cykern + if kern is None: + cykern = 0 + elif isinstance(kern, (CUkernel,)): + pkern = int(kern) + cykern = pkern + else: + pkern = int(CUkernel(kern)) + cykern = pkern + self._kern._pvt_ptr[0] = cykern + + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + +cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: + """ + GPU kernel node parameters + + Attributes + ---------- + + func : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + kernelParams : Any + Array of pointers to kernel parameters + + + extra : Any + Extra options + + + kern : CUkernel + Kernel to launch, will only be referenced if func is NULL + + + 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. + + + 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 + + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) + + + self._kern = CUkernel(_ptr=&self._pvt_ptr[0].kern) + + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + 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 += ['func : ' + str(self.func)] + except ValueError: + str_list += ['func : '] + + + try: + str_list += ['gridDimX : ' + str(self.gridDimX)] + except ValueError: + str_list += ['gridDimX : '] + + + try: + str_list += ['gridDimY : ' + str(self.gridDimY)] + except ValueError: + str_list += ['gridDimY : '] + + + try: + str_list += ['gridDimZ : ' + str(self.gridDimZ)] + except ValueError: + str_list += ['gridDimZ : '] + + + try: + str_list += ['blockDimX : ' + str(self.blockDimX)] + except ValueError: + str_list += ['blockDimX : '] + + + try: + str_list += ['blockDimY : ' + str(self.blockDimY)] + except ValueError: + str_list += ['blockDimY : '] + + + try: + str_list += ['blockDimZ : ' + str(self.blockDimZ)] + except ValueError: + str_list += ['blockDimZ : '] + + + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + + + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + + + try: + str_list += ['extra : ' + str(self.extra)] + except ValueError: + str_list += ['extra : '] + + + try: + str_list += ['kern : ' + str(self.kern)] + except ValueError: + str_list += ['kern : '] + + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def func(self): + return self._func + @func.setter + def func(self, func): + cdef cydriver.CUfunction cyfunc + if func is None: + cyfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + cyfunc = pfunc + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + self._func._pvt_ptr[0] = cyfunc + + + @property + def gridDimX(self): + return self._pvt_ptr[0].gridDimX + @gridDimX.setter + def gridDimX(self, unsigned int gridDimX): + self._pvt_ptr[0].gridDimX = gridDimX + + + @property + def gridDimY(self): + return self._pvt_ptr[0].gridDimY + @gridDimY.setter + def gridDimY(self, unsigned int gridDimY): + self._pvt_ptr[0].gridDimY = gridDimY + + + @property + def gridDimZ(self): + return self._pvt_ptr[0].gridDimZ + @gridDimZ.setter + def gridDimZ(self, unsigned int gridDimZ): + self._pvt_ptr[0].gridDimZ = gridDimZ + + + @property + def blockDimX(self): + return self._pvt_ptr[0].blockDimX + @blockDimX.setter + def blockDimX(self, unsigned int blockDimX): + self._pvt_ptr[0].blockDimX = blockDimX + + + @property + def blockDimY(self): + return self._pvt_ptr[0].blockDimY + @blockDimY.setter + def blockDimY(self, unsigned int blockDimY): + self._pvt_ptr[0].blockDimY = blockDimY + + + @property + def blockDimZ(self): + return self._pvt_ptr[0].blockDimZ + @blockDimZ.setter + def blockDimZ(self, unsigned int blockDimZ): + self._pvt_ptr[0].blockDimZ = blockDimZ + + + @property + def sharedMemBytes(self): + return self._pvt_ptr[0].sharedMemBytes + @sharedMemBytes.setter + def sharedMemBytes(self, unsigned int sharedMemBytes): + self._pvt_ptr[0].sharedMemBytes = sharedMemBytes + + + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + + + @property + def extra(self): + return self._pvt_ptr[0].extra + @extra.setter + def extra(self, void_ptr extra): + self._pvt_ptr[0].extra = extra + + + @property + def kern(self): + return self._kern + @kern.setter + def kern(self, kern): + cdef cydriver.CUkernel cykern + if kern is None: + cykern = 0 + elif isinstance(kern, (CUkernel,)): + pkern = int(kern) + cykern = pkern + else: + pkern = int(CUkernel(kern)) + cykern = pkern + self._kern._pvt_ptr[0] = cykern + + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + +cdef class CUDA_MEMSET_NODE_PARAMS_st: + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + 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 + + self._dst = CUdeviceptr(_ptr=&self._pvt_ptr[0].dst) + + 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 += ['dst : ' + str(self.dst)] + except ValueError: + str_list += ['dst : '] + + + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + + try: + str_list += ['elementSize : ' + str(self.elementSize)] + except ValueError: + str_list += ['elementSize : '] + + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def dst(self): + return self._dst + @dst.setter + def dst(self, dst): + cdef cydriver.CUdeviceptr cydst + if dst is None: + cydst = 0 + elif isinstance(dst, (CUdeviceptr)): + pdst = int(dst) + cydst = pdst + else: + pdst = int(CUdeviceptr(dst)) + cydst = pdst + self._dst._pvt_ptr[0] = cydst + + + + @property + def pitch(self): + return self._pvt_ptr[0].pitch + @pitch.setter + def pitch(self, size_t pitch): + self._pvt_ptr[0].pitch = pitch + + + @property + def value(self): + return self._pvt_ptr[0].value + @value.setter + def value(self, unsigned int value): + self._pvt_ptr[0].value = value + + + @property + def elementSize(self): + return self._pvt_ptr[0].elementSize + @elementSize.setter + def elementSize(self, unsigned int elementSize): + self._pvt_ptr[0].elementSize = elementSize + + + @property + def width(self): + return self._pvt_ptr[0].width + @width.setter + def width(self, size_t width): + self._pvt_ptr[0].width = width + + + @property + def height(self): + return self._pvt_ptr[0].height + @height.setter + def height(self, size_t height): + self._pvt_ptr[0].height = height + + +cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: + """ + Memset node parameters + + Attributes + ---------- + + dst : CUdeviceptr + Destination device pointer + + + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + + + value : unsigned int + Value to be set + + + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + + + width : size_t + Width of the row in elements + + + height : size_t + Number of rows + + + ctx : CUcontext + Context on which to run the node + + + 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 + + self._dst = CUdeviceptr(_ptr=&self._pvt_ptr[0].dst) + + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + 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 += ['dst : ' + str(self.dst)] + except ValueError: + str_list += ['dst : '] + + + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + + try: + str_list += ['elementSize : ' + str(self.elementSize)] + except ValueError: + str_list += ['elementSize : '] + + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def dst(self): + return self._dst + @dst.setter + def dst(self, dst): + cdef cydriver.CUdeviceptr cydst + if dst is None: + cydst = 0 + elif isinstance(dst, (CUdeviceptr)): + pdst = int(dst) + cydst = pdst + else: + pdst = int(CUdeviceptr(dst)) + cydst = pdst + self._dst._pvt_ptr[0] = cydst + + + + @property + def pitch(self): + return self._pvt_ptr[0].pitch + @pitch.setter + def pitch(self, size_t pitch): + self._pvt_ptr[0].pitch = pitch + + + @property + def value(self): + return self._pvt_ptr[0].value + @value.setter + def value(self, unsigned int value): + self._pvt_ptr[0].value = value + + + @property + def elementSize(self): + return self._pvt_ptr[0].elementSize + @elementSize.setter + def elementSize(self, unsigned int elementSize): + self._pvt_ptr[0].elementSize = elementSize + + + @property + def width(self): + return self._pvt_ptr[0].width + @width.setter + def width(self, size_t width): + self._pvt_ptr[0].width = width + + + @property + def height(self): + return self._pvt_ptr[0].height + @height.setter + def height(self, size_t height): + self._pvt_ptr[0].height = height + + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + +cdef class CUDA_HOST_NODE_PARAMS_st: + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + 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 + + self._fn = CUhostFn(_ptr=&self._pvt_ptr[0].fn) + + 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 += ['fn : ' + str(self.fn)] + except ValueError: + str_list += ['fn : '] + + + try: + str_list += ['userData : ' + hex(self.userData)] + except ValueError: + str_list += ['userData : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def fn(self): + return self._fn + @fn.setter + def fn(self, fn): + cdef cydriver.CUhostFn cyfn + if fn is None: + cyfn = 0 + elif isinstance(fn, (CUhostFn)): + pfn = int(fn) + cyfn = pfn + else: + pfn = int(CUhostFn(fn)) + cyfn = pfn + self._fn._pvt_ptr[0] = cyfn + + + @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 + + +cdef class CUDA_HOST_NODE_PARAMS_v2_st: + """ + Host node parameters + + Attributes + ---------- + + fn : CUhostFn + The function to call when the node executes + + + userData : Any + Argument to pass to the function + + + 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 + + self._fn = CUhostFn(_ptr=&self._pvt_ptr[0].fn) + + 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 += ['fn : ' + str(self.fn)] + except ValueError: + str_list += ['fn : '] + + + try: + str_list += ['userData : ' + hex(self.userData)] + except ValueError: + str_list += ['userData : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def fn(self): + return self._fn + @fn.setter + def fn(self, fn): + cdef cydriver.CUhostFn cyfn + if fn is None: + cyfn = 0 + elif isinstance(fn, (CUhostFn)): + pfn = int(fn) + cyfn = pfn + else: + pfn = int(CUhostFn(fn)) + cyfn = pfn + self._fn._pvt_ptr[0] = cyfn + + + @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 + + +cdef class CUDA_CONDITIONAL_NODE_PARAMS: + """ + Conditional node parameters + + Attributes + ---------- + + handle : CUgraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cuGraphConditionalHandleCreate. + + + type : CUgraphConditionalNodeType + Type of conditional node. + + + 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. + + + phGraph_out : CUgraph + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + CU_GRAPH_COND_TYPE_WHILE: phGraph_out[0] is executed as long as the + 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. + + + ctx : CUcontext + Context on which to run the node. Must match context used to create + the handle and all body nodes. + + + 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 + + self._handle = CUgraphConditionalHandle(_ptr=&self._pvt_ptr[0].handle) + + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + 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 += ['handle : ' + str(self.handle)] + except ValueError: + str_list += ['handle : '] + + + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['phGraph_out : ' + str(self.phGraph_out)] + except ValueError: + str_list += ['phGraph_out : '] + + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def handle(self): + return self._handle + @handle.setter + def handle(self, handle): + cdef cydriver.CUgraphConditionalHandle cyhandle + if handle is None: + cyhandle = 0 + elif isinstance(handle, (CUgraphConditionalHandle)): + phandle = int(handle) + cyhandle = phandle + else: + phandle = int(CUgraphConditionalHandle(handle)) + cyhandle = phandle + self._handle._pvt_ptr[0] = cyhandle + + + + @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) + + + @property + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, unsigned int size): + self._pvt_ptr[0].size = size + + + @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] + + + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + +cdef class CUgraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + + 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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, + CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or + CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. + + + to_port : bytes + This indicates what portion of the downstream node is dependent on + the upstream node or portion thereof (indicated by `from_port`). + The meaning is specific to the node type. A value of 0 in all cases + 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. + + + 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. + + + 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 += ['from_port : ' + str(self.from_port)] + except ValueError: + str_list += ['from_port : '] + + + try: + str_list += ['to_port : ' + str(self.to_port)] + except ValueError: + str_list += ['to_port : '] + + + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @property + def type(self): + return self._pvt_ptr[0].type + @type.setter + def type(self, unsigned char type): + self._pvt_ptr[0].type = type + + +cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: + """ + Graph instantiation parameters + + Attributes + ---------- + + flags : cuuint64_t + Instantiation flags + + + hUploadStream : CUstream + Upload stream + + + hErrNode_out : CUgraphNode + The node which caused instantiation to fail, if any + + + result_out : CUgraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + + + 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 + + self._flags = cuuint64_t(_ptr=&self._pvt_ptr[0].flags) + + + self._hUploadStream = CUstream(_ptr=&self._pvt_ptr[0].hUploadStream) + + + self._hErrNode_out = CUgraphNode(_ptr=&self._pvt_ptr[0].hErrNode_out) + + 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 += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['hUploadStream : ' + str(self.hUploadStream)] + except ValueError: + str_list += ['hUploadStream : '] + + + try: + str_list += ['hErrNode_out : ' + str(self.hErrNode_out)] + except ValueError: + str_list += ['hErrNode_out : '] + + + try: + str_list += ['result_out : ' + str(self.result_out)] + except ValueError: + str_list += ['result_out : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def flags(self): + return self._flags + @flags.setter + def flags(self, flags): + cdef cydriver.cuuint64_t cyflags + if flags is None: + cyflags = 0 + elif isinstance(flags, (cuuint64_t)): + pflags = int(flags) + cyflags = pflags + else: + pflags = int(cuuint64_t(flags)) + cyflags = pflags + self._flags._pvt_ptr[0] = cyflags + + + + @property + def hUploadStream(self): + return self._hUploadStream + @hUploadStream.setter + def hUploadStream(self, hUploadStream): + cdef cydriver.CUstream cyhUploadStream + if hUploadStream is None: + cyhUploadStream = 0 + elif isinstance(hUploadStream, (CUstream,)): + phUploadStream = int(hUploadStream) + cyhUploadStream = phUploadStream + else: + phUploadStream = int(CUstream(hUploadStream)) + cyhUploadStream = phUploadStream + self._hUploadStream._pvt_ptr[0] = cyhUploadStream + + + @property + def hErrNode_out(self): + return self._hErrNode_out + @hErrNode_out.setter + def hErrNode_out(self, hErrNode_out): + cdef cydriver.CUgraphNode cyhErrNode_out + if hErrNode_out is None: + cyhErrNode_out = 0 + elif isinstance(hErrNode_out, (CUgraphNode,)): + phErrNode_out = int(hErrNode_out) + cyhErrNode_out = phErrNode_out + else: + phErrNode_out = int(CUgraphNode(hErrNode_out)) + cyhErrNode_out = phErrNode_out + self._hErrNode_out._pvt_ptr[0] = cyhErrNode_out + + + @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) + + +cdef class CUlaunchMemSyncDomainMap_st: + """ + Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. + By default, kernels are launched in domain 0. Kernel launched with + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. + User may also alter the domain ID with CUlaunchMemSyncDomainMap for + a specific stream / graph node / kernel launch. See + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is + available through CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT. + + Attributes + ---------- + + default_ : bytes + The default domain ID to use for designated kernels + + + remote : bytes + The remote domain ID to use for designated kernels + + + 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 += ['default_ : ' + str(self.default_)] + except ValueError: + str_list += ['default_ : '] + + + try: + str_list += ['remote : ' + str(self.remote)] + except ValueError: + str_list += ['remote : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def default_(self): + return self._pvt_ptr[0].default_ + @default_.setter + def default_(self, unsigned char default_): + self._pvt_ptr[0].default_ = default_ + + + @property + def remote(self): + return self._pvt_ptr[0].remote + @remote.setter + def remote(self, unsigned char remote): + self._pvt_ptr[0].remote = remote + + +cdef class anon_struct1: + """ + Attributes + ---------- + + x : unsigned int + + + + y : unsigned int + + + + z : 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].clusterDim + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + + + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + + + try: + str_list += ['z : ' + str(self.z)] + except ValueError: + str_list += ['z : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + +cdef class anon_struct2: + """ + Attributes + ---------- + + event : CUevent + + + + flags : int + + + + triggerAtBlockStart : 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 + + self._event = CUevent(_ptr=&self._pvt_ptr[0].programmaticEvent.event) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].programmaticEvent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['triggerAtBlockStart : ' + str(self.triggerAtBlockStart)] + except ValueError: + str_list += ['triggerAtBlockStart : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cydriver.CUevent cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(CUevent(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + + + @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 + + + @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 + + +cdef class anon_struct3: + """ + Attributes + ---------- + + event : CUevent + + + + flags : 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 + + self._event = CUevent(_ptr=&self._pvt_ptr[0].launchCompletionEvent.event) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].launchCompletionEvent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cydriver.CUevent cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(CUevent(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + + + @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 + + +cdef class anon_struct4: + """ + Attributes + ---------- + + x : unsigned int + + + + y : unsigned int + + + + z : 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].preferredClusterDim + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + + + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + + + try: + str_list += ['z : ' + str(self.z)] + except ValueError: + str_list += ['z : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + +cdef class anon_struct5: + """ + Attributes + ---------- + + deviceUpdatable : int + + + + devNode : CUgraphDeviceNode + + + + 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._devNode = CUgraphDeviceNode(_ptr=&self._pvt_ptr[0].deviceUpdatableKernelNode.devNode) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].deviceUpdatableKernelNode + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['deviceUpdatable : ' + str(self.deviceUpdatable)] + except ValueError: + str_list += ['deviceUpdatable : '] + + + try: + str_list += ['devNode : ' + str(self.devNode)] + except ValueError: + str_list += ['devNode : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @property + def devNode(self): + return self._devNode + @devNode.setter + def devNode(self, devNode): + cdef cydriver.CUgraphDeviceNode cydevNode + if devNode is None: + cydevNode = 0 + elif isinstance(devNode, (CUgraphDeviceNode,)): + pdevNode = int(devNode) + cydevNode = pdevNode + else: + pdevNode = int(CUgraphDeviceNode(devNode)) + cydevNode = pdevNode + self._devNode._pvt_ptr[0] = cydevNode + + +cdef class CUlaunchAttributeValue_union: + """ + Launch attributes union; used as value field of CUlaunchAttribute + + Attributes + ---------- + + pad : bytes + + + + accessPolicyWindow : CUaccessPolicyWindow + Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. + + + cooperative : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero + indicates a cooperative kernel (see cuLaunchCooperativeKernel). + + + syncPolicy : CUsynchronizationPolicy + Value of launch attribute + 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. + Opaque type with the following fields: - `x` - The X dimension of + the cluster, in blocks. Must be a divisor of the grid X dimension. + - `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. + + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster + scheduling policy preference for the kernel. + + + programmaticStreamSerializationAllowed : int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. + + + programmaticEvent : anon_struct2 + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + with the following fields: - `CUevent` event - Event to fire when + all blocks trigger it. - `Event` record flags, see + cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. + - `triggerAtBlockStart` - If this is set to non-0, each block + launch will automatically trigger the event. + + + 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. + + + priority : int + Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution + priority of the kernel. + + + memSyncDomainMap : CUlaunchMemSyncDomainMap + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. + See CUlaunchMemSyncDomainMap. + + + memSyncDomain : CUlaunchMemSyncDomain + Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. + See::CUlaunchMemSyncDomain + + + preferredClusterDim : anon_struct4 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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 + CUlaunchAttributeValue::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 + CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + CUlaunchAttributeValue::clusterDim. + + + deviceUpdatableKernelNode : anon_struct5 + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the + following fields: - `int` deviceUpdatable - Whether or not the + resulting kernel node should be device-updatable. - + `CUgraphDeviceNode` devNode - Returns a handle to pass to the + various device-side update functions. + + + sharedMemCarveout : unsigned int + Value of launch attribute + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. + + + 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 + + self._accessPolicyWindow = CUaccessPolicyWindow(_ptr=&self._pvt_ptr[0].accessPolicyWindow) + + + self._clusterDim = anon_struct1(_ptr=self._pvt_ptr) + + + self._programmaticEvent = anon_struct2(_ptr=self._pvt_ptr) + + + self._launchCompletionEvent = anon_struct3(_ptr=self._pvt_ptr) + + + self._memSyncDomainMap = CUlaunchMemSyncDomainMap(_ptr=&self._pvt_ptr[0].memSyncDomainMap) + + + self._preferredClusterDim = anon_struct4(_ptr=self._pvt_ptr) + + + self._deviceUpdatableKernelNode = anon_struct5(_ptr=self._pvt_ptr) + + 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 += ['pad : ' + str(self.pad)] + except ValueError: + str_list += ['pad : '] + + + try: + str_list += ['accessPolicyWindow :\n' + '\n'.join([' ' + line for line in str(self.accessPolicyWindow).splitlines()])] + except ValueError: + str_list += ['accessPolicyWindow : '] + + + try: + str_list += ['cooperative : ' + str(self.cooperative)] + except ValueError: + str_list += ['cooperative : '] + + + try: + str_list += ['syncPolicy : ' + str(self.syncPolicy)] + except ValueError: + str_list += ['syncPolicy : '] + + + try: + str_list += ['clusterDim :\n' + '\n'.join([' ' + line for line in str(self.clusterDim).splitlines()])] + except ValueError: + str_list += ['clusterDim : '] + + + try: + str_list += ['clusterSchedulingPolicyPreference : ' + str(self.clusterSchedulingPolicyPreference)] + except ValueError: + str_list += ['clusterSchedulingPolicyPreference : '] + + + try: + str_list += ['programmaticStreamSerializationAllowed : ' + str(self.programmaticStreamSerializationAllowed)] + except ValueError: + str_list += ['programmaticStreamSerializationAllowed : '] + + + try: + str_list += ['programmaticEvent :\n' + '\n'.join([' ' + line for line in str(self.programmaticEvent).splitlines()])] + except ValueError: + str_list += ['programmaticEvent : '] + + + try: + str_list += ['launchCompletionEvent :\n' + '\n'.join([' ' + line for line in str(self.launchCompletionEvent).splitlines()])] + except ValueError: + str_list += ['launchCompletionEvent : '] + + + try: + str_list += ['priority : ' + str(self.priority)] + except ValueError: + str_list += ['priority : '] + + + try: + str_list += ['memSyncDomainMap :\n' + '\n'.join([' ' + line for line in str(self.memSyncDomainMap).splitlines()])] + except ValueError: + str_list += ['memSyncDomainMap : '] + + + try: + str_list += ['memSyncDomain : ' + str(self.memSyncDomain)] + except ValueError: + str_list += ['memSyncDomain : '] + + + try: + str_list += ['preferredClusterDim :\n' + '\n'.join([' ' + line for line in str(self.preferredClusterDim).splitlines()])] + except ValueError: + str_list += ['preferredClusterDim : '] + + + try: + str_list += ['deviceUpdatableKernelNode :\n' + '\n'.join([' ' + line for line in str(self.deviceUpdatableKernelNode).splitlines()])] + except ValueError: + str_list += ['deviceUpdatableKernelNode : '] + + + try: + str_list += ['sharedMemCarveout : ' + str(self.sharedMemCarveout)] + except ValueError: + str_list += ['sharedMemCarveout : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def pad(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].pad, 64) + @pad.setter + def pad(self, pad): + if len(pad) != 64: + raise ValueError("pad length must be 64, is " + str(len(pad))) + if CHAR_MIN == 0: + for i, b in enumerate(pad): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].pad[i] = b + else: + for i, b in enumerate(pad): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].pad[i] = b + + + @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)) + + + @property + def cooperative(self): + return self._pvt_ptr[0].cooperative + @cooperative.setter + def cooperative(self, int cooperative): + self._pvt_ptr[0].cooperative = cooperative + + + @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) + + + @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)) + + + @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) + + + @property + def programmaticStreamSerializationAllowed(self): + return self._pvt_ptr[0].programmaticStreamSerializationAllowed + @programmaticStreamSerializationAllowed.setter + def programmaticStreamSerializationAllowed(self, int programmaticStreamSerializationAllowed): + self._pvt_ptr[0].programmaticStreamSerializationAllowed = programmaticStreamSerializationAllowed + + + @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)) + + + @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)) + + + @property + def priority(self): + return self._pvt_ptr[0].priority + @priority.setter + def priority(self, int priority): + self._pvt_ptr[0].priority = priority + + + @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)) + + + @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) + + + @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)) + + + @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)) + + + @property + def sharedMemCarveout(self): + return self._pvt_ptr[0].sharedMemCarveout + @sharedMemCarveout.setter + def sharedMemCarveout(self, unsigned int sharedMemCarveout): + self._pvt_ptr[0].sharedMemCarveout = sharedMemCarveout + + +cdef class CUlaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + + id : CUlaunchAttributeID + Attribute to set + + + value : CUlaunchAttributeValue + Value of the attribute + + + 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 + + self._value = CUlaunchAttributeValue(_ptr=&self._pvt_ptr[0].value) + + 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 += ['id : ' + str(self.id)] + except ValueError: + str_list += ['id : '] + + + try: + str_list += ['value :\n' + '\n'.join([' ' + line for line in str(self.value).splitlines()])] + except ValueError: + str_list += ['value : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + +cdef class CUlaunchConfig_st: + """ + CUDA extensible launch configuration + + Attributes + ---------- + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + attrs : CUlaunchAttribute + List of attributes; nullable if CUlaunchConfig::numAttrs == 0 + + + numAttrs : unsigned int + Number of attributes populated in CUlaunchConfig::attrs + + + 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 + + self._hStream = CUstream(_ptr=&self._pvt_ptr[0].hStream) + + def __dealloc__(self): + pass + + if self._attrs is not NULL: + free(self._attrs) + 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 = [] + + try: + str_list += ['gridDimX : ' + str(self.gridDimX)] + except ValueError: + str_list += ['gridDimX : '] + + + try: + str_list += ['gridDimY : ' + str(self.gridDimY)] + except ValueError: + str_list += ['gridDimY : '] + + + try: + str_list += ['gridDimZ : ' + str(self.gridDimZ)] + except ValueError: + str_list += ['gridDimZ : '] + + + try: + str_list += ['blockDimX : ' + str(self.blockDimX)] + except ValueError: + str_list += ['blockDimX : '] + + + try: + str_list += ['blockDimY : ' + str(self.blockDimY)] + except ValueError: + str_list += ['blockDimY : '] + + + try: + str_list += ['blockDimZ : ' + str(self.blockDimZ)] + except ValueError: + str_list += ['blockDimZ : '] + + + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + + + try: + str_list += ['hStream : ' + str(self.hStream)] + except ValueError: + str_list += ['hStream : '] + + + try: + str_list += ['attrs : ' + str(self.attrs)] + except ValueError: + str_list += ['attrs : '] + + + try: + str_list += ['numAttrs : ' + str(self.numAttrs)] + except ValueError: + str_list += ['numAttrs : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def gridDimX(self): + return self._pvt_ptr[0].gridDimX + @gridDimX.setter + def gridDimX(self, unsigned int gridDimX): + self._pvt_ptr[0].gridDimX = gridDimX + + + @property + def gridDimY(self): + return self._pvt_ptr[0].gridDimY + @gridDimY.setter + def gridDimY(self, unsigned int gridDimY): + self._pvt_ptr[0].gridDimY = gridDimY + + + @property + def gridDimZ(self): + return self._pvt_ptr[0].gridDimZ + @gridDimZ.setter + def gridDimZ(self, unsigned int gridDimZ): + self._pvt_ptr[0].gridDimZ = gridDimZ + + + @property + def blockDimX(self): + return self._pvt_ptr[0].blockDimX + @blockDimX.setter + def blockDimX(self, unsigned int blockDimX): + self._pvt_ptr[0].blockDimX = blockDimX + + + @property + def blockDimY(self): + return self._pvt_ptr[0].blockDimY + @blockDimY.setter + def blockDimY(self, unsigned int blockDimY): + self._pvt_ptr[0].blockDimY = blockDimY + + + @property + def blockDimZ(self): + return self._pvt_ptr[0].blockDimZ + @blockDimZ.setter + def blockDimZ(self, unsigned int blockDimZ): + self._pvt_ptr[0].blockDimZ = blockDimZ + + + @property + def sharedMemBytes(self): + return self._pvt_ptr[0].sharedMemBytes + @sharedMemBytes.setter + def sharedMemBytes(self, unsigned int sharedMemBytes): + self._pvt_ptr[0].sharedMemBytes = sharedMemBytes + + + @property + def hStream(self): + return self._hStream + @hStream.setter + def hStream(self, hStream): + cdef cydriver.CUstream cyhStream + if hStream is None: + cyhStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + cyhStream = phStream + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + self._hStream._pvt_ptr[0] = cyhStream + + + @property + def attrs(self): + arrs = [self._pvt_ptr[0].attrs + x*sizeof(cydriver.CUlaunchAttribute) for x in range(self._attrs_length)] + return [CUlaunchAttribute(_ptr=arr) for arr in arrs] + @attrs.setter + def attrs(self, val): + cdef cydriver.CUlaunchAttribute* _attrs_new + if len(val) == 0: + free(self._attrs) + self._attrs = NULL + self._attrs_length = 0 + self._pvt_ptr[0].attrs = NULL + else: + if self._attrs_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _attrs_new = calloc(len(val), sizeof(cydriver.CUlaunchAttribute)) + if _attrs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUlaunchAttribute))) + for idx in range(len(val)): + string.memcpy(&_attrs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) + free(self._attrs) + self._attrs = _attrs_new + self._attrs_length = len(val) + self._pvt_ptr[0].attrs = _attrs_new + else: + for idx in range(len(val)): + string.memcpy(&self._attrs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) + + + + @property + def numAttrs(self): + return self._pvt_ptr[0].numAttrs + @numAttrs.setter + def numAttrs(self, unsigned int numAttrs): + self._pvt_ptr[0].numAttrs = numAttrs + + +cdef class CUexecAffinitySmCount_st: + """ + Value for CU_EXEC_AFFINITY_TYPE_SM_COUNT + + Attributes + ---------- + + val : unsigned int + The number of SMs the context is limited to use. + + + 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 += ['val : ' + str(self.val)] + except ValueError: + str_list += ['val : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def val(self): + return self._pvt_ptr[0].val + @val.setter + def val(self, unsigned int val): + self._pvt_ptr[0].val = val + + +cdef class anon_union3: + """ + Attributes + ---------- + + smCount : CUexecAffinitySmCount + + + + 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._smCount = CUexecAffinitySmCount(_ptr=&self._pvt_ptr[0].param.smCount) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].param + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['smCount :\n' + '\n'.join([' ' + line for line in str(self.smCount).splitlines()])] + except ValueError: + str_list += ['smCount : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + +cdef class CUexecAffinityParam_st: + """ + Execution Affinity Parameters + + Attributes + ---------- + + type : CUexecAffinityType + + + + param : anon_union3 + + + + 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.CUexecAffinityParam_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._param = anon_union3(_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 += ['param :\n' + '\n'.join([' ' + line for line in str(self.param).splitlines()])] + except ValueError: + str_list += ['param : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + +cdef class CUctxCigParam_st: + """ + CIG Context Create Params + + Attributes + ---------- + + sharedDataType : CUcigDataType + + + + sharedData : Any + + + + 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 += ['sharedDataType : ' + str(self.sharedDataType)] + except ValueError: + str_list += ['sharedDataType : '] + + + try: + str_list += ['sharedData : ' + hex(self.sharedData)] + except ValueError: + str_list += ['sharedData : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def sharedData(self): + return self._pvt_ptr[0].sharedData + @sharedData.setter + def sharedData(self, sharedData): + self._cysharedData = _HelperInputVoidPtr(sharedData) + self._pvt_ptr[0].sharedData = self._cysharedData.cptr + + +cdef class CUctxCreateParams_st: + """ + Params for creating CUDA context Exactly one of execAffinityParams + and cigParams must be non-NULL. + + Attributes + ---------- + + execAffinityParams : CUexecAffinityParam + + + + numExecAffinityParams : int + + + + cigParams : CUctxCigParam + + + + 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 + + if self._execAffinityParams is not NULL: + free(self._execAffinityParams) + self._pvt_ptr[0].execAffinityParams = NULL + + + if self._cigParams is not NULL: + free(self._cigParams) + 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 = [] + + try: + str_list += ['execAffinityParams : ' + str(self.execAffinityParams)] + except ValueError: + str_list += ['execAffinityParams : '] + + + try: + str_list += ['numExecAffinityParams : ' + str(self.numExecAffinityParams)] + except ValueError: + str_list += ['numExecAffinityParams : '] + + + try: + str_list += ['cigParams : ' + str(self.cigParams)] + except ValueError: + str_list += ['cigParams : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def execAffinityParams(self): + arrs = [self._pvt_ptr[0].execAffinityParams + x*sizeof(cydriver.CUexecAffinityParam) for x in range(self._execAffinityParams_length)] + return [CUexecAffinityParam(_ptr=arr) for arr in arrs] + @execAffinityParams.setter + def execAffinityParams(self, val): + cdef cydriver.CUexecAffinityParam* _execAffinityParams_new + if len(val) == 0: + free(self._execAffinityParams) + self._execAffinityParams = NULL + self._execAffinityParams_length = 0 + self._pvt_ptr[0].execAffinityParams = NULL + else: + if self._execAffinityParams_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _execAffinityParams_new = calloc(len(val), sizeof(cydriver.CUexecAffinityParam)) + if _execAffinityParams_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexecAffinityParam))) + for idx in range(len(val)): + string.memcpy(&_execAffinityParams_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) + free(self._execAffinityParams) + self._execAffinityParams = _execAffinityParams_new + self._execAffinityParams_length = len(val) + self._pvt_ptr[0].execAffinityParams = _execAffinityParams_new + else: + for idx in range(len(val)): + string.memcpy(&self._execAffinityParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) + + + + @property + def numExecAffinityParams(self): + return self._pvt_ptr[0].numExecAffinityParams + @numExecAffinityParams.setter + def numExecAffinityParams(self, int numExecAffinityParams): + self._pvt_ptr[0].numExecAffinityParams = numExecAffinityParams + + + @property + def cigParams(self): + arrs = [self._pvt_ptr[0].cigParams + x*sizeof(cydriver.CUctxCigParam) for x in range(self._cigParams_length)] + return [CUctxCigParam(_ptr=arr) for arr in arrs] + @cigParams.setter + def cigParams(self, val): + cdef cydriver.CUctxCigParam* _cigParams_new + if len(val) == 0: + free(self._cigParams) + self._cigParams = NULL + self._cigParams_length = 0 + self._pvt_ptr[0].cigParams = NULL + else: + if self._cigParams_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _cigParams_new = calloc(len(val), sizeof(cydriver.CUctxCigParam)) + if _cigParams_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUctxCigParam))) + for idx in range(len(val)): + string.memcpy(&_cigParams_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) + free(self._cigParams) + self._cigParams = _cigParams_new + self._cigParams_length = len(val) + self._pvt_ptr[0].cigParams = _cigParams_new + else: + for idx in range(len(val)): + string.memcpy(&self._cigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) + + + +cdef class CUlibraryHostUniversalFunctionAndDataTable_st: + """ + Attributes + ---------- + + functionTable : Any + + + + functionWindowSize : size_t + + + + dataTable : Any + + + + dataWindowSize : size_t + + + + 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 += ['functionTable : ' + hex(self.functionTable)] + except ValueError: + str_list += ['functionTable : '] + + + try: + str_list += ['functionWindowSize : ' + str(self.functionWindowSize)] + except ValueError: + str_list += ['functionWindowSize : '] + + + try: + str_list += ['dataTable : ' + hex(self.dataTable)] + except ValueError: + str_list += ['dataTable : '] + + + try: + str_list += ['dataWindowSize : ' + str(self.dataWindowSize)] + except ValueError: + str_list += ['dataWindowSize : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def functionTable(self): + return self._pvt_ptr[0].functionTable + @functionTable.setter + def functionTable(self, functionTable): + self._cyfunctionTable = _HelperInputVoidPtr(functionTable) + self._pvt_ptr[0].functionTable = self._cyfunctionTable.cptr + + + @property + def functionWindowSize(self): + return self._pvt_ptr[0].functionWindowSize + @functionWindowSize.setter + def functionWindowSize(self, size_t functionWindowSize): + self._pvt_ptr[0].functionWindowSize = functionWindowSize + + + @property + def dataTable(self): + return self._pvt_ptr[0].dataTable + @dataTable.setter + def dataTable(self, dataTable): + self._cydataTable = _HelperInputVoidPtr(dataTable) + self._pvt_ptr[0].dataTable = self._cydataTable.cptr + + + @property + def dataWindowSize(self): + return self._pvt_ptr[0].dataWindowSize + @dataWindowSize.setter + def dataWindowSize(self, size_t dataWindowSize): + self._pvt_ptr[0].dataWindowSize = dataWindowSize + + +cdef class CUDA_MEMCPY2D_st: + """ + 2D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + WidthInBytes : size_t + Width of 2D memory copy in bytes + + + Height : size_t + Height of 2D memory copy + + + 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 + + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) + + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) + + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) + + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) + + 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 += ['srcXInBytes : ' + str(self.srcXInBytes)] + except ValueError: + str_list += ['srcXInBytes : '] + + + try: + str_list += ['srcY : ' + str(self.srcY)] + except ValueError: + str_list += ['srcY : '] + + + try: + str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] + except ValueError: + str_list += ['srcMemoryType : '] + + + try: + str_list += ['srcHost : ' + hex(self.srcHost)] + except ValueError: + str_list += ['srcHost : '] + + + try: + str_list += ['srcDevice : ' + str(self.srcDevice)] + except ValueError: + str_list += ['srcDevice : '] + + + try: + str_list += ['srcArray : ' + str(self.srcArray)] + except ValueError: + str_list += ['srcArray : '] + + + try: + str_list += ['srcPitch : ' + str(self.srcPitch)] + except ValueError: + str_list += ['srcPitch : '] + + + try: + str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] + except ValueError: + str_list += ['dstXInBytes : '] + + + try: + str_list += ['dstY : ' + str(self.dstY)] + except ValueError: + str_list += ['dstY : '] + + + try: + str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] + except ValueError: + str_list += ['dstMemoryType : '] + + + try: + str_list += ['dstHost : ' + hex(self.dstHost)] + except ValueError: + str_list += ['dstHost : '] + + + try: + str_list += ['dstDevice : ' + str(self.dstDevice)] + except ValueError: + str_list += ['dstDevice : '] + + + try: + str_list += ['dstArray : ' + str(self.dstArray)] + except ValueError: + str_list += ['dstArray : '] + + + try: + str_list += ['dstPitch : ' + str(self.dstPitch)] + except ValueError: + str_list += ['dstPitch : '] + + + try: + str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] + except ValueError: + str_list += ['WidthInBytes : '] + + + try: + str_list += ['Height : ' + str(self.Height)] + except ValueError: + str_list += ['Height : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def srcXInBytes(self): + return self._pvt_ptr[0].srcXInBytes + @srcXInBytes.setter + def srcXInBytes(self, size_t srcXInBytes): + self._pvt_ptr[0].srcXInBytes = srcXInBytes + + + @property + def srcY(self): + return self._pvt_ptr[0].srcY + @srcY.setter + def srcY(self, size_t srcY): + self._pvt_ptr[0].srcY = srcY + + + @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) + + + @property + def srcHost(self): + return self._pvt_ptr[0].srcHost + @srcHost.setter + def srcHost(self, srcHost): + self._cysrcHost = _HelperInputVoidPtr(srcHost) + self._pvt_ptr[0].srcHost = self._cysrcHost.cptr + + + @property + def srcDevice(self): + return self._srcDevice + @srcDevice.setter + def srcDevice(self, srcDevice): + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + cysrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr)): + psrcDevice = int(srcDevice) + cysrcDevice = psrcDevice + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + self._srcDevice._pvt_ptr[0] = cysrcDevice + + + + @property + def srcArray(self): + return self._srcArray + @srcArray.setter + def srcArray(self, srcArray): + cdef cydriver.CUarray cysrcArray + if srcArray is None: + cysrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + cysrcArray = psrcArray + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + self._srcArray._pvt_ptr[0] = cysrcArray + + + @property + def srcPitch(self): + return self._pvt_ptr[0].srcPitch + @srcPitch.setter + def srcPitch(self, size_t srcPitch): + self._pvt_ptr[0].srcPitch = srcPitch + + + @property + def dstXInBytes(self): + return self._pvt_ptr[0].dstXInBytes + @dstXInBytes.setter + def dstXInBytes(self, size_t dstXInBytes): + self._pvt_ptr[0].dstXInBytes = dstXInBytes + + + @property + def dstY(self): + return self._pvt_ptr[0].dstY + @dstY.setter + def dstY(self, size_t dstY): + self._pvt_ptr[0].dstY = dstY + + + @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) + + + @property + def dstHost(self): + return self._pvt_ptr[0].dstHost + @dstHost.setter + def dstHost(self, dstHost): + self._cydstHost = _HelperInputVoidPtr(dstHost) + self._pvt_ptr[0].dstHost = self._cydstHost.cptr + + + @property + def dstDevice(self): + return self._dstDevice + @dstDevice.setter + def dstDevice(self, dstDevice): + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + cydstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr)): + pdstDevice = int(dstDevice) + cydstDevice = pdstDevice + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + self._dstDevice._pvt_ptr[0] = cydstDevice + + + + @property + def dstArray(self): + return self._dstArray + @dstArray.setter + def dstArray(self, dstArray): + cdef cydriver.CUarray cydstArray + if dstArray is None: + cydstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + cydstArray = pdstArray + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + self._dstArray._pvt_ptr[0] = cydstArray + + + @property + def dstPitch(self): + return self._pvt_ptr[0].dstPitch + @dstPitch.setter + def dstPitch(self, size_t dstPitch): + self._pvt_ptr[0].dstPitch = dstPitch + + + @property + def WidthInBytes(self): + return self._pvt_ptr[0].WidthInBytes + @WidthInBytes.setter + def WidthInBytes(self, size_t WidthInBytes): + self._pvt_ptr[0].WidthInBytes = WidthInBytes + + + @property + def Height(self): + return self._pvt_ptr[0].Height + @Height.setter + def Height(self, size_t Height): + self._pvt_ptr[0].Height = Height + + +cdef class CUDA_MEMCPY3D_st: + """ + 3D memory copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + 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 + + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) + + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) + + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) + + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) + + 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 += ['srcXInBytes : ' + str(self.srcXInBytes)] + except ValueError: + str_list += ['srcXInBytes : '] + + + try: + str_list += ['srcY : ' + str(self.srcY)] + except ValueError: + str_list += ['srcY : '] + + + try: + str_list += ['srcZ : ' + str(self.srcZ)] + except ValueError: + str_list += ['srcZ : '] + + + try: + str_list += ['srcLOD : ' + str(self.srcLOD)] + except ValueError: + str_list += ['srcLOD : '] + + + try: + str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] + except ValueError: + str_list += ['srcMemoryType : '] + + + try: + str_list += ['srcHost : ' + hex(self.srcHost)] + except ValueError: + str_list += ['srcHost : '] + + + try: + str_list += ['srcDevice : ' + str(self.srcDevice)] + except ValueError: + str_list += ['srcDevice : '] + + + try: + str_list += ['srcArray : ' + str(self.srcArray)] + except ValueError: + str_list += ['srcArray : '] + + + try: + str_list += ['srcPitch : ' + str(self.srcPitch)] + except ValueError: + str_list += ['srcPitch : '] + + + try: + str_list += ['srcHeight : ' + str(self.srcHeight)] + except ValueError: + str_list += ['srcHeight : '] + + + try: + str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] + except ValueError: + str_list += ['dstXInBytes : '] + + + try: + str_list += ['dstY : ' + str(self.dstY)] + except ValueError: + str_list += ['dstY : '] + + + try: + str_list += ['dstZ : ' + str(self.dstZ)] + except ValueError: + str_list += ['dstZ : '] + + + try: + str_list += ['dstLOD : ' + str(self.dstLOD)] + except ValueError: + str_list += ['dstLOD : '] + + + try: + str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] + except ValueError: + str_list += ['dstMemoryType : '] + + + try: + str_list += ['dstHost : ' + hex(self.dstHost)] + except ValueError: + str_list += ['dstHost : '] + + + try: + str_list += ['dstDevice : ' + str(self.dstDevice)] + except ValueError: + str_list += ['dstDevice : '] + + + try: + str_list += ['dstArray : ' + str(self.dstArray)] + except ValueError: + str_list += ['dstArray : '] + + + try: + str_list += ['dstPitch : ' + str(self.dstPitch)] + except ValueError: + str_list += ['dstPitch : '] + + + try: + str_list += ['dstHeight : ' + str(self.dstHeight)] + except ValueError: + str_list += ['dstHeight : '] + + + try: + str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] + except ValueError: + str_list += ['WidthInBytes : '] + + + try: + str_list += ['Height : ' + str(self.Height)] + except ValueError: + str_list += ['Height : '] + + + try: + str_list += ['Depth : ' + str(self.Depth)] + except ValueError: + str_list += ['Depth : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def srcXInBytes(self): + return self._pvt_ptr[0].srcXInBytes + @srcXInBytes.setter + def srcXInBytes(self, size_t srcXInBytes): + self._pvt_ptr[0].srcXInBytes = srcXInBytes + + + @property + def srcY(self): + return self._pvt_ptr[0].srcY + @srcY.setter + def srcY(self, size_t srcY): + self._pvt_ptr[0].srcY = srcY + + + @property + def srcZ(self): + return self._pvt_ptr[0].srcZ + @srcZ.setter + def srcZ(self, size_t srcZ): + self._pvt_ptr[0].srcZ = srcZ + + + @property + def srcLOD(self): + return self._pvt_ptr[0].srcLOD + @srcLOD.setter + def srcLOD(self, size_t srcLOD): + self._pvt_ptr[0].srcLOD = srcLOD + + + @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) + + + @property + def srcHost(self): + return self._pvt_ptr[0].srcHost + @srcHost.setter + def srcHost(self, srcHost): + self._cysrcHost = _HelperInputVoidPtr(srcHost) + self._pvt_ptr[0].srcHost = self._cysrcHost.cptr + + + @property + def srcDevice(self): + return self._srcDevice + @srcDevice.setter + def srcDevice(self, srcDevice): + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + cysrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr)): + psrcDevice = int(srcDevice) + cysrcDevice = psrcDevice + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + self._srcDevice._pvt_ptr[0] = cysrcDevice + + + + @property + def srcArray(self): + return self._srcArray + @srcArray.setter + def srcArray(self, srcArray): + cdef cydriver.CUarray cysrcArray + if srcArray is None: + cysrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + cysrcArray = psrcArray + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + self._srcArray._pvt_ptr[0] = cysrcArray + + + @property + def srcPitch(self): + return self._pvt_ptr[0].srcPitch + @srcPitch.setter + def srcPitch(self, size_t srcPitch): + self._pvt_ptr[0].srcPitch = srcPitch + + + @property + def srcHeight(self): + return self._pvt_ptr[0].srcHeight + @srcHeight.setter + def srcHeight(self, size_t srcHeight): + self._pvt_ptr[0].srcHeight = srcHeight + + + @property + def dstXInBytes(self): + return self._pvt_ptr[0].dstXInBytes + @dstXInBytes.setter + def dstXInBytes(self, size_t dstXInBytes): + self._pvt_ptr[0].dstXInBytes = dstXInBytes + + + @property + def dstY(self): + return self._pvt_ptr[0].dstY + @dstY.setter + def dstY(self, size_t dstY): + self._pvt_ptr[0].dstY = dstY + + + @property + def dstZ(self): + return self._pvt_ptr[0].dstZ + @dstZ.setter + def dstZ(self, size_t dstZ): + self._pvt_ptr[0].dstZ = dstZ + + + @property + def dstLOD(self): + return self._pvt_ptr[0].dstLOD + @dstLOD.setter + def dstLOD(self, size_t dstLOD): + self._pvt_ptr[0].dstLOD = dstLOD + + + @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) + + + @property + def dstHost(self): + return self._pvt_ptr[0].dstHost + @dstHost.setter + def dstHost(self, dstHost): + self._cydstHost = _HelperInputVoidPtr(dstHost) + self._pvt_ptr[0].dstHost = self._cydstHost.cptr + + + @property + def dstDevice(self): + return self._dstDevice + @dstDevice.setter + def dstDevice(self, dstDevice): + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + cydstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr)): + pdstDevice = int(dstDevice) + cydstDevice = pdstDevice + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + self._dstDevice._pvt_ptr[0] = cydstDevice + + + + @property + def dstArray(self): + return self._dstArray + @dstArray.setter + def dstArray(self, dstArray): + cdef cydriver.CUarray cydstArray + if dstArray is None: + cydstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + cydstArray = pdstArray + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + self._dstArray._pvt_ptr[0] = cydstArray + + + @property + def dstPitch(self): + return self._pvt_ptr[0].dstPitch + @dstPitch.setter + def dstPitch(self, size_t dstPitch): + self._pvt_ptr[0].dstPitch = dstPitch + + + @property + def dstHeight(self): + return self._pvt_ptr[0].dstHeight + @dstHeight.setter + def dstHeight(self, size_t dstHeight): + self._pvt_ptr[0].dstHeight = dstHeight + + + @property + def WidthInBytes(self): + return self._pvt_ptr[0].WidthInBytes + @WidthInBytes.setter + def WidthInBytes(self, size_t WidthInBytes): + self._pvt_ptr[0].WidthInBytes = WidthInBytes + + + @property + def Height(self): + return self._pvt_ptr[0].Height + @Height.setter + def Height(self, size_t Height): + self._pvt_ptr[0].Height = Height + + + @property + def Depth(self): + return self._pvt_ptr[0].Depth + @Depth.setter + def Depth(self, size_t Depth): + self._pvt_ptr[0].Depth = Depth + + +cdef class CUDA_MEMCPY3D_PEER_st: + """ + 3D memory cross-context copy parameters + + Attributes + ---------- + + srcXInBytes : size_t + Source X in bytes + + + srcY : size_t + Source Y + + + srcZ : size_t + Source Z + + + srcLOD : size_t + Source LOD + + + srcMemoryType : CUmemorytype + Source memory type (host, device, array) + + + srcHost : Any + Source host pointer + + + srcDevice : CUdeviceptr + Source device pointer + + + srcArray : CUarray + Source array reference + + + srcContext : CUcontext + Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) + + + srcPitch : size_t + Source pitch (ignored when src is array) + + + srcHeight : size_t + Source height (ignored when src is array; may be 0 if Depth==1) + + + dstXInBytes : size_t + Destination X in bytes + + + dstY : size_t + Destination Y + + + dstZ : size_t + Destination Z + + + dstLOD : size_t + Destination LOD + + + dstMemoryType : CUmemorytype + Destination memory type (host, device, array) + + + dstHost : Any + Destination host pointer + + + dstDevice : CUdeviceptr + Destination device pointer + + + dstArray : CUarray + Destination array reference + + + dstContext : CUcontext + Destination context (ignored with dstMemoryType is + CU_MEMORYTYPE_ARRAY) + + + dstPitch : size_t + Destination pitch (ignored when dst is array) + + + dstHeight : size_t + Destination height (ignored when dst is array; may be 0 if + Depth==1) + + + WidthInBytes : size_t + Width of 3D memory copy in bytes + + + Height : size_t + Height of 3D memory copy + + + Depth : size_t + Depth of 3D memory copy + + + 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 + + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) + + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) + + + self._srcContext = CUcontext(_ptr=&self._pvt_ptr[0].srcContext) + + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) + + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) + + + self._dstContext = CUcontext(_ptr=&self._pvt_ptr[0].dstContext) + + 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 += ['srcXInBytes : ' + str(self.srcXInBytes)] + except ValueError: + str_list += ['srcXInBytes : '] + + + try: + str_list += ['srcY : ' + str(self.srcY)] + except ValueError: + str_list += ['srcY : '] + + + try: + str_list += ['srcZ : ' + str(self.srcZ)] + except ValueError: + str_list += ['srcZ : '] + + + try: + str_list += ['srcLOD : ' + str(self.srcLOD)] + except ValueError: + str_list += ['srcLOD : '] + + + try: + str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] + except ValueError: + str_list += ['srcMemoryType : '] + + + try: + str_list += ['srcHost : ' + hex(self.srcHost)] + except ValueError: + str_list += ['srcHost : '] + + + try: + str_list += ['srcDevice : ' + str(self.srcDevice)] + except ValueError: + str_list += ['srcDevice : '] + + + try: + str_list += ['srcArray : ' + str(self.srcArray)] + except ValueError: + str_list += ['srcArray : '] + + + try: + str_list += ['srcContext : ' + str(self.srcContext)] + except ValueError: + str_list += ['srcContext : '] + + + try: + str_list += ['srcPitch : ' + str(self.srcPitch)] + except ValueError: + str_list += ['srcPitch : '] + + + try: + str_list += ['srcHeight : ' + str(self.srcHeight)] + except ValueError: + str_list += ['srcHeight : '] + + + try: + str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] + except ValueError: + str_list += ['dstXInBytes : '] + + + try: + str_list += ['dstY : ' + str(self.dstY)] + except ValueError: + str_list += ['dstY : '] + + + try: + str_list += ['dstZ : ' + str(self.dstZ)] + except ValueError: + str_list += ['dstZ : '] + + + try: + str_list += ['dstLOD : ' + str(self.dstLOD)] + except ValueError: + str_list += ['dstLOD : '] + + + try: + str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] + except ValueError: + str_list += ['dstMemoryType : '] + + + try: + str_list += ['dstHost : ' + hex(self.dstHost)] + except ValueError: + str_list += ['dstHost : '] + + + try: + str_list += ['dstDevice : ' + str(self.dstDevice)] + except ValueError: + str_list += ['dstDevice : '] + + + try: + str_list += ['dstArray : ' + str(self.dstArray)] + except ValueError: + str_list += ['dstArray : '] + + + try: + str_list += ['dstContext : ' + str(self.dstContext)] + except ValueError: + str_list += ['dstContext : '] + + + try: + str_list += ['dstPitch : ' + str(self.dstPitch)] + except ValueError: + str_list += ['dstPitch : '] + + + try: + str_list += ['dstHeight : ' + str(self.dstHeight)] + except ValueError: + str_list += ['dstHeight : '] + + + try: + str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] + except ValueError: + str_list += ['WidthInBytes : '] + + + try: + str_list += ['Height : ' + str(self.Height)] + except ValueError: + str_list += ['Height : '] + + + try: + str_list += ['Depth : ' + str(self.Depth)] + except ValueError: + str_list += ['Depth : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def srcXInBytes(self): + return self._pvt_ptr[0].srcXInBytes + @srcXInBytes.setter + def srcXInBytes(self, size_t srcXInBytes): + self._pvt_ptr[0].srcXInBytes = srcXInBytes + + + @property + def srcY(self): + return self._pvt_ptr[0].srcY + @srcY.setter + def srcY(self, size_t srcY): + self._pvt_ptr[0].srcY = srcY + + + @property + def srcZ(self): + return self._pvt_ptr[0].srcZ + @srcZ.setter + def srcZ(self, size_t srcZ): + self._pvt_ptr[0].srcZ = srcZ + + + @property + def srcLOD(self): + return self._pvt_ptr[0].srcLOD + @srcLOD.setter + def srcLOD(self, size_t srcLOD): + self._pvt_ptr[0].srcLOD = srcLOD + + + @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) + + + @property + def srcHost(self): + return self._pvt_ptr[0].srcHost + @srcHost.setter + def srcHost(self, srcHost): + self._cysrcHost = _HelperInputVoidPtr(srcHost) + self._pvt_ptr[0].srcHost = self._cysrcHost.cptr + + + @property + def srcDevice(self): + return self._srcDevice + @srcDevice.setter + def srcDevice(self, srcDevice): + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + cysrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr)): + psrcDevice = int(srcDevice) + cysrcDevice = psrcDevice + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + self._srcDevice._pvt_ptr[0] = cysrcDevice + + + + @property + def srcArray(self): + return self._srcArray + @srcArray.setter + def srcArray(self, srcArray): + cdef cydriver.CUarray cysrcArray + if srcArray is None: + cysrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + cysrcArray = psrcArray + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + self._srcArray._pvt_ptr[0] = cysrcArray + + + @property + def srcContext(self): + return self._srcContext + @srcContext.setter + def srcContext(self, srcContext): + cdef cydriver.CUcontext cysrcContext + if srcContext is None: + cysrcContext = 0 + elif isinstance(srcContext, (CUcontext,)): + psrcContext = int(srcContext) + cysrcContext = psrcContext + else: + psrcContext = int(CUcontext(srcContext)) + cysrcContext = psrcContext + self._srcContext._pvt_ptr[0] = cysrcContext + + + @property + def srcPitch(self): + return self._pvt_ptr[0].srcPitch + @srcPitch.setter + def srcPitch(self, size_t srcPitch): + self._pvt_ptr[0].srcPitch = srcPitch + + + @property + def srcHeight(self): + return self._pvt_ptr[0].srcHeight + @srcHeight.setter + def srcHeight(self, size_t srcHeight): + self._pvt_ptr[0].srcHeight = srcHeight + + + @property + def dstXInBytes(self): + return self._pvt_ptr[0].dstXInBytes + @dstXInBytes.setter + def dstXInBytes(self, size_t dstXInBytes): + self._pvt_ptr[0].dstXInBytes = dstXInBytes + + + @property + def dstY(self): + return self._pvt_ptr[0].dstY + @dstY.setter + def dstY(self, size_t dstY): + self._pvt_ptr[0].dstY = dstY + + + @property + def dstZ(self): + return self._pvt_ptr[0].dstZ + @dstZ.setter + def dstZ(self, size_t dstZ): + self._pvt_ptr[0].dstZ = dstZ + + + @property + def dstLOD(self): + return self._pvt_ptr[0].dstLOD + @dstLOD.setter + def dstLOD(self, size_t dstLOD): + self._pvt_ptr[0].dstLOD = dstLOD + + + @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) + + + @property + def dstHost(self): + return self._pvt_ptr[0].dstHost + @dstHost.setter + def dstHost(self, dstHost): + self._cydstHost = _HelperInputVoidPtr(dstHost) + self._pvt_ptr[0].dstHost = self._cydstHost.cptr + + + @property + def dstDevice(self): + return self._dstDevice + @dstDevice.setter + def dstDevice(self, dstDevice): + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + cydstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr)): + pdstDevice = int(dstDevice) + cydstDevice = pdstDevice + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + self._dstDevice._pvt_ptr[0] = cydstDevice + + + + @property + def dstArray(self): + return self._dstArray + @dstArray.setter + def dstArray(self, dstArray): + cdef cydriver.CUarray cydstArray + if dstArray is None: + cydstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + cydstArray = pdstArray + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + self._dstArray._pvt_ptr[0] = cydstArray + + + @property + def dstContext(self): + return self._dstContext + @dstContext.setter + def dstContext(self, dstContext): + cdef cydriver.CUcontext cydstContext + if dstContext is None: + cydstContext = 0 + elif isinstance(dstContext, (CUcontext,)): + pdstContext = int(dstContext) + cydstContext = pdstContext + else: + pdstContext = int(CUcontext(dstContext)) + cydstContext = pdstContext + self._dstContext._pvt_ptr[0] = cydstContext + + + @property + def dstPitch(self): + return self._pvt_ptr[0].dstPitch + @dstPitch.setter + def dstPitch(self, size_t dstPitch): + self._pvt_ptr[0].dstPitch = dstPitch + + + @property + def dstHeight(self): + return self._pvt_ptr[0].dstHeight + @dstHeight.setter + def dstHeight(self, size_t dstHeight): + self._pvt_ptr[0].dstHeight = dstHeight + + + @property + def WidthInBytes(self): + return self._pvt_ptr[0].WidthInBytes + @WidthInBytes.setter + def WidthInBytes(self, size_t WidthInBytes): + self._pvt_ptr[0].WidthInBytes = WidthInBytes + + + @property + def Height(self): + return self._pvt_ptr[0].Height + @Height.setter + def Height(self, size_t Height): + self._pvt_ptr[0].Height = Height + + + @property + def Depth(self): + return self._pvt_ptr[0].Depth + @Depth.setter + def Depth(self, size_t Depth): + self._pvt_ptr[0].Depth = Depth + + +cdef class CUDA_MEMCPY_NODE_PARAMS_st: + """ + Memcpy node parameters + + Attributes + ---------- + + flags : int + Must be zero + + + copyCtx : CUcontext + Context on which to run the node + + + copyParams : CUDA_MEMCPY3D + Parameters for the memory copy + + + 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 + + self._copyCtx = CUcontext(_ptr=&self._pvt_ptr[0].copyCtx) + + + self._copyParams = CUDA_MEMCPY3D(_ptr=&self._pvt_ptr[0].copyParams) + + 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 += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['copyCtx : ' + str(self.copyCtx)] + except ValueError: + str_list += ['copyCtx : '] + + + try: + str_list += ['copyParams :\n' + '\n'.join([' ' + line for line in str(self.copyParams).splitlines()])] + except ValueError: + str_list += ['copyParams : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, int flags): + self._pvt_ptr[0].flags = flags + + + @property + def copyCtx(self): + return self._copyCtx + @copyCtx.setter + def copyCtx(self, copyCtx): + cdef cydriver.CUcontext cycopyCtx + if copyCtx is None: + cycopyCtx = 0 + elif isinstance(copyCtx, (CUcontext,)): + pcopyCtx = int(copyCtx) + cycopyCtx = pcopyCtx + else: + pcopyCtx = int(CUcontext(copyCtx)) + cycopyCtx = pcopyCtx + self._copyCtx._pvt_ptr[0] = cycopyCtx + + + @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)) + + +cdef class CUDA_ARRAY_DESCRIPTOR_st: + """ + Array descriptor + + Attributes + ---------- + + Width : size_t + Width of array + + + Height : size_t + Height of array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + 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 += ['Width : ' + str(self.Width)] + except ValueError: + str_list += ['Width : '] + + + try: + str_list += ['Height : ' + str(self.Height)] + except ValueError: + str_list += ['Height : '] + + + try: + str_list += ['Format : ' + str(self.Format)] + except ValueError: + str_list += ['Format : '] + + + try: + str_list += ['NumChannels : ' + str(self.NumChannels)] + except ValueError: + str_list += ['NumChannels : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def Width(self): + return self._pvt_ptr[0].Width + @Width.setter + def Width(self, size_t Width): + self._pvt_ptr[0].Width = Width + + + @property + def Height(self): + return self._pvt_ptr[0].Height + @Height.setter + def Height(self, size_t Height): + self._pvt_ptr[0].Height = Height + + + @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) + + + @property + def NumChannels(self): + return self._pvt_ptr[0].NumChannels + @NumChannels.setter + def NumChannels(self, unsigned int NumChannels): + self._pvt_ptr[0].NumChannels = NumChannels + + +cdef class CUDA_ARRAY3D_DESCRIPTOR_st: + """ + 3D array descriptor + + Attributes + ---------- + + Width : size_t + Width of 3D array + + + Height : size_t + Height of 3D array + + + Depth : size_t + Depth of 3D array + + + Format : CUarray_format + Array format + + + NumChannels : unsigned int + Channels per array element + + + Flags : unsigned int + Flags + + + 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 += ['Width : ' + str(self.Width)] + except ValueError: + str_list += ['Width : '] + + + try: + str_list += ['Height : ' + str(self.Height)] + except ValueError: + str_list += ['Height : '] + + + try: + str_list += ['Depth : ' + str(self.Depth)] + except ValueError: + str_list += ['Depth : '] + + + try: + str_list += ['Format : ' + str(self.Format)] + except ValueError: + str_list += ['Format : '] + + + try: + str_list += ['NumChannels : ' + str(self.NumChannels)] + except ValueError: + str_list += ['NumChannels : '] + + + try: + str_list += ['Flags : ' + str(self.Flags)] + except ValueError: + str_list += ['Flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def Width(self): + return self._pvt_ptr[0].Width + @Width.setter + def Width(self, size_t Width): + self._pvt_ptr[0].Width = Width + + + @property + def Height(self): + return self._pvt_ptr[0].Height + @Height.setter + def Height(self, size_t Height): + self._pvt_ptr[0].Height = Height + + + @property + def Depth(self): + return self._pvt_ptr[0].Depth + @Depth.setter + def Depth(self, size_t Depth): + self._pvt_ptr[0].Depth = Depth + + + @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) + + + @property + def NumChannels(self): + return self._pvt_ptr[0].NumChannels + @NumChannels.setter + def NumChannels(self, unsigned int NumChannels): + self._pvt_ptr[0].NumChannels = NumChannels + + + @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 anon_struct6: + """ + Attributes + ---------- + + width : unsigned int + + + + height : unsigned int + + + + depth : 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].tileExtent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['depth : ' + str(self.depth)] + except ValueError: + str_list += ['depth : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + +cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: + """ + CUDA array sparse properties + + Attributes + ---------- + + tileExtent : anon_struct6 + + + + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins. + + + miptailSize : unsigned long long + Total size of the mip tail. + + + flags : unsigned int + Flags will either be zero or + CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + + + 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 + + self._tileExtent = anon_struct6(_ptr=self._pvt_ptr) + + 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 += ['tileExtent :\n' + '\n'.join([' ' + line for line in str(self.tileExtent).splitlines()])] + except ValueError: + str_list += ['tileExtent : '] + + + try: + str_list += ['miptailFirstLevel : ' + str(self.miptailFirstLevel)] + except ValueError: + str_list += ['miptailFirstLevel : '] + + + try: + str_list += ['miptailSize : ' + str(self.miptailSize)] + except ValueError: + str_list += ['miptailSize : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @property + def miptailFirstLevel(self): + return self._pvt_ptr[0].miptailFirstLevel + @miptailFirstLevel.setter + def miptailFirstLevel(self, unsigned int miptailFirstLevel): + self._pvt_ptr[0].miptailFirstLevel = miptailFirstLevel + + + @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 + + + @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 CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + """ + CUDA array memory requirements + + Attributes + ---------- + + size : size_t + Total required memory size + + + alignment : size_t + alignment requirement + + + 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 += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['alignment : ' + str(self.alignment)] + except ValueError: + str_list += ['alignment : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, size_t size): + self._pvt_ptr[0].size = size + + + @property + def alignment(self): + return self._pvt_ptr[0].alignment + @alignment.setter + def alignment(self, size_t alignment): + self._pvt_ptr[0].alignment = alignment + + +cdef class anon_struct7: + """ + Attributes + ---------- + + hArray : CUarray + + + + 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._hArray = CUarray(_ptr=&self._pvt_ptr[0].res.array.hArray) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.array + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['hArray : ' + str(self.hArray)] + except ValueError: + str_list += ['hArray : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def hArray(self): + return self._hArray + @hArray.setter + def hArray(self, hArray): + cdef cydriver.CUarray cyhArray + if hArray is None: + cyhArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + cyhArray = phArray + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + self._hArray._pvt_ptr[0] = cyhArray + + +cdef class anon_struct8: + """ + Attributes + ---------- + + hMipmappedArray : CUmipmappedArray + + + + 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._hMipmappedArray = CUmipmappedArray(_ptr=&self._pvt_ptr[0].res.mipmap.hMipmappedArray) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.mipmap + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['hMipmappedArray : ' + str(self.hMipmappedArray)] + except ValueError: + str_list += ['hMipmappedArray : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def hMipmappedArray(self): + return self._hMipmappedArray + @hMipmappedArray.setter + def hMipmappedArray(self, hMipmappedArray): + cdef cydriver.CUmipmappedArray cyhMipmappedArray + if hMipmappedArray is None: + cyhMipmappedArray = 0 + elif isinstance(hMipmappedArray, (CUmipmappedArray,)): + phMipmappedArray = int(hMipmappedArray) + cyhMipmappedArray = phMipmappedArray + else: + phMipmappedArray = int(CUmipmappedArray(hMipmappedArray)) + cyhMipmappedArray = phMipmappedArray + self._hMipmappedArray._pvt_ptr[0] = cyhMipmappedArray + + +cdef class anon_struct9: + """ + Attributes + ---------- + + devPtr : CUdeviceptr + + + + format : CUarray_format + + + + numChannels : unsigned int + + + + sizeInBytes : size_t + + + + 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._devPtr = CUdeviceptr(_ptr=&self._pvt_ptr[0].res.linear.devPtr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.linear + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['devPtr : ' + str(self.devPtr)] + except ValueError: + str_list += ['devPtr : '] + + + try: + str_list += ['format : ' + str(self.format)] + except ValueError: + str_list += ['format : '] + + + try: + str_list += ['numChannels : ' + str(self.numChannels)] + except ValueError: + str_list += ['numChannels : '] + + + try: + str_list += ['sizeInBytes : ' + str(self.sizeInBytes)] + except ValueError: + str_list += ['sizeInBytes : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def devPtr(self): + return self._devPtr + @devPtr.setter + def devPtr(self, devPtr): + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + cydevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr)): + pdevPtr = int(devPtr) + cydevPtr = pdevPtr + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + self._devPtr._pvt_ptr[0] = cydevPtr + + + + @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) + + + @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 + + + @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 + + +cdef class anon_struct10: + """ + Attributes + ---------- + + devPtr : CUdeviceptr + + + + format : CUarray_format + + + + numChannels : unsigned int + + + + width : size_t + + + + height : size_t + + + + pitchInBytes : size_t + + + + 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._devPtr = CUdeviceptr(_ptr=&self._pvt_ptr[0].res.pitch2D.devPtr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.pitch2D + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['devPtr : ' + str(self.devPtr)] + except ValueError: + str_list += ['devPtr : '] + + + try: + str_list += ['format : ' + str(self.format)] + except ValueError: + str_list += ['format : '] + + + try: + str_list += ['numChannels : ' + str(self.numChannels)] + except ValueError: + str_list += ['numChannels : '] + + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['pitchInBytes : ' + str(self.pitchInBytes)] + except ValueError: + str_list += ['pitchInBytes : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def devPtr(self): + return self._devPtr + @devPtr.setter + def devPtr(self, devPtr): + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + cydevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr)): + pdevPtr = int(devPtr) + cydevPtr = pdevPtr + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + self._devPtr._pvt_ptr[0] = cydevPtr + + + + @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) + + + @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 + + + @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 + + + @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 + + + @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 + + +cdef class anon_struct11: + """ + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.reserved + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class anon_union4: + """ + Attributes + ---------- + + array : anon_struct7 + + + + mipmap : anon_struct8 + + + + linear : anon_struct9 + + + + pitch2D : anon_struct10 + + + + 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._array = anon_struct7(_ptr=self._pvt_ptr) + + + self._mipmap = anon_struct8(_ptr=self._pvt_ptr) + + + self._linear = anon_struct9(_ptr=self._pvt_ptr) + + + self._pitch2D = anon_struct10(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['array :\n' + '\n'.join([' ' + line for line in str(self.array).splitlines()])] + except ValueError: + str_list += ['array : '] + + + try: + str_list += ['mipmap :\n' + '\n'.join([' ' + line for line in str(self.mipmap).splitlines()])] + except ValueError: + str_list += ['mipmap : '] + + + try: + str_list += ['linear :\n' + '\n'.join([' ' + line for line in str(self.linear).splitlines()])] + except ValueError: + str_list += ['linear : '] + + + try: + str_list += ['pitch2D :\n' + '\n'.join([' ' + line for line in str(self.pitch2D).splitlines()])] + except ValueError: + str_list += ['pitch2D : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + + @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)) + + + @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)) + + +cdef class CUDA_RESOURCE_DESC_st: + """ + CUDA Resource descriptor + + Attributes + ---------- + + resType : CUresourcetype + Resource type + + + res : anon_union4 + + + + flags : unsigned int + Flags (must be zero) + + + 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.CUDA_RESOURCE_DESC_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._res = anon_union4(_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 += ['resType : ' + str(self.resType)] + except ValueError: + str_list += ['resType : '] + + + try: + str_list += ['res :\n' + '\n'.join([' ' + line for line in str(self.res).splitlines()])] + except ValueError: + str_list += ['res : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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 CUDA_TEXTURE_DESC_st: + """ + Texture descriptor + + Attributes + ---------- + + addressMode : list[CUaddress_mode] + Address modes + + + filterMode : CUfilter_mode + Filter mode + + + flags : unsigned int + Flags + + + maxAnisotropy : unsigned int + Maximum anisotropy ratio + + + mipmapFilterMode : CUfilter_mode + Mipmap filter mode + + + mipmapLevelBias : float + Mipmap level bias + + + minMipmapLevelClamp : float + Mipmap minimum level clamp + + + maxMipmapLevelClamp : float + Mipmap maximum level clamp + + + borderColor : list[float] + Border Color + + + 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 += ['addressMode : ' + str(self.addressMode)] + except ValueError: + str_list += ['addressMode : '] + + + try: + str_list += ['filterMode : ' + str(self.filterMode)] + except ValueError: + str_list += ['filterMode : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + try: + str_list += ['maxAnisotropy : ' + str(self.maxAnisotropy)] + except ValueError: + str_list += ['maxAnisotropy : '] + + + try: + str_list += ['mipmapFilterMode : ' + str(self.mipmapFilterMode)] + except ValueError: + str_list += ['mipmapFilterMode : '] + + + try: + str_list += ['mipmapLevelBias : ' + str(self.mipmapLevelBias)] + except ValueError: + str_list += ['mipmapLevelBias : '] + + + try: + str_list += ['minMipmapLevelClamp : ' + str(self.minMipmapLevelClamp)] + except ValueError: + str_list += ['minMipmapLevelClamp : '] + + + try: + str_list += ['maxMipmapLevelClamp : ' + str(self.maxMipmapLevelClamp)] + except ValueError: + str_list += ['maxMipmapLevelClamp : '] + + + try: + str_list += ['borderColor : ' + str(self.borderColor)] + except ValueError: + str_list += ['borderColor : '] + + return '\n'.join(str_list) + else: + return '' + + @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] + + + @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) + + + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + + + @property + def maxAnisotropy(self): + return self._pvt_ptr[0].maxAnisotropy + @maxAnisotropy.setter + def maxAnisotropy(self, unsigned int maxAnisotropy): + self._pvt_ptr[0].maxAnisotropy = maxAnisotropy + + + @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) + + + @property + def mipmapLevelBias(self): + return self._pvt_ptr[0].mipmapLevelBias + @mipmapLevelBias.setter + def mipmapLevelBias(self, float mipmapLevelBias): + self._pvt_ptr[0].mipmapLevelBias = mipmapLevelBias + + + @property + def minMipmapLevelClamp(self): + return self._pvt_ptr[0].minMipmapLevelClamp + @minMipmapLevelClamp.setter + def minMipmapLevelClamp(self, float minMipmapLevelClamp): + self._pvt_ptr[0].minMipmapLevelClamp = minMipmapLevelClamp + + + @property + def maxMipmapLevelClamp(self): + return self._pvt_ptr[0].maxMipmapLevelClamp + @maxMipmapLevelClamp.setter + def maxMipmapLevelClamp(self, float maxMipmapLevelClamp): + self._pvt_ptr[0].maxMipmapLevelClamp = maxMipmapLevelClamp + + + @property + def borderColor(self): + return self._pvt_ptr[0].borderColor + @borderColor.setter + def borderColor(self, borderColor): + self._pvt_ptr[0].borderColor = borderColor + + +cdef class CUDA_RESOURCE_VIEW_DESC_st: + """ + Resource view descriptor + + Attributes + ---------- + + format : CUresourceViewFormat + Resource view format + + + width : size_t + Width of the resource view + + + height : size_t + Height of the resource view + + + depth : size_t + Depth of the resource view + + + firstMipmapLevel : unsigned int + First defined mipmap level + + + lastMipmapLevel : unsigned int + Last defined mipmap level + + + firstLayer : unsigned int + First layer index + + + lastLayer : unsigned int + Last layer index + + + 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 += ['format : ' + str(self.format)] + except ValueError: + str_list += ['format : '] + + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['depth : ' + str(self.depth)] + except ValueError: + str_list += ['depth : '] + + + try: + str_list += ['firstMipmapLevel : ' + str(self.firstMipmapLevel)] + except ValueError: + str_list += ['firstMipmapLevel : '] + + + try: + str_list += ['lastMipmapLevel : ' + str(self.lastMipmapLevel)] + except ValueError: + str_list += ['lastMipmapLevel : '] + + + try: + str_list += ['firstLayer : ' + str(self.firstLayer)] + except ValueError: + str_list += ['firstLayer : '] + + + try: + str_list += ['lastLayer : ' + str(self.lastLayer)] + except ValueError: + str_list += ['lastLayer : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def width(self): + return self._pvt_ptr[0].width + @width.setter + def width(self, size_t width): + self._pvt_ptr[0].width = width + + + @property + def height(self): + return self._pvt_ptr[0].height + @height.setter + def height(self, size_t height): + self._pvt_ptr[0].height = height + + + @property + def depth(self): + return self._pvt_ptr[0].depth + @depth.setter + def depth(self, size_t depth): + self._pvt_ptr[0].depth = depth + + + @property + def firstMipmapLevel(self): + return self._pvt_ptr[0].firstMipmapLevel + @firstMipmapLevel.setter + def firstMipmapLevel(self, unsigned int firstMipmapLevel): + self._pvt_ptr[0].firstMipmapLevel = firstMipmapLevel + + + @property + def lastMipmapLevel(self): + return self._pvt_ptr[0].lastMipmapLevel + @lastMipmapLevel.setter + def lastMipmapLevel(self, unsigned int lastMipmapLevel): + self._pvt_ptr[0].lastMipmapLevel = lastMipmapLevel + + + @property + def firstLayer(self): + return self._pvt_ptr[0].firstLayer + @firstLayer.setter + def firstLayer(self, unsigned int firstLayer): + self._pvt_ptr[0].firstLayer = firstLayer + + + @property + def lastLayer(self): + return self._pvt_ptr[0].lastLayer + @lastLayer.setter + def lastLayer(self, unsigned int lastLayer): + self._pvt_ptr[0].lastLayer = lastLayer + + +cdef class CUtensorMap_st: + """ + Tensor map descriptor. Requires compiler support for aligning to 64 + bytes. + + Attributes + ---------- + + opaque : list[cuuint64_t] + + + + 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 += ['opaque : ' + str(self.opaque)] + except ValueError: + str_list += ['opaque : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def opaque(self): + return [cuuint64_t(init_value=_opaque) for _opaque in self._pvt_ptr[0].opaque] + @opaque.setter + def opaque(self, opaque): + self._pvt_ptr[0].opaque = opaque + + + +cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + """ + GPU Direct v3 tokens + + Attributes + ---------- + + p2pToken : unsigned long long + + + + vaSpaceToken : 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 + 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 += ['p2pToken : ' + str(self.p2pToken)] + except ValueError: + str_list += ['p2pToken : '] + + + try: + str_list += ['vaSpaceToken : ' + str(self.vaSpaceToken)] + except ValueError: + str_list += ['vaSpaceToken : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @property + def vaSpaceToken(self): + return self._pvt_ptr[0].vaSpaceToken + @vaSpaceToken.setter + def vaSpaceToken(self, unsigned int vaSpaceToken): + self._pvt_ptr[0].vaSpaceToken = vaSpaceToken + + +cdef class CUDA_LAUNCH_PARAMS_st: + """ + Kernel launch parameters + + Attributes + ---------- + + function : CUfunction + Kernel to launch + + + gridDimX : unsigned int + Width of grid in blocks + + + gridDimY : unsigned int + Height of grid in blocks + + + gridDimZ : unsigned int + Depth of grid in blocks + + + blockDimX : unsigned int + X dimension of each thread block + + + blockDimY : unsigned int + Y dimension of each thread block + + + blockDimZ : unsigned int + Z dimension of each thread block + + + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + + + hStream : CUstream + Stream identifier + + + kernelParams : Any + Array of pointers to kernel parameters + + + 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 + + self._function = CUfunction(_ptr=&self._pvt_ptr[0].function) + + + self._hStream = CUstream(_ptr=&self._pvt_ptr[0].hStream) + + 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 += ['function : ' + str(self.function)] + except ValueError: + str_list += ['function : '] + + + try: + str_list += ['gridDimX : ' + str(self.gridDimX)] + except ValueError: + str_list += ['gridDimX : '] + + + try: + str_list += ['gridDimY : ' + str(self.gridDimY)] + except ValueError: + str_list += ['gridDimY : '] + + + try: + str_list += ['gridDimZ : ' + str(self.gridDimZ)] + except ValueError: + str_list += ['gridDimZ : '] + + + try: + str_list += ['blockDimX : ' + str(self.blockDimX)] + except ValueError: + str_list += ['blockDimX : '] + + + try: + str_list += ['blockDimY : ' + str(self.blockDimY)] + except ValueError: + str_list += ['blockDimY : '] + + + try: + str_list += ['blockDimZ : ' + str(self.blockDimZ)] + except ValueError: + str_list += ['blockDimZ : '] + + + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + + + try: + str_list += ['hStream : ' + str(self.hStream)] + except ValueError: + str_list += ['hStream : '] + + + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def function(self): + return self._function + @function.setter + def function(self, function): + cdef cydriver.CUfunction cyfunction + if function is None: + cyfunction = 0 + elif isinstance(function, (CUfunction,)): + pfunction = int(function) + cyfunction = pfunction + else: + pfunction = int(CUfunction(function)) + cyfunction = pfunction + self._function._pvt_ptr[0] = cyfunction + + + @property + def gridDimX(self): + return self._pvt_ptr[0].gridDimX + @gridDimX.setter + def gridDimX(self, unsigned int gridDimX): + self._pvt_ptr[0].gridDimX = gridDimX + + + @property + def gridDimY(self): + return self._pvt_ptr[0].gridDimY + @gridDimY.setter + def gridDimY(self, unsigned int gridDimY): + self._pvt_ptr[0].gridDimY = gridDimY + + + @property + def gridDimZ(self): + return self._pvt_ptr[0].gridDimZ + @gridDimZ.setter + def gridDimZ(self, unsigned int gridDimZ): + self._pvt_ptr[0].gridDimZ = gridDimZ + + + @property + def blockDimX(self): + return self._pvt_ptr[0].blockDimX + @blockDimX.setter + def blockDimX(self, unsigned int blockDimX): + self._pvt_ptr[0].blockDimX = blockDimX + + + @property + def blockDimY(self): + return self._pvt_ptr[0].blockDimY + @blockDimY.setter + def blockDimY(self, unsigned int blockDimY): + self._pvt_ptr[0].blockDimY = blockDimY + + + @property + def blockDimZ(self): + return self._pvt_ptr[0].blockDimZ + @blockDimZ.setter + def blockDimZ(self, unsigned int blockDimZ): + self._pvt_ptr[0].blockDimZ = blockDimZ + + + @property + def sharedMemBytes(self): + return self._pvt_ptr[0].sharedMemBytes + @sharedMemBytes.setter + def sharedMemBytes(self, unsigned int sharedMemBytes): + self._pvt_ptr[0].sharedMemBytes = sharedMemBytes + + + @property + def hStream(self): + return self._hStream + @hStream.setter + def hStream(self, hStream): + cdef cydriver.CUstream cyhStream + if hStream is None: + cyhStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + cyhStream = phStream + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + self._hStream._pvt_ptr[0] = cyhStream + + + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + + +cdef class anon_struct12: + """ + Attributes + ---------- + + handle : Any + + + + name : Any + + + + 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].handle.win32 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['handle : ' + hex(self.handle)] + except ValueError: + str_list += ['handle : '] + + + try: + str_list += ['name : ' + hex(self.name)] + except ValueError: + str_list += ['name : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def handle(self): + return self._pvt_ptr[0].handle.win32.handle + @handle.setter + def handle(self, handle): + self._cyhandle = _HelperInputVoidPtr(handle) + self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr + + + @property + def name(self): + return self._pvt_ptr[0].handle.win32.name + @name.setter + def name(self, name): + self._cyname = _HelperInputVoidPtr(name) + self._pvt_ptr[0].handle.win32.name = self._cyname.cptr + + +cdef class anon_union5: + """ + Attributes + ---------- + + fd : int + + + + win32 : anon_struct12 + + + + nvSciBufObject : Any + + + + 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._win32 = anon_struct12(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fd : ' + str(self.fd)] + except ValueError: + str_list += ['fd : '] + + + try: + str_list += ['win32 :\n' + '\n'.join([' ' + line for line in str(self.win32).splitlines()])] + except ValueError: + str_list += ['win32 : '] + + + try: + str_list += ['nvSciBufObject : ' + hex(self.nvSciBufObject)] + except ValueError: + str_list += ['nvSciBufObject : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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)) + + + @property + def nvSciBufObject(self): + return self._pvt_ptr[0].handle.nvSciBufObject + @nvSciBufObject.setter + def nvSciBufObject(self, nvSciBufObject): + self._cynvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) + self._pvt_ptr[0].handle.nvSciBufObject = self._cynvSciBufObject.cptr + + +cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + """ + External memory handle descriptor + + Attributes + ---------- + + type : CUexternalMemoryHandleType + Type of the handle + + + handle : anon_union5 + + + + size : unsigned long long + Size of the memory allocation + + + flags : unsigned int + Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED + + + 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.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._handle = anon_union5(_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 += ['handle :\n' + '\n'.join([' ' + line for line in str(self.handle).splitlines()])] + except ValueError: + str_list += ['handle : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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 flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + + +cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: + """ + External memory buffer descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the buffer's base is + + + size : unsigned long long + Size of the buffer + + + flags : unsigned int + Flags reserved for future use. Must be zero. + + + 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 += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + + +cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: + """ + External memory mipmap descriptor + + Attributes + ---------- + + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR + Format, dimension and type of base level of the mipmap chain + + + numLevels : unsigned int + Total number of levels in the mipmap chain + + + 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 + + self._arrayDesc = CUDA_ARRAY3D_DESCRIPTOR(_ptr=&self._pvt_ptr[0].arrayDesc) + + 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 += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + + + try: + str_list += ['arrayDesc :\n' + '\n'.join([' ' + line for line in str(self.arrayDesc).splitlines()])] + except ValueError: + str_list += ['arrayDesc : '] + + + try: + str_list += ['numLevels : ' + str(self.numLevels)] + except ValueError: + str_list += ['numLevels : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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)) + + + @property + def numLevels(self): + return self._pvt_ptr[0].numLevels + @numLevels.setter + def numLevels(self, unsigned int numLevels): + self._pvt_ptr[0].numLevels = numLevels + + +cdef class anon_struct13: + """ + Attributes + ---------- + + handle : Any + + + + name : Any + + + + 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].handle.win32 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['handle : ' + hex(self.handle)] + except ValueError: + str_list += ['handle : '] + + + try: + str_list += ['name : ' + hex(self.name)] + except ValueError: + str_list += ['name : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def handle(self): + return self._pvt_ptr[0].handle.win32.handle + @handle.setter + def handle(self, handle): + self._cyhandle = _HelperInputVoidPtr(handle) + self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr + + + @property + def name(self): + return self._pvt_ptr[0].handle.win32.name + @name.setter + def name(self, name): + self._cyname = _HelperInputVoidPtr(name) + self._pvt_ptr[0].handle.win32.name = self._cyname.cptr + + +cdef class anon_union6: + """ + Attributes + ---------- + + fd : int + + + + win32 : anon_struct13 + + + + nvSciSyncObj : Any + + + + 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._win32 = anon_struct13(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fd : ' + str(self.fd)] + except ValueError: + str_list += ['fd : '] + + + try: + str_list += ['win32 :\n' + '\n'.join([' ' + line for line in str(self.win32).splitlines()])] + except ValueError: + str_list += ['win32 : '] + + + try: + str_list += ['nvSciSyncObj : ' + hex(self.nvSciSyncObj)] + except ValueError: + str_list += ['nvSciSyncObj : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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)) + + + @property + def nvSciSyncObj(self): + return self._pvt_ptr[0].handle.nvSciSyncObj + @nvSciSyncObj.setter + def nvSciSyncObj(self, nvSciSyncObj): + self._cynvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) + self._pvt_ptr[0].handle.nvSciSyncObj = self._cynvSciSyncObj.cptr + + +cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + """ + External semaphore handle descriptor + + Attributes + ---------- + + type : CUexternalSemaphoreHandleType + Type of the handle + + + handle : anon_union6 + + + + flags : unsigned int + Flags reserved for the future. Must be zero. + + + 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.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._handle = anon_union6(_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 += ['handle :\n' + '\n'.join([' ' + line for line in str(self.handle).splitlines()])] + except ValueError: + str_list += ['handle : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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 anon_struct14: + """ + Attributes + ---------- + + value : unsigned long long + + + + 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].params.fence + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + +cdef class anon_union7: + """ + Attributes + ---------- + + fence : Any + + + + 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].params.nvSciSync + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fence : ' + hex(self.fence)] + except ValueError: + str_list += ['fence : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def fence(self): + return self._pvt_ptr[0].params.nvSciSync.fence + @fence.setter + def fence(self, fence): + self._cyfence = _HelperInputVoidPtr(fence) + self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr + + +cdef class anon_struct15: + """ + Attributes + ---------- + + key : unsigned long long + + + + 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].params.keyedMutex + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['key : ' + str(self.key)] + except ValueError: + str_list += ['key : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + +cdef class anon_struct16: + """ + Attributes + ---------- + + fence : anon_struct14 + + + + nvSciSync : anon_union7 + + + + keyedMutex : anon_struct15 + + + + 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._fence = anon_struct14(_ptr=self._pvt_ptr) + + + self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) + + + self._keyedMutex = anon_struct15(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fence :\n' + '\n'.join([' ' + line for line in str(self.fence).splitlines()])] + except ValueError: + str_list += ['fence : '] + + + try: + str_list += ['nvSciSync :\n' + '\n'.join([' ' + line for line in str(self.nvSciSync).splitlines()])] + except ValueError: + str_list += ['nvSciSync : '] + + + try: + str_list += ['keyedMutex :\n' + '\n'.join([' ' + line for line in str(self.keyedMutex).splitlines()])] + except ValueError: + str_list += ['keyedMutex : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + + @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)) + + +cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: + """ + External semaphore signal parameters + + Attributes + ---------- + + params : anon_struct16 + + + + 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. + + + 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 + + self._params = anon_struct16(_ptr=self._pvt_ptr) + + 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 += ['params :\n' + '\n'.join([' ' + line for line in str(self.params).splitlines()])] + except ValueError: + str_list += ['params : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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 anon_struct17: + """ + Attributes + ---------- + + value : unsigned long long + + + + 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].params.fence + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + +cdef class anon_union8: + """ + Attributes + ---------- + + fence : Any + + + + 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].params.nvSciSync + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fence : ' + hex(self.fence)] + except ValueError: + str_list += ['fence : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def fence(self): + return self._pvt_ptr[0].params.nvSciSync.fence + @fence.setter + def fence(self, fence): + self._cyfence = _HelperInputVoidPtr(fence) + self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr + + +cdef class anon_struct18: + """ + Attributes + ---------- + + key : unsigned long long + + + + timeoutMs : 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].params.keyedMutex + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['key : ' + str(self.key)] + except ValueError: + str_list += ['key : '] + + + try: + str_list += ['timeoutMs : ' + str(self.timeoutMs)] + except ValueError: + str_list += ['timeoutMs : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + +cdef class anon_struct19: + """ + Attributes + ---------- + + fence : anon_struct17 + + + + nvSciSync : anon_union8 + + + + keyedMutex : anon_struct18 + + + + 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._fence = anon_struct17(_ptr=self._pvt_ptr) + + + self._nvSciSync = anon_union8(_ptr=self._pvt_ptr) + + + self._keyedMutex = anon_struct18(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['fence :\n' + '\n'.join([' ' + line for line in str(self.fence).splitlines()])] + except ValueError: + str_list += ['fence : '] + + + try: + str_list += ['nvSciSync :\n' + '\n'.join([' ' + line for line in str(self.nvSciSync).splitlines()])] + except ValueError: + str_list += ['nvSciSync : '] + + + try: + str_list += ['keyedMutex :\n' + '\n'.join([' ' + line for line in str(self.keyedMutex).splitlines()])] + except ValueError: + str_list += ['keyedMutex : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + + @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)) + + +cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: + """ + External semaphore wait parameters + + Attributes + ---------- + + params : anon_struct19 + + + + flags : unsigned int + 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. + + + 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 + + self._params = anon_struct19(_ptr=self._pvt_ptr) + + 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 += ['params :\n' + '\n'.join([' ' + line for line in str(self.params).splitlines()])] + except ValueError: + str_list += ['params : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + 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 + + if self._extSemArray is not NULL: + free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL + + + if self._paramsArray is not NULL: + free(self._paramsArray) + 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 = [] + + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + + + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + + + try: + str_list += ['numExtSems : ' + str(self.numExtSems)] + except ValueError: + str_list += ['numExtSems : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] + return [CUexternalSemaphore(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cydriver.CUexternalSemaphore)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + + + @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)] + return [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(_ptr=arr) for arr in arrs] + @paramsArray.setter + def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray_new + if len(val) == 0: + free(self._paramsArray) + self._paramsArray = NULL + self._paramsArray_length = 0 + self._pvt_ptr[0].paramsArray = NULL + else: + if self._paramsArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + if _paramsArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + + + + @property + def numExtSems(self): + return self._pvt_ptr[0].numExtSems + @numExtSems.setter + def numExtSems(self, unsigned int numExtSems): + self._pvt_ptr[0].numExtSems = numExtSems + + +cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + """ + Semaphore signal node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS + Array of external semaphore signal parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + 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 + + if self._extSemArray is not NULL: + free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL + + + if self._paramsArray is not NULL: + free(self._paramsArray) + 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 = [] + + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + + + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + + + try: + str_list += ['numExtSems : ' + str(self.numExtSems)] + except ValueError: + str_list += ['numExtSems : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] + return [CUexternalSemaphore(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cydriver.CUexternalSemaphore)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + + + @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)] + return [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(_ptr=arr) for arr in arrs] + @paramsArray.setter + def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray_new + if len(val) == 0: + free(self._paramsArray) + self._paramsArray = NULL + self._paramsArray_length = 0 + self._pvt_ptr[0].paramsArray = NULL + else: + if self._paramsArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + if _paramsArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + + + + @property + def numExtSems(self): + return self._pvt_ptr[0].numExtSems + @numExtSems.setter + def numExtSems(self, unsigned int numExtSems): + self._pvt_ptr[0].numExtSems = numExtSems + + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + 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 + + if self._extSemArray is not NULL: + free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL + + + if self._paramsArray is not NULL: + free(self._paramsArray) + 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 = [] + + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + + + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + + + try: + str_list += ['numExtSems : ' + str(self.numExtSems)] + except ValueError: + str_list += ['numExtSems : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] + return [CUexternalSemaphore(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cydriver.CUexternalSemaphore)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + + + @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)] + return [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(_ptr=arr) for arr in arrs] + @paramsArray.setter + def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray_new + if len(val) == 0: + free(self._paramsArray) + self._paramsArray = NULL + self._paramsArray_length = 0 + self._pvt_ptr[0].paramsArray = NULL + else: + if self._paramsArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + if _paramsArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + + + + @property + def numExtSems(self): + return self._pvt_ptr[0].numExtSems + @numExtSems.setter + def numExtSems(self, unsigned int numExtSems): + self._pvt_ptr[0].numExtSems = numExtSems + + +cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: + """ + Semaphore wait node parameters + + Attributes + ---------- + + extSemArray : CUexternalSemaphore + Array of external semaphore handles. + + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS + Array of external semaphore wait parameters. + + + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + + + 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 + + if self._extSemArray is not NULL: + free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL + + + if self._paramsArray is not NULL: + free(self._paramsArray) + 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 = [] + + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + + + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + + + try: + str_list += ['numExtSems : ' + str(self.numExtSems)] + except ValueError: + str_list += ['numExtSems : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] + return [CUexternalSemaphore(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cydriver.CUexternalSemaphore)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + + + @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)] + return [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(_ptr=arr) for arr in arrs] + @paramsArray.setter + def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray_new + if len(val) == 0: + free(self._paramsArray) + self._paramsArray = NULL + self._paramsArray_length = 0 + self._pvt_ptr[0].paramsArray = NULL + else: + if self._paramsArray_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + if _paramsArray_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + + + + @property + def numExtSems(self): + return self._pvt_ptr[0].numExtSems + @numExtSems.setter + def numExtSems(self, unsigned int numExtSems): + self._pvt_ptr[0].numExtSems = numExtSems + + +cdef class anon_union9: + """ + Attributes + ---------- + + mipmap : CUmipmappedArray + + + + array : CUarray + + + + 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._mipmap = CUmipmappedArray(_ptr=&self._pvt_ptr[0].resource.mipmap) + + + self._array = CUarray(_ptr=&self._pvt_ptr[0].resource.array) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].resource + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['mipmap : ' + str(self.mipmap)] + except ValueError: + str_list += ['mipmap : '] + + + try: + str_list += ['array : ' + str(self.array)] + except ValueError: + str_list += ['array : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def mipmap(self): + return self._mipmap + @mipmap.setter + def mipmap(self, mipmap): + cdef cydriver.CUmipmappedArray cymipmap + if mipmap is None: + cymipmap = 0 + elif isinstance(mipmap, (CUmipmappedArray,)): + pmipmap = int(mipmap) + cymipmap = pmipmap + else: + pmipmap = int(CUmipmappedArray(mipmap)) + cymipmap = pmipmap + self._mipmap._pvt_ptr[0] = cymipmap + + + @property + def array(self): + return self._array + @array.setter + def array(self, array): + cdef cydriver.CUarray cyarray + if array is None: + cyarray = 0 + elif isinstance(array, (CUarray,)): + parray = int(array) + cyarray = parray + else: + parray = int(CUarray(array)) + cyarray = parray + self._array._pvt_ptr[0] = cyarray + + +cdef class anon_struct20: + """ + Attributes + ---------- + + level : unsigned int + + + + layer : unsigned int + + + + offsetX : unsigned int + + + + offsetY : unsigned int + + + + offsetZ : unsigned int + + + + extentWidth : unsigned int + + + + extentHeight : unsigned int + + + + extentDepth : 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].subresource.sparseLevel + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['level : ' + str(self.level)] + except ValueError: + str_list += ['level : '] + + + try: + str_list += ['layer : ' + str(self.layer)] + except ValueError: + str_list += ['layer : '] + + + try: + str_list += ['offsetX : ' + str(self.offsetX)] + except ValueError: + str_list += ['offsetX : '] + + + try: + str_list += ['offsetY : ' + str(self.offsetY)] + except ValueError: + str_list += ['offsetY : '] + + + try: + str_list += ['offsetZ : ' + str(self.offsetZ)] + except ValueError: + str_list += ['offsetZ : '] + + + try: + str_list += ['extentWidth : ' + str(self.extentWidth)] + except ValueError: + str_list += ['extentWidth : '] + + + try: + str_list += ['extentHeight : ' + str(self.extentHeight)] + except ValueError: + str_list += ['extentHeight : '] + + + try: + str_list += ['extentDepth : ' + str(self.extentDepth)] + except ValueError: + str_list += ['extentDepth : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + + @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 + + + @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 + + + @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 + + + @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 + + + @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 + + +cdef class anon_struct21: + """ + Attributes + ---------- + + layer : unsigned int + + + + offset : unsigned long long + + + + size : unsigned long long + + + + 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].subresource.miptail + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['layer : ' + str(self.layer)] + except ValueError: + str_list += ['layer : '] + + + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + +cdef class anon_union10: + """ + Attributes + ---------- + + sparseLevel : anon_struct20 + + + + miptail : anon_struct21 + + + + 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._sparseLevel = anon_struct20(_ptr=self._pvt_ptr) + + + self._miptail = anon_struct21(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].subresource + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['sparseLevel :\n' + '\n'.join([' ' + line for line in str(self.sparseLevel).splitlines()])] + except ValueError: + str_list += ['sparseLevel : '] + + + try: + str_list += ['miptail :\n' + '\n'.join([' ' + line for line in str(self.miptail).splitlines()])] + except ValueError: + str_list += ['miptail : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + +cdef class anon_union11: + """ + Attributes + ---------- + + memHandle : CUmemGenericAllocationHandle + + + + 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._memHandle = CUmemGenericAllocationHandle(_ptr=&self._pvt_ptr[0].memHandle.memHandle) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].memHandle + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['memHandle : ' + str(self.memHandle)] + except ValueError: + str_list += ['memHandle : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def memHandle(self): + return self._memHandle + @memHandle.setter + def memHandle(self, memHandle): + cdef cydriver.CUmemGenericAllocationHandle cymemHandle + if memHandle is None: + cymemHandle = 0 + elif isinstance(memHandle, (CUmemGenericAllocationHandle)): + pmemHandle = int(memHandle) + cymemHandle = pmemHandle + else: + pmemHandle = int(CUmemGenericAllocationHandle(memHandle)) + cymemHandle = pmemHandle + self._memHandle._pvt_ptr[0] = cymemHandle + + + +cdef class CUarrayMapInfo_st: + """ + Specifies the CUDA array or CUDA mipmapped array memory mapping + information + + Attributes + ---------- + + resourceType : CUresourcetype + Resource type + + + resource : anon_union9 + + + + subresourceType : CUarraySparseSubresourceType + Sparse subresource type + + + subresource : anon_union10 + + + + memOperationType : CUmemOperationType + Memory operation type + + + memHandleType : CUmemHandleType + Memory handle type + + + memHandle : anon_union11 + + + + offset : unsigned long long + Offset within mip tail Offset within the memory + + + deviceBitMask : unsigned int + Device ordinal bit mask + + + flags : unsigned int + flags for future use, must be zero now. + + + 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.CUarrayMapInfo_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._resource = anon_union9(_ptr=self._pvt_ptr) + + + self._subresource = anon_union10(_ptr=self._pvt_ptr) + + + self._memHandle = anon_union11(_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 += ['resourceType : ' + str(self.resourceType)] + except ValueError: + str_list += ['resourceType : '] + + + try: + str_list += ['resource :\n' + '\n'.join([' ' + line for line in str(self.resource).splitlines()])] + except ValueError: + str_list += ['resource : '] + + + try: + str_list += ['subresourceType : ' + str(self.subresourceType)] + except ValueError: + str_list += ['subresourceType : '] + + + try: + str_list += ['subresource :\n' + '\n'.join([' ' + line for line in str(self.subresource).splitlines()])] + except ValueError: + str_list += ['subresource : '] + + + try: + str_list += ['memOperationType : ' + str(self.memOperationType)] + except ValueError: + str_list += ['memOperationType : '] + + + try: + str_list += ['memHandleType : ' + str(self.memHandleType)] + except ValueError: + str_list += ['memHandleType : '] + + + try: + str_list += ['memHandle :\n' + '\n'.join([' ' + line for line in str(self.memHandle).splitlines()])] + except ValueError: + str_list += ['memHandle : '] + + + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + + + try: + str_list += ['deviceBitMask : ' + str(self.deviceBitMask)] + except ValueError: + str_list += ['deviceBitMask : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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) + + + @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)) + + + @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) + + + @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) + + + @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)) + + + @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 + + + @property + def deviceBitMask(self): + return self._pvt_ptr[0].deviceBitMask + @deviceBitMask.setter + def deviceBitMask(self, unsigned int deviceBitMask): + self._pvt_ptr[0].deviceBitMask = deviceBitMask + + + @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 CUmemLocation_st: + """ + Specifies a memory location. + + Attributes + ---------- + + type : CUmemLocationType + Specifies the location type, which modifies the meaning of id. + + + id : int + identifier for a given this location's CUmemLocationType. + + + 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 += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + + try: + str_list += ['id : ' + str(self.id)] + except ValueError: + str_list += ['id : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def id(self): + return self._pvt_ptr[0].id + @id.setter + def id(self, int id): + self._pvt_ptr[0].id = id + + +cdef class anon_struct22: + """ + Attributes + ---------- + + compressionType : bytes + + + + gpuDirectRDMACapable : bytes + + + + usage : unsigned short + + + + 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].allocFlags + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['compressionType : ' + str(self.compressionType)] + except ValueError: + str_list += ['compressionType : '] + + + try: + str_list += ['gpuDirectRDMACapable : ' + str(self.gpuDirectRDMACapable)] + except ValueError: + str_list += ['gpuDirectRDMACapable : '] + + + try: + str_list += ['usage : ' + str(self.usage)] + except ValueError: + str_list += ['usage : '] + + return '\n'.join(str_list) + else: + return '' + + @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 + + + @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 + + + @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 + + +cdef class CUmemAllocationProp_st: + """ + Specifies the allocation properties for a allocation. + + Attributes + ---------- + + type : CUmemAllocationType + Allocation type + + + requestedHandleTypes : CUmemAllocationHandleType + requested CUmemAllocationHandleType + + + location : CUmemLocation + Location of allocation + + + 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. + + + allocFlags : anon_struct22 + + + + 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 + + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) + + + self._allocFlags = anon_struct22(_ptr=self._pvt_ptr) + + 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 += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + + try: + str_list += ['requestedHandleTypes : ' + str(self.requestedHandleTypes)] + except ValueError: + str_list += ['requestedHandleTypes : '] + + + try: + str_list += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] + except ValueError: + str_list += ['location : '] + + + try: + str_list += ['win32HandleMetaData : ' + hex(self.win32HandleMetaData)] + except ValueError: + str_list += ['win32HandleMetaData : '] + + + try: + str_list += ['allocFlags :\n' + '\n'.join([' ' + line for line in str(self.allocFlags).splitlines()])] + except ValueError: + str_list += ['allocFlags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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) + + + @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)) + + + @property + def win32HandleMetaData(self): + return self._pvt_ptr[0].win32HandleMetaData + @win32HandleMetaData.setter + def win32HandleMetaData(self, win32HandleMetaData): + self._cywin32HandleMetaData = _HelperInputVoidPtr(win32HandleMetaData) + self._pvt_ptr[0].win32HandleMetaData = self._cywin32HandleMetaData.cptr + + + @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)) + + +cdef class CUmulticastObjectProp_st: + """ + Specifies the properties for a multicast object. + + Attributes + ---------- + + numDevices : unsigned int + The number of devices in the multicast team that will bind memory + to this object + + + size : size_t + The maximum amount of memory that can be bound to this multicast + object per device + + + handleTypes : unsigned long long + Bitmask of exportable handle types (see CUmemAllocationHandleType) + for this object + + + flags : unsigned long long + Flags for future use, must be zero now + + + 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 += ['numDevices : ' + str(self.numDevices)] + except ValueError: + str_list += ['numDevices : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['handleTypes : ' + str(self.handleTypes)] + except ValueError: + str_list += ['handleTypes : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def numDevices(self): + return self._pvt_ptr[0].numDevices + @numDevices.setter + def numDevices(self, unsigned int numDevices): + self._pvt_ptr[0].numDevices = numDevices + + + @property + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, size_t size): + self._pvt_ptr[0].size = size + + + @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 + + + @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 + + +cdef class CUmemAccessDesc_st: + """ + Memory access descriptor + + Attributes + ---------- + + location : CUmemLocation + Location on which the request is to change it's accessibility + + + flags : CUmemAccess_flags + ::CUmemProt accessibility flags to set on the request + + + 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 + + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) + + 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 += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] + except ValueError: + str_list += ['location : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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) + + +cdef class CUgraphExecUpdateResultInfo_st: + """ + Result information returned by cuGraphExecUpdate + + Attributes + ---------- + + result : CUgraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + + + 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. + + + errorFromNode : CUgraphNode + The from node of error edge when the topologies do not match. + Otherwise NULL. + + + 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 + + self._errorNode = CUgraphNode(_ptr=&self._pvt_ptr[0].errorNode) + + + self._errorFromNode = CUgraphNode(_ptr=&self._pvt_ptr[0].errorFromNode) + + 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 += ['result : ' + str(self.result)] + except ValueError: + str_list += ['result : '] + + + try: + str_list += ['errorNode : ' + str(self.errorNode)] + except ValueError: + str_list += ['errorNode : '] + + + try: + str_list += ['errorFromNode : ' + str(self.errorFromNode)] + except ValueError: + str_list += ['errorFromNode : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def errorNode(self): + return self._errorNode + @errorNode.setter + def errorNode(self, errorNode): + cdef cydriver.CUgraphNode cyerrorNode + if errorNode is None: + cyerrorNode = 0 + elif isinstance(errorNode, (CUgraphNode,)): + perrorNode = int(errorNode) + cyerrorNode = perrorNode + else: + perrorNode = int(CUgraphNode(errorNode)) + cyerrorNode = perrorNode + self._errorNode._pvt_ptr[0] = cyerrorNode + + + @property + def errorFromNode(self): + return self._errorFromNode + @errorFromNode.setter + def errorFromNode(self, errorFromNode): + cdef cydriver.CUgraphNode cyerrorFromNode + if errorFromNode is None: + cyerrorFromNode = 0 + elif isinstance(errorFromNode, (CUgraphNode,)): + perrorFromNode = int(errorFromNode) + cyerrorFromNode = perrorFromNode + else: + perrorFromNode = int(CUgraphNode(errorFromNode)) + cyerrorFromNode = perrorFromNode + self._errorFromNode._pvt_ptr[0] = cyerrorFromNode + + +cdef class CUmemPoolProps_st: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + + allocType : CUmemAllocationType + Allocation type. Currently must be specified as + CU_MEM_ALLOCATION_TYPE_PINNED + + + handleTypes : CUmemAllocationHandleType + Handle types that will be supported by allocations from the pool. + + + location : CUmemLocation + Location where allocations should reside. + + + 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. + + + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + + + usage : unsigned short + Bitmask indicating intended usage for the pool. + + + 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 + + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) + + 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 += ['allocType : ' + str(self.allocType)] + except ValueError: + str_list += ['allocType : '] + + + try: + str_list += ['handleTypes : ' + str(self.handleTypes)] + except ValueError: + str_list += ['handleTypes : '] + + + try: + str_list += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] + except ValueError: + str_list += ['location : '] + + + try: + str_list += ['win32SecurityAttributes : ' + hex(self.win32SecurityAttributes)] + except ValueError: + str_list += ['win32SecurityAttributes : '] + + + try: + str_list += ['maxSize : ' + str(self.maxSize)] + except ValueError: + str_list += ['maxSize : '] + + + try: + str_list += ['usage : ' + str(self.usage)] + except ValueError: + str_list += ['usage : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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) + + + @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)) + + + @property + def win32SecurityAttributes(self): + return self._pvt_ptr[0].win32SecurityAttributes + @win32SecurityAttributes.setter + def win32SecurityAttributes(self, win32SecurityAttributes): + self._cywin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) + self._pvt_ptr[0].win32SecurityAttributes = self._cywin32SecurityAttributes.cptr + + + @property + def maxSize(self): + return self._pvt_ptr[0].maxSize + @maxSize.setter + def maxSize(self, size_t maxSize): + self._pvt_ptr[0].maxSize = maxSize + + + @property + def usage(self): + return self._pvt_ptr[0].usage + @usage.setter + def usage(self, unsigned short usage): + self._pvt_ptr[0].usage = usage + + +cdef class CUmemPoolPtrExportData_st: + """ + Opaque data for exporting a pool allocation + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUmemcpyAttributes_st: + """ + Attributes specific to copies within a batch. For more details on + usage see cuMemcpyBatchAsync. + + Attributes + ---------- + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + + + srcLocHint : CUmemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + + + dstLocHint : CUmemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + 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 + + self._srcLocHint = CUmemLocation(_ptr=&self._pvt_ptr[0].srcLocHint) + + + self._dstLocHint = CUmemLocation(_ptr=&self._pvt_ptr[0].dstLocHint) + + 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 += ['srcAccessOrder : ' + str(self.srcAccessOrder)] + except ValueError: + str_list += ['srcAccessOrder : '] + + + try: + str_list += ['srcLocHint :\n' + '\n'.join([' ' + line for line in str(self.srcLocHint).splitlines()])] + except ValueError: + str_list += ['srcLocHint : '] + + + try: + str_list += ['dstLocHint :\n' + '\n'.join([' ' + line for line in str(self.dstLocHint).splitlines()])] + except ValueError: + str_list += ['dstLocHint : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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)) + + + @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 CUoffset3D_st: + """ + Struct representing offset into a CUarray in elements + + Attributes + ---------- + + x : size_t + + + + y : size_t + + + + z : size_t + + + + 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 += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + + + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + + + try: + str_list += ['z : ' + str(self.z)] + except ValueError: + str_list += ['z : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def x(self): + return self._pvt_ptr[0].x + @x.setter + def x(self, size_t x): + self._pvt_ptr[0].x = x + + + @property + def y(self): + return self._pvt_ptr[0].y + @y.setter + def y(self, size_t y): + self._pvt_ptr[0].y = y + + + @property + def z(self): + return self._pvt_ptr[0].z + @z.setter + def z(self, size_t z): + self._pvt_ptr[0].z = z + + +cdef class CUextent3D_st: + """ + Struct representing width/height/depth of a CUarray in elements + + Attributes + ---------- + + width : size_t + + + + height : size_t + + + + depth : size_t + + + + 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 += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['depth : ' + str(self.depth)] + except ValueError: + str_list += ['depth : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def width(self): + return self._pvt_ptr[0].width + @width.setter + def width(self, size_t width): + self._pvt_ptr[0].width = width + + + @property + def height(self): + return self._pvt_ptr[0].height + @height.setter + def height(self, size_t height): + self._pvt_ptr[0].height = height + + + @property + def depth(self): + return self._pvt_ptr[0].depth + @depth.setter + def depth(self, size_t depth): + self._pvt_ptr[0].depth = depth + + +cdef class anon_struct23: + """ + Attributes + ---------- + + ptr : CUdeviceptr + + + + rowLength : size_t + + + + layerHeight : size_t + + + + locHint : CUmemLocation + + + + 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._ptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].op.ptr.ptr) + + + self._locHint = CUmemLocation(_ptr=&self._pvt_ptr[0].op.ptr.locHint) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op.ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['ptr : ' + str(self.ptr)] + except ValueError: + str_list += ['ptr : '] + + + try: + str_list += ['rowLength : ' + str(self.rowLength)] + except ValueError: + str_list += ['rowLength : '] + + + try: + str_list += ['layerHeight : ' + str(self.layerHeight)] + except ValueError: + str_list += ['layerHeight : '] + + + try: + str_list += ['locHint :\n' + '\n'.join([' ' + line for line in str(self.locHint).splitlines()])] + except ValueError: + str_list += ['locHint : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def ptr(self): + return self._ptr + @ptr.setter + def ptr(self, ptr): + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + cyptr = 0 + elif isinstance(ptr, (CUdeviceptr)): + pptr = int(ptr) + cyptr = pptr + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + self._ptr._pvt_ptr[0] = cyptr + + + + @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 + + + @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 + + + @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)) + + +cdef class anon_struct24: + """ + Attributes + ---------- + + array : CUarray + + + + offset : CUoffset3D + + + + 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._array = CUarray(_ptr=&self._pvt_ptr[0].op.array.array) + + + self._offset = CUoffset3D(_ptr=&self._pvt_ptr[0].op.array.offset) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op.array + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['array : ' + str(self.array)] + except ValueError: + str_list += ['array : '] + + + try: + str_list += ['offset :\n' + '\n'.join([' ' + line for line in str(self.offset).splitlines()])] + except ValueError: + str_list += ['offset : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def array(self): + return self._array + @array.setter + def array(self, array): + cdef cydriver.CUarray cyarray + if array is None: + cyarray = 0 + elif isinstance(array, (CUarray,)): + parray = int(array) + cyarray = parray + else: + parray = int(CUarray(array)) + cyarray = parray + self._array._pvt_ptr[0] = cyarray + + + @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)) + + +cdef class anon_union12: + """ + Attributes + ---------- + + ptr : anon_struct23 + + + + array : anon_struct24 + + + + 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._ptr = anon_struct23(_ptr=self._pvt_ptr) + + + self._array = anon_struct24(_ptr=self._pvt_ptr) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['ptr :\n' + '\n'.join([' ' + line for line in str(self.ptr).splitlines()])] + except ValueError: + str_list += ['ptr : '] + + + try: + str_list += ['array :\n' + '\n'.join([' ' + line for line in str(self.array).splitlines()])] + except ValueError: + str_list += ['array : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + +cdef class CUmemcpy3DOperand_st: + """ + Struct representing an operand for copy with cuMemcpy3DBatchAsync + + Attributes + ---------- + + type : CUmemcpy3DOperandType + + + + op : anon_union12 + + + + 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.CUmemcpy3DOperand_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._op = anon_union12(_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 += ['op :\n' + '\n'.join([' ' + line for line in str(self.op).splitlines()])] + except ValueError: + str_list += ['op : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def op(self): + return self._op + @op.setter + def op(self, op not None : anon_union12): + string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) + + +cdef class CUDA_MEMCPY3D_BATCH_OP_st: + """ + Attributes + ---------- + + src : CUmemcpy3DOperand + Source memcpy operand. + + + dst : CUmemcpy3DOperand + Destination memcpy operand. + + + extent : CUextent3D + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + + + srcAccessOrder : CUmemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + + + flags : unsigned int + Additional flags for copies with this attribute. See CUmemcpyFlags + + + 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 + + self._src = CUmemcpy3DOperand(_ptr=&self._pvt_ptr[0].src) + + + self._dst = CUmemcpy3DOperand(_ptr=&self._pvt_ptr[0].dst) + + + self._extent = CUextent3D(_ptr=&self._pvt_ptr[0].extent) + + 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 += ['src :\n' + '\n'.join([' ' + line for line in str(self.src).splitlines()])] + except ValueError: + str_list += ['src : '] + + + try: + str_list += ['dst :\n' + '\n'.join([' ' + line for line in str(self.dst).splitlines()])] + except ValueError: + str_list += ['dst : '] + + + try: + str_list += ['extent :\n' + '\n'.join([' ' + line for line in str(self.extent).splitlines()])] + except ValueError: + str_list += ['extent : '] + + + try: + str_list += ['srcAccessOrder : ' + str(self.srcAccessOrder)] + except ValueError: + str_list += ['srcAccessOrder : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @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)) + + + @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)) + + + @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) + + + @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 CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + 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 + + self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) + + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) + + def __dealloc__(self): + pass + + if self._accessDescs is not NULL: + free(self._accessDescs) + 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 = [] + + try: + str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] + except ValueError: + str_list += ['poolProps : '] + + + try: + str_list += ['accessDescs : ' + str(self.accessDescs)] + except ValueError: + str_list += ['accessDescs : '] + + + try: + str_list += ['accessDescCount : ' + str(self.accessDescCount)] + except ValueError: + str_list += ['accessDescCount : '] + + + try: + str_list += ['bytesize : ' + str(self.bytesize)] + except ValueError: + str_list += ['bytesize : '] + + + try: + str_list += ['dptr : ' + str(self.dptr)] + except ValueError: + str_list += ['dptr : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @property + def accessDescs(self): + arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] + return [CUmemAccessDesc(_ptr=arr) for arr in arrs] + @accessDescs.setter + def accessDescs(self, val): + cdef cydriver.CUmemAccessDesc* _accessDescs_new + if len(val) == 0: + free(self._accessDescs) + self._accessDescs = NULL + self._accessDescs_length = 0 + self._pvt_ptr[0].accessDescs = NULL + else: + if self._accessDescs_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) + if _accessDescs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + free(self._accessDescs) + self._accessDescs = _accessDescs_new + self._accessDescs_length = len(val) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + + + + @property + def accessDescCount(self): + return self._pvt_ptr[0].accessDescCount + @accessDescCount.setter + def accessDescCount(self, size_t accessDescCount): + self._pvt_ptr[0].accessDescCount = accessDescCount + + + @property + def bytesize(self): + return self._pvt_ptr[0].bytesize + @bytesize.setter + def bytesize(self, size_t bytesize): + self._pvt_ptr[0].bytesize = bytesize + + + @property + def dptr(self): + return self._dptr + @dptr.setter + def dptr(self, dptr): + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + cydptr = 0 + elif isinstance(dptr, (CUdeviceptr)): + pdptr = int(dptr) + cydptr = pdptr + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + self._dptr._pvt_ptr[0] = cydptr + + + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + 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 + + self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) + + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) + + def __dealloc__(self): + pass + + if self._accessDescs is not NULL: + free(self._accessDescs) + 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 = [] + + try: + str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] + except ValueError: + str_list += ['poolProps : '] + + + try: + str_list += ['accessDescs : ' + str(self.accessDescs)] + except ValueError: + str_list += ['accessDescs : '] + + + try: + str_list += ['accessDescCount : ' + str(self.accessDescCount)] + except ValueError: + str_list += ['accessDescCount : '] + + + try: + str_list += ['bytesize : ' + str(self.bytesize)] + except ValueError: + str_list += ['bytesize : '] + + + try: + str_list += ['dptr : ' + str(self.dptr)] + except ValueError: + str_list += ['dptr : '] + + return '\n'.join(str_list) + else: + return '' + + @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)) + + + @property + def accessDescs(self): + arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] + return [CUmemAccessDesc(_ptr=arr) for arr in arrs] + @accessDescs.setter + def accessDescs(self, val): + cdef cydriver.CUmemAccessDesc* _accessDescs_new + if len(val) == 0: + free(self._accessDescs) + self._accessDescs = NULL + self._accessDescs_length = 0 + self._pvt_ptr[0].accessDescs = NULL + else: + if self._accessDescs_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) + if _accessDescs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + free(self._accessDescs) + self._accessDescs = _accessDescs_new + self._accessDescs_length = len(val) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + + + + @property + def accessDescCount(self): + return self._pvt_ptr[0].accessDescCount + @accessDescCount.setter + def accessDescCount(self, size_t accessDescCount): + self._pvt_ptr[0].accessDescCount = accessDescCount + + + @property + def bytesize(self): + return self._pvt_ptr[0].bytesize + @bytesize.setter + def bytesize(self, size_t bytesize): + self._pvt_ptr[0].bytesize = bytesize + + + @property + def dptr(self): + return self._dptr + @dptr.setter + def dptr(self, dptr): + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + cydptr = 0 + elif isinstance(dptr, (CUdeviceptr)): + pdptr = int(dptr) + cydptr = pdptr + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + self._dptr._pvt_ptr[0] = cydptr + + + +cdef class CUDA_MEM_FREE_NODE_PARAMS_st: + """ + Memory free node parameters + + Attributes + ---------- + + dptr : CUdeviceptr + in: the pointer to free + + + 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 + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) + + 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 += ['dptr : ' + str(self.dptr)] + except ValueError: + str_list += ['dptr : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def dptr(self): + return self._dptr + @dptr.setter + def dptr(self, dptr): + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + cydptr = 0 + elif isinstance(dptr, (CUdeviceptr)): + pdptr = int(dptr) + cydptr = pdptr + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + self._dptr._pvt_ptr[0] = cydptr + + + +cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: + """ + Child graph node parameters + + Attributes + ---------- + + 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. + + + ownership : CUgraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + + + 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 + + self._graph = CUgraph(_ptr=&self._pvt_ptr[0].graph) + + 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 += ['graph : ' + str(self.graph)] + except ValueError: + str_list += ['graph : '] + + + try: + str_list += ['ownership : ' + str(self.ownership)] + except ValueError: + str_list += ['ownership : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def graph(self): + return self._graph + @graph.setter + def graph(self, graph): + cdef cydriver.CUgraph cygraph + if graph is None: + cygraph = 0 + elif isinstance(graph, (CUgraph,)): + pgraph = int(graph) + cygraph = pgraph + else: + pgraph = int(CUgraph(graph)) + cygraph = pgraph + self._graph._pvt_ptr[0] = cygraph + + + @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) + + +cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: + """ + Event record node parameters + + Attributes + ---------- + + event : CUevent + The event to record when the node executes + + + 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 + + self._event = CUevent(_ptr=&self._pvt_ptr[0].event) + + 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 += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cydriver.CUevent cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(CUevent(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + + +cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: + """ + Event wait node parameters + + Attributes + ---------- + + event : CUevent + The event to wait on from the node + + + 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 + + self._event = CUevent(_ptr=&self._pvt_ptr[0].event) + + 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 += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cydriver.CUevent cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(CUevent(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + + +cdef class CUgraphNodeParams_st: + """ + Graph node parameters. See cuGraphAddNode. + + Attributes + ---------- + + type : CUgraphNodeType + Type of the node + + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 + Kernel node parameters. + + + memcpy : CUDA_MEMCPY_NODE_PARAMS + Memcpy node parameters. + + + memset : CUDA_MEMSET_NODE_PARAMS_v2 + Memset node parameters. + + + host : CUDA_HOST_NODE_PARAMS_v2 + Host node parameters. + + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS + Child graph node parameters. + + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS + Event wait node parameters. + + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS + Event record node parameters. + + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 + External semaphore signal node parameters. + + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 + External semaphore wait node parameters. + + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 + Memory allocation node parameters. + + + free : CUDA_MEM_FREE_NODE_PARAMS + Memory free node parameters. + + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 + MemOp node parameters. + + + conditional : CUDA_CONDITIONAL_NODE_PARAMS + Conditional node parameters. + + + 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.CUgraphNodeParams_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._kernel = CUDA_KERNEL_NODE_PARAMS_v3(_ptr=&self._pvt_ptr[0].kernel) + + + self._memcpy = CUDA_MEMCPY_NODE_PARAMS(_ptr=&self._pvt_ptr[0].memcpy) + + + self._memset = CUDA_MEMSET_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].memset) + + + self._host = CUDA_HOST_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].host) + + + self._graph = CUDA_CHILD_GRAPH_NODE_PARAMS(_ptr=&self._pvt_ptr[0].graph) + + + self._eventWait = CUDA_EVENT_WAIT_NODE_PARAMS(_ptr=&self._pvt_ptr[0].eventWait) + + + self._eventRecord = CUDA_EVENT_RECORD_NODE_PARAMS(_ptr=&self._pvt_ptr[0].eventRecord) + + + self._extSemSignal = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].extSemSignal) + + + self._extSemWait = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].extSemWait) + + + self._alloc = CUDA_MEM_ALLOC_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].alloc) + + + self._free = CUDA_MEM_FREE_NODE_PARAMS(_ptr=&self._pvt_ptr[0].free) + + + self._memOp = CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].memOp) + + + self._conditional = CUDA_CONDITIONAL_NODE_PARAMS(_ptr=&self._pvt_ptr[0].conditional) + + 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 += ['kernel :\n' + '\n'.join([' ' + line for line in str(self.kernel).splitlines()])] + except ValueError: + str_list += ['kernel : '] + + + try: + str_list += ['memcpy :\n' + '\n'.join([' ' + line for line in str(self.memcpy).splitlines()])] + except ValueError: + str_list += ['memcpy : '] + + + try: + str_list += ['memset :\n' + '\n'.join([' ' + line for line in str(self.memset).splitlines()])] + except ValueError: + str_list += ['memset : '] + + + try: + str_list += ['host :\n' + '\n'.join([' ' + line for line in str(self.host).splitlines()])] + except ValueError: + str_list += ['host : '] + + + try: + str_list += ['graph :\n' + '\n'.join([' ' + line for line in str(self.graph).splitlines()])] + except ValueError: + str_list += ['graph : '] + + + try: + str_list += ['eventWait :\n' + '\n'.join([' ' + line for line in str(self.eventWait).splitlines()])] + except ValueError: + str_list += ['eventWait : '] + + + try: + str_list += ['eventRecord :\n' + '\n'.join([' ' + line for line in str(self.eventRecord).splitlines()])] + except ValueError: + str_list += ['eventRecord : '] + + + try: + str_list += ['extSemSignal :\n' + '\n'.join([' ' + line for line in str(self.extSemSignal).splitlines()])] + except ValueError: + str_list += ['extSemSignal : '] + + + try: + str_list += ['extSemWait :\n' + '\n'.join([' ' + line for line in str(self.extSemWait).splitlines()])] + except ValueError: + str_list += ['extSemWait : '] + + + try: + str_list += ['alloc :\n' + '\n'.join([' ' + line for line in str(self.alloc).splitlines()])] + except ValueError: + str_list += ['alloc : '] + + + try: + str_list += ['free :\n' + '\n'.join([' ' + line for line in str(self.free).splitlines()])] + except ValueError: + str_list += ['free : '] + + + try: + str_list += ['memOp :\n' + '\n'.join([' ' + line for line in str(self.memOp).splitlines()])] + except ValueError: + str_list += ['memOp : '] + + + try: + str_list += ['conditional :\n' + '\n'.join([' ' + line for line in str(self.conditional).splitlines()])] + except ValueError: + str_list += ['conditional : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + + @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)) + + +cdef class CUcheckpointLockArgs_st: + """ + CUDA checkpoint optional lock arguments + + Attributes + ---------- + + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + + + 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 += ['timeoutMs : ' + str(self.timeoutMs)] + except ValueError: + str_list += ['timeoutMs : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def timeoutMs(self): + return self._pvt_ptr[0].timeoutMs + @timeoutMs.setter + def timeoutMs(self, unsigned int timeoutMs): + self._pvt_ptr[0].timeoutMs = timeoutMs + + +cdef class CUcheckpointCheckpointArgs_st: + """ + CUDA checkpoint optional checkpoint arguments + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUcheckpointRestoreArgs_st: + """ + CUDA checkpoint optional restore arguments + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUcheckpointUnlockArgs_st: + """ + CUDA checkpoint optional unlock arguments + + 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 = [] + + return '\n'.join(str_list) + else: + return '' + +cdef class CUmemDecompressParams_st: + """ + Structure describing the parameters that compose a single + decompression operation. + + Attributes + ---------- + + srcNumBytes : size_t + The number of bytes to be read and decompressed from + CUmemDecompressParams_st.src. + + + 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. + + + 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. + + + src : Any + Pointer to a buffer of at least + CUmemDecompressParams_st.srcNumBytes compressed bytes. + + + 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 + + + algo : CUmemDecompressAlgorithm + The decompression algorithm to use. + + + 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 += ['srcNumBytes : ' + str(self.srcNumBytes)] + except ValueError: + str_list += ['srcNumBytes : '] + + + try: + str_list += ['dstNumBytes : ' + str(self.dstNumBytes)] + except ValueError: + str_list += ['dstNumBytes : '] + + + try: + str_list += ['dstActBytes : ' + str(self.dstActBytes)] + except ValueError: + str_list += ['dstActBytes : '] + + + try: + str_list += ['src : ' + hex(self.src)] + except ValueError: + str_list += ['src : '] + + + try: + str_list += ['dst : ' + hex(self.dst)] + except ValueError: + str_list += ['dst : '] + + + try: + str_list += ['algo : ' + str(self.algo)] + except ValueError: + str_list += ['algo : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def srcNumBytes(self): + return self._pvt_ptr[0].srcNumBytes + @srcNumBytes.setter + def srcNumBytes(self, size_t srcNumBytes): + self._pvt_ptr[0].srcNumBytes = srcNumBytes + + + @property + def dstNumBytes(self): + return self._pvt_ptr[0].dstNumBytes + @dstNumBytes.setter + def dstNumBytes(self, size_t dstNumBytes): + self._pvt_ptr[0].dstNumBytes = dstNumBytes + + + @property + def dstActBytes(self): + return cuuint32_t(_ptr=self._pvt_ptr[0].dstActBytes) + + + @property + def src(self): + return self._pvt_ptr[0].src + @src.setter + def src(self, src): + self._cysrc = _HelperInputVoidPtr(src) + self._pvt_ptr[0].src = self._cysrc.cptr + + + @property + def dst(self): + return self._pvt_ptr[0].dst + @dst.setter + def dst(self, dst): + self._cydst = _HelperInputVoidPtr(dst) + self._pvt_ptr[0].dst = self._cydst.cptr + + + @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) + + +cdef class CUdevSmResource_st: + """ + Attributes + ---------- + + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + This is an output parameter only, do not write to this field. + + + 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 += ['smCount : ' + str(self.smCount)] + except ValueError: + str_list += ['smCount : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def smCount(self): + return self._pvt_ptr[0].smCount + @smCount.setter + def smCount(self, unsigned int smCount): + self._pvt_ptr[0].smCount = smCount + + +cdef class CUdevResource_st: + """ + Attributes + ---------- + + type : CUdevResourceType + Type of resource, dictates which union field was last set + + + _internal_padding : bytes + + + + sm : CUdevSmResource + Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. + + + _oversize : bytes + + + + 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.CUdevResource_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._sm = CUdevSmResource(_ptr=&self._pvt_ptr[0].sm) + + 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 += ['_internal_padding : ' + str(self._internal_padding)] + except ValueError: + str_list += ['_internal_padding : '] + + + try: + str_list += ['sm :\n' + '\n'.join([' ' + line for line in str(self.sm).splitlines()])] + except ValueError: + str_list += ['sm : '] + + + try: + str_list += ['_oversize : ' + str(self._oversize)] + except ValueError: + str_list += ['_oversize : '] + + return '\n'.join(str_list) + else: + return '' + + @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) + + + @property + def _internal_padding(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0]._internal_padding, 92) + @_internal_padding.setter + def _internal_padding(self, _internal_padding): + if len(_internal_padding) != 92: + 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 + + + @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)) + + + @property + def _oversize(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0]._oversize, 48) + @_oversize.setter + def _oversize(self, _oversize): + if len(_oversize) != 48: + raise ValueError("_oversize length must be 48, is " + str(len(_oversize))) + for i, b in enumerate(_oversize): + self._pvt_ptr[0]._oversize[i] = b + + +cdef class anon_union15: + """ + Attributes + ---------- + + pArray : list[CUarray] + + + + pPitch : list[Any] + + + + 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].frame + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['pArray : ' + str(self.pArray)] + except ValueError: + str_list += ['pArray : '] + + + try: + str_list += ['pPitch : ' + hex(self.pPitch)] + except ValueError: + str_list += ['pPitch : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def pArray(self): + return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] + @pArray.setter + def pArray(self, pArray : list[CUarray]): + if len(pArray) != 3: + raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) + pArray = [int(_pArray) for _pArray in pArray] + for _idx, _pArray in enumerate(pArray): + self._pvt_ptr[0].frame.pArray[_idx] = _pArray + + + + @property + def pPitch(self): + return [_pPitch for _pPitch in self._pvt_ptr[0].frame.pPitch] + @pPitch.setter + def pPitch(self, pPitch : list[int]): + if len(pPitch) != 3: + raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) + pPitch = [_pPitch for _pPitch in pPitch] + for _idx, _pPitch in enumerate(pPitch): + self._pvt_ptr[0].frame.pPitch[_idx] = _pPitch + + +cdef class CUeglFrame_st: + """ + CUDA EGLFrame structure Descriptor - structure defining one frame + of EGL. Each frame may contain one or more planes depending on + whether the surface * is Multiplanar or not. + + Attributes + ---------- + + frame : anon_union15 + + + + width : unsigned int + Width of first plane + + + height : unsigned int + Height of first plane + + + depth : unsigned int + Depth of first plane + + + pitch : unsigned int + Pitch of first plane + + + planeCount : unsigned int + Number of planes + + + numChannels : unsigned int + Number of channels for the plane + + + frameType : CUeglFrameType + Array or Pitch + + + eglColorFormat : CUeglColorFormat + CUDA EGL Color Format + + + cuFormat : CUarray_format + CUDA Array Format + + + 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.CUeglFrame_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._frame = anon_union15(_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 += ['frame :\n' + '\n'.join([' ' + line for line in str(self.frame).splitlines()])] + except ValueError: + str_list += ['frame : '] + + + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + + + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + + + try: + str_list += ['depth : ' + str(self.depth)] + except ValueError: + str_list += ['depth : '] + + + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + + + try: + str_list += ['planeCount : ' + str(self.planeCount)] + except ValueError: + str_list += ['planeCount : '] + + + try: + str_list += ['numChannels : ' + str(self.numChannels)] + except ValueError: + str_list += ['numChannels : '] + + + try: + str_list += ['frameType : ' + str(self.frameType)] + except ValueError: + str_list += ['frameType : '] + + + try: + str_list += ['eglColorFormat : ' + str(self.eglColorFormat)] + except ValueError: + str_list += ['eglColorFormat : '] + + + try: + str_list += ['cuFormat : ' + str(self.cuFormat)] + except ValueError: + str_list += ['cuFormat : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def frame(self): + return self._frame + @frame.setter + def frame(self, frame not None : anon_union15): + 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 + + + @property + def height(self): + return self._pvt_ptr[0].height + @height.setter + def height(self, unsigned int height): + self._pvt_ptr[0].height = height + + + @property + def depth(self): + return self._pvt_ptr[0].depth + @depth.setter + def depth(self, unsigned int depth): + self._pvt_ptr[0].depth = depth + + + @property + def pitch(self): + return self._pvt_ptr[0].pitch + @pitch.setter + def pitch(self, unsigned int pitch): + self._pvt_ptr[0].pitch = pitch + + + @property + def planeCount(self): + return self._pvt_ptr[0].planeCount + @planeCount.setter + def planeCount(self, unsigned int planeCount): + self._pvt_ptr[0].planeCount = planeCount + + + @property + def numChannels(self): + return self._pvt_ptr[0].numChannels + @numChannels.setter + def numChannels(self, unsigned int numChannels): + self._pvt_ptr[0].numChannels = numChannels + + + @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) + + + @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) + + + @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) + + +cdef class cuuint32_t: + """ + + 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 cuuint64_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, uint64_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 CUdeviceptr_v2: + """ + + CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUdevice_v1: + """ + + CUDA device + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class CUtexObject_v1: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUsurfObject_v1: + """ + + An opaque value that represents a CUDA surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUmemGenericAllocationHandle_v1: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 CUlogIterator: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +cdef class VdpDevice: + """ + + 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 VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long 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 VdpVideoSurface: + """ + + 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 VdpOutputSurface: + """ + + 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 + +@cython.embedsignature(True) +def cuGetErrorString(error not None : CUresult): + """ Gets the string description of an error code. + + Sets `*pStr` to the address of a NULL-terminated string description of + the error code `error`. If the error code is not recognized, + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned and `*pStr` will + be set to the NULL address. + + Parameters + ---------- + error : :py:obj:`~.CUresult` + Error code to convert to string + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pStr : bytes + Address of the string pointer. + + See Also + -------- + :py:obj:`~.CUresult`, :py:obj:`~.cudaGetErrorString` + """ + cdef cydriver.CUresult cyerror = int(error) + cdef const char* pStr = NULL + with nogil: + err = cydriver.cuGetErrorString(cyerror, &pStr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pStr if pStr != NULL else None) + +@cython.embedsignature(True) +def cuGetErrorName(error not None : CUresult): + """ Gets the string representation of an error code enum name. + + Sets `*pStr` to the address of a NULL-terminated string representation + of the name of the enum error code `error`. If the error code is not + recognized, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned and + `*pStr` will be set to the NULL address. + + Parameters + ---------- + error : :py:obj:`~.CUresult` + Error code to convert to string + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pStr : bytes + Address of the string pointer. + + See Also + -------- + :py:obj:`~.CUresult`, :py:obj:`~.cudaGetErrorName` + """ + cdef cydriver.CUresult cyerror = int(error) + cdef const char* pStr = NULL + with nogil: + err = cydriver.cuGetErrorName(cyerror, &pStr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pStr if pStr != NULL else None) + +@cython.embedsignature(True) +def cuInit(unsigned int Flags): + """ Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the `Flags` parameter must be 0. If :py:obj:`~.cuInit()` has not been called, any function from the driver API will return :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`. + + Parameters + ---------- + Flags : unsigned int + Initialization flag for CUDA. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_SYSTEM_DRIVER_MISMATCH`, :py:obj:`~.CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE` + """ + with nogil: + err = cydriver.cuInit(Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDriverGetVersion(): + """ Returns the latest CUDA version supported by driver. + + Returns in `*driverVersion` the version of CUDA supported by the + driver. The version is returned as (1000 * major + 10 * minor). For + example, CUDA 9.2 would be represented by 9020. + + This function automatically returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if `driverVersion` is NULL. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + driverVersion : int + Returns the CUDA driver version + + See Also + -------- + :py:obj:`~.cudaDriverGetVersion`, :py:obj:`~.cudaRuntimeGetVersion` + """ + cdef int driverVersion = 0 + with nogil: + err = cydriver.cuDriverGetVersion(&driverVersion) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, driverVersion) + +@cython.embedsignature(True) +def cuDeviceGet(int ordinal): + """ Returns a handle to a compute device. + + Returns in `*device` a device handle given an ordinal in the range [0, + :py:obj:`~.cuDeviceGetCount()`-1]. + + Parameters + ---------- + ordinal : int + Device number to get handle for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + device : :py:obj:`~.CUdevice` + Returned device handle + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport` + """ + cdef CUdevice device = CUdevice() + with nogil: + err = cydriver.cuDeviceGet(device._pvt_ptr, ordinal) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, device) + +@cython.embedsignature(True) +def cuDeviceGetCount(): + """ Returns the number of compute-capable devices. + + Returns in `*count` the number of devices with compute capability + greater than or equal to 2.0 that are available for execution. If there + is no such device, :py:obj:`~.cuDeviceGetCount()` returns 0. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + count : int + Returned number of compute-capable devices + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaGetDeviceCount` + """ + cdef int count = 0 + with nogil: + err = cydriver.cuDeviceGetCount(&count) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, count) + +@cython.embedsignature(True) +def cuDeviceGetName(int length, dev): + """ Returns an identifier string for the device. + + Returns an ASCII string identifying the device `dev` in the NULL- + terminated string pointed to by `name`. `length` specifies the maximum + length of the string that may be returned. `name` is shortened to the + specified `length`, if `length` is less than the device name + + Parameters + ---------- + length : int + Maximum length of string to store in `name` + dev : :py:obj:`~.CUdevice` + Device to get identifier string for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + name : bytes + Returned identifier string for the device + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaGetDeviceProperties` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + pyname = b" " * length + cdef char* name = pyname + with nogil: + err = cydriver.cuDeviceGetName(name, length, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pyname) + +@cython.embedsignature(True) +def cuDeviceGetUuid(dev): + """ Return an UUID for the device. + + Note there is a later version of this API, + :py:obj:`~.cuDeviceGetUuid_v2`. It will supplant this version in 12.0, + which is retained for minor version compatibility. + + Returns 16-octets identifying the device `dev` in the structure pointed + by the `uuid`. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device to get identifier string for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + uuid : :py:obj:`~.CUuuid` + Returned UUID + + See Also + -------- + :py:obj:`~.cuDeviceGetUuid_v2` :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaGetDeviceProperties` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUuuid uuid = CUuuid() + with nogil: + err = cydriver.cuDeviceGetUuid(uuid._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, uuid) + +@cython.embedsignature(True) +def cuDeviceGetUuid_v2(dev): + """ Return an UUID for the device (11.4+). + + Returns 16-octets identifying the device `dev` in the structure pointed + by the `uuid`. If the device is in MIG mode, returns its MIG UUID which + uniquely identifies the subscribed MIG compute instance. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device to get identifier string for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + uuid : :py:obj:`~.CUuuid` + Returned UUID + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetLuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cudaGetDeviceProperties` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUuuid uuid = CUuuid() + with nogil: + err = cydriver.cuDeviceGetUuid_v2(uuid._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, uuid) + +@cython.embedsignature(True) +def cuDeviceGetLuid(dev): + """ Return an LUID and device node mask for the device. + + Return identifying information (`luid` and `deviceNodeMask`) to allow + matching device with graphics APIs. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device to get identifier string for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + luid : bytes + Returned LUID + deviceNodeMask : unsigned int + Returned device node mask + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaGetDeviceProperties` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef char luid[8] + cdef unsigned int deviceNodeMask = 0 + with nogil: + err = cydriver.cuDeviceGetLuid(luid, &deviceNodeMask, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, luid, deviceNodeMask) + +@cython.embedsignature(True) +def cuDeviceTotalMem(dev): + """ Returns the total amount of memory on the device. + + Returns in `*bytes` the total amount of memory available on the device + `dev` in bytes. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + numbytes : int + Returned memory available on device in bytes + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaMemGetInfo` + """ + 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 size_t numbytes = 0 + with nogil: + err = cydriver.cuDeviceTotalMem(&numbytes, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, numbytes) + +@cython.embedsignature(True) +def cuDeviceGetTexture1DLinearMaxWidth(pformat not None : CUarray_format, unsigned numChannels, dev): + """ Returns the maximum number of elements allocatable in a 1D linear texture for a given texture element size. + + Returns in `maxWidthInElements` the maximum number of texture elements + allocatable in a 1D linear texture for given `pformat` and + `numChannels`. + + Parameters + ---------- + pformat : :py:obj:`~.CUarray_format` + Texture format. + numChannels : unsigned + Number of channels per texture element. + dev : :py:obj:`~.CUdevice` + Device handle. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + maxWidthInElements : int + Returned maximum number of texture elements allocatable for given + `pformat` and `numChannels`. + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cudaMemGetInfo`, :py:obj:`~.cuDeviceTotalMem` + """ + 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 size_t maxWidthInElements = 0 + cdef cydriver.CUarray_format cypformat = int(pformat) + with nogil: + err = cydriver.cuDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cypformat, numChannels, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, maxWidthInElements) + +@cython.embedsignature(True) +def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): + """ Returns information about the device. + + Returns in `*pi` the integer value of the attribute `attrib` on device + `dev`. The supported attributes are: + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK`: Maximum number + of threads per block; + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X`: Maximum x-dimension + of a block + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y`: Maximum y-dimension + of a block + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z`: Maximum z-dimension + of a block + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X`: Maximum x-dimension + of a grid + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y`: Maximum y-dimension + of a grid + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z`: Maximum z-dimension + of a grid + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`: Maximum + amount of shared memory available to a thread block in bytes + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY`: Memory + available on device for constant variables in a CUDA C kernel in + bytes + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_WARP_SIZE`: Warp size in threads + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`: Maximum pitch in bytes + allowed by the memory copy functions that involve memory regions + allocated through :py:obj:`~.cuMemAllocPitch()` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`: Maximum 1D + texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`: + Maximum width for a 1D texture bound to linear memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH`: + Maximum mipmapped 1D texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH`: Maximum 2D + texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT`: Maximum 2D + texture height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`: + Maximum width for a 2D texture bound to linear memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`: + Maximum height for a 2D texture bound to linear memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`: + Maximum pitch in bytes for a 2D texture bound to linear memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH`: + Maximum mipmapped 2D texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT`: + Maximum mipmapped 2D texture height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH`: Maximum 3D + texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT`: Maximum 3D + texture height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH`: Maximum 3D + texture depth + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE`: + Alternate maximum 3D texture width, 0 if no alternate maximum 3D + texture size is supported + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE`: + Alternate maximum 3D texture height, 0 if no alternate maximum 3D + texture size is supported + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE`: + Alternate maximum 3D texture depth, 0 if no alternate maximum 3D + texture size is supported + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH`: Maximum + cubemap texture width or height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH`: + Maximum 1D layered texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS`: + Maximum layers in a 1D layered texture + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH`: + Maximum 2D layered texture width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT`: + Maximum 2D layered texture height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS`: + Maximum layers in a 2D layered texture + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH`: + Maximum cubemap layered texture width or height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS`: + Maximum layers in a cubemap layered texture + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH`: Maximum 1D + surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH`: Maximum 2D + surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT`: Maximum 2D + surface height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH`: Maximum 3D + surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT`: Maximum 3D + surface height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH`: Maximum 3D + surface depth + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH`: + Maximum 1D layered surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS`: + Maximum layers in a 1D layered surface + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH`: + Maximum 2D layered surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT`: + Maximum 2D layered surface height + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS`: + Maximum layers in a 2D layered surface + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH`: Maximum + cubemap surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH`: + Maximum cubemap layered surface width + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS`: + Maximum layers in a cubemap layered surface + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK`: Maximum + number of 32-bit registers available to a thread block + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CLOCK_RATE`: The typical clock + frequency in kilohertz + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`: Alignment + requirement; texture base addresses aligned to + :py:obj:`~.textureAlign` bytes do not need an offset applied to + texture fetches + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`: Pitch + alignment requirement for 2D texture references bound to pitched + memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP`: 1 if the device can + concurrently copy memory between host and device while executing a + kernel, or 0 if not + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`: Number of + multiprocessors on the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT`: 1 if there is a + run time limit for kernels executed on the device, or 0 if not + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_INTEGRATED`: 1 if the device is + integrated with the memory subsystem, or 0 if not + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY`: 1 if the device + can map host memory into the CUDA address space, or 0 if not + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`: Compute mode that + device is currently in. Available modes are as follows: + + - :py:obj:`~.CU_COMPUTEMODE_DEFAULT`: Default mode - Device is not + restricted and can have multiple CUDA contexts present at a single + time. + + - :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`: Compute-prohibited mode - + Device is prohibited from creating new CUDA contexts. + + - :py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS`: Compute-exclusive- + process mode - Device can have only one context used by a single + process at a time. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS`: 1 if the device + supports executing multiple kernels within the same context + simultaneously, or 0 if not. It is not guaranteed that multiple + kernels will be resident on the device concurrently so this feature + should not be relied upon for correctness. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_ECC_ENABLED`: 1 if error correction is + enabled on the device, 0 if error correction is disabled or not + supported by the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID`: PCI bus identifier of the + device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID`: PCI device (also known + as slot) identifier of the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID`: PCI domain identifier + of the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_TCC_DRIVER`: 1 if the device is using + a TCC driver. TCC is only available on Tesla hardware running Windows + Vista or later + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE`: Peak memory clock + frequency in kilohertz + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH`: Global + memory bus width in bits + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE`: Size of L2 cache in + bytes. 0 if the device doesn't have L2 cache + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR`: + Maximum resident threads per multiprocessor + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`: 1 if the device + shares a unified address space with the host, or 0 if not + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR`: Major + compute capability version number + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR`: Minor + compute capability version number + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED`: 1 if + device supports caching globals in L1 cache, 0 if caching globals in + L1 cache is not supported by the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED`: 1 if device + supports caching locals in L1 cache, 0 if caching locals in L1 cache + is not supported by the device + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`: + Maximum amount of shared memory available to a multiprocessor in + bytes; this amount is shared by all thread blocks simultaneously + resident on a multiprocessor + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR`: + Maximum number of 32-bit registers available to a multiprocessor; + this number is shared by all thread blocks simultaneously resident on + a multiprocessor + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`: 1 if device supports + allocating managed memory on this system, 0 if allocating managed + memory is not supported by the device on this system. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD`: 1 if device is on a + multi-GPU board, 0 if not. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID`: Unique + identifier for a group of devices associated with the same board. + Devices on the same multi-GPU board will share the same identifier. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED`: 1 if + Link between the device and the host supports native atomic + operations. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO`: + Ratio of single precision performance (in floating-point operations + per second) to double precision performance. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`: Device + supports coherently accessing pageable memory without calling + cudaHostRegister on it. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`: Device can + coherently access managed memory concurrently with the CPU. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED`: Device + supports Compute Preemption. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`: + Device can access host registered memory at the same virtual address + as the CPU. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`: + The maximum per block shared memory size supported on this device. + This is the maximum value that can be opted into when using the + :py:obj:`~.cuFuncSetAttribute()` or + :py:obj:`~.cuKernelSetAttribute()` call. For more details see + :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`: + Device accesses pageable memory via the host's page tables. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST`: + The host can directly access managed memory on the device without + migration. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`: + Device supports virtual memory management APIs like + :py:obj:`~.cuMemAddressReserve`, :py:obj:`~.cuMemCreate`, + :py:obj:`~.cuMemMap` and related APIs + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED`: + Device supports exporting memory to a posix file descriptor with + :py:obj:`~.cuMemExportToShareableHandle`, if requested via + :py:obj:`~.cuMemCreate` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED`: + Device supports exporting memory to a Win32 NT handle with + :py:obj:`~.cuMemExportToShareableHandle`, if requested via + :py:obj:`~.cuMemCreate` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED`: + Device supports exporting memory to a Win32 KMT handle with + :py:obj:`~.cuMemExportToShareableHandle`, if requested via + :py:obj:`~.cuMemCreate` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR`: + Maximum number of thread blocks that can reside on a multiprocessor + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED`: Device + supports compressible memory allocation via :py:obj:`~.cuMemCreate` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE`: Maximum + L2 persisting lines capacity setting in bytes + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE`: + Maximum value of :py:obj:`~.CUaccessPolicyWindow.num_bytes` + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED`: + Device supports specifying the GPUDirect RDMA flag with + :py:obj:`~.cuMemCreate`. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK`: + Amount of shared memory per block reserved by CUDA driver in bytes + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED`: Device + supports sparse CUDA arrays and sparse CUDA mipmapped arrays. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`: + Device supports using the :py:obj:`~.cuMemHostRegister` flag + :py:obj:`~.CU_MEMHOSTERGISTER_READ_ONLY` to register memory that must + be mapped as read-only to the GPU + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED`: Device + supports using the :py:obj:`~.cuMemAllocAsync` and + :py:obj:`~.cuMemPool` family of APIs + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED`: Device + supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see + https://docs.nvidia.com/cuda/gpudirect-rdma for more information) + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS`: + The returned attribute shall be interpreted as a bitmask, where the + individual bits are described by the + :py:obj:`~.CUflushGPUDirectRDMAWritesOptions` enum + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING`: + GPUDirect RDMA writes to the device do not need to be flushed for + consumers within the scope indicated by the returned attribute. See + :py:obj:`~.CUGPUDirectRDMAWritesOrdering` for the numerical values + returned here. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES`: + Bitmask of handle types supported with mempool based IPC + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED`: + Device supports deferred mapping CUDA arrays and CUDA mipmapped + arrays. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_NUMA_CONFIG`: NUMA configuration of a + device: value is of type :py:obj:`~.CUdeviceNumaConfig` enum + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_NUMA_ID`: NUMA node ID of the GPU + memory + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED`: Device supports + switch multicast and reduction operations. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID`: The combined + 16-bit PCI device ID and 16-bit PCI vendor ID. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID`: The combined + 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. ID. + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`: + Device supports HOST_NUMA location with the virtual memory management + APIs like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related + APIs + + - :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED`: + Device supports HOST_NUMA location with the + :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + + Parameters + ---------- + attrib : :py:obj:`~.CUdevice_attribute` + Device attribute to query + dev : :py:obj:`~.CUdevice` + Device handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + pi : int + Returned device attribute value + + See Also + -------- + :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem`, :py:obj:`~.cuDeviceGetExecAffinitySupport`, :py:obj:`~.cudaDeviceGetAttribute`, :py:obj:`~.cudaGetDeviceProperties` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef int pi = 0 + cdef cydriver.CUdevice_attribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuDeviceGetAttribute(&pi, cyattrib, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pi) + +@cython.embedsignature(True) +def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): + """ Return NvSciSync attributes that this device can support. + + Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this + CUDA device, `dev` can support. The returned `nvSciSyncAttrList` can be + used to create an NvSciSync object that matches this device's + capabilities. + + If NvSciSyncAttrKey_RequiredPerm field in `nvSciSyncAttrList` is + already set this API will return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + The applications should set `nvSciSyncAttrList` to a valid + NvSciSyncAttrList failing which this API will return + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`. + + The `flags` controls how applications intends to use the NvSciSync + created from the `nvSciSyncAttrList`. The valid flags are: + + - :py:obj:`~.CUDA_NVSCISYNC_ATTR_SIGNAL`, specifies that the + applications intends to signal an NvSciSync on this CUDA device. + + - :py:obj:`~.CUDA_NVSCISYNC_ATTR_WAIT`, specifies that the applications + intends to wait on an NvSciSync on this CUDA device. + + At least one of these flags must be set, failing which the API returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. Both the flags are orthogonal to + one another: a developer may set both these flags that allows to set + both wait and signal specific attributes in the same + `nvSciSyncAttrList`. + + Note that this API updates the input `nvSciSyncAttrList` with values + equivalent to the following public attribute key-values: + NvSciSyncAttrKey_RequiredPerm is set to + + - NvSciSyncAccessPerm_SignalOnly if + :py:obj:`~.CUDA_NVSCISYNC_ATTR_SIGNAL` is set in `flags`. + + - NvSciSyncAccessPerm_WaitOnly if :py:obj:`~.CUDA_NVSCISYNC_ATTR_WAIT` + is set in `flags`. + + - NvSciSyncAccessPerm_WaitSignal if both + :py:obj:`~.CUDA_NVSCISYNC_ATTR_WAIT` and + :py:obj:`~.CUDA_NVSCISYNC_ATTR_SIGNAL` are set in `flags`. + NvSciSyncAttrKey_PrimitiveInfo is set to + + - NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid `device`. + + - NvSciSyncAttrValPrimitiveType_Syncpoint if `device` is a Tegra + device. + + - NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if `device` + is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is + returned for this `device` from :py:obj:`~.cuDeviceGetUuid`. + + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, + :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, + :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, + :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, + :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + Parameters + ---------- + nvSciSyncAttrList : Any + Return NvSciSync attributes supported. + dev : :py:obj:`~.CUdevice` + Valid Cuda Device to get NvSciSync attributes for. + flags : int + flags describing NvSciSync usage. + + Returns + ------- + CUresult + + See Also + -------- + :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + 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 _HelperInputVoidPtrStruct cynvSciSyncAttrListHelper + cdef void* cynvSciSyncAttrList = _helper_input_void_ptr(nvSciSyncAttrList, &cynvSciSyncAttrListHelper) + with nogil: + err = cydriver.cuDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList, cydev, flags) + _helper_input_void_ptr_free(&cynvSciSyncAttrListHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceSetMemPool(dev, pool): + """ Sets the current memory pool of a device. + + The memory pool must be local to the specified device. + :py:obj:`~.cuMemAllocAsync` allocates from the current mempool of the + provided stream's device. By default, a device's current memory pool is + its default memory pool. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + None + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolDestroy`, :py:obj:`~.cuMemAllocFromPoolAsync` + + Notes + ----- + Use :py:obj:`~.cuMemAllocFromPoolAsync` to specify asynchronous allocations from a device different than the one the stream runs on. + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + with nogil: + err = cydriver.cuDeviceSetMemPool(cydev, cypool) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceGetMemPool(dev): + """ Gets the current mempool for a device. + + Returns the last pool provided to :py:obj:`~.cuDeviceSetMemPool` for + this device or the device's default memory pool if + :py:obj:`~.cuDeviceSetMemPool` has never been called. By default the + current mempool is the default mempool for a device. Otherwise the + returned pool must have been set with :py:obj:`~.cuDeviceSetMemPool`. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pool : :py:obj:`~.CUmemoryPool` + None + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuDeviceSetMemPool` + """ + 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 CUmemoryPool pool = CUmemoryPool() + with nogil: + err = cydriver.cuDeviceGetMemPool(pool._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pool) + +@cython.embedsignature(True) +def cuDeviceGetDefaultMemPool(dev): + """ Returns the default mempool of a device. + + The default mempool of a device contains device memory from that + device. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pool_out : :py:obj:`~.CUmemoryPool` + None + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cuMemPoolSetAttribute`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + 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 CUmemoryPool pool_out = CUmemoryPool() + with nogil: + err = cydriver.cuDeviceGetDefaultMemPool(pool_out._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pool_out) + +@cython.embedsignature(True) +def cuDeviceGetExecAffinitySupport(typename not None : CUexecAffinityType, dev): + """ Returns information about the execution affinity support of the device. + + Returns in `*pi` whether execution affinity type `typename` is + supported by device `dev`. The supported types are: + + - :py:obj:`~.CU_EXEC_AFFINITY_TYPE_SM_COUNT`: 1 if context with limited + SMs is supported by the device, or 0 if not; + + Parameters + ---------- + typename : :py:obj:`~.CUexecAffinityType` + Execution affinity type to query + dev : :py:obj:`~.CUdevice` + Device handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + pi : int + 1 if the execution affinity type `typename` is supported by the + device, or 0 if not + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem` + """ + 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 int pi = 0 + cdef cydriver.CUexecAffinityType cytypename = int(typename) + with nogil: + err = cydriver.cuDeviceGetExecAffinitySupport(&pi, cytypename, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pi) + +@cython.embedsignature(True) +def cuFlushGPUDirectRDMAWrites(target not None : CUflushGPUDirectRDMAWritesTarget, scope not None : CUflushGPUDirectRDMAWritesScope): + """ Blocks until remote writes are visible to the specified scope. + + Blocks until GPUDirect RDMA writes to the target context via mappings + created through APIs like nvidia_p2p_get_pages (see + https://docs.nvidia.com/cuda/gpudirect-rdma for more information), are + visible to the specified scope. + + If the scope equals or lies within the scope indicated by + :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING`, the + call will be a no-op and can be safely omitted for performance. This + can be determined by comparing the numerical values between the two + enums, with smaller scopes having smaller values. + + On platforms that support GPUDirect RDMA writes via more than one path + in hardware (see + :py:obj:`~.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`), the user + should consider those paths as belonging to separate ordering domains. + Note that in such cases CUDA driver will report both RDMA writes + ordering and RDMA write scope as ALL_DEVICES and a call to + cuFlushGPUDirectRDMA will be a no-op, but when these multiple paths are + used simultaneously, it is the user's responsibility to ensure ordering + by using mechanisms outside the scope of CUDA. + + Users may query support for this API via + :py:obj:`~.CU_DEVICE_ATTRIBUTE_FLUSH_FLUSH_GPU_DIRECT_RDMA_OPTIONS`. + + Parameters + ---------- + target : :py:obj:`~.CUflushGPUDirectRDMAWritesTarget` + The target of the operation, see + :py:obj:`~.CUflushGPUDirectRDMAWritesTarget` + scope : :py:obj:`~.CUflushGPUDirectRDMAWritesScope` + The scope of the operation, see + :py:obj:`~.CUflushGPUDirectRDMAWritesScope` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + """ + cdef cydriver.CUflushGPUDirectRDMAWritesTarget cytarget = int(target) + cdef cydriver.CUflushGPUDirectRDMAWritesScope cyscope = int(scope) + with nogil: + err = cydriver.cuFlushGPUDirectRDMAWrites(cytarget, cyscope) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceGetProperties(dev): + """ Returns properties for a selected device. + + [Deprecated] + + This function was deprecated as of CUDA 5.0 and replaced by + :py:obj:`~.cuDeviceGetAttribute()`. + + Returns in `*prop` the properties of device `dev`. The + :py:obj:`~.CUdevprop` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.maxThreadsPerBlock` is the maximum number of threads per + block; + + - :py:obj:`~.maxThreadsDim`[3] is the maximum sizes of each dimension + of a block; + + - :py:obj:`~.maxGridSize`[3] is the maximum sizes of each dimension of + a grid; + + - :py:obj:`~.sharedMemPerBlock` is the total amount of shared memory + available per block in bytes; + + - :py:obj:`~.totalConstantMemory` is the total amount of constant + memory available on the device in bytes; + + - :py:obj:`~.SIMDWidth` is the warp size; + + - :py:obj:`~.memPitch` is the maximum pitch allowed by the memory copy + functions that involve memory regions allocated through + :py:obj:`~.cuMemAllocPitch()`; + + - :py:obj:`~.regsPerBlock` is the total number of registers available + per block; + + - :py:obj:`~.clockRate` is the clock frequency in kilohertz; + + - :py:obj:`~.textureAlign` is the alignment requirement; texture base + addresses that are aligned to :py:obj:`~.textureAlign` bytes do not + need an offset applied to texture fetches. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device to get properties for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + prop : :py:obj:`~.CUdevprop` + Returned properties of device + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem` + """ + 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 CUdevprop prop = CUdevprop() + with nogil: + err = cydriver.cuDeviceGetProperties(prop._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, prop) + +@cython.embedsignature(True) +def cuDeviceComputeCapability(dev): + """ Returns the compute capability of the device. + + [Deprecated] + + This function was deprecated as of CUDA 5.0 and its functionality + superseded by :py:obj:`~.cuDeviceGetAttribute()`. + + Returns in `*major` and `*minor` the major and minor revision numbers + that define the compute capability of the device `dev`. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + major : int + Major revision number + minor : int + Minor revision number + + See Also + -------- + :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetCount`, :py:obj:`~.cuDeviceGetName`, :py:obj:`~.cuDeviceGetUuid`, :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceTotalMem` + """ + 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 int major = 0 + cdef int minor = 0 + with nogil: + err = cydriver.cuDeviceComputeCapability(&major, &minor, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, major, minor) + +@cython.embedsignature(True) +def cuDevicePrimaryCtxRetain(dev): + """ Retain the primary context on the GPU. + + Retains the primary context on the device. Once the user successfully + retains the primary context, the primary context will be active and + available to the user until the user releases it with + :py:obj:`~.cuDevicePrimaryCtxRelease()` or resets it with + :py:obj:`~.cuDevicePrimaryCtxReset()`. Unlike :py:obj:`~.cuCtxCreate()` + the newly retained context is not pushed onto the stack. + + Retaining the primary context for the first time will fail with + :py:obj:`~.CUDA_ERROR_UNKNOWN` if the compute mode of the device is + :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. The function + :py:obj:`~.cuDeviceGetAttribute()` can be used with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute + mode of the device. The `nvidia-smi` tool can be used to set the + compute mode for devices. Documentation for `nvidia-smi` can be + obtained by passing a -h option to it. + + Please note that the primary context always supports pinned + allocations. Other flags can be specified by + :py:obj:`~.cuDevicePrimaryCtxSetFlags()`. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device for which primary context is requested + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pctx : :py:obj:`~.CUcontext` + Returned context handle of the new context + + See Also + -------- + :py:obj:`~.cuDevicePrimaryCtxRelease`, :py:obj:`~.cuDevicePrimaryCtxSetFlags`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuDevicePrimaryCtxRetain(pctx._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuDevicePrimaryCtxRelease(dev): + """ Release the primary context on the GPU. + + Releases the primary context interop on the device. A retained context + should always be released once the user is done using it. The context + is automatically reset once the last reference to it is released. This + behavior is different when the primary context was retained by the CUDA + runtime from CUDA 4.0 and earlier. In this case, the primary context + remains always active. + + Releasing a primary context that has not been previously retained will + fail with :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. + + Please note that unlike :py:obj:`~.cuCtxDestroy()` this method does not + pop the context from stack in any circumstances. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device which primary context is released + + Returns + ------- + 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_CONTEXT` + + See Also + -------- + :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + with nogil: + err = cydriver.cuDevicePrimaryCtxRelease(cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDevicePrimaryCtxSetFlags(dev, unsigned int flags): + """ Set flags for the primary context. + + Sets the flags for the primary context on the device overwriting + perviously set ones. + + The three LSBs of the `flags` parameter can be used to control how the + OS thread, which owns the CUDA context at the time of an API call, + interacts with the OS scheduler when waiting for results from the GPU. + Only one of the scheduling flags can be set when creating a context. + + - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when + waiting for results from the GPU. This can decrease latency when + waiting for the GPU, but may lower the performance of CPU threads if + they are performing work in parallel with the CUDA thread. + + - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread + when waiting for results from the GPU. This can increase latency when + waiting for the GPU, but can increase the performance of CPU threads + performing work in parallel with the GPU. + + - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the + CPU thread on a synchronization primitive when waiting for the GPU to + finish work. + + - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU + thread on a synchronization primitive when waiting for the GPU to + finish work. Deprecated: This flag was deprecated as of CUDA 4.0 + and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. + + - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` + parameter is zero, uses a heuristic based on the number of active + CUDA contexts in the process `C` and the number of logical processors + in the system `P`. If `C` > `P`, then CUDA will yield to other OS + threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), + otherwise CUDA will not yield while waiting for results and actively + spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, + on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic + based on the power profile of the platform and may choose + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. + + - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce + local memory after resizing local memory for a kernel. This can + prevent thrashing by local memory allocations when launching many + kernels with high local memory usage at the cost of potentially + increased memory usage. Deprecated: This flag is deprecated and the + behavior enabled by this flag is now the default and cannot be + disabled. + + - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been + enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or + environment variables, this flag can be set during context creation + to instruct CUDA to create a coredump if this context raises an + exception during execution. These environment variables are described + in the CUDA-GDB user guide under the "GPU core dump support" section. + The initial settings will be taken from the global settings at the + time of context creation. The other settings that control coredump + output can be modified by calling :py:obj:`~.cuCoredumpSetAttribute` + from the created context after it becomes current. + + - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU + coredumps have not been enabled globally with + :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, + this flag can be set during context creation to instruct CUDA to + create a coredump if data is written to a certain pipe that is + present in the OS space. These environment variables are described in + the CUDA-GDB user guide under the "GPU core dump support" section. It + is important to note that the pipe name `must` be set with + :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context + if this flag is used. Setting this flag implies that + :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial settings will + be taken from the global settings at the time of context creation. + The other settings that control coredump output can be modified by + calling :py:obj:`~.cuCoredumpSetAttribute` from the created context + after it becomes current. + + - :py:obj:`~.CU_CTX_SYNC_MEMOPS`: Ensures that synchronous memory + operations initiated on this context will always synchronize. See + further documentation in the section titled "API Synchronization + behavior" to learn more about cases when synchronous memory + operations can exhibit asynchronous behavior. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device for which the primary context flags are set + flags : unsigned int + New flags for the device + + Returns + ------- + 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`, + + See Also + -------- + :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuDevicePrimaryCtxGetState`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxSetFlags`, :py:obj:`~.cudaSetDeviceFlags` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + with nogil: + err = cydriver.cuDevicePrimaryCtxSetFlags(cydev, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDevicePrimaryCtxGetState(dev): + """ Get the state of the primary context. + + Returns in `*flags` the flags for the primary context of `dev`, and in + `*active` whether it is active. See + :py:obj:`~.cuDevicePrimaryCtxSetFlags` for flag values. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device to get primary context flags for + + Returns + ------- + 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`, + flags : unsigned int + Pointer to store flags + active : int + Pointer to store context state; 0 = inactive, 1 = active + + See Also + -------- + :py:obj:`~.cuDevicePrimaryCtxSetFlags`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxSetFlags`, :py:obj:`~.cudaGetDeviceFlags` + """ + 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 unsigned int flags = 0 + cdef int active = 0 + with nogil: + err = cydriver.cuDevicePrimaryCtxGetState(cydev, &flags, &active) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, flags, active) + +@cython.embedsignature(True) +def cuDevicePrimaryCtxReset(dev): + """ Destroy all allocations and reset all state on the primary context. + + Explicitly destroys and cleans up all resources associated with the + current device in the current process. + + Note that it is responsibility of the calling function to ensure that + no other module in the process is using the device any more. For that + reason it is recommended to use :py:obj:`~.cuDevicePrimaryCtxRelease()` + in most cases. However it is safe for other modules to call + :py:obj:`~.cuDevicePrimaryCtxRelease()` even after resetting the + device. Resetting the primary context does not release it, an + application that has retained the primary context should explicitly + release its usage. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device for which primary context is destroyed + + Returns + ------- + 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_PRIMARY_CONTEXT_ACTIVE` + + See Also + -------- + :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuDevicePrimaryCtxRelease`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaDeviceReset` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + with nogil: + err = cydriver.cuDevicePrimaryCtxReset(cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxCreate(unsigned int flags, dev): + """ Create a CUDA context. + + Creates a new CUDA context and associates it with the calling thread. + The `flags` parameter is described below. The context is created with a + usage count of 1 and the caller of :py:obj:`~.cuCtxCreate()` must call + :py:obj:`~.cuCtxDestroy()` when done using the context. If a context is + already current to the thread, it is supplanted by the newly created + context and may be restored by a subsequent call to + :py:obj:`~.cuCtxPopCurrent()`. + + The three LSBs of the `flags` parameter can be used to control how the + OS thread, which owns the CUDA context at the time of an API call, + interacts with the OS scheduler when waiting for results from the GPU. + Only one of the scheduling flags can be set when creating a context. + + - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when + waiting for results from the GPU. This can decrease latency when + waiting for the GPU, but may lower the performance of CPU threads if + they are performing work in parallel with the CUDA thread. + + - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread + when waiting for results from the GPU. This can increase latency when + waiting for the GPU, but can increase the performance of CPU threads + performing work in parallel with the GPU. + + - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the + CPU thread on a synchronization primitive when waiting for the GPU to + finish work. + + - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU + thread on a synchronization primitive when waiting for the GPU to + finish work. Deprecated: This flag was deprecated as of CUDA 4.0 + and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. + + - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` + parameter is zero, uses a heuristic based on the number of active + CUDA contexts in the process `C` and the number of logical processors + in the system `P`. If `C` > `P`, then CUDA will yield to other OS + threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), + otherwise CUDA will not yield while waiting for results and actively + spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, + on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic + based on the power profile of the platform and may choose + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. + + - :py:obj:`~.CU_CTX_MAP_HOST`: Instruct CUDA to support mapped pinned + allocations. This flag must be set in order to allocate pinned host + memory that is accessible to the GPU. + + - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce + local memory after resizing local memory for a kernel. This can + prevent thrashing by local memory allocations when launching many + kernels with high local memory usage at the cost of potentially + increased memory usage. Deprecated: This flag is deprecated and the + behavior enabled by this flag is now the default and cannot be + disabled. Instead, the per-thread stack size can be controlled with + :py:obj:`~.cuCtxSetLimit()`. + + - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been + enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or + environment variables, this flag can be set during context creation + to instruct CUDA to create a coredump if this context raises an + exception during execution. These environment variables are described + in the CUDA-GDB user guide under the "GPU core dump support" section. + The initial attributes will be taken from the global attributes at + the time of context creation. The other attributes that control + coredump output can be modified by calling + :py:obj:`~.cuCoredumpSetAttribute` from the created context after it + becomes current. + + - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU + coredumps have not been enabled globally with + :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, + this flag can be set during context creation to instruct CUDA to + create a coredump if data is written to a certain pipe that is + present in the OS space. These environment variables are described in + the CUDA-GDB user guide under the "GPU core dump support" section. It + is important to note that the pipe name `must` be set with + :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context + if this flag is used. Setting this flag implies that + :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial attributes + will be taken from the global attributes at the time of context + creation. The other attributes that control coredump output can be + modified by calling :py:obj:`~.cuCoredumpSetAttribute` from the + created context after it becomes current. Setting this flag on any + context creation is equivalent to setting the + :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` attribute to `true` + globally. + + - :py:obj:`~.CU_CTX_SYNC_MEMOPS`: Ensures that synchronous memory + operations initiated on this context will always synchronize. See + further documentation in the section titled "API Synchronization + behavior" to learn more about cases when synchronous memory + operations can exhibit asynchronous behavior. + + Context creation will fail with :py:obj:`~.CUDA_ERROR_UNKNOWN` if the + compute mode of the device is :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. + The function :py:obj:`~.cuDeviceGetAttribute()` can be used with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute + mode of the device. The `nvidia-smi` tool can be used to set the + compute mode for * devices. Documentation for `nvidia-smi` can be + obtained by passing a -h option to it. + + Parameters + ---------- + flags : unsigned int + Context creation flags + dev : :py:obj:`~.CUdevice` + Device to create context on + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pctx : :py:obj:`~.CUcontext` + Returned context handle of the new context + + See Also + -------- + :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCoredumpSetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCtxSynchronize` + + Notes + ----- + In most cases it is recommended to use :py:obj:`~.cuDevicePrimaryCtxRetain`. + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuCtxCreate(pctx._pvt_ptr, flags, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxCreate_v3(paramsArray : Optional[tuple[CUexecAffinityParam] | list[CUexecAffinityParam]], int numParams, unsigned int flags, dev): + """ Create a CUDA context with execution affinity. + + Creates a new CUDA context with execution affinity and associates it + with the calling thread. The `paramsArray` and `flags` parameter are + described below. The context is created with a usage count of 1 and the + caller of :py:obj:`~.cuCtxCreate()` must call + :py:obj:`~.cuCtxDestroy()` when done using the context. If a context is + already current to the thread, it is supplanted by the newly created + context and may be restored by a subsequent call to + :py:obj:`~.cuCtxPopCurrent()`. + + The type and the amount of execution resource the context can use is + limited by `paramsArray` and `numParams`. The `paramsArray` is an array + of `CUexecAffinityParam` and the `numParams` describes the size of the + array. If two `CUexecAffinityParam` in the array have the same type, + the latter execution affinity parameter overrides the former execution + affinity parameter. The supported execution affinity types are: + + - :py:obj:`~.CU_EXEC_AFFINITY_TYPE_SM_COUNT` limits the portion of SMs + that the context can use. The portion of SMs is specified as the + number of SMs via `CUexecAffinitySmCount`. This limit will be + internally rounded up to the next hardware-supported amount. Hence, + it is imperative to query the actual execution affinity of the + context via `cuCtxGetExecAffinity` after context creation. Currently, + this attribute is only supported under Volta+ MPS. + + The three LSBs of the `flags` parameter can be used to control how the + OS thread, which owns the CUDA context at the time of an API call, + interacts with the OS scheduler when waiting for results from the GPU. + Only one of the scheduling flags can be set when creating a context. + + - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when + waiting for results from the GPU. This can decrease latency when + waiting for the GPU, but may lower the performance of CPU threads if + they are performing work in parallel with the CUDA thread. + + - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread + when waiting for results from the GPU. This can increase latency when + waiting for the GPU, but can increase the performance of CPU threads + performing work in parallel with the GPU. + + - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the + CPU thread on a synchronization primitive when waiting for the GPU to + finish work. + + - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU + thread on a synchronization primitive when waiting for the GPU to + finish work. Deprecated: This flag was deprecated as of CUDA 4.0 + and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. + + - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` + parameter is zero, uses a heuristic based on the number of active + CUDA contexts in the process `C` and the number of logical processors + in the system `P`. If `C` > `P`, then CUDA will yield to other OS + threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), + otherwise CUDA will not yield while waiting for results and actively + spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, + on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic + based on the power profile of the platform and may choose + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. + + - :py:obj:`~.CU_CTX_MAP_HOST`: Instruct CUDA to support mapped pinned + allocations. This flag must be set in order to allocate pinned host + memory that is accessible to the GPU. + + - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce + local memory after resizing local memory for a kernel. This can + prevent thrashing by local memory allocations when launching many + kernels with high local memory usage at the cost of potentially + increased memory usage. Deprecated: This flag is deprecated and the + behavior enabled by this flag is now the default and cannot be + disabled. Instead, the per-thread stack size can be controlled with + :py:obj:`~.cuCtxSetLimit()`. + + - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been + enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or + environment variables, this flag can be set during context creation + to instruct CUDA to create a coredump if this context raises an + exception during execution. These environment variables are described + in the CUDA-GDB user guide under the "GPU core dump support" section. + The initial attributes will be taken from the global attributes at + the time of context creation. The other attributes that control + coredump output can be modified by calling + :py:obj:`~.cuCoredumpSetAttribute` from the created context after it + becomes current. + + - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU + coredumps have not been enabled globally with + :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, + this flag can be set during context creation to instruct CUDA to + create a coredump if data is written to a certain pipe that is + present in the OS space. These environment variables are described in + the CUDA-GDB user guide under the "GPU core dump support" section. It + is important to note that the pipe name `must` be set with + :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context + if this flag is used. Setting this flag implies that + :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial attributes + will be taken from the global attributes at the time of context + creation. The other attributes that control coredump output can be + modified by calling :py:obj:`~.cuCoredumpSetAttribute` from the + created context after it becomes current. Setting this flag on any + context creation is equivalent to setting the + :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` attribute to `true` + globally. + + Context creation will fail with :py:obj:`~.CUDA_ERROR_UNKNOWN` if the + compute mode of the device is :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. + The function :py:obj:`~.cuDeviceGetAttribute()` can be used with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute + mode of the device. The `nvidia-smi` tool can be used to set the + compute mode for * devices. Documentation for `nvidia-smi` can be + obtained by passing a -h option to it. + + Parameters + ---------- + paramsArray : list[:py:obj:`~.CUexecAffinityParam`] + Execution affinity parameters + numParams : int + Number of execution affinity parameters + flags : unsigned int + Context creation flags + dev : :py:obj:`~.CUdevice` + Device to create context on + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pctx : :py:obj:`~.CUcontext` + Returned context handle of the new context + + See Also + -------- + :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuCoredumpSetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.CUexecAffinityParam` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + paramsArray = [] if paramsArray is None else paramsArray + if not all(isinstance(_x, (CUexecAffinityParam,)) for _x in paramsArray): + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUexecAffinityParam,] or list[cydriver.CUexecAffinityParam,]") + cdef CUcontext pctx = CUcontext() + cdef cydriver.CUexecAffinityParam* cyparamsArray = NULL + if len(paramsArray) > 1: + cyparamsArray = calloc(len(paramsArray), sizeof(cydriver.CUexecAffinityParam)) + if cyparamsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cydriver.CUexecAffinityParam))) + for idx in range(len(paramsArray)): + string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) + elif len(paramsArray) == 1: + cyparamsArray = (paramsArray[0])._pvt_ptr + with nogil: + err = cydriver.cuCtxCreate_v3(pctx._pvt_ptr, cyparamsArray, numParams, flags, cydev) + if len(paramsArray) > 1 and cyparamsArray is not NULL: + free(cyparamsArray) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxCreate_v4(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flags, dev): + """ Create a CUDA context. + + Creates a new CUDA context and associates it with the calling thread. + The `flags` parameter is described below. The context is created with a + usage count of 1 and the caller of :py:obj:`~.cuCtxCreate()` must call + :py:obj:`~.cuCtxDestroy()` when done using the context. If a context is + already current to the thread, it is supplanted by the newly created + context and may be restored by a subsequent call to + :py:obj:`~.cuCtxPopCurrent()`. + + CUDA context can be created with execution affinity. The type and the + amount of execution resource the context can use is limited by + `paramsArray` and `numExecAffinityParams` in `execAffinity`. The + `paramsArray` is an array of `CUexecAffinityParam` and the + `numExecAffinityParams` describes the size of the paramsArray. If two + `CUexecAffinityParam` in the array have the same type, the latter + execution affinity parameter overrides the former execution affinity + parameter. The supported execution affinity types are: + + - :py:obj:`~.CU_EXEC_AFFINITY_TYPE_SM_COUNT` limits the portion of SMs + that the context can use. The portion of SMs is specified as the + number of SMs via `CUexecAffinitySmCount`. This limit will be + internally rounded up to the next hardware-supported amount. Hence, + it is imperative to query the actual execution affinity of the + context via `cuCtxGetExecAffinity` after context creation. Currently, + this attribute is only supported under Volta+ MPS. + + CUDA context can be created in CIG(CUDA in Graphics) mode by setting + `cigParams`. Data from graphics client is shared with CUDA via the + `sharedData` in `cigParams`. Support for D3D12 graphics client can be + determined using :py:obj:`~.cuDeviceGetAttribute()` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED`. `sharedData` is a + ID3D12CommandQueue handle. Support for Vulkan graphics client can be + determined using :py:obj:`~.cuDeviceGetAttribute()` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED`. `sharedData` is a + Nvidia specific data blob populated by calling + vkGetExternalComputeQueueDataNV(). Either `execAffinityParams` or + `cigParams` can be set to a non-null value. Setting both to a non-null + value will result in an undefined behavior. + + The three LSBs of the `flags` parameter can be used to control how the + OS thread, which owns the CUDA context at the time of an API call, + interacts with the OS scheduler when waiting for results from the GPU. + Only one of the scheduling flags can be set when creating a context. + + - :py:obj:`~.CU_CTX_SCHED_SPIN`: Instruct CUDA to actively spin when + waiting for results from the GPU. This can decrease latency when + waiting for the GPU, but may lower the performance of CPU threads if + they are performing work in parallel with the CUDA thread. + + - :py:obj:`~.CU_CTX_SCHED_YIELD`: Instruct CUDA to yield its thread + when waiting for results from the GPU. This can increase latency when + waiting for the GPU, but can increase the performance of CPU threads + performing work in parallel with the GPU. + + - :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`: Instruct CUDA to block the + CPU thread on a synchronization primitive when waiting for the GPU to + finish work. + + - :py:obj:`~.CU_CTX_BLOCKING_SYNC`: Instruct CUDA to block the CPU + thread on a synchronization primitive when waiting for the GPU to + finish work. Deprecated: This flag was deprecated as of CUDA 4.0 + and was replaced with :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC`. + + - :py:obj:`~.CU_CTX_SCHED_AUTO`: The default value if the `flags` + parameter is zero, uses a heuristic based on the number of active + CUDA contexts in the process `C` and the number of logical processors + in the system `P`. If `C` > `P`, then CUDA will yield to other OS + threads when waiting for the GPU (:py:obj:`~.CU_CTX_SCHED_YIELD`), + otherwise CUDA will not yield while waiting for results and actively + spin on the processor (:py:obj:`~.CU_CTX_SCHED_SPIN`). Additionally, + on Tegra devices, :py:obj:`~.CU_CTX_SCHED_AUTO` uses a heuristic + based on the power profile of the platform and may choose + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` for low-powered devices. + + - :py:obj:`~.CU_CTX_MAP_HOST`: Instruct CUDA to support mapped pinned + allocations. This flag must be set in order to allocate pinned host + memory that is accessible to the GPU. + + - :py:obj:`~.CU_CTX_LMEM_RESIZE_TO_MAX`: Instruct CUDA to not reduce + local memory after resizing local memory for a kernel. This can + prevent thrashing by local memory allocations when launching many + kernels with high local memory usage at the cost of potentially + increased memory usage. Deprecated: This flag is deprecated and the + behavior enabled by this flag is now the default and cannot be + disabled. Instead, the per-thread stack size can be controlled with + :py:obj:`~.cuCtxSetLimit()`. + + - :py:obj:`~.CU_CTX_COREDUMP_ENABLE`: If GPU coredumps have not been + enabled globally with :py:obj:`~.cuCoredumpSetAttributeGlobal` or + environment variables, this flag can be set during context creation + to instruct CUDA to create a coredump if this context raises an + exception during execution. These environment variables are described + in the CUDA-GDB user guide under the "GPU core dump support" section. + The initial attributes will be taken from the global attributes at + the time of context creation. The other attributes that control + coredump output can be modified by calling + :py:obj:`~.cuCoredumpSetAttribute` from the created context after it + becomes current. This flag is not supported when CUDA context is + created in CIG(CUDA in Graphics) mode. + + - :py:obj:`~.CU_CTX_USER_COREDUMP_ENABLE`: If user-triggered GPU + coredumps have not been enabled globally with + :py:obj:`~.cuCoredumpSetAttributeGlobal` or environment variables, + this flag can be set during context creation to instruct CUDA to + create a coredump if data is written to a certain pipe that is + present in the OS space. These environment variables are described in + the CUDA-GDB user guide under the "GPU core dump support" section. It + is important to note that the pipe name `must` be set with + :py:obj:`~.cuCoredumpSetAttributeGlobal` before creating the context + if this flag is used. Setting this flag implies that + :py:obj:`~.CU_CTX_COREDUMP_ENABLE` is set. The initial attributes + will be taken from the global attributes at the time of context + creation. The other attributes that control coredump output can be + modified by calling :py:obj:`~.cuCoredumpSetAttribute` from the + created context after it becomes current. Setting this flag on any + context creation is equivalent to setting the + :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` attribute to `true` + globally. This flag is not supported when CUDA context is created in + CIG(CUDA in Graphics) mode. + + - :py:obj:`~.CU_CTX_SYNC_MEMOPS`: Ensures that synchronous memory + operations initiated on this context will always synchronize. See + further documentation in the section titled "API Synchronization + behavior" to learn more about cases when synchronous memory + operations can exhibit asynchronous behavior. + + Context creation will fail with :py:obj:`~.CUDA_ERROR_UNKNOWN` if the + compute mode of the device is :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. + The function :py:obj:`~.cuDeviceGetAttribute()` can be used with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE` to determine the compute + mode of the device. The `nvidia-smi` tool can be used to set the + compute mode for * devices. Documentation for `nvidia-smi` can be + obtained by passing a -h option to it. + + Context creation will fail with :: CUDA_ERROR_INVALID_VALUE if invalid + parameter was passed by client to create the CUDA context. + + Context creation in CIG mode will fail with + :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` if CIG is not supported by the + device or the driver. + + Parameters + ---------- + ctxCreateParams : :py:obj:`~.CUctxCreateParams` + Context creation parameters + flags : unsigned int + Context creation flags + dev : :py:obj:`~.CUdevice` + Device to create context on + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pctx : :py:obj:`~.CUcontext` + Returned context handle of the new context + + See Also + -------- + :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCoredumpSetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUcontext pctx = CUcontext() + cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams is not None else NULL + with nogil: + err = cydriver.cuCtxCreate_v4(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxDestroy(ctx): + """ Destroy a CUDA context. + + Destroys the CUDA context specified by `ctx`. The context `ctx` will be + destroyed regardless of how many threads it is current to. It is the + responsibility of the calling function to ensure that no API call + issues using `ctx` while :py:obj:`~.cuCtxDestroy()` is executing. + + Destroys and cleans up all resources associated with the context. It is + the caller's responsibility to ensure that the context or its resources + are not accessed or passed in subsequent API calls and doing so will + result in undefined behavior. These resources include CUDA types + :py:obj:`~.CUmodule`, :py:obj:`~.CUfunction`, :py:obj:`~.CUstream`, + :py:obj:`~.CUevent`, :py:obj:`~.CUarray`, :py:obj:`~.CUmipmappedArray`, + :py:obj:`~.CUtexObject`, :py:obj:`~.CUsurfObject`, + :py:obj:`~.CUtexref`, :py:obj:`~.CUsurfref`, + :py:obj:`~.CUgraphicsResource`, :py:obj:`~.CUlinkState`, + :py:obj:`~.CUexternalMemory` and :py:obj:`~.CUexternalSemaphore`. These + resources also include memory allocations by :py:obj:`~.cuMemAlloc()`, + :py:obj:`~.cuMemAllocHost()`, :py:obj:`~.cuMemAllocManaged()` and + :py:obj:`~.cuMemAllocPitch()`. + + If `ctx` is current to the calling thread then `ctx` will also be + popped from the current thread's context stack (as though + :py:obj:`~.cuCtxPopCurrent()` were called). If `ctx` is current to + other threads, then `ctx` will remain current to those threads, and + attempting to access `ctx` from those threads will result in the error + :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + + Notes + ----- + :py:obj:`~.cuCtxDestroy()` will not destroy memory allocations by :py:obj:`~.cuMemCreate()`, :py:obj:`~.cuMemAllocAsync()` and :py:obj:`~.cuMemAllocFromPoolAsync()`. These memory allocations are not associated with any CUDA context and need to be destroyed explicitly. + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + with nogil: + err = cydriver.cuCtxDestroy(cyctx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxPushCurrent(ctx): + """ Pushes a context on the current CPU thread. + + Pushes the given context `ctx` onto the CPU thread's stack of current + contexts. The specified context becomes the CPU thread's current + context, so all CUDA functions that operate on the current context are + affected. + + The previous current context may be made current again by calling + :py:obj:`~.cuCtxDestroy()` or :py:obj:`~.cuCtxPopCurrent()`. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to push + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + with nogil: + err = cydriver.cuCtxPushCurrent(cyctx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxPopCurrent(): + """ Pops the current CUDA context from the current CPU thread. + + Pops the current CUDA context from the CPU thread and passes back the + old context handle in `*pctx`. That context may then be made current to + a different CPU thread by calling :py:obj:`~.cuCtxPushCurrent()`. + + If a context was current to the CPU thread before + :py:obj:`~.cuCtxCreate()` or :py:obj:`~.cuCtxPushCurrent()` was called, + this function makes that context current to the CPU thread again. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + pctx : :py:obj:`~.CUcontext` + Returned popped context handle + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuCtxPopCurrent(pctx._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxSetCurrent(ctx): + """ Binds the specified CUDA context to the calling CPU thread. + + Binds the specified CUDA context to the calling CPU thread. If `ctx` is + NULL then the CUDA context previously bound to the calling CPU thread + is unbound and :py:obj:`~.CUDA_SUCCESS` is returned. + + If there exists a CUDA context stack on the calling CPU thread, this + will replace the top of that stack with `ctx`. If `ctx` is NULL then + this will be equivalent to popping the top of the calling CPU thread's + CUDA context stack (or a no-op if the calling CPU thread's CUDA context + stack is empty). + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to bind to the calling CPU thread + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxGetCurrent`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cudaSetDevice` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + with nogil: + err = cydriver.cuCtxSetCurrent(cyctx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetCurrent(): + """ Returns the CUDA context bound to the calling CPU thread. + + Returns in `*pctx` the CUDA context bound to the calling CPU thread. If + no context is bound to the calling CPU thread then `*pctx` is set to + NULL and :py:obj:`~.CUDA_SUCCESS` is returned. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, + pctx : :py:obj:`~.CUcontext` + Returned context handle + + See Also + -------- + :py:obj:`~.cuCtxSetCurrent`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cudaGetDevice` + """ + cdef CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuCtxGetCurrent(pctx._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxGetDevice(): + """ Returns the device handle for the current context. + + Returns in `*device` the handle of the current context's device. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + device : :py:obj:`~.CUdevice` + Returned device handle for the current context + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaGetDevice` + """ + cdef CUdevice device = CUdevice() + with nogil: + err = cydriver.cuCtxGetDevice(device._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, device) + +@cython.embedsignature(True) +def cuCtxGetFlags(): + """ Returns the flags for the current context. + + Returns in `*flags` the flags of the current context. See + :py:obj:`~.cuCtxCreate` for flag values. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + flags : unsigned int + Pointer to store flags of current context + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetCurrent`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxGetSharedMemConfig`, :py:obj:`~.cuCtxGetStreamPriorityRange`, :py:obj:`~.cuCtxSetFlags`, :py:obj:`~.cudaGetDeviceFlags` + """ + cdef unsigned int flags = 0 + with nogil: + err = cydriver.cuCtxGetFlags(&flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, flags) + +@cython.embedsignature(True) +def cuCtxSetFlags(unsigned int flags): + """ Sets the flags for the current context. + + Sets the flags for the current context overwriting previously set ones. + See :py:obj:`~.cuDevicePrimaryCtxSetFlags` for flag values. + + Parameters + ---------- + flags : unsigned int + Flags to set on the current context + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetCurrent`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxGetSharedMemConfig`, :py:obj:`~.cuCtxGetStreamPriorityRange`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cudaGetDeviceFlags`, :py:obj:`~.cuDevicePrimaryCtxSetFlags`, + """ + with nogil: + err = cydriver.cuCtxSetFlags(flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetId(ctx): + """ Returns the unique Id associated with the context supplied. + + Returns in `ctxId` the unique Id which is associated with a given + context. The Id is unique for the life of the program for this instance + of CUDA. If context is supplied as NULL and there is one current, the + Id of the current context is returned. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context for which to obtain the Id + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + ctxId : unsigned long long + Pointer to store the Id of the context + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPushCurrent` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef unsigned long long ctxId = 0 + with nogil: + err = cydriver.cuCtxGetId(cyctx, &ctxId) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, ctxId) + +@cython.embedsignature(True) +def cuCtxSynchronize(): + """ Block for the current context's tasks to complete. + + Blocks until the current context has completed all preceding requested + tasks. If the current context is the primary context, green contexts + that have been created will also be synchronized. + :py:obj:`~.cuCtxSynchronize()` returns an error if one of the preceding + tasks failed. If the context was created with the + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` flag, the CPU thread will block + until the GPU context has finished its work. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cudaDeviceSynchronize` + """ + with nogil: + err = cydriver.cuCtxSynchronize() + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxSetLimit(limit not None : CUlimit, size_t value): + """ Set resource limits. + + Setting `limit` to `value` is a request by the application to update + the current limit maintained by the context. The driver is free to + modify the requested value to meet h/w requirements (this could be + clamping to minimum or maximum values, rounding up to nearest element + size, etc). The application can use :py:obj:`~.cuCtxGetLimit()` to find + out exactly what the limit has been set to. + + Setting each :py:obj:`~.CUlimit` has its own specific restrictions, so + each is discussed here. + + - :py:obj:`~.CU_LIMIT_STACK_SIZE` controls the stack size in bytes of + each GPU thread. The driver automatically increases the per-thread + stack size for each kernel launch as needed. This size isn't reset + back to the original value after each launch. Setting this value will + take effect immediately, and if necessary, the device will block + until all preceding requested tasks are complete. + + - :py:obj:`~.CU_LIMIT_PRINTF_FIFO_SIZE` controls the size in bytes of + the FIFO used by the :py:obj:`~.printf()` device system call. Setting + :py:obj:`~.CU_LIMIT_PRINTF_FIFO_SIZE` must be performed before + launching any kernel that uses the :py:obj:`~.printf()` device system + call, otherwise :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be + returned. + + - :py:obj:`~.CU_LIMIT_MALLOC_HEAP_SIZE` controls the size in bytes of + the heap used by the :py:obj:`~.malloc()` and :py:obj:`~.free()` + device system calls. Setting :py:obj:`~.CU_LIMIT_MALLOC_HEAP_SIZE` + must be performed before launching any kernel that uses the + :py:obj:`~.malloc()` or :py:obj:`~.free()` device system calls, + otherwise :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned. + + - :py:obj:`~.CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH` controls the maximum + nesting depth of a grid at which a thread can safely call + :py:obj:`~.cudaDeviceSynchronize()`. Setting this limit must be + performed before any launch of a kernel that uses the device runtime + and calls :py:obj:`~.cudaDeviceSynchronize()` above the default sync + depth, two levels of grids. Calls to + :py:obj:`~.cudaDeviceSynchronize()` will fail with error code + :py:obj:`~.cudaErrorSyncDepthExceeded` if the limitation is violated. + This limit can be set smaller than the default or up the maximum + launch depth of 24. When setting this limit, keep in mind that + additional levels of sync depth require the driver to reserve large + amounts of device memory which can no longer be used for user + allocations. If these reservations of device memory fail, + :py:obj:`~.cuCtxSetLimit()` will return + :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, and the limit can be reset to a + lower value. This limit is only applicable to devices of compute + capability < 9.0. Attempting to set this limit on devices of other + compute capability versions will result in the error + :py:obj:`~.CUDA_ERROR_UNSUPPORTED_LIMIT` being returned. + + - :py:obj:`~.CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT` controls the + maximum number of outstanding device runtime launches that can be + made from the current context. A grid is outstanding from the point + of launch up until the grid is known to have been completed. Device + runtime launches which violate this limitation fail and return + :py:obj:`~.cudaErrorLaunchPendingCountExceeded` when + :py:obj:`~.cudaGetLastError()` is called after launch. If more + pending launches than the default (2048 launches) are needed for a + module using the device runtime, this limit can be increased. Keep in + mind that being able to sustain additional pending launches will + require the driver to reserve larger amounts of device memory upfront + which can no longer be used for allocations. If these reservations + fail, :py:obj:`~.cuCtxSetLimit()` will return + :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, and the limit can be reset to a + lower value. This limit is only applicable to devices of compute + capability 3.5 and higher. Attempting to set this limit on devices of + compute capability less than 3.5 will result in the error + :py:obj:`~.CUDA_ERROR_UNSUPPORTED_LIMIT` being returned. + + - :py:obj:`~.CU_LIMIT_MAX_L2_FETCH_GRANULARITY` controls the L2 cache + fetch granularity. Values can range from 0B to 128B. This is purely a + performance hint and it can be ignored or clamped depending on the + platform. + + - :py:obj:`~.CU_LIMIT_PERSISTING_L2_CACHE_SIZE` controls size in bytes + available for persisting L2 cache. This is purely a performance hint + and it can be ignored or clamped depending on the platform. + + Parameters + ---------- + limit : :py:obj:`~.CUlimit` + Limit to set + value : size_t + Size of limit + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_LIMIT`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaDeviceSetLimit` + """ + cdef cydriver.CUlimit cylimit = int(limit) + with nogil: + err = cydriver.cuCtxSetLimit(cylimit, value) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetLimit(limit not None : CUlimit): + """ Returns resource limits. + + Returns in `*pvalue` the current size of `limit`. The supported + :py:obj:`~.CUlimit` values are: + + - :py:obj:`~.CU_LIMIT_STACK_SIZE`: stack size in bytes of each GPU + thread. + + - :py:obj:`~.CU_LIMIT_PRINTF_FIFO_SIZE`: size in bytes of the FIFO used + by the :py:obj:`~.printf()` device system call. + + - :py:obj:`~.CU_LIMIT_MALLOC_HEAP_SIZE`: size in bytes of the heap used + by the :py:obj:`~.malloc()` and :py:obj:`~.free()` device system + calls. + + - :py:obj:`~.CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH`: maximum grid depth at + which a thread can issue the device runtime call + :py:obj:`~.cudaDeviceSynchronize()` to wait on child grid launches to + complete. + + - :py:obj:`~.CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT`: maximum number + of outstanding device runtime launches that can be made from this + context. + + - :py:obj:`~.CU_LIMIT_MAX_L2_FETCH_GRANULARITY`: L2 cache fetch + granularity. + + - :py:obj:`~.CU_LIMIT_PERSISTING_L2_CACHE_SIZE`: Persisting L2 cache + size in bytes + + Parameters + ---------- + limit : :py:obj:`~.CUlimit` + Limit to query + + 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` + """ + cdef size_t pvalue = 0 + cdef cydriver.CUlimit cylimit = int(limit) + with nogil: + err = cydriver.cuCtxGetLimit(&pvalue, cylimit) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pvalue) + +@cython.embedsignature(True) +def cuCtxGetCacheConfig(): + """ Returns the preferred cache configuration for the current context. + + On devices where the L1 cache and shared memory use the same hardware + resources, this function returns through `pconfig` the preferred cache + configuration for the current context. This is only a preference. The + driver will use the requested configuration if possible, but it is free + to choose a different configuration if required to execute functions. + + This will return a `pconfig` of :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE` + on devices where the size of the L1 cache and shared memory are fixed. + + The supported cache configurations are: + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE`: no preference for shared + memory or L1 (default) + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_SHARED`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_L1`: prefer larger L1 cache and + smaller shared memory + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_EQUAL`: prefer equal sized L1 cache + and shared memory + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pconfig : :py:obj:`~.CUfunc_cache` + Returned cache configuration + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig` + """ + cdef cydriver.CUfunc_cache pconfig + with nogil: + err = cydriver.cuCtxGetCacheConfig(&pconfig) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUfunc_cache(pconfig)) + +@cython.embedsignature(True) +def cuCtxSetCacheConfig(config not None : CUfunc_cache): + """ Sets the preferred cache configuration for the current context. + + On devices where the L1 cache and shared memory use the same hardware + resources, this sets through `config` the preferred cache configuration + for the current context. This is only a preference. The driver will use + the requested configuration if possible, but it is free to choose a + different configuration if required to execute the function. Any + function preference set via :py:obj:`~.cuFuncSetCacheConfig()` or + :py:obj:`~.cuKernelSetCacheConfig()` will be preferred over this + context-wide setting. Setting the context-wide cache configuration to + :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE` will cause subsequent kernel + launches to prefer to not change the cache configuration unless + required to launch the kernel. + + This setting does nothing on devices where the size of the L1 cache and + shared memory are fixed. + + Launching a kernel with a different preference than the most recent + preference setting may insert a device-side synchronization point. + + The supported cache configurations are: + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE`: no preference for shared + memory or L1 (default) + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_SHARED`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_L1`: prefer larger L1 cache and + smaller shared memory + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_EQUAL`: prefer equal sized L1 cache + and shared memory + + Parameters + ---------- + config : :py:obj:`~.CUfunc_cache` + Requested cache configuration + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cuKernelSetCacheConfig` + """ + cdef cydriver.CUfunc_cache cyconfig = int(config) + with nogil: + err = cydriver.cuCtxSetCacheConfig(cyconfig) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetApiVersion(ctx): + """ Gets the context's API version. + + Returns a version number in `version` corresponding to the capabilities + of the context (e.g. 3010 or 3020), which library developers can use to + direct callers to a specific API version. If `ctx` is NULL, returns the + API version used to create the currently bound context. + + Note that new API versions are only introduced when context + capabilities are changed that break binary compatibility, so the API + version and driver version may be different. For example, it is valid + for the API version to be 3020 while the driver version is 4020. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to check + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + version : unsigned int + Pointer to version + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef unsigned int version = 0 + with nogil: + err = cydriver.cuCtxGetApiVersion(cyctx, &version) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, version) + +@cython.embedsignature(True) +def cuCtxGetStreamPriorityRange(): + """ Returns numerical values that correspond to the least and greatest stream priorities. + + Returns in `*leastPriority` and `*greatestPriority` the numerical + values that correspond to the least and greatest stream priorities + respectively. Stream priorities follow a convention where lower numbers + imply greater priorities. The range of meaningful stream priorities is + given by [`*greatestPriority`, `*leastPriority`]. If the user attempts + to create a stream with a priority value that is outside the meaningful + range as specified by this API, the priority is automatically clamped + down or up to either `*leastPriority` or `*greatestPriority` + respectively. See :py:obj:`~.cuStreamCreateWithPriority` for details on + creating a priority stream. A NULL may be passed in for + `*leastPriority` or `*greatestPriority` if the value is not desired. + + This function will return '0' in both `*leastPriority` and + `*greatestPriority` if the current context's device does not support + stream priorities (see :py:obj:`~.cuDeviceGetAttribute`). + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + leastPriority : int + Pointer to an int in which the numerical value for least stream + priority is returned + greatestPriority : int + Pointer to an int in which the numerical value for greatest stream + priority is returned + + See Also + -------- + :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaDeviceGetStreamPriorityRange` + """ + cdef int leastPriority = 0 + cdef int greatestPriority = 0 + with nogil: + err = cydriver.cuCtxGetStreamPriorityRange(&leastPriority, &greatestPriority) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, leastPriority, greatestPriority) + +@cython.embedsignature(True) +def cuCtxResetPersistingL2Cache(): + """ Resets all persisting lines in cache to normal status. + + :py:obj:`~.cuCtxResetPersistingL2Cache` Resets all persisting lines in + cache to normal status. Takes effect on function return. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.CUaccessPolicyWindow` + """ + with nogil: + err = cydriver.cuCtxResetPersistingL2Cache() + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetExecAffinity(typename not None : CUexecAffinityType): + """ Returns the execution affinity setting for the current context. + + Returns in `*pExecAffinity` the current value of `typename`. The + supported :py:obj:`~.CUexecAffinityType` values are: + + - :py:obj:`~.CU_EXEC_AFFINITY_TYPE_SM_COUNT`: number of SMs the context + is limited to use. + + Parameters + ---------- + typename : :py:obj:`~.CUexecAffinityType` + Execution affinity type to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY` + pExecAffinity : :py:obj:`~.CUexecAffinityParam` + Returned execution affinity + + See Also + -------- + :py:obj:`~.CUexecAffinityParam` + """ + cdef CUexecAffinityParam pExecAffinity = CUexecAffinityParam() + cdef cydriver.CUexecAffinityType cytypename = int(typename) + with nogil: + err = cydriver.cuCtxGetExecAffinity(pExecAffinity._pvt_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pExecAffinity) + +@cython.embedsignature(True) +def cuCtxRecordEvent(hCtx, hEvent): + """ Records an event. + + Captures in `hEvent` all the activities of the context `hCtx` at the + time of this call. `hEvent` and `hCtx` must be from the same CUDA + context, otherwise :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` will be + returned. Calls such as :py:obj:`~.cuEventQuery()` or + :py:obj:`~.cuCtxWaitEvent()` will then examine or wait for completion + of the work that was captured. Uses of `hCtx` after this call do not + modify `hEvent`. If the context passed to `hCtx` is the primary + context, `hEvent` will capture all the activities of the primary + context and its green contexts. If the context passed to `hCtx` is a + context converted from green context via + :py:obj:`~.cuCtxFromGreenCtx()`, `hEvent` will capture only the + activities of the green context. + + Parameters + ---------- + hCtx : :py:obj:`~.CUcontext` + Context to record event for + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + + 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_STREAM_CAPTURE_UNSUPPORTED` + + See Also + -------- + :py:obj:`~.cuCtxWaitEvent`, :py:obj:`~.cuGreenCtxRecordEvent`, :py:obj:`~.cuGreenCtxWaitEvent`, :py:obj:`~.cuEventRecord` + + Notes + ----- + The API will return :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` if the specified context `hCtx` has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures. + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + cdef cydriver.CUcontext cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUcontext,)): + phCtx = int(hCtx) + else: + phCtx = int(CUcontext(hCtx)) + cyhCtx = phCtx + with nogil: + err = cydriver.cuCtxRecordEvent(cyhCtx, cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxWaitEvent(hCtx, hEvent): + """ Make a context wait on an event. + + Makes all future work submitted to context `hCtx` wait for all work + captured in `hEvent`. The synchronization will be performed on the + device and will not block the calling CPU thread. See + :py:obj:`~.cuCtxRecordEvent()` for details on what is captured by an + event. If the context passed to `hCtx` is the primary context, the + primary context and its green contexts will wait for `hEvent`. If the + context passed to `hCtx` is a context converted from green context via + :py:obj:`~.cuCtxFromGreenCtx()`, the green context will wait for + `hEvent`. + + Parameters + ---------- + hCtx : :py:obj:`~.CUcontext` + Context to wait + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait on + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` + + See Also + -------- + :py:obj:`~.cuCtxRecordEvent`, :py:obj:`~.cuGreenCtxRecordEvent`, :py:obj:`~.cuGreenCtxWaitEvent`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + `hEvent` may be from a different context or device than `hCtx`. + + The API will return :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` and invalidate the capture if the specified event `hEvent` is part of an ongoing capture sequence or if the specified context `hCtx` has a stream in the capture mode. + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + cdef cydriver.CUcontext cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUcontext,)): + phCtx = int(hCtx) + else: + phCtx = int(CUcontext(hCtx)) + cyhCtx = phCtx + with nogil: + err = cydriver.cuCtxWaitEvent(cyhCtx, cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxAttach(unsigned int flags): + """ Increment a context's usage-count. + + [Deprecated] + + Note that this function is deprecated and should not be used. + + Increments the usage count of the context and passes back a context + handle in `*pctx` that must be passed to :py:obj:`~.cuCtxDetach()` when + the application is done with the context. :py:obj:`~.cuCtxAttach()` + fails if there is no context current to the thread. + + Currently, the `flags` parameter must be 0. + + Parameters + ---------- + flags : unsigned int + Context attach flags (must be 0) + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pctx : :py:obj:`~.CUcontext` + Returned context handle of the current context + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxDetach`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuCtxAttach(pctx._pvt_ptr, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuCtxDetach(ctx): + """ Decrement a context's usage-count. + + [Deprecated] + + Note that this function is deprecated and should not be used. + + Decrements the usage count of the context `ctx`, and destroys the + context if the usage count goes to 0. The context must be a handle that + was passed back by :py:obj:`~.cuCtxCreate()` or + :py:obj:`~.cuCtxAttach()`, and must be current to the calling thread. + + Parameters + ---------- + ctx : :py:obj:`~.CUcontext` + Context to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + with nogil: + err = cydriver.cuCtxDetach(cyctx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxGetSharedMemConfig(): + """ Returns the current shared memory configuration for the current context. + + [Deprecated] + + This function will return in `pConfig` the current size of shared + memory banks in the current context. On devices with configurable + shared memory banks, :py:obj:`~.cuCtxSetSharedMemConfig` can be used to + change this setting, so that all subsequent kernel launches will by + default use the new bank size. When :py:obj:`~.cuCtxGetSharedMemConfig` + is called on devices without configurable shared memory, it will return + the fixed bank size of the hardware. + + The returned bank configurations can be either: + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`: shared memory + bank width is four bytes. + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`: shared memory + bank width will eight bytes. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pConfig : :py:obj:`~.CUsharedconfig` + returned shared memory configuration + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuCtxGetSharedMemConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cudaDeviceGetSharedMemConfig` + """ + cdef cydriver.CUsharedconfig pConfig + with nogil: + err = cydriver.cuCtxGetSharedMemConfig(&pConfig) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUsharedconfig(pConfig)) + +@cython.embedsignature(True) +def cuCtxSetSharedMemConfig(config not None : CUsharedconfig): + """ Sets the shared memory configuration for the current context. + + [Deprecated] + + On devices with configurable shared memory banks, this function will + set the context's shared memory bank size which is used for subsequent + kernel launches. + + Changed the shared memory configuration between launches may insert a + device side synchronization point between those launches. + + Changing the shared memory bank size will not increase shared memory + usage or affect occupancy of kernels, but may have major effects on + performance. Larger bank sizes will allow for greater potential + bandwidth to shared memory, but will change what kinds of accesses to + shared memory will result in bank conflicts. + + This function will do nothing on devices with fixed shared memory bank + size. + + The supported bank configurations are: + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`: set bank width to + the default initial setting (currently, four bytes). + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`: set shared + memory bank width to be natively four bytes. + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`: set shared + memory bank width to be natively eight bytes. + + Parameters + ---------- + config : :py:obj:`~.CUsharedconfig` + requested shared memory configuration + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxGetLimit`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cuCtxGetSharedMemConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cudaDeviceSetSharedMemConfig` + """ + cdef cydriver.CUsharedconfig cyconfig = int(config) + with nogil: + err = cydriver.cuCtxSetSharedMemConfig(cyconfig) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuModuleLoad(char* fname): + """ Loads a compute module. + + Takes a filename `fname` and loads the corresponding module `module` + into the current context. The CUDA driver API does not attempt to + lazily allocate the resources needed by a module; if the memory for + functions and data (constant and global) needed by the module cannot be + allocated, :py:obj:`~.cuModuleLoad()` fails. The file should be a + `cubin` file as output by nvcc, or a `PTX` file either as output by + nvcc or handwritten, or a `fatbin` file as output by nvcc from + toolchain 4.0 or later. + + Parameters + ---------- + fname : bytes + Filename of module to load + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_FILE_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND` + module : :py:obj:`~.CUmodule` + Returned module + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + cdef CUmodule module = CUmodule() + with nogil: + err = cydriver.cuModuleLoad(module._pvt_ptr, fname) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, module) + +@cython.embedsignature(True) +def cuModuleLoadData(image): + """ Load a module's data. + + Takes a pointer `image` and loads the corresponding module `module` + into the current context. The `image` may be a `cubin` or `fatbin` as + output by nvcc, or a NULL-terminated `PTX`, either as output by nvcc or + hand-written. + + Parameters + ---------- + image : Any + Module data to load + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND` + module : :py:obj:`~.CUmodule` + Returned module + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + cdef CUmodule module = CUmodule() + cdef _HelperInputVoidPtrStruct cyimageHelper + cdef void* cyimage = _helper_input_void_ptr(image, &cyimageHelper) + with nogil: + err = cydriver.cuModuleLoadData(module._pvt_ptr, cyimage) + _helper_input_void_ptr_free(&cyimageHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, module) + +@cython.embedsignature(True) +def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): + """ Load a module's data with options. + + Takes a pointer `image` and loads the corresponding module `module` + into the current context. The `image` may be a `cubin` or `fatbin` as + output by nvcc, or a NULL-terminated `PTX`, either as output by nvcc or + hand-written. + + Parameters + ---------- + image : Any + Module data to load + numOptions : unsigned int + Number of options + options : list[:py:obj:`~.CUjit_option`] + Options for JIT + optionValues : list[Any] + Option values for JIT + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND` + module : :py:obj:`~.CUmodule` + Returned module + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + optionValues = [] if optionValues is None else optionValues + options = [] if options is None else options + if not all(isinstance(_x, (CUjit_option)) for _x in options): + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + cdef CUmodule module = CUmodule() + cdef _HelperInputVoidPtrStruct cyimageHelper + cdef void* cyimage = _helper_input_void_ptr(image, &cyimageHelper) + if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) + if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) + cdef vector[cydriver.CUjit_option] cyoptions = options + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr + with nogil: + err = cydriver.cuModuleLoadDataEx(module._pvt_ptr, cyimage, numOptions, cyoptions.data(), cyoptionValues_ptr) + _helper_input_void_ptr_free(&cyimageHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, module) + +@cython.embedsignature(True) +def cuModuleLoadFatBinary(fatCubin): + """ Load a module's data. + + Takes a pointer `fatCubin` and loads the corresponding module `module` + into the current context. The pointer represents a `fat binary` object, + which is a collection of different `cubin` and/or `PTX` files, all + representing the same device code, but compiled and optimized for + different architectures. + + Prior to CUDA 4.0, there was no documented API for constructing and + using fat binary objects by programmers. Starting with CUDA 4.0, fat + binary objects can be constructed by providing the `-fatbin option` to + nvcc. More information can be found in the nvcc document. + + Parameters + ---------- + fatCubin : Any + Fat binary to load + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND` + module : :py:obj:`~.CUmodule` + Returned module + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleUnload` + """ + cdef CUmodule module = CUmodule() + cdef _HelperInputVoidPtrStruct cyfatCubinHelper + cdef void* cyfatCubin = _helper_input_void_ptr(fatCubin, &cyfatCubinHelper) + with nogil: + err = cydriver.cuModuleLoadFatBinary(module._pvt_ptr, cyfatCubin) + _helper_input_void_ptr_free(&cyfatCubinHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, module) + +@cython.embedsignature(True) +def cuModuleUnload(hmod): + """ Unloads a module. + + Unloads a module `hmod` from the current context. Attempting to unload + a module which was obtained from the Library Management API such as + :py:obj:`~.cuLibraryGetModule` will return + :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`. + + Parameters + ---------- + hmod : :py:obj:`~.CUmodule` + Module to unload + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED` + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary` + """ + cdef cydriver.CUmodule cyhmod + if hmod is None: + phmod = 0 + elif isinstance(hmod, (CUmodule,)): + phmod = int(hmod) + else: + phmod = int(CUmodule(hmod)) + cyhmod = phmod + with nogil: + err = cydriver.cuModuleUnload(cyhmod) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuModuleGetLoadingMode(): + """ Query lazy loading mode. + + Returns lazy loading mode Module loading mode is controlled by + CUDA_MODULE_LOADING env variable + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + mode : :py:obj:`~.CUmoduleLoadingMode` + Returns the lazy loading mode + + See Also + -------- + :py:obj:`~.cuModuleLoad`, + """ + cdef cydriver.CUmoduleLoadingMode mode + with nogil: + err = cydriver.cuModuleGetLoadingMode(&mode) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUmoduleLoadingMode(mode)) + +@cython.embedsignature(True) +def cuModuleGetFunction(hmod, char* name): + """ Returns a function handle. + + Returns in `*hfunc` the handle of the function of name `name` located + in module `hmod`. If no function of that name exists, + :py:obj:`~.cuModuleGetFunction()` returns + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + hmod : :py:obj:`~.CUmodule` + Module to retrieve function from + name : bytes + Name of function to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + hfunc : :py:obj:`~.CUfunction` + Returned function handle + + See Also + -------- + :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + cdef cydriver.CUmodule cyhmod + if hmod is None: + phmod = 0 + elif isinstance(hmod, (CUmodule,)): + phmod = int(hmod) + else: + phmod = int(CUmodule(hmod)) + cyhmod = phmod + cdef CUfunction hfunc = CUfunction() + with nogil: + err = cydriver.cuModuleGetFunction(hfunc._pvt_ptr, cyhmod, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, hfunc) + +@cython.embedsignature(True) +def cuModuleGetFunctionCount(mod): + """ Returns the number of functions within a module. + + Returns in `count` the number of functions in `mod`. + + Parameters + ---------- + mod : :py:obj:`~.CUmodule` + Module to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + count : unsigned int + Number of functions found within the module + """ + cdef cydriver.CUmodule cymod + if mod is None: + pmod = 0 + elif isinstance(mod, (CUmodule,)): + pmod = int(mod) + else: + pmod = int(CUmodule(mod)) + cymod = pmod + cdef unsigned int count = 0 + with nogil: + err = cydriver.cuModuleGetFunctionCount(&count, cymod) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, count) + +@cython.embedsignature(True) +def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): + """ Returns the function handles within a module. + + Returns in `functions` a maximum number of `numFunctions` function + handles within `mod`. When function loading mode is set to LAZY the + function retrieved may be partially loaded. The loading state of a + function can be queried using :py:obj:`~.cuFunctionIsLoaded`. CUDA APIs + may load the function automatically when called with partially loaded + function handle which may incur additional latency. Alternatively, + :py:obj:`~.cuFunctionLoad` can be used to explicitly load a function. + The returned function handles become invalid when the module is + unloaded. + + Parameters + ---------- + numFunctions : unsigned int + Maximum number of function handles may be returned to the buffer + mod : :py:obj:`~.CUmodule` + Module to query from + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + functions : list[:py:obj:`~.CUfunction`] + Buffer where the function handles are returned to + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetFunctionCount`, :py:obj:`~.cuFuncIsLoaded`, :py:obj:`~.cuFuncLoad` + """ + cdef cydriver.CUmodule cymod + if mod is None: + pmod = 0 + elif isinstance(mod, (CUmodule,)): + pmod = int(mod) + else: + pmod = int(CUmodule(mod)) + cymod = pmod + cdef cydriver.CUfunction* cyfunctions = NULL + pyfunctions = [] + if numFunctions != 0: + cyfunctions = calloc(numFunctions, sizeof(cydriver.CUfunction)) + if cyfunctions is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(numFunctions) + 'x' + str(sizeof(cydriver.CUfunction))) + with nogil: + err = cydriver.cuModuleEnumerateFunctions(cyfunctions, numFunctions, cymod) + if CUresult(err) == CUresult(0): + pyfunctions = [CUfunction(init_value=cyfunctions[idx]) for idx in range(numFunctions)] + if cyfunctions is not NULL: + free(cyfunctions) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pyfunctions) + +@cython.embedsignature(True) +def cuModuleGetGlobal(hmod, char* name): + """ Returns a global pointer from a module. + + Returns in `*dptr` and `*bytes` the base pointer and size of the global + of name `name` located in module `hmod`. If no variable of that name + exists, :py:obj:`~.cuModuleGetGlobal()` returns + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. One of the parameters `dptr` or + `numbytes` (not both) can be NULL in which case it is ignored. + + Parameters + ---------- + hmod : :py:obj:`~.CUmodule` + Module to retrieve global from + name : bytes + Name of global to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + dptr : :py:obj:`~.CUdeviceptr` + Returned global device pointer + numbytes : int + Returned global size in bytes + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload`, :py:obj:`~.cudaGetSymbolAddress`, :py:obj:`~.cudaGetSymbolSize` + """ + cdef cydriver.CUmodule cyhmod + if hmod is None: + phmod = 0 + elif isinstance(hmod, (CUmodule,)): + phmod = int(hmod) + else: + phmod = int(CUmodule(hmod)) + cyhmod = phmod + cdef CUdeviceptr dptr = CUdeviceptr() + cdef size_t numbytes = 0 + with nogil: + err = cydriver.cuModuleGetGlobal(dptr._pvt_ptr, &numbytes, cyhmod, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, dptr, numbytes) + +@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 + :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 :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 + nvcc) when linking the final cubin during :py:obj:`~.cuLinkComplete` + and will have similar consequences as offline relocatable device code + linking. + + `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 + ---------- + numOptions : unsigned int + Size of options arrays + options : list[:py:obj:`~.CUjit_option`] + Array of linker and compiler options + optionValues : list[Any] + Array of option values, each cast to void * + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :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 :py:obj:`~.CUlinkState` to specify + and complete this action + + See Also + -------- + :py:obj:`~.cuLinkAddData`, :py:obj:`~.cuLinkAddFile`, :py:obj:`~.cuLinkComplete`, :py:obj:`~.cuLinkDestroy` + + Notes + ----- + For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted + """ + optionValues = [] if optionValues is None else optionValues + options = [] if options is None else options + if not all(isinstance(_x, (CUjit_option)) for _x in options): + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) + if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) + cdef vector[cydriver.CUjit_option] cyoptions = options + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr + cdef CUlinkState stateOut = CUlinkState() + with nogil: + err = cydriver.cuLinkCreate(numOptions, cyoptions.data(), cyoptionValues_ptr, stateOut._pvt_ptr) + stateOut._keepalive.append(voidStarHelperoptionValues) + for option in pylist: + stateOut._keepalive.append(option) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, stateOut) + +@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]]): + """ Add an input to a pending linker invocation. + + Ownership of `data` is retained by the caller. No reference is retained + to any inputs after this call returns. + + This method accepts only compiler options, which are used if the data + must be compiled from PTX, and does not accept any of + :py:obj:`~.CU_JIT_WALL_TIME`, :py:obj:`~.CU_JIT_INFO_LOG_BUFFER`, + :py:obj:`~.CU_JIT_ERROR_LOG_BUFFER`, + :py:obj:`~.CU_JIT_TARGET_FROM_CUCONTEXT`, or :py:obj:`~.CU_JIT_TARGET`. + + Parameters + ---------- + state : :py:obj:`~.CUlinkState` + A pending linker action. + typename : :py:obj:`~.CUjitInputType` + The type of the input data. + data : Any + The input data. PTX must be NULL-terminated. + size : size_t + The length of the input data. + name : bytes + An optional name for this input in log messages. + numOptions : unsigned int + Size of options. + options : list[:py:obj:`~.CUjit_option`] + Options to be applied only for this input (overrides options from + :py:obj:`~.cuLinkCreate`). + optionValues : list[Any] + Array of option values, each cast to void *. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU` + + See Also + -------- + :py:obj:`~.cuLinkCreate`, :py:obj:`~.cuLinkAddFile`, :py:obj:`~.cuLinkComplete`, :py:obj:`~.cuLinkDestroy` + + Notes + ----- + For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted + """ + optionValues = [] if optionValues is None else optionValues + options = [] if options is None else options + if not all(isinstance(_x, (CUjit_option)) for _x in options): + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + cdef cydriver.CUlinkState cystate + if state is None: + pstate = 0 + elif isinstance(state, (CUlinkState,)): + pstate = int(state) + else: + pstate = int(CUlinkState(state)) + cystate = pstate + cdef cydriver.CUjitInputType cytypename = int(typename) + cdef _HelperInputVoidPtrStruct cydataHelper + cdef void* cydata = _helper_input_void_ptr(data, &cydataHelper) + if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) + if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) + cdef vector[cydriver.CUjit_option] cyoptions = options + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr + with nogil: + err = cydriver.cuLinkAddData(cystate, cytypename, cydata, size, name, numOptions, cyoptions.data(), cyoptionValues_ptr) + _helper_input_void_ptr_free(&cydataHelper) + return (_CUresult(err),) + +@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]]): + """ Add a file input to a pending linker invocation. + + No reference is retained to any inputs after this call returns. + + This method accepts only compiler options, which are used if the input + must be compiled from PTX, and does not accept any of + :py:obj:`~.CU_JIT_WALL_TIME`, :py:obj:`~.CU_JIT_INFO_LOG_BUFFER`, + :py:obj:`~.CU_JIT_ERROR_LOG_BUFFER`, + :py:obj:`~.CU_JIT_TARGET_FROM_CUCONTEXT`, or :py:obj:`~.CU_JIT_TARGET`. + + This method is equivalent to invoking :py:obj:`~.cuLinkAddData` on the + contents of the file. + + Parameters + ---------- + state : :py:obj:`~.CUlinkState` + A pending linker action + typename : :py:obj:`~.CUjitInputType` + The type of the input data + path : bytes + Path to the input file + numOptions : unsigned int + Size of options + options : list[:py:obj:`~.CUjit_option`] + Options to be applied only for this input (overrides options from + :py:obj:`~.cuLinkCreate`) + optionValues : list[Any] + Array of option values, each cast to void * + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_FILE_NOT_FOUND` :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU` + + See Also + -------- + :py:obj:`~.cuLinkCreate`, :py:obj:`~.cuLinkAddData`, :py:obj:`~.cuLinkComplete`, :py:obj:`~.cuLinkDestroy` + + Notes + ----- + For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted + """ + optionValues = [] if optionValues is None else optionValues + options = [] if options is None else options + if not all(isinstance(_x, (CUjit_option)) for _x in options): + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + cdef cydriver.CUlinkState cystate + if state is None: + pstate = 0 + elif isinstance(state, (CUlinkState,)): + pstate = int(state) + else: + pstate = int(CUlinkState(state)) + cystate = pstate + cdef cydriver.CUjitInputType cytypename = int(typename) + if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) + if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) + cdef vector[cydriver.CUjit_option] cyoptions = options + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr + with nogil: + err = cydriver.cuLinkAddFile(cystate, cytypename, path, numOptions, cyoptions.data(), cyoptionValues_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLinkComplete(state): + """ Complete a pending linker invocation. + + Completes the pending linker action and returns the cubin image for the + linked device code, which can be used with + :py:obj:`~.cuModuleLoadData`. The cubin is owned by `state`, so it + should be loaded before `state` is destroyed via + :py:obj:`~.cuLinkDestroy`. This call does not destroy `state`. + + Parameters + ---------- + state : :py:obj:`~.CUlinkState` + A pending linker invocation + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + cubinOut : Any + On success, this will point to the output image + sizeOut : int + Optional parameter to receive the size of the generated image + + See Also + -------- + :py:obj:`~.cuLinkCreate`, :py:obj:`~.cuLinkAddData`, :py:obj:`~.cuLinkAddFile`, :py:obj:`~.cuLinkDestroy`, :py:obj:`~.cuModuleLoadData` + """ + cdef cydriver.CUlinkState cystate + if state is None: + pstate = 0 + elif isinstance(state, (CUlinkState,)): + pstate = int(state) + else: + pstate = int(CUlinkState(state)) + cystate = pstate + cdef void_ptr cubinOut = 0 + cdef size_t sizeOut = 0 + with nogil: + err = cydriver.cuLinkComplete(cystate, &cubinOut, &sizeOut) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, cubinOut, sizeOut) + +@cython.embedsignature(True) +def cuLinkDestroy(state): + """ Destroys state for a JIT linker invocation. + + Parameters + ---------- + state : :py:obj:`~.CUlinkState` + State object for the linker invocation + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuLinkCreate` + """ + cdef cydriver.CUlinkState cystate + if state is None: + pstate = 0 + elif isinstance(state, (CUlinkState,)): + pstate = int(state) + else: + pstate = int(CUlinkState(state)) + cystate = pstate + with nogil: + err = cydriver.cuLinkDestroy(cystate) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuModuleGetTexRef(hmod, char* name): + """ Returns a handle to a texture reference. + + [Deprecated] + + Returns in `*pTexRef` the handle of the texture reference of name + `name` in the module `hmod`. If no texture reference of that name + exists, :py:obj:`~.cuModuleGetTexRef()` returns + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. This texture reference handle should + not be destroyed, since it will be destroyed when the module is + unloaded. + + Parameters + ---------- + hmod : :py:obj:`~.CUmodule` + Module to retrieve texture reference from + name : bytes + Name of texture reference to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + pTexRef : :py:obj:`~.CUtexref` + Returned texture reference + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetSurfRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + cdef cydriver.CUmodule cyhmod + if hmod is None: + phmod = 0 + elif isinstance(hmod, (CUmodule,)): + phmod = int(hmod) + else: + phmod = int(CUmodule(hmod)) + cyhmod = phmod + cdef CUtexref pTexRef = CUtexref() + with nogil: + err = cydriver.cuModuleGetTexRef(pTexRef._pvt_ptr, cyhmod, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pTexRef) + +@cython.embedsignature(True) +def cuModuleGetSurfRef(hmod, char* name): + """ Returns a handle to a surface reference. + + [Deprecated] + + Returns in `*pSurfRef` the handle of the surface reference of name + `name` in the module `hmod`. If no surface reference of that name + exists, :py:obj:`~.cuModuleGetSurfRef()` returns + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + hmod : :py:obj:`~.CUmodule` + Module to retrieve surface reference from + name : bytes + Name of surface reference to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + pSurfRef : :py:obj:`~.CUsurfref` + Returned surface reference + + See Also + -------- + :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` + """ + cdef cydriver.CUmodule cyhmod + if hmod is None: + phmod = 0 + elif isinstance(hmod, (CUmodule,)): + phmod = int(hmod) + else: + phmod = int(CUmodule(hmod)) + cyhmod = phmod + cdef CUsurfref pSurfRef = CUsurfref() + with nogil: + err = cydriver.cuModuleGetSurfRef(pSurfRef._pvt_ptr, cyhmod, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pSurfRef) + +@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): + """ Load a library with specified code and options. + + Takes a pointer `code` and loads the corresponding library `library` + based on the application defined library loading mode: + + - If module loading is set to EAGER, via the environment variables + described in "Module loading", `library` is loaded eagerly into all + contexts at the time of the call and future contexts at the time of + creation until the library is unloaded with + :py:obj:`~.cuLibraryUnload()`. + + - If the environment variables are set to LAZY, `library` is not + immediately loaded onto all existent contexts and will only be loaded + when a function is needed for that context, such as a kernel launch. + + These environment variables are described in the CUDA programming guide + under the "CUDA environment variables" section. + + The `code` may be a `cubin` or `fatbin` as output by nvcc, or a NULL- + terminated `PTX`, either as output by nvcc or hand-written. A fatbin + should also contain relocatable code when doing separate compilation. + + Options are passed as an array via `jitOptions` and any corresponding + parameters are passed in `jitOptionsValues`. The number of total JIT + options is supplied via `numJitOptions`. Any outputs will be returned + via `jitOptionsValues`. + + Library load options are passed as an array via `libraryOptions` and + any corresponding parameters are passed in `libraryOptionValues`. The + number of total library load options is supplied via + `numLibraryOptions`. + + Parameters + ---------- + code : Any + Code to load + jitOptions : list[:py:obj:`~.CUjit_option`] + Options for JIT + jitOptionsValues : list[Any] + Option values for JIT + numJitOptions : unsigned int + Number of options + libraryOptions : list[:py:obj:`~.CUlibraryOption`] + Options for loading + libraryOptionValues : list[Any] + Option values for loading + numLibraryOptions : unsigned int + Number of options for loading + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + library : :py:obj:`~.CUlibrary` + Returned library + + See Also + -------- + :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx` + + Notes + ----- + If the library contains managed variables and no device in the system supports managed variables this call is expected to return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues + libraryOptions = [] if libraryOptions is None else libraryOptions + if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") + jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues + jitOptions = [] if jitOptions is None else jitOptions + if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + cdef CUlibrary library = CUlibrary() + cdef _HelperInputVoidPtrStruct cycodeHelper + cdef void* cycode = _helper_input_void_ptr(code, &cycodeHelper) + cdef vector[cydriver.CUjit_option] cyjitOptions = jitOptions + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr + if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) + if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) + cdef vector[cydriver.CUlibraryOption] cylibraryOptions = libraryOptions + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr + if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) + if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) + with nogil: + err = cydriver.cuLibraryLoadData(library._pvt_ptr, cycode, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) + _helper_input_void_ptr_free(&cycodeHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, library) + +@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): + """ Load a library with specified file and options. + + Takes a pointer `code` and loads the corresponding library `library` + based on the application defined library loading mode: + + - If module loading is set to EAGER, via the environment variables + described in "Module loading", `library` is loaded eagerly into all + contexts at the time of the call and future contexts at the time of + creation until the library is unloaded with + :py:obj:`~.cuLibraryUnload()`. + + - If the environment variables are set to LAZY, `library` is not + immediately loaded onto all existent contexts and will only be loaded + when a function is needed for that context, such as a kernel launch. + + These environment variables are described in the CUDA programming guide + under the "CUDA environment variables" section. + + The file should be a `cubin` file as output by nvcc, or a `PTX` file + either as output by nvcc or handwritten, or a `fatbin` file as output + by nvcc. A fatbin should also contain relocatable code when doing + separate compilation. + + Options are passed as an array via `jitOptions` and any corresponding + parameters are passed in `jitOptionsValues`. The number of total + options is supplied via `numJitOptions`. Any outputs will be returned + via `jitOptionsValues`. + + Library load options are passed as an array via `libraryOptions` and + any corresponding parameters are passed in `libraryOptionValues`. The + number of total library load options is supplied via + `numLibraryOptions`. + + Parameters + ---------- + fileName : bytes + File to load from + jitOptions : list[:py:obj:`~.CUjit_option`] + Options for JIT + jitOptionsValues : list[Any] + Option values for JIT + numJitOptions : unsigned int + Number of options + libraryOptions : list[:py:obj:`~.CUlibraryOption`] + Options for loading + libraryOptionValues : list[Any] + Option values for loading + numLibraryOptions : unsigned int + Number of options for loading + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_PTX`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_PTX_VERSION`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NO_BINARY_FOR_GPU`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + library : :py:obj:`~.CUlibrary` + Returned library + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx` + + Notes + ----- + If the library contains managed variables and no device in the system supports managed variables this call is expected to return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues + libraryOptions = [] if libraryOptions is None else libraryOptions + if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") + jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues + jitOptions = [] if jitOptions is None else jitOptions + if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") + cdef CUlibrary library = CUlibrary() + cdef vector[cydriver.CUjit_option] cyjitOptions = jitOptions + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr + if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) + if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) + cdef vector[cydriver.CUlibraryOption] cylibraryOptions = libraryOptions + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr + if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) + if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) + with nogil: + err = cydriver.cuLibraryLoadFromFile(library._pvt_ptr, fileName, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, library) + +@cython.embedsignature(True) +def cuLibraryUnload(library): + """ Unloads a library. + + Unloads the library specified with `library` + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to unload + + 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:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuModuleUnload` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + with nogil: + err = cydriver.cuLibraryUnload(cylibrary) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLibraryGetKernel(library, char* name): + """ Returns a kernel handle. + + Returns in `pKernel` the handle of the kernel with name `name` located + in library `library`. If kernel handle is not found, the call returns + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to retrieve kernel from + name : bytes + Name of kernel to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + pKernel : :py:obj:`~.CUkernel` + Returned kernel handle + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuKernelGetFunction`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetFunction` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + cdef CUkernel pKernel = CUkernel() + with nogil: + err = cydriver.cuLibraryGetKernel(pKernel._pvt_ptr, cylibrary, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pKernel) + +@cython.embedsignature(True) +def cuLibraryGetKernelCount(lib): + """ Returns the number of kernels within a library. + + Returns in `count` the number of kernels in `lib`. + + Parameters + ---------- + lib : :py:obj:`~.CUlibrary` + Library to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + count : unsigned int + Number of kernels found within the library + """ + cdef cydriver.CUlibrary cylib + if lib is None: + plib = 0 + elif isinstance(lib, (CUlibrary,)): + plib = int(lib) + else: + plib = int(CUlibrary(lib)) + cylib = plib + cdef unsigned int count = 0 + with nogil: + err = cydriver.cuLibraryGetKernelCount(&count, cylib) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, count) + +@cython.embedsignature(True) +def cuLibraryEnumerateKernels(unsigned int numKernels, lib): + """ Retrieve the kernel handles within a library. + + Returns in `kernels` a maximum number of `numKernels` kernel handles + within `lib`. The returned kernel handle becomes invalid when the + library is unloaded. + + Parameters + ---------- + numKernels : unsigned int + Maximum number of kernel handles may be returned to the buffer + lib : :py:obj:`~.CUlibrary` + Library to query from + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + kernels : list[:py:obj:`~.CUkernel`] + Buffer where the kernel handles are returned to + + See Also + -------- + :py:obj:`~.cuLibraryGetKernelCount` + """ + cdef cydriver.CUlibrary cylib + if lib is None: + plib = 0 + elif isinstance(lib, (CUlibrary,)): + plib = int(lib) + else: + plib = int(CUlibrary(lib)) + cylib = plib + cdef cydriver.CUkernel* cykernels = NULL + pykernels = [] + if numKernels != 0: + cykernels = calloc(numKernels, sizeof(cydriver.CUkernel)) + if cykernels is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(numKernels) + 'x' + str(sizeof(cydriver.CUkernel))) + with nogil: + err = cydriver.cuLibraryEnumerateKernels(cykernels, numKernels, cylib) + if CUresult(err) == CUresult(0): + pykernels = [CUkernel(init_value=cykernels[idx]) for idx in range(numKernels)] + if cykernels is not NULL: + free(cykernels) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pykernels) + +@cython.embedsignature(True) +def cuLibraryGetModule(library): + """ Returns a module handle. + + Returns in `pMod` the module handle associated with the current context + located in library `library`. If module handle is not found, the call + returns :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to retrieve module from + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + pMod : :py:obj:`~.CUmodule` + Returned module handle + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuModuleGetFunction` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + cdef CUmodule pMod = CUmodule() + with nogil: + err = cydriver.cuLibraryGetModule(pMod._pvt_ptr, cylibrary) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pMod) + +@cython.embedsignature(True) +def cuKernelGetFunction(kernel): + """ Returns a function handle. + + Returns in `pFunc` the handle of the function for the requested kernel + `kernel` and the current context. If function handle is not found, the + call returns :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + kernel : :py:obj:`~.CUkernel` + Kernel to retrieve function for the requested context + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + pFunc : :py:obj:`~.CUfunction` + Returned function handle + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetFunction` + """ + cdef cydriver.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef CUfunction pFunc = CUfunction() + with nogil: + err = cydriver.cuKernelGetFunction(pFunc._pvt_ptr, cykernel) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pFunc) + +@cython.embedsignature(True) +def cuKernelGetLibrary(kernel): + """ Returns a library handle. + + Returns in `pLib` the handle of the library for the requested kernel + `kernel` + + Parameters + ---------- + kernel : :py:obj:`~.CUkernel` + Kernel to retrieve library handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + pLib : :py:obj:`~.CUlibrary` + Returned library handle + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuLibraryGetKernel` + """ + cdef cydriver.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef CUlibrary pLib = CUlibrary() + with nogil: + err = cydriver.cuKernelGetLibrary(pLib._pvt_ptr, cykernel) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pLib) + +@cython.embedsignature(True) +def cuLibraryGetGlobal(library, char* name): + """ Returns a global device pointer. + + Returns in `*dptr` and `*bytes` the base pointer and size of the global + with name `name` for the requested library `library` and the current + context. If no global for the requested name `name` exists, the call + returns :py:obj:`~.CUDA_ERROR_NOT_FOUND`. One of the parameters `dptr` + or `numbytes` (not both) can be NULL in which case it is ignored. + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to retrieve global from + name : bytes + Name of global to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + dptr : :py:obj:`~.CUdeviceptr` + Returned global device pointer for the requested context + numbytes : int + Returned global size in bytes + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetGlobal` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + cdef CUdeviceptr dptr = CUdeviceptr() + cdef size_t numbytes = 0 + with nogil: + err = cydriver.cuLibraryGetGlobal(dptr._pvt_ptr, &numbytes, cylibrary, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, dptr, numbytes) + +@cython.embedsignature(True) +def cuLibraryGetManaged(library, char* name): + """ Returns a pointer to managed memory. + + Returns in `*dptr` and `*bytes` the base pointer and size of the + managed memory with name `name` for the requested library `library`. If + no managed memory with the requested name `name` exists, the call + returns :py:obj:`~.CUDA_ERROR_NOT_FOUND`. One of the parameters `dptr` + or `numbytes` (not both) can be NULL in which case it is ignored. Note + that managed memory for library `library` is shared across devices and + is registered when the library is loaded into atleast one context. + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to retrieve managed memory from + name : bytes + Name of managed memory to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + dptr : :py:obj:`~.CUdeviceptr` + Returned pointer to the managed memory + numbytes : int + Returned memory size in bytes + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + cdef CUdeviceptr dptr = CUdeviceptr() + cdef size_t numbytes = 0 + with nogil: + err = cydriver.cuLibraryGetManaged(dptr._pvt_ptr, &numbytes, cylibrary, name) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, dptr, numbytes) + +@cython.embedsignature(True) +def cuLibraryGetUnifiedFunction(library, char* symbol): + """ Returns a pointer to a unified function. + + Returns in `*fptr` the function pointer to a unified function denoted + by `symbol`. If no unified function with name `symbol` exists, the call + returns :py:obj:`~.CUDA_ERROR_NOT_FOUND`. If there is no device with + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS` + present in the system, the call may return + :py:obj:`~.CUDA_ERROR_NOT_FOUND`. + + Parameters + ---------- + library : :py:obj:`~.CUlibrary` + Library to retrieve function pointer memory from + symbol : bytes + Name of function pointer to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + fptr : Any + Returned pointer to a unified function + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload` + """ + cdef cydriver.CUlibrary cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (CUlibrary,)): + plibrary = int(library) + else: + plibrary = int(CUlibrary(library)) + cylibrary = plibrary + cdef void_ptr fptr = 0 + with nogil: + err = cydriver.cuLibraryGetUnifiedFunction(&fptr, cylibrary, symbol) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, fptr) + +@cython.embedsignature(True) +def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): + """ Returns information about a kernel. + + Returns in `*pi` the integer value of the attribute `attrib` for the + kernel `kernel` for the requested device `dev`. The supported + attributes are: + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`: The maximum + number of threads per block, beyond which a launch of the kernel + would fail. This number depends on both the kernel and the requested + device. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`: The size in bytes of + statically-allocated shared memory per block required by this kernel. + This does not include dynamically-allocated shared memory requested + by the user at runtime. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`: The size in bytes of + user-allocated constant memory required by this kernel. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`: The size in bytes of + local memory used by each thread of this kernel. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NUM_REGS`: The number of registers used + by each thread of this kernel. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_PTX_VERSION`: The PTX virtual + architecture version for which the kernel 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. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_BINARY_VERSION`: The binary architecture + version for which the kernel 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. + + - :py:obj:`~.CU_FUNC_CACHE_MODE_CA`: The attribute to indicate whether + the kernel has been compiled with user specified option "-Xptxas + --dlcm=ca" set. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`: The + maximum size in bytes of dynamically-allocated shared memory. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`: + Preferred shared memory-L1 cache split ratio in percent of total + shared memory. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`: If this + attribute is set, the kernel must launch with a valid cluster size + specified. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`: The required + cluster width in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`: The required + cluster height in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`: The required + cluster depth in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`: + Indicates whether the function can be launched with non-portable + cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster + size may only function on the specific SKUs the program is tested on. + The launch might fail if the program is run on a different hardware + platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist + with checking whether the desired size can be launched on the current + device. A portable cluster size is guaranteed to be functional on all + compute capabilities higher than the target compute capability. The + portable cluster size for sm_90 is 8 blocks per cluster. This value + may increase for future compute capabilities. The specific hardware + unit may support higher cluster sizes that’s not guaranteed to be + portable. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: + The block scheduling policy of a function. The value type is + :py:obj:`~.CUclusterSchedulingPolicy`. + + Parameters + ---------- + attrib : :py:obj:`~.CUfunction_attribute` + Attribute requested + kernel : :py:obj:`~.CUkernel` + Kernel to query attribute of + dev : :py:obj:`~.CUdevice` + Device to query attribute of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + pi : int + Returned attribute value + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuKernelSetAttribute`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuKernelGetFunction`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuFuncGetAttribute` + + Notes + ----- + If another thread is trying to set the same attribute on the same device using :py:obj:`~.cuKernelSetAttribute()` simultaneously, the attribute query will give the old or new value depending on the interleavings chosen by the OS scheduler and memory consistency. + """ + 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.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef int pi = 0 + cdef cydriver.CUfunction_attribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuKernelGetAttribute(&pi, cyattrib, cykernel, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pi) + +@cython.embedsignature(True) +def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel, dev): + """ Sets information about a kernel. + + This call sets the value of a specified attribute `attrib` on the + kernel `kernel` for the requested device `dev` to an integer value + specified by `val`. This function returns CUDA_SUCCESS if the new value + of the attribute could be successfully set. If the set fails, this call + will return an error. Not all attributes can have values set. + Attempting to set a value on a read-only attribute will result in an + error (CUDA_ERROR_INVALID_VALUE) + + Note that attributes set using :py:obj:`~.cuFuncSetAttribute()` will + override the attribute set by this API irrespective of whether the call + to :py:obj:`~.cuFuncSetAttribute()` is made before or after this API + call. However, :py:obj:`~.cuKernelGetAttribute()` will always return + the attribute value set by this API. + + Supported attributes are: + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`: This is + the maximum size in bytes of dynamically-allocated shared memory. The + value should contain the requested maximum size of dynamically- + allocated shared memory. The sum of this value and the function + attribute :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` cannot + exceed the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`. + The maximal size of requestable dynamic shared memory may differ by + GPU architecture. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`: On + devices where the L1 cache and shared memory use the same hardware + resources, this sets the shared memory carveout preference, in + percent of the total shared memory. See + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR` + This is only a hint, and the driver can choose a different ratio if + required to execute the function. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`: The required + cluster width in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`: The required + cluster height in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`: The required + cluster depth in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`: + Indicates whether the function can be launched with non-portable + cluster size. 1 is allowed, 0 is disallowed. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: + The block scheduling policy of a function. The value type is + :py:obj:`~.CUclusterSchedulingPolicy`. + + Parameters + ---------- + attrib : :py:obj:`~.CUfunction_attribute` + Attribute requested + val : int + Value to set + kernel : :py:obj:`~.CUkernel` + Kernel to set attribute of + dev : :py:obj:`~.CUdevice` + Device to set attribute of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuKernelGetAttribute`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuKernelGetFunction`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuFuncSetAttribute` + + Notes + ----- + The API has stricter locking requirements in comparison to its legacy counterpart :py:obj:`~.cuFuncSetAttribute()` due to device-wide semantics. If multiple threads are trying to set the same attribute on the same device simultaneously, the attribute setting will depend on the interleavings chosen by the OS scheduler and memory consistency. + """ + 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.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef cydriver.CUfunction_attribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuKernelSetAttribute(cyattrib, val, cykernel, cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuKernelSetCacheConfig(kernel, config not None : CUfunc_cache, dev): + """ Sets the preferred cache configuration for a device kernel. + + On devices where the L1 cache and shared memory use the same hardware + resources, this sets through `config` the preferred cache configuration + for the device kernel `kernel` on the requested device `dev`. This is + only a preference. The driver will use the requested configuration if + possible, but it is free to choose a different configuration if + required to execute `kernel`. Any context-wide preference set via + :py:obj:`~.cuCtxSetCacheConfig()` will be overridden by this per-kernel + setting. + + Note that attributes set using :py:obj:`~.cuFuncSetCacheConfig()` will + override the attribute set by this API irrespective of whether the call + to :py:obj:`~.cuFuncSetCacheConfig()` is made before or after this API + call. + + This setting does nothing on devices where the size of the L1 cache and + shared memory are fixed. + + Launching a kernel with a different preference than the most recent + preference setting may insert a device-side synchronization point. + + The supported cache configurations are: + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE`: no preference for shared + memory or L1 (default) + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_SHARED`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_L1`: prefer larger L1 cache and + smaller shared memory + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_EQUAL`: prefer equal sized L1 cache + and shared memory + + Parameters + ---------- + kernel : :py:obj:`~.CUkernel` + Kernel to configure cache for + config : :py:obj:`~.CUfunc_cache` + Requested cache configuration + dev : :py:obj:`~.CUdevice` + Device to set attribute of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuLibraryLoadData`, :py:obj:`~.cuLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuKernelGetFunction`, :py:obj:`~.cuLibraryGetModule`, :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuLaunchKernel` + + Notes + ----- + The API has stricter locking requirements in comparison to its legacy counterpart :py:obj:`~.cuFuncSetCacheConfig()` due to device-wide semantics. If multiple threads are trying to set a config on the same device simultaneously, the cache config setting will depend on the interleavings chosen by the OS scheduler and memory consistency. + """ + 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.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef cydriver.CUfunc_cache cyconfig = int(config) + with nogil: + err = cydriver.cuKernelSetCacheConfig(cykernel, cyconfig, cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuKernelGetName(hfunc): + """ Returns the function name for a :py:obj:`~.CUkernel` handle. + + Returns in `**name` the function name associated with the kernel handle + `hfunc` . The function name is returned as a null-terminated string. + The returned name is only valid when the kernel handle is valid. If the + library is unloaded or reloaded, one must call the API again to get the + updated name. This API may return a mangled name if the function is not + declared as having C linkage. If either `**name` or `hfunc` is NULL, + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + Parameters + ---------- + hfunc : :py:obj:`~.CUkernel` + The function handle to retrieve the name for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + name : bytes + The returned name of the function + """ + cdef cydriver.CUkernel cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUkernel,)): + phfunc = int(hfunc) + else: + phfunc = int(CUkernel(hfunc)) + cyhfunc = phfunc + cdef const char* name = NULL + with nogil: + err = cydriver.cuKernelGetName(&name, cyhfunc) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, name if name != NULL else None) + +@cython.embedsignature(True) +def cuKernelGetParamInfo(kernel, size_t paramIndex): + """ Returns the offset and size of a kernel parameter in the device-side parameter layout. + + Queries the kernel parameter at `paramIndex` into `kernel's` list of + parameters, and returns in `paramOffset` and `paramSize` the offset and + size, respectively, where the parameter will reside in the device-side + parameter layout. This information can be used to update kernel node + parameters from the device via + :py:obj:`~.cudaGraphKernelNodeSetParam()` and + :py:obj:`~.cudaGraphKernelNodeUpdatesApply()`. `paramIndex` must be + less than the number of parameters that `kernel` takes. `paramSize` can + be set to NULL if only the parameter offset is desired. + + Parameters + ---------- + kernel : :py:obj:`~.CUkernel` + The kernel to query + paramIndex : size_t + The parameter index to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + paramOffset : int + Returns the offset into the device-side parameter layout at which + the parameter resides + paramSize : int + Optionally returns the size of the parameter in the device-side + parameter layout + + See Also + -------- + :py:obj:`~.cuFuncGetParamInfo` + """ + cdef cydriver.CUkernel cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (CUkernel,)): + pkernel = int(kernel) + else: + pkernel = int(CUkernel(kernel)) + cykernel = pkernel + cdef size_t paramOffset = 0 + cdef size_t paramSize = 0 + with nogil: + err = cydriver.cuKernelGetParamInfo(cykernel, paramIndex, ¶mOffset, ¶mSize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, paramOffset, paramSize) + +@cython.embedsignature(True) +def cuMemGetInfo(): + """ Gets free and total memory. + + Returns in `*total` the total amount of memory available to the the + current context. Returns in `*free` the amount of memory on the device + that is free according to the OS. CUDA is not guaranteed to be able to + allocate all of the memory that the OS reports as free. In a multi- + tenet situation, free estimate returned is prone to race condition + where a new allocation/free done by a different process or a different + thread in the same process between the time when free memory was + estimated and reported, will result in deviation in free value reported + and actual free memory. + + The integrated GPU on Tegra shares memory with CPU and other component + of the SoC. The free and total values returned by the API excludes the + SWAP memory space maintained by the OS on some platforms. The OS may + move some of the memory pages into swap area as the GPU or CPU allocate + or access memory. See Tegra app note on how to calculate total and free + memory on Tegra. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + free : int + Returned free memory in bytes + total : int + Returned total memory in bytes + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemGetInfo` + """ + cdef size_t free = 0 + cdef size_t total = 0 + with nogil: + err = cydriver.cuMemGetInfo(&free, &total) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, free, total) + +@cython.embedsignature(True) +def cuMemAlloc(size_t bytesize): + """ Allocates device memory. + + Allocates `bytesize` bytes of linear memory on the device and returns + in `*dptr` a pointer to the allocated memory. The allocated memory is + suitably aligned for any kind of variable. The memory is not cleared. + If `bytesize` is 0, :py:obj:`~.cuMemAlloc()` returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Parameters + ---------- + bytesize : size_t + Requested allocation size in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + dptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :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:`~.cudaMalloc` + """ + cdef CUdeviceptr dptr = CUdeviceptr() + with nogil: + err = cydriver.cuMemAlloc(dptr._pvt_ptr, bytesize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dptr) + +@cython.embedsignature(True) +def cuMemAllocPitch(size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes): + """ Allocates pitched device memory. + + Allocates at least `WidthInBytes` * `Height` bytes of linear memory on + the device and returns in `*dptr` a pointer to the allocated memory. + The function may pad the allocation to ensure that corresponding + pointers in any given row will continue to meet the alignment + requirements for coalescing as the address is updated from row to row. + `ElementSizeBytes` specifies the size of the largest reads and writes + that will be performed on the memory range. `ElementSizeBytes` may be + 4, 8 or 16 (since coalesced memory transactions are not possible on + other data sizes). If `ElementSizeBytes` is smaller than the actual + read/write size of a kernel, the kernel will run correctly, but + possibly at reduced speed. The pitch returned in `*pPitch` by + :py:obj:`~.cuMemAllocPitch()` is the width in bytes of the allocation. + The intended usage of pitch is as a separate parameter of the + allocation, used to compute addresses within the 2D array. Given the + row and column of an array element of type T, the address is computed + as: + + **View CUDA Toolkit Documentation for a C++ code example** + + The pitch returned by :py:obj:`~.cuMemAllocPitch()` is guaranteed to + work with :py:obj:`~.cuMemcpy2D()` under all circumstances. For + allocations of 2D arrays, it is recommended that programmers consider + performing pitch allocations using :py:obj:`~.cuMemAllocPitch()`. Due + to alignment restrictions in the hardware, this is especially true if + the application will be performing 2D memory copies between different + regions of device memory (whether linear memory or CUDA arrays). + + The byte alignment of the pitch returned by + :py:obj:`~.cuMemAllocPitch()` is guaranteed to match or exceed the + alignment requirement for texture binding with + :py:obj:`~.cuTexRefSetAddress2D()`. + + Parameters + ---------- + WidthInBytes : size_t + Requested allocation width in bytes + Height : size_t + Requested allocation height in rows + ElementSizeBytes : unsigned int + Size of largest reads/writes for range + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + dptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + pPitch : int + Returned pitch of allocation in bytes + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :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:`~.cudaMallocPitch` + """ + cdef CUdeviceptr dptr = CUdeviceptr() + cdef size_t pPitch = 0 + with nogil: + err = cydriver.cuMemAllocPitch(dptr._pvt_ptr, &pPitch, WidthInBytes, Height, ElementSizeBytes) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, dptr, pPitch) + +@cython.embedsignature(True) +def cuMemFree(dptr): + """ Frees device memory. + + Frees the memory space pointed to by `dptr`, which must have been + returned by a previous call to one of the following memory allocation + APIs - :py:obj:`~.cuMemAlloc()`, :py:obj:`~.cuMemAllocPitch()`, + :py:obj:`~.cuMemAllocManaged()`, :py:obj:`~.cuMemAllocAsync()`, + :py:obj:`~.cuMemAllocFromPoolAsync()` + + Note - This API will not perform any implict synchronization when the + pointer was allocated with :py:obj:`~.cuMemAllocAsync` or + :py:obj:`~.cuMemAllocFromPoolAsync`. Callers must ensure that all + accesses to these pointer have completed before invoking + :py:obj:`~.cuMemFree`. For best performance and memory reuse, users + should use :py:obj:`~.cuMemFreeAsync` to free memory allocated via the + stream ordered memory allocator. For all other pointers, this API may + perform implicit synchronization. + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + Pointer to memory to free + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemAllocManaged`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemAllocFromPoolAsync`, :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:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaFree` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + with nogil: + err = cydriver.cuMemFree(cydptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemGetAddressRange(dptr): + """ Get information on memory allocations. + + Returns the base address in `*pbase` and size in `*psize` of the + allocation by :py:obj:`~.cuMemAlloc()` or :py:obj:`~.cuMemAllocPitch()` + that contains the input pointer `dptr`. Both parameters `pbase` and + `psize` are optional. If one of them is NULL, it is ignored. + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + Device pointer to query + + 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_NOT_FOUND`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pbase : :py:obj:`~.CUdeviceptr` + Returned base address + psize : int + Returned size of device memory allocation + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.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` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef CUdeviceptr pbase = CUdeviceptr() + cdef size_t psize = 0 + with nogil: + err = cydriver.cuMemGetAddressRange(pbase._pvt_ptr, &psize, cydptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pbase, psize) + +@cython.embedsignature(True) +def cuMemAllocHost(size_t bytesize): + """ Allocates page-locked host memory. + + Allocates `bytesize` bytes of host memory that is page-locked and + accessible to the device. The driver tracks the virtual memory ranges + allocated with this function and automatically accelerates calls to + functions such as :py:obj:`~.cuMemcpy()`. Since the memory can be + accessed directly by the device, it can be read or written with much + higher bandwidth than pageable memory obtained with functions such as + :py:obj:`~.malloc()`. + + On systems where + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES` + is true, :py:obj:`~.cuMemAllocHost` may not page-lock the allocated + memory. + + Page-locking excessive amounts of memory with + :py:obj:`~.cuMemAllocHost()` may degrade system performance, since it + reduces the amount of memory available to the system for paging. As a + result, this function is best used sparingly to allocate staging areas + for data exchange between host and device. + + Note all host memory allocated using :py:obj:`~.cuMemAllocHost()` will + automatically be immediately accessible to all contexts on all devices + which support unified addressing (as may be queried using + :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`). The device pointer + that may be used to access this host memory from those contexts is + always equal to the returned host pointer `*pp`. See :py:obj:`~.Unified + Addressing` for additional details. + + Parameters + ---------- + bytesize : size_t + Requested allocation size in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + pp : Any + Returned pointer to host memory + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :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:`~.cudaMallocHost` + """ + cdef void_ptr pp = 0 + with nogil: + err = cydriver.cuMemAllocHost(&pp, bytesize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pp) + +@cython.embedsignature(True) +def cuMemFreeHost(p): + """ Frees page-locked host memory. + + Frees the memory space pointed to by `p`, which must have been returned + by a previous call to :py:obj:`~.cuMemAllocHost()`. + + Parameters + ---------- + p : Any + Pointer to memory to free + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaFreeHost` + """ + cdef _HelperInputVoidPtrStruct cypHelper + cdef void* cyp = _helper_input_void_ptr(p, &cypHelper) + with nogil: + err = cydriver.cuMemFreeHost(cyp) + _helper_input_void_ptr_free(&cypHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemHostAlloc(size_t bytesize, unsigned int Flags): + """ Allocates page-locked host memory. + + Allocates `bytesize` bytes of host memory that is page-locked and + accessible to the device. The driver tracks the virtual memory ranges + allocated with this function and automatically accelerates calls to + functions such as :py:obj:`~.cuMemcpyHtoD()`. Since the memory can be + accessed directly by the device, it can be read or written with much + higher bandwidth than pageable memory obtained with functions such as + :py:obj:`~.malloc()`. + + On systems where + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES` + is true, :py:obj:`~.cuMemHostAlloc` may not page-lock the allocated + memory. + + Page-locking excessive amounts of memory may degrade system + performance, since it reduces the amount of memory available to the + system for paging. As a result, this function is best used sparingly to + allocate staging areas for data exchange between host and device. + + The `Flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.CU_MEMHOSTALLOC_PORTABLE`: The memory returned by this + call will be considered as pinned memory by all CUDA contexts, not + just the one that performed the allocation. + + - :py:obj:`~.CU_MEMHOSTALLOC_DEVICEMAP`: Maps the allocation into the + CUDA address space. The device pointer to the memory may be obtained + by calling :py:obj:`~.cuMemHostGetDevicePointer()`. + + - :py:obj:`~.CU_MEMHOSTALLOC_WRITECOMBINED`: Allocates the memory as + write-combined (WC). WC memory can be transferred across the PCI + Express bus more quickly on some system configurations, but cannot be + read efficiently by most CPUs. WC memory is a good option for buffers + that will be written by the CPU and read by the GPU via mapped pinned + memory or host->device transfers. + + All of these flags are orthogonal to one another: a developer may + allocate memory that is portable, mapped and/or write-combined with no + restrictions. + + The :py:obj:`~.CU_MEMHOSTALLOC_DEVICEMAP` flag may be specified on CUDA + contexts for devices that do not support mapped pinned memory. The + failure is deferred to :py:obj:`~.cuMemHostGetDevicePointer()` because + the memory may be mapped into other CUDA contexts via the + :py:obj:`~.CU_MEMHOSTALLOC_PORTABLE` flag. + + The memory allocated by this function must be freed with + :py:obj:`~.cuMemFreeHost()`. + + Note all host memory allocated using :py:obj:`~.cuMemHostAlloc()` will + automatically be immediately accessible to all contexts on all devices + which support unified addressing (as may be queried using + :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`). Unless the flag + :py:obj:`~.CU_MEMHOSTALLOC_WRITECOMBINED` is specified, the device + pointer that may be used to access this host memory from those contexts + is always equal to the returned host pointer `*pp`. If the flag + :py:obj:`~.CU_MEMHOSTALLOC_WRITECOMBINED` is specified, then the + function :py:obj:`~.cuMemHostGetDevicePointer()` must be used to query + the device pointer, even if the context supports unified addressing. + See :py:obj:`~.Unified Addressing` for additional details. + + Parameters + ---------- + bytesize : size_t + Requested allocation size in bytes + Flags : unsigned int + Flags for allocation request + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + pp : Any + Returned pointer to host memory + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaHostAlloc` + """ + cdef void_ptr pp = 0 + with nogil: + err = cydriver.cuMemHostAlloc(&pp, bytesize, Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pp) + +@cython.embedsignature(True) +def cuMemHostGetDevicePointer(p, unsigned int Flags): + """ Passes back device pointer of mapped pinned memory. + + Passes back the device pointer `pdptr` corresponding to the mapped, + pinned host buffer `p` allocated by :py:obj:`~.cuMemHostAlloc`. + + :py:obj:`~.cuMemHostGetDevicePointer()` will fail if the + :py:obj:`~.CU_MEMHOSTALLOC_DEVICEMAP` flag was not specified at the + time the memory was allocated, or if the function is called on a GPU + that does not support mapped pinned memory. + + For devices that have a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`, + the memory can also be accessed from the device using the host pointer + `p`. The device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` may or may not match the + original host pointer `p` and depends on the devices visible to the + application. If all devices visible to the application have a non-zero + value for the device attribute, the device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` will match the original pointer + `p`. If any device visible to the application has a zero value for the + device attribute, the device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` will not match the original + host pointer `p`, but it will be suitable for use on all devices + provided Unified Virtual Addressing is enabled. In such systems, it is + valid to access the memory using either pointer on devices that have a + non-zero value for the device attribute. Note however that such devices + should access the memory using only one of the two pointers and not + both. + + `Flags` provides for future releases. For now, it must be set to 0. + + Parameters + ---------- + p : Any + Host pointer + Flags : unsigned int + Options (must be 0) + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pdptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaHostGetDevicePointer` + """ + cdef CUdeviceptr pdptr = CUdeviceptr() + cdef _HelperInputVoidPtrStruct cypHelper + cdef void* cyp = _helper_input_void_ptr(p, &cypHelper) + with nogil: + err = cydriver.cuMemHostGetDevicePointer(pdptr._pvt_ptr, cyp, Flags) + _helper_input_void_ptr_free(&cypHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pdptr) + +@cython.embedsignature(True) +def cuMemHostGetFlags(p): + """ Passes back flags that were used for a pinned allocation. + + Passes back the flags `pFlags` that were specified when allocating the + pinned host buffer `p` allocated by :py:obj:`~.cuMemHostAlloc`. + + :py:obj:`~.cuMemHostGetFlags()` will fail if the pointer does not + reside in an allocation performed by :py:obj:`~.cuMemAllocHost()` or + :py:obj:`~.cuMemHostAlloc()`. + + Parameters + ---------- + p : Any + Host pointer + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pFlags : unsigned int + Returned flags word + + See Also + -------- + :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cudaHostGetFlags` + """ + cdef unsigned int pFlags = 0 + cdef _HelperInputVoidPtrStruct cypHelper + cdef void* cyp = _helper_input_void_ptr(p, &cypHelper) + with nogil: + err = cydriver.cuMemHostGetFlags(&pFlags, cyp) + _helper_input_void_ptr_free(&cypHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pFlags) + +@cython.embedsignature(True) +def cuMemAllocManaged(size_t bytesize, unsigned int flags): + """ Allocates memory that will be automatically managed by the Unified Memory system. + + Allocates `bytesize` bytes of managed memory on the device and returns + in `*dptr` a pointer to the allocated memory. If the device doesn't + support allocating managed memory, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + is returned. Support for managed memory can be queried using the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`. The allocated + memory is suitably aligned for any kind of variable. The memory is not + cleared. If `bytesize` is 0, :py:obj:`~.cuMemAllocManaged` returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. The pointer is valid on the CPU + and on all GPUs in the system that support managed memory. All accesses + to this pointer must obey the Unified Memory programming model. + + `flags` specifies the default stream association for this allocation. + `flags` must be one of :py:obj:`~.CU_MEM_ATTACH_GLOBAL` or + :py:obj:`~.CU_MEM_ATTACH_HOST`. If :py:obj:`~.CU_MEM_ATTACH_GLOBAL` is + specified, then this memory is accessible from any stream on any + device. If :py:obj:`~.CU_MEM_ATTACH_HOST` is specified, then the + allocation should not be accessed from devices that have a zero value + for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`; an explicit + call to :py:obj:`~.cuStreamAttachMemAsync` will be required to enable + access on such devices. + + If the association is later changed via + :py:obj:`~.cuStreamAttachMemAsync` to a single stream, the default + association as specified during :py:obj:`~.cuMemAllocManaged` is + restored when that stream is destroyed. For managed variables, the + default association is always :py:obj:`~.CU_MEM_ATTACH_GLOBAL`. Note + that destroying a stream is an asynchronous operation, and as a result, + the change to default association won't happen until all work in the + stream has completed. + + Memory allocated with :py:obj:`~.cuMemAllocManaged` should be released + with :py:obj:`~.cuMemFree`. + + Device memory oversubscription is possible for GPUs that have a non- + zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Managed + memory on such GPUs may be evicted from device memory to host memory at + any time by the Unified Memory driver in order to make room for other + allocations. + + In a system where all GPUs have a non-zero value for the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`, + managed memory may not be populated when this API returns and instead + may be populated on access. In such systems, managed memory can migrate + to any processor's memory at any time. The Unified Memory driver will + employ heuristics to maintain data locality and prevent excessive page + faults to the extent possible. The application can also guide the + driver about memory usage patterns via :py:obj:`~.cuMemAdvise`. The + application can also explicitly migrate memory to a desired processor's + memory via :py:obj:`~.cuMemPrefetchAsync`. + + In a multi-GPU system where all of the GPUs have a zero value for the + device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` and all the + GPUs have peer-to-peer support with each other, the physical storage + for managed memory is created on the GPU which is active at the time + :py:obj:`~.cuMemAllocManaged` is called. All other GPUs will reference + the data at reduced bandwidth via peer mappings over the PCIe bus. The + Unified Memory driver does not migrate memory among such GPUs. + + In a multi-GPU system where not all GPUs have peer-to-peer support with + each other and where the value of the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` is zero for + at least one of those GPUs, the location chosen for physical storage of + managed memory is system-dependent. + + - On Linux, the location chosen will be device memory as long as the + current set of active contexts are on devices that either have peer- + to-peer support with each other or have a non-zero value for the + device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. If there + is an active context on a GPU that does not have a non-zero value for + that device attribute and it does not have peer-to-peer support with + the other devices that have active contexts on them, then the + location for physical storage will be 'zero-copy' or host memory. + Note that this means that managed memory that is located in device + memory is migrated to host memory if a new context is created on a + GPU that doesn't have a non-zero value for the device attribute and + does not support peer-to-peer with at least one of the other devices + that has an active context. This in turn implies that context + creation may fail if there is insufficient host memory to migrate all + managed allocations. + + - On Windows, the physical storage is always created in 'zero-copy' or + host memory. All GPUs will reference the data at reduced bandwidth + over the PCIe bus. In these circumstances, use of the environment + variable CUDA_VISIBLE_DEVICES is recommended to restrict CUDA to only + use those GPUs that have peer-to-peer support. Alternatively, users + can also set CUDA_MANAGED_FORCE_DEVICE_ALLOC to a non-zero value to + force the driver to always use device memory for physical storage. + When this environment variable is set to a non-zero value, all + contexts created in that process on devices that support managed + memory have to be peer-to-peer compatible with each other. Context + creation will fail if a context is created on a device that supports + managed memory and is not peer-to-peer compatible with any of the + other managed memory supporting devices on which contexts were + previously created, even if those contexts have been destroyed. These + environment variables are described in the CUDA programming guide + under the "CUDA environment variables" section. + + - On ARM, managed memory is not available on discrete gpu with Drive + PX-2. + + Parameters + ---------- + bytesize : size_t + Requested allocation size in bytes + flags : unsigned int + Must be one of :py:obj:`~.CU_MEM_ATTACH_GLOBAL` or + :py:obj:`~.CU_MEM_ATTACH_HOST` + + 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_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + dptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :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:`~.cuDeviceGetAttribute`, :py:obj:`~.cuStreamAttachMemAsync`, :py:obj:`~.cudaMallocManaged` + """ + cdef CUdeviceptr dptr = CUdeviceptr() + with nogil: + err = cydriver.cuMemAllocManaged(dptr._pvt_ptr, bytesize, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dptr) + +ctypedef struct cuAsyncCallbackData_st: + cydriver.CUasyncCallback callback + void *userData + +ctypedef cuAsyncCallbackData_st cuAsyncCallbackData + +@cython.show_performance_hints(False) +cdef void cuAsyncNotificationCallbackWrapper(cydriver.CUasyncNotificationInfo *info, void *data, cydriver.CUasyncCallbackHandle handle) nogil: + cdef cuAsyncCallbackData *cbData = data + with gil: + cbData.callback(info, cbData.userData, handle) + +@cython.embedsignature(True) +def cuDeviceRegisterAsyncNotification(device, callbackFunc, userData): + """ Registers a callback function to receive async notifications. + + Registers `callbackFunc` to receive async notifications. + + The `userData` parameter is passed to the callback function at async + notification time. Likewise, `callback` is also passed to the + callback function to distinguish between multiple registered callbacks. + + The callback function being registered should be designed to return + quickly (~10ms). Any long running tasks should be queued for + execution on an application thread. + + Callbacks may not call cuDeviceRegisterAsyncNotification or + cuDeviceUnregisterAsyncNotification. Doing so will result in + :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`. Async notification callbacks + execute in an undefined order and may be serialized. + + Returns in `*callback` a handle representing the registered callback + instance. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + The device on which to register the callback + callbackFunc : :py:obj:`~.CUasyncCallback` + The function to register as a callback + userData : Any + A generic pointer to user data. This is passed into the callback + function. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + callback : :py:obj:`~.CUasyncCallbackHandle` + A handle representing the registered callback instance + + See Also + -------- + :py:obj:`~.cuDeviceUnregisterAsyncNotification` + """ + cdef cydriver.CUasyncCallback cycallbackFunc + if callbackFunc is None: + pcallbackFunc = 0 + elif isinstance(callbackFunc, (CUasyncCallback,)): + pcallbackFunc = int(callbackFunc) + else: + pcallbackFunc = int(CUasyncCallback(callbackFunc)) + cycallbackFunc = pcallbackFunc + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cuAsyncCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (CUresult.CUDA_ERROR_OUT_OF_MEMORY, None) + cbData.callback = cycallbackFunc + cbData.userData = cyuserData + + cdef CUasyncCallbackHandle callback = CUasyncCallbackHandle() + with nogil: + err = cydriver.cuDeviceRegisterAsyncNotification(cydevice, cuAsyncNotificationCallbackWrapper, cbData, callback._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + free(cbData) + else: + m_global._allocated[int(callback)] = cbData + _helper_input_void_ptr_free(&cyuserDataHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, callback) + +@cython.embedsignature(True) +def cuDeviceUnregisterAsyncNotification(device, callback): + """ Unregisters an async notification callback. + + Unregisters `callback` so that the corresponding callback function will + stop receiving async notifications. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + The device from which to remove `callback`. + callback : :py:obj:`~.CUasyncCallbackHandle` + The callback instance to unregister from receiving async + notifications. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + + See Also + -------- + :py:obj:`~.cuDeviceRegisterAsyncNotification` + """ + cdef cydriver.CUasyncCallbackHandle cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (CUasyncCallbackHandle,)): + pcallback = int(callback) + else: + pcallback = int(CUasyncCallbackHandle(callback)) + cycallback = pcallback + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + with nogil: + err = cydriver.cuDeviceUnregisterAsyncNotification(cydevice, cycallback) + if err == cydriver.CUDA_SUCCESS: + free(m_global._allocated[pcallback]) + m_global._allocated.erase(pcallback) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceGetByPCIBusId(char* pciBusId): + """ Returns a handle to a compute device. + + Returns in `*device` a device handle given a PCI bus ID string. + + where `domain`, `bus`, `device`, and `function` are all hexadecimal + values + + Parameters + ---------- + pciBusId : bytes + String in one of the following forms: + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + dev : :py:obj:`~.CUdevice` + Returned device handle + + See Also + -------- + :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetPCIBusId`, :py:obj:`~.cudaDeviceGetByPCIBusId` + """ + cdef CUdevice dev = CUdevice() + with nogil: + err = cydriver.cuDeviceGetByPCIBusId(dev._pvt_ptr, pciBusId) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dev) + +@cython.embedsignature(True) +def cuDeviceGetPCIBusId(int length, dev): + """ Returns a PCI Bus Id string for the device. + + Returns an ASCII string identifying the device `dev` in the NULL- + terminated string pointed to by `pciBusId`. `length` specifies the + maximum length of the string that may be returned. + + where `domain`, `bus`, `device`, and `function` are all hexadecimal + values. pciBusId should be large enough to store 13 characters + including the NULL-terminator. + + Parameters + ---------- + length : int + Maximum length of string to store in `name` + dev : :py:obj:`~.CUdevice` + Device to get identifier string for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + pciBusId : bytes + Returned identifier string for the device in the following format + + See Also + -------- + :py:obj:`~.cuDeviceGet`, :py:obj:`~.cuDeviceGetAttribute`, :py:obj:`~.cuDeviceGetByPCIBusId`, :py:obj:`~.cudaDeviceGetPCIBusId` + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + pypciBusId = b" " * length + cdef char* pciBusId = pypciBusId + with nogil: + err = cydriver.cuDeviceGetPCIBusId(pciBusId, length, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pypciBusId) + +@cython.embedsignature(True) +def cuIpcGetEventHandle(event): + """ Gets an interprocess handle for a previously allocated event. + + Takes as input a previously allocated event. This event must have been + created with the :py:obj:`~.CU_EVENT_INTERPROCESS` and + :py:obj:`~.CU_EVENT_DISABLE_TIMING` flags set. This opaque handle may + be copied into other processes and opened with + :py:obj:`~.cuIpcOpenEventHandle` to allow efficient hardware + synchronization between GPU work in different processes. + + After the event has been opened in the importing process, + :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventSynchronize`, + :py:obj:`~.cuStreamWaitEvent` and :py:obj:`~.cuEventQuery` may be used + in either process. Performing operations on the imported event after + the exported event has been freed with :py:obj:`~.cuEventDestroy` will + result in undefined behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cuDeviceGetAttribute` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED` + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event allocated with :py:obj:`~.CU_EVENT_INTERPROCESS` and + :py:obj:`~.CU_EVENT_DISABLE_TIMING` flags. + + Returns + ------- + 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 :py:obj:`~.CUipcEventHandle` in which + to return the opaque event handle + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuIpcOpenEventHandle`, :py:obj:`~.cuIpcGetMemHandle`, :py:obj:`~.cuIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle`, :py:obj:`~.cudaIpcGetEventHandle` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + cdef CUipcEventHandle pHandle = CUipcEventHandle() + with nogil: + err = cydriver.cuIpcGetEventHandle(pHandle._pvt_ptr, cyevent) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle) + +@cython.embedsignature(True) +def cuIpcOpenEventHandle(handle not None : CUipcEventHandle): + """ Opens an interprocess event handle for use in the current process. + + Opens an interprocess event handle exported from another process with + :py:obj:`~.cuIpcGetEventHandle`. This function returns a + :py:obj:`~.CUevent` that behaves like a locally created event with the + :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag specified. This event must be + freed with :py:obj:`~.cuEventDestroy`. + + Performing operations on the imported event after the exported event + has been freed with :py:obj:`~.cuEventDestroy` will result in undefined + behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cuapiDeviceGetAttribute` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED` + + Parameters + ---------- + handle : :py:obj:`~.CUipcEventHandle` + Interprocess handle to open + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_MAP_FAILED`, :py:obj:`~.CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phEvent : :py:obj:`~.CUevent` + Returns the imported event + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuIpcGetEventHandle`, :py:obj:`~.cuIpcGetMemHandle`, :py:obj:`~.cuIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle`, :py:obj:`~.cudaIpcOpenEventHandle` + """ + cdef CUevent phEvent = CUevent() + with nogil: + err = cydriver.cuIpcOpenEventHandle(phEvent._pvt_ptr, handle._pvt_ptr[0]) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phEvent) + +@cython.embedsignature(True) +def cuIpcGetMemHandle(dptr): + """ Gets an interprocess memory handle for an existing device memory allocation. + + Takes a pointer to the base of an existing device memory allocation + created with :py:obj:`~.cuMemAlloc` and exports it for use in another + process. This is a lightweight operation and may be called multiple + times on an allocation without adverse effects. + + If a region of memory is freed with :py:obj:`~.cuMemFree` and a + subsequent call to :py:obj:`~.cuMemAlloc` returns memory with the same + device address, :py:obj:`~.cuIpcGetMemHandle` will return a unique + handle for the new memory. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cuapiDeviceGetAttribute` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED` + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + Base pointer to previously allocated device memory + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_MAP_FAILED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pHandle : :py:obj:`~.CUipcMemHandle` + Pointer to user allocated :py:obj:`~.CUipcMemHandle` to return the + handle in. + + See Also + -------- + :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuIpcGetEventHandle`, :py:obj:`~.cuIpcOpenEventHandle`, :py:obj:`~.cuIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle`, :py:obj:`~.cudaIpcGetMemHandle` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef CUipcMemHandle pHandle = CUipcMemHandle() + with nogil: + err = cydriver.cuIpcGetMemHandle(pHandle._pvt_ptr, cydptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle) + +@cython.embedsignature(True) +def cuIpcOpenMemHandle(handle not None : CUipcMemHandle, unsigned int Flags): + """ Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process. + + Maps memory exported from another process with + :py:obj:`~.cuIpcGetMemHandle` into the current device address space. + For contexts on different devices :py:obj:`~.cuIpcOpenMemHandle` can + attempt to enable peer access between the devices as if the user called + :py:obj:`~.cuCtxEnablePeerAccess`. This behavior is controlled by the + :py:obj:`~.CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS` flag. + :py:obj:`~.cuDeviceCanAccessPeer` can determine if a mapping is + possible. + + Contexts that may open :py:obj:`~.CUipcMemHandles` are restricted in + the following way. :py:obj:`~.CUipcMemHandles` from each + :py:obj:`~.CUdevice` in a given process may only be opened by one + :py:obj:`~.CUcontext` per :py:obj:`~.CUdevice` per other process. + + If the memory handle has already been opened by the current context, + the reference count on the handle is incremented by 1 and the existing + device pointer is returned. + + Memory returned from :py:obj:`~.cuIpcOpenMemHandle` must be freed with + :py:obj:`~.cuIpcCloseMemHandle`. + + Calling :py:obj:`~.cuMemFree` on an exported memory region before + calling :py:obj:`~.cuIpcCloseMemHandle` in the importing context will + result in undefined behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cuapiDeviceGetAttribute` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED` + + Parameters + ---------- + handle : :py:obj:`~.CUipcMemHandle` + :py:obj:`~.CUipcMemHandle` to open + Flags : unsigned int + Flags for this operation. Must be specified as + :py:obj:`~.CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_MAP_FAILED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_TOO_MANY_PEERS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pdptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuIpcGetEventHandle`, :py:obj:`~.cuIpcOpenEventHandle`, :py:obj:`~.cuIpcGetMemHandle`, :py:obj:`~.cuIpcCloseMemHandle`, :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cudaIpcOpenMemHandle` + + Notes + ----- + No guarantees are made about the address returned in `*pdptr`. In particular, multiple processes may not receive the same address for the same `handle`. + """ + cdef CUdeviceptr pdptr = CUdeviceptr() + with nogil: + err = cydriver.cuIpcOpenMemHandle(pdptr._pvt_ptr, handle._pvt_ptr[0], Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pdptr) + +@cython.embedsignature(True) +def cuIpcCloseMemHandle(dptr): + """ Attempts to close memory mapped with :py:obj:`~.cuIpcOpenMemHandle`. + + Decrements the reference count of the memory returned by + :py:obj:`~.cuIpcOpenMemHandle` by 1. When the reference count reaches + 0, this API unmaps the memory. The original allocation in the exporting + process as well as imported mappings in other processes will be + unaffected. + + Any resources used to enable peer access will be freed if this is the + last mapping using them. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cuapiDeviceGetAttribute` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED` + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + Device pointer returned by :py:obj:`~.cuIpcOpenMemHandle` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_MAP_FAILED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuIpcGetEventHandle`, :py:obj:`~.cuIpcOpenEventHandle`, :py:obj:`~.cuIpcGetMemHandle`, :py:obj:`~.cuIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + with nogil: + err = cydriver.cuIpcCloseMemHandle(cydptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): + """ Registers an existing host memory range for use by CUDA. + + Page-locks the memory range specified by `p` and `bytesize` and maps it + for the device(s) as specified by `Flags`. This memory range also is + added to the same tracking mechanism as :py:obj:`~.cuMemHostAlloc` to + automatically accelerate calls to functions such as + :py:obj:`~.cuMemcpyHtoD()`. Since the memory can be accessed directly + by the device, it can be read or written with much higher bandwidth + than pageable memory that has not been registered. Page-locking + excessive amounts of memory may degrade system performance, since it + reduces the amount of memory available to the system for paging. As a + result, this function is best used sparingly to register staging areas + for data exchange between host and device. + + On systems where + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES` + is true, :py:obj:`~.cuMemHostRegister` will not page-lock the memory + range specified by `ptr` but only populate unpopulated pages. + + The `Flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.CU_MEMHOSTREGISTER_PORTABLE`: The memory returned by this + call will be considered as pinned memory by all CUDA contexts, not + just the one that performed the allocation. + + - :py:obj:`~.CU_MEMHOSTREGISTER_DEVICEMAP`: Maps the allocation into + the CUDA address space. The device pointer to the memory may be + obtained by calling :py:obj:`~.cuMemHostGetDevicePointer()`. + + - :py:obj:`~.CU_MEMHOSTREGISTER_IOMEMORY`: The pointer is treated as + pointing to some I/O memory space, e.g. the PCI Express resource of a + 3rd party device. + + - :py:obj:`~.CU_MEMHOSTREGISTER_READ_ONLY`: The pointer is treated as + pointing to memory that is considered read-only by the device. On + platforms without + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, + this flag is required in order to register memory mapped to the CPU + as read-only. Support for the use of this flag can be queried from + the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`. + Using this flag with a current context associated with a device that + does not have this attribute set will cause + :py:obj:`~.cuMemHostRegister` to error with CUDA_ERROR_NOT_SUPPORTED. + + All of these flags are orthogonal to one another: a developer may page- + lock memory that is portable or mapped with no restrictions. + + The :py:obj:`~.CU_MEMHOSTREGISTER_DEVICEMAP` flag may be specified on + CUDA contexts for devices that do not support mapped pinned memory. The + failure is deferred to :py:obj:`~.cuMemHostGetDevicePointer()` because + the memory may be mapped into other CUDA contexts via the + :py:obj:`~.CU_MEMHOSTREGISTER_PORTABLE` flag. + + For devices that have a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`, + the memory can also be accessed from the device using the host pointer + `p`. The device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` may or may not match the + original host pointer `ptr` and depends on the devices visible to the + application. If all devices visible to the application have a non-zero + value for the device attribute, the device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` will match the original pointer + `ptr`. If any device visible to the application has a zero value for + the device attribute, the device pointer returned by + :py:obj:`~.cuMemHostGetDevicePointer()` will not match the original + host pointer `ptr`, but it will be suitable for use on all devices + provided Unified Virtual Addressing is enabled. In such systems, it is + valid to access the memory using either pointer on devices that have a + non-zero value for the device attribute. Note however that such devices + should access the memory using only of the two pointers and not both. + + The memory page-locked by this function must be unregistered with + :py:obj:`~.cuMemHostUnregister()`. + + Parameters + ---------- + p : Any + Host pointer to memory to page-lock + bytesize : size_t + Size in bytes of the address range to page-lock + Flags : unsigned int + Flags for allocation request + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuMemHostUnregister`, :py:obj:`~.cuMemHostGetFlags`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cudaHostRegister` + """ + cdef _HelperInputVoidPtrStruct cypHelper + cdef void* cyp = _helper_input_void_ptr(p, &cypHelper) + with nogil: + err = cydriver.cuMemHostRegister(cyp, bytesize, Flags) + _helper_input_void_ptr_free(&cypHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemHostUnregister(p): + """ Unregisters a memory range that was registered with cuMemHostRegister. + + Unmaps the memory range whose base address is specified by `p`, and + makes it pageable again. + + The base address must be the same one specified to + :py:obj:`~.cuMemHostRegister()`. + + Parameters + ---------- + p : Any + Host pointer to memory to unregister + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED`, + + See Also + -------- + :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cudaHostUnregister` + """ + cdef _HelperInputVoidPtrStruct cypHelper + cdef void* cyp = _helper_input_void_ptr(p, &cypHelper) + with nogil: + err = cydriver.cuMemHostUnregister(cyp) + _helper_input_void_ptr_free(&cypHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy(dst, src, size_t ByteCount): + """ Copies memory. + + Copies data between two pointers. `dst` and `src` are base pointers of + the destination and source, respectively. `ByteCount` specifies the + number of bytes to copy. Note that this function infers the type of the + transfer (host to host, host to device, device to device, or device to + host) from the pointer values. This function is only allowed in + contexts which support unified addressing. + + Parameters + ---------- + dst : :py:obj:`~.CUdeviceptr` + Destination unified virtual address space pointer + src : :py:obj:`~.CUdeviceptr` + Source unified virtual address space pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.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:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol` + """ + cdef cydriver.CUdeviceptr cysrc + if src is None: + psrc = 0 + elif isinstance(src, (CUdeviceptr,)): + psrc = int(src) + else: + psrc = int(CUdeviceptr(src)) + cysrc = psrc + cdef cydriver.CUdeviceptr cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (CUdeviceptr,)): + pdst = int(dst) + else: + pdst = int(CUdeviceptr(dst)) + cydst = pdst + with nogil: + err = cydriver.cuMemcpy(cydst, cysrc, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount): + """ Copies device memory between two contexts. + + Copies from device memory in one context to device memory in another + context. `dstDevice` is the base device pointer of the destination + memory and `dstContext` is the destination context. `srcDevice` is the + base device pointer of the source memory and `srcContext` is the source + pointer. `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstContext : :py:obj:`~.CUcontext` + Destination context + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + srcContext : :py:obj:`~.CUcontext` + Source context + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpy3DPeer`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyPeerAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cudaMemcpyPeer` + """ + cdef cydriver.CUcontext cysrcContext + if srcContext is None: + psrcContext = 0 + elif isinstance(srcContext, (CUcontext,)): + psrcContext = int(srcContext) + else: + psrcContext = int(CUcontext(srcContext)) + cysrcContext = psrcContext + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef cydriver.CUcontext cydstContext + if dstContext is None: + pdstContext = 0 + elif isinstance(dstContext, (CUcontext,)): + pdstContext = int(dstContext) + else: + pdstContext = int(CUcontext(dstContext)) + cydstContext = pdstContext + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemcpyPeer(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): + """ Copies memory from Host to Device. + + Copies from host memory to device memory. `dstDevice` and `srcHost` are + the base addresses of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + srcHost : Any + Source host pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.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:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyToSymbol` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + cdef _HelperInputVoidPtrStruct cysrcHostHelper + cdef void* cysrcHost = _helper_input_void_ptr(srcHost, &cysrcHostHelper) + with nogil: + err = cydriver.cuMemcpyHtoD(cydstDevice, cysrcHost, ByteCount) + _helper_input_void_ptr_free(&cysrcHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): + """ Copies memory from Device to Host. + + Copies from device to host memory. `dstHost` and `srcDevice` specify + the base pointers of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstHost : Any + Destination host pointer + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.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:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyFromSymbol` + """ + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef _HelperInputVoidPtrStruct cydstHostHelper + cdef void* cydstHost = _helper_input_void_ptr(dstHost, &cydstHostHelper) + with nogil: + err = cydriver.cuMemcpyDtoH(cydstHost, cysrcDevice, ByteCount) + _helper_input_void_ptr_free(&cydstHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyDtoD(dstDevice, srcDevice, size_t ByteCount): + """ Copies memory from Device to Device. + + Copies from device memory to device memory. `dstDevice` and `srcDevice` + are the base pointers of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.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:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol` + """ + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemcpyDtoD(cydstDevice, cysrcDevice, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyDtoA(dstArray, size_t dstOffset, srcDevice, size_t ByteCount): + """ Copies memory from Device to Array. + + Copies from device memory to a 1D CUDA array. `dstArray` and + `dstOffset` specify the CUDA array handle and starting index of the + destination data. `srcDevice` specifies the base pointer of the source. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstArray : :py:obj:`~.CUarray` + Destination array + dstOffset : size_t + Offset in bytes of destination array + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.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:`~.cudaMemcpyToArray` + """ + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef cydriver.CUarray cydstArray + if dstArray is None: + pdstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + with nogil: + err = cydriver.cuMemcpyDtoA(cydstArray, dstOffset, cysrcDevice, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyAtoD(dstDevice, srcArray, size_t srcOffset, size_t ByteCount): + """ Copies memory from Array to Device. + + Copies from one 1D CUDA array to device memory. `dstDevice` specifies + the base pointer of the destination and must be naturally aligned with + the CUDA array elements. `srcArray` and `srcOffset` specify the CUDA + array handle and the offset in bytes into the array where the copy is + to begin. `ByteCount` specifies the number of bytes to copy and must be + evenly divisible by the array element size. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + srcArray : :py:obj:`~.CUarray` + Source array + srcOffset : size_t + Offset in bytes of source array + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.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:`~.cudaMemcpyFromArray` + """ + cdef cydriver.CUarray cysrcArray + if srcArray is None: + psrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemcpyAtoD(cydstDevice, cysrcArray, srcOffset, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): + """ Copies memory from Host to Array. + + Copies from host memory to a 1D CUDA array. `dstArray` and `dstOffset` + specify the CUDA array handle and starting offset in bytes of the + destination data. `pSrc` specifies the base address of the source. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstArray : :py:obj:`~.CUarray` + Destination array + dstOffset : size_t + Offset in bytes of destination array + srcHost : Any + Source host pointer + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.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:`~.cudaMemcpyToArray` + """ + cdef cydriver.CUarray cydstArray + if dstArray is None: + pdstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + cdef _HelperInputVoidPtrStruct cysrcHostHelper + cdef void* cysrcHost = _helper_input_void_ptr(srcHost, &cysrcHostHelper) + with nogil: + err = cydriver.cuMemcpyHtoA(cydstArray, dstOffset, cysrcHost, ByteCount) + _helper_input_void_ptr_free(&cysrcHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): + """ Copies memory from Array to Host. + + Copies from one 1D CUDA array to host memory. `dstHost` specifies the + base pointer of the destination. `srcArray` and `srcOffset` specify the + CUDA array handle and starting offset in bytes of the source data. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstHost : Any + Destination device pointer + srcArray : :py:obj:`~.CUarray` + Source array + srcOffset : size_t + Offset in bytes of source array + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.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:`~.cudaMemcpyFromArray` + """ + cdef cydriver.CUarray cysrcArray + if srcArray is None: + psrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + cdef _HelperInputVoidPtrStruct cydstHostHelper + cdef void* cydstHost = _helper_input_void_ptr(dstHost, &cydstHostHelper) + with nogil: + err = cydriver.cuMemcpyAtoH(cydstHost, cysrcArray, srcOffset, ByteCount) + _helper_input_void_ptr_free(&cydstHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyAtoA(dstArray, size_t dstOffset, srcArray, size_t srcOffset, size_t ByteCount): + """ Copies memory from Array to Array. + + Copies from one 1D CUDA array to another. `dstArray` and `srcArray` + specify the handles of the destination and source CUDA arrays for the + copy, respectively. `dstOffset` and `srcOffset` specify the destination + and source offsets in bytes into the CUDA arrays. `ByteCount` is the + number of bytes to be copied. The size of the elements in the CUDA + arrays need not be the same format, but the elements must be the same + size; and count must be evenly divisible by that size. + + Parameters + ---------- + dstArray : :py:obj:`~.CUarray` + Destination array + dstOffset : size_t + Offset in bytes of destination array + srcArray : :py:obj:`~.CUarray` + Source array + srcOffset : size_t + Offset in bytes of source array + ByteCount : size_t + Size of memory copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.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:`~.cudaMemcpyArrayToArray` + """ + cdef cydriver.CUarray cysrcArray + if srcArray is None: + psrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + cdef cydriver.CUarray cydstArray + if dstArray is None: + pdstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + with nogil: + err = cydriver.cuMemcpyAtoA(cydstArray, dstOffset, cysrcArray, srcOffset, ByteCount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy2D(pCopy : Optional[CUDA_MEMCPY2D]): + """ Copies memory for 2D arrays. + + Perform a 2D memory copy according to the parameters specified in + `pCopy`. The :py:obj:`~.CUDA_MEMCPY2D` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.srcMemoryType` and :py:obj:`~.dstMemoryType` specify the + type of memory of the source and destination, respectively; + :py:obj:`~.CUmemorytype_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.srcArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.srcHost` and :py:obj:`~.srcPitch` specify the (host) base + address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (device) + base address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.srcArray` specifies the handle of the source data. + :py:obj:`~.srcHost`, :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` are + ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.dstHost` and :py:obj:`~.dstPitch` specify the (host) base + address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.dstArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (device) + base address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.dstArray` specifies the handle of the destination data. + :py:obj:`~.dstHost`, :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` are + ignored. + + - :py:obj:`~.srcXInBytes` and :py:obj:`~.srcY` specify the base address + of the source data for the copy. + + For host pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.srcXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.dstXInBytes` and :py:obj:`~.dstY` specify the base address + of the destination data for the copy. + + For host pointers, the base address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.dstXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.WidthInBytes` and :py:obj:`~.Height` specify the width (in + bytes) and height of the 2D copy being performed. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + :py:obj:`~.cuMemcpy2D()` returns an error if any pitch is greater than + the maximum allowed (:py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`). + :py:obj:`~.cuMemAllocPitch()` passes back pitches that always work with + :py:obj:`~.cuMemcpy2D()`. On intra-device memory copies (device to + device, CUDA array to device, CUDA array to CUDA array), + :py:obj:`~.cuMemcpy2D()` may fail for pitches not computed by + :py:obj:`~.cuMemAllocPitch()`. :py:obj:`~.cuMemcpy2DUnaligned()` does + not have this restriction, but may run significantly slower in the + cases where :py:obj:`~.cuMemcpy2D()` would have returned an error code. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY2D` + Parameters for the memory copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.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 + with nogil: + err = cydriver.cuMemcpy2D(cypCopy_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy2DUnaligned(pCopy : Optional[CUDA_MEMCPY2D]): + """ Copies memory for 2D arrays. + + Perform a 2D memory copy according to the parameters specified in + `pCopy`. The :py:obj:`~.CUDA_MEMCPY2D` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.srcMemoryType` and :py:obj:`~.dstMemoryType` specify the + type of memory of the source and destination, respectively; + :py:obj:`~.CUmemorytype_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.srcArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.srcHost` and :py:obj:`~.srcPitch` specify the (host) base + address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (device) + base address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.srcArray` specifies the handle of the source data. + :py:obj:`~.srcHost`, :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` are + ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.dstArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.dstHost` and :py:obj:`~.dstPitch` specify the (host) base + address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (device) + base address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.dstArray` specifies the handle of the destination data. + :py:obj:`~.dstHost`, :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` are + ignored. + + - :py:obj:`~.srcXInBytes` and :py:obj:`~.srcY` specify the base address + of the source data for the copy. + + For host pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.srcXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.dstXInBytes` and :py:obj:`~.dstY` specify the base address + of the destination data for the copy. + + For host pointers, the base address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.dstXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.WidthInBytes` and :py:obj:`~.Height` specify the width (in + bytes) and height of the 2D copy being performed. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + :py:obj:`~.cuMemcpy2D()` returns an error if any pitch is greater than + the maximum allowed (:py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`). + :py:obj:`~.cuMemAllocPitch()` passes back pitches that always work with + :py:obj:`~.cuMemcpy2D()`. On intra-device memory copies (device to + device, CUDA array to device, CUDA array to CUDA array), + :py:obj:`~.cuMemcpy2D()` may fail for pitches not computed by + :py:obj:`~.cuMemAllocPitch()`. :py:obj:`~.cuMemcpy2DUnaligned()` does + not have this restriction, but may run significantly slower in the + cases where :py:obj:`~.cuMemcpy2D()` would have returned an error code. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY2D` + Parameters for the memory copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.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 + with nogil: + err = cydriver.cuMemcpy2DUnaligned(cypCopy_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy3D(pCopy : Optional[CUDA_MEMCPY3D]): + """ Copies memory for 3D arrays. + + Perform a 3D memory copy according to the parameters specified in + `pCopy`. The :py:obj:`~.CUDA_MEMCPY3D` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.srcMemoryType` and :py:obj:`~.dstMemoryType` specify the + type of memory of the source and destination, respectively; + :py:obj:`~.CUmemorytype_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.srcArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.srcHost`, :py:obj:`~.srcPitch` and :py:obj:`~.srcHeight` + specify the (host) base address of the source data, the bytes per row, + and the height of each 2D slice of the 3D array. :py:obj:`~.srcArray` + is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.srcDevice`, :py:obj:`~.srcPitch` and :py:obj:`~.srcHeight` + specify the (device) base address of the source data, the bytes per + row, and the height of each 2D slice of the 3D array. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.srcArray` specifies the handle of the source data. + :py:obj:`~.srcHost`, :py:obj:`~.srcDevice`, :py:obj:`~.srcPitch` and + :py:obj:`~.srcHeight` are ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.dstArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.dstHost` and :py:obj:`~.dstPitch` specify the (host) base + address of the destination data, the bytes per row, and the height of + each 2D slice of the 3D array. :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (device) + base address of the destination data, the bytes per row, and the height + of each 2D slice of the 3D array. :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.dstArray` specifies the handle of the destination data. + :py:obj:`~.dstHost`, :py:obj:`~.dstDevice`, :py:obj:`~.dstPitch` and + :py:obj:`~.dstHeight` are ignored. + + - :py:obj:`~.srcXInBytes`, :py:obj:`~.srcY` and :py:obj:`~.srcZ` + specify the base address of the source data for the copy. + + For host pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.srcXInBytes` must be evenly divisible by + the array element size. + + - dstXInBytes, :py:obj:`~.dstY` and :py:obj:`~.dstZ` specify the base + address of the destination data for the copy. + + For host pointers, the base address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.dstXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.WidthInBytes`, :py:obj:`~.Height` and :py:obj:`~.Depth` + specify the width (in bytes), height and depth of the 3D copy being + performed. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + - If specified, :py:obj:`~.srcHeight` must be greater than or equal to + :py:obj:`~.Height` + :py:obj:`~.srcY`, and :py:obj:`~.dstHeight` must + be greater than or equal to :py:obj:`~.Height` + :py:obj:`~.dstY`. + + :py:obj:`~.cuMemcpy3D()` returns an error if any pitch is greater than + the maximum allowed (:py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`). + + The :py:obj:`~.srcLOD` and :py:obj:`~.dstLOD` members of the + :py:obj:`~.CUDA_MEMCPY3D` structure must be set to 0. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY3D` + Parameters for the memory copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.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 + with nogil: + err = cydriver.cuMemcpy3D(cypCopy_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy3DPeer(pCopy : Optional[CUDA_MEMCPY3D_PEER]): + """ Copies memory between contexts. + + Perform a 3D memory copy according to the parameters specified in + `pCopy`. See the definition of the :py:obj:`~.CUDA_MEMCPY3D_PEER` + structure for documentation of its parameters. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY3D_PEER` + Parameters for the memory copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.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 + with nogil: + err = cydriver.cuMemcpy3DPeer(cypCopy_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyAsync(dst, src, size_t ByteCount, hStream): + """ Copies memory asynchronously. + + Copies data between two pointers. `dst` and `src` are base pointers of + the destination and source, respectively. `ByteCount` specifies the + number of bytes to copy. Note that this function infers the type of the + transfer (host to host, host to device, device to device, or device to + host) from the pointer values. This function is only allowed in + contexts which support unified addressing. + + Parameters + ---------- + dst : :py:obj:`~.CUdeviceptr` + Destination unified virtual address space pointer + src : :py:obj:`~.CUdeviceptr` + Source unified virtual address space pointer + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync` + """ + 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.CUdeviceptr cysrc + if src is None: + psrc = 0 + elif isinstance(src, (CUdeviceptr,)): + psrc = int(src) + else: + psrc = int(CUdeviceptr(src)) + cysrc = psrc + cdef cydriver.CUdeviceptr cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (CUdeviceptr,)): + pdst = int(dst) + else: + pdst = int(CUdeviceptr(dst)) + cydst = pdst + with nogil: + err = cydriver.cuMemcpyAsync(cydst, cysrc, ByteCount, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount, hStream): + """ Copies device memory between two contexts asynchronously. + + Copies from device memory in one context to device memory in another + context. `dstDevice` is the base device pointer of the destination + memory and `dstContext` is the destination context. `srcDevice` is the + base device pointer of the source memory and `srcContext` is the source + pointer. `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstContext : :py:obj:`~.CUcontext` + Destination context + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + srcContext : :py:obj:`~.CUcontext` + Source context + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpy3DPeer`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cudaMemcpyPeerAsync` + """ + 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.CUcontext cysrcContext + if srcContext is None: + psrcContext = 0 + elif isinstance(srcContext, (CUcontext,)): + psrcContext = int(srcContext) + else: + psrcContext = int(CUcontext(srcContext)) + cysrcContext = psrcContext + cdef cydriver.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef cydriver.CUcontext cydstContext + if dstContext is None: + pdstContext = 0 + elif isinstance(dstContext, (CUcontext,)): + pdstContext = int(dstContext) + else: + pdstContext = int(CUcontext(dstContext)) + cydstContext = pdstContext + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemcpyPeerAsync(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): + """ Copies memory from Host to Device. + + Copies from host memory to device memory. `dstDevice` and `srcHost` are + the base addresses of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + srcHost : Any + Source host pointer + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + cdef _HelperInputVoidPtrStruct cysrcHostHelper + cdef void* cysrcHost = _helper_input_void_ptr(srcHost, &cysrcHostHelper) + with nogil: + err = cydriver.cuMemcpyHtoDAsync(cydstDevice, cysrcHost, ByteCount, cyhStream) + _helper_input_void_ptr_free(&cysrcHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): + """ Copies memory from Device to Host. + + Copies from device to host memory. `dstHost` and `srcDevice` specify + the base pointers of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstHost : Any + Destination host pointer + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync` + """ + 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.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef _HelperInputVoidPtrStruct cydstHostHelper + cdef void* cydstHost = _helper_input_void_ptr(dstHost, &cydstHostHelper) + with nogil: + err = cydriver.cuMemcpyDtoHAsync(cydstHost, cysrcDevice, ByteCount, cyhStream) + _helper_input_void_ptr_free(&cydstHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyDtoDAsync(dstDevice, srcDevice, size_t ByteCount, hStream): + """ Copies memory from Device to Device. + + Copies from device memory to device memory. `dstDevice` and `srcDevice` + are the base pointers of the destination and source, respectively. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + srcDevice : :py:obj:`~.CUdeviceptr` + Source device pointer + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync` + """ + 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.CUdeviceptr cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdeviceptr,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdeviceptr(srcDevice)) + cysrcDevice = psrcDevice + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemcpyDtoDAsync(cydstDevice, cysrcDevice, ByteCount, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hStream): + """ Copies memory from Host to Array. + + Copies from host memory to a 1D CUDA array. `dstArray` and `dstOffset` + specify the CUDA array handle and starting offset in bytes of the + destination data. `srcHost` specifies the base address of the source. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstArray : :py:obj:`~.CUarray` + Destination array + dstOffset : size_t + Offset in bytes of destination array + srcHost : Any + Source host pointer + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyToArrayAsync` + """ + 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.CUarray cydstArray + if dstArray is None: + pdstArray = 0 + elif isinstance(dstArray, (CUarray,)): + pdstArray = int(dstArray) + else: + pdstArray = int(CUarray(dstArray)) + cydstArray = pdstArray + cdef _HelperInputVoidPtrStruct cysrcHostHelper + cdef void* cysrcHost = _helper_input_void_ptr(srcHost, &cysrcHostHelper) + with nogil: + err = cydriver.cuMemcpyHtoAAsync(cydstArray, dstOffset, cysrcHost, ByteCount, cyhStream) + _helper_input_void_ptr_free(&cysrcHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hStream): + """ Copies memory from Array to Host. + + Copies from one 1D CUDA array to host memory. `dstHost` specifies the + base pointer of the destination. `srcArray` and `srcOffset` specify the + CUDA array handle and starting offset in bytes of the source data. + `ByteCount` specifies the number of bytes to copy. + + Parameters + ---------- + dstHost : Any + Destination pointer + srcArray : :py:obj:`~.CUarray` + Source array + srcOffset : size_t + Offset in bytes of source array + ByteCount : size_t + Size of memory copy in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpyFromArrayAsync` + """ + 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.CUarray cysrcArray + if srcArray is None: + psrcArray = 0 + elif isinstance(srcArray, (CUarray,)): + psrcArray = int(srcArray) + else: + psrcArray = int(CUarray(srcArray)) + cysrcArray = psrcArray + cdef _HelperInputVoidPtrStruct cydstHostHelper + cdef void* cydstHost = _helper_input_void_ptr(dstHost, &cydstHostHelper) + with nogil: + err = cydriver.cuMemcpyAtoHAsync(cydstHost, cysrcArray, srcOffset, ByteCount, cyhStream) + _helper_input_void_ptr_free(&cydstHostHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemcpy2DAsync(pCopy : Optional[CUDA_MEMCPY2D], hStream): + """ Copies memory for 2D arrays. + + Perform a 2D memory copy according to the parameters specified in + `pCopy`. The :py:obj:`~.CUDA_MEMCPY2D` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.srcMemoryType` and :py:obj:`~.dstMemoryType` specify the + type of memory of the source and destination, respectively; + :py:obj:`~.CUmemorytype_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.srcHost` and :py:obj:`~.srcPitch` specify the (host) base + address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.srcArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (device) + base address of the source data and the bytes per row to apply. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.srcArray` specifies the handle of the source data. + :py:obj:`~.srcHost`, :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` are + ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.dstArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.dstHost` and :py:obj:`~.dstPitch` specify the (host) base + address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (device) + base address of the destination data and the bytes per row to apply. + :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.dstArray` specifies the handle of the destination data. + :py:obj:`~.dstHost`, :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` are + ignored. + + - :py:obj:`~.srcXInBytes` and :py:obj:`~.srcY` specify the base address + of the source data for the copy. + + For host pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.srcXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.dstXInBytes` and :py:obj:`~.dstY` specify the base address + of the destination data for the copy. + + For host pointers, the base address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.dstXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.WidthInBytes` and :py:obj:`~.Height` specify the width (in + bytes) and height of the 2D copy being performed. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + - If specified, :py:obj:`~.srcHeight` must be greater than or equal to + :py:obj:`~.Height` + :py:obj:`~.srcY`, and :py:obj:`~.dstHeight` must + be greater than or equal to :py:obj:`~.Height` + :py:obj:`~.dstY`. + + :py:obj:`~.cuMemcpy2DAsync()` returns an error if any pitch is greater + than the maximum allowed (:py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`). + :py:obj:`~.cuMemAllocPitch()` passes back pitches that always work with + :py:obj:`~.cuMemcpy2D()`. On intra-device memory copies (device to + device, CUDA array to device, CUDA array to CUDA array), + :py:obj:`~.cuMemcpy2DAsync()` may fail for pitches not computed by + :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY2D` + Parameters for the memory copy + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :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:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync` + """ + 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.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),) + +@cython.embedsignature(True) +def cuMemcpy3DAsync(pCopy : Optional[CUDA_MEMCPY3D], hStream): + """ Copies memory for 3D arrays. + + Perform a 3D memory copy according to the parameters specified in + `pCopy`. The :py:obj:`~.CUDA_MEMCPY3D` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.srcMemoryType` and :py:obj:`~.dstMemoryType` specify the + type of memory of the source and destination, respectively; + :py:obj:`~.CUmemorytype_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.srcDevice` and :py:obj:`~.srcPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.srcArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.srcHost`, :py:obj:`~.srcPitch` and :py:obj:`~.srcHeight` + specify the (host) base address of the source data, the bytes per row, + and the height of each 2D slice of the 3D array. :py:obj:`~.srcArray` + is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.srcDevice`, :py:obj:`~.srcPitch` and :py:obj:`~.srcHeight` + specify the (device) base address of the source data, the bytes per + row, and the height of each 2D slice of the 3D array. + :py:obj:`~.srcArray` is ignored. + + If :py:obj:`~.srcMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.srcArray` specifies the handle of the source data. + :py:obj:`~.srcHost`, :py:obj:`~.srcDevice`, :py:obj:`~.srcPitch` and + :py:obj:`~.srcHeight` are ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_UNIFIED`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (unified + virtual address space) base address of the source data and the bytes + per row to apply. :py:obj:`~.dstArray` is ignored. This value may be + used only if unified addressing is supported in the calling context. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_HOST`, + :py:obj:`~.dstHost` and :py:obj:`~.dstPitch` specify the (host) base + address of the destination data, the bytes per row, and the height of + each 2D slice of the 3D array. :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_DEVICE`, + :py:obj:`~.dstDevice` and :py:obj:`~.dstPitch` specify the (device) + base address of the destination data, the bytes per row, and the height + of each 2D slice of the 3D array. :py:obj:`~.dstArray` is ignored. + + If :py:obj:`~.dstMemoryType` is :py:obj:`~.CU_MEMORYTYPE_ARRAY`, + :py:obj:`~.dstArray` specifies the handle of the destination data. + :py:obj:`~.dstHost`, :py:obj:`~.dstDevice`, :py:obj:`~.dstPitch` and + :py:obj:`~.dstHeight` are ignored. + + - :py:obj:`~.srcXInBytes`, :py:obj:`~.srcY` and :py:obj:`~.srcZ` + specify the base address of the source data for the copy. + + For host pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.srcXInBytes` must be evenly divisible by + the array element size. + + - dstXInBytes, :py:obj:`~.dstY` and :py:obj:`~.dstZ` specify the base + address of the destination data for the copy. + + For host pointers, the base address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For device pointers, the starting address is + + **View CUDA Toolkit Documentation for a C++ code example** + + For CUDA arrays, :py:obj:`~.dstXInBytes` must be evenly divisible by + the array element size. + + - :py:obj:`~.WidthInBytes`, :py:obj:`~.Height` and :py:obj:`~.Depth` + specify the width (in bytes), height and depth of the 3D copy being + performed. + + - If specified, :py:obj:`~.srcPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + :py:obj:`~.srcXInBytes`, and + :py:obj:`~.dstPitch` must be greater than or equal to + :py:obj:`~.WidthInBytes` + dstXInBytes. + + - If specified, :py:obj:`~.srcHeight` must be greater than or equal to + :py:obj:`~.Height` + :py:obj:`~.srcY`, and :py:obj:`~.dstHeight` must + be greater than or equal to :py:obj:`~.Height` + :py:obj:`~.dstY`. + + :py:obj:`~.cuMemcpy3DAsync()` returns an error if any pitch is greater + than the maximum allowed (:py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_PITCH`). + + The :py:obj:`~.srcLOD` and :py:obj:`~.dstLOD` members of the + :py:obj:`~.CUDA_MEMCPY3D` structure must be set to 0. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY3D` + Parameters for the memory copy + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.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:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemcpy3DAsync` + """ + 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.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),) + +@cython.embedsignature(True) +def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): + """ Copies memory between contexts asynchronously. + + Perform a 3D memory copy according to the parameters specified in + `pCopy`. See the definition of the :py:obj:`~.CUDA_MEMCPY3D_PEER` + structure for documentation of its parameters. + + Parameters + ---------- + pCopy : :py:obj:`~.CUDA_MEMCPY3D_PEER` + Parameters for the memory copy + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyPeerAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync` + """ + 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.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),) + +@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): + """ Performs a batch of memory copies asynchronously. + + Performs a batch of memory copies. The batch as a whole executes in + stream order but copies within a batch are not guaranteed to execute in + any specific order. This API only supports pointer-to-pointer copies. + For copies involving CUDA arrays, please see + :py:obj:`~.cuMemcpy3DBatchAsync`. + + Performs memory copies from source buffers specified in `srcs` to + destination buffers specified in `dsts`. The size of each copy is + specified in `sizes`. All three arrays must be of the same length as + specified by `count`. Since there are no ordering guarantees for copies + within a batch, specifying any dependent copies within a batch will + result in undefined behavior. + + Every copy in the batch has to be associated with a set of attributes + specified in the `attrs` array. Each entry in this array can apply to + more than one copy. This can be done by specifying in the `attrsIdxs` + array, the index of the first copy that the corresponding entry in the + `attrs` array applies to. Both `attrs` and `attrsIdxs` must be of the + same length as specified by `numAttrs`. For example, if a batch has 10 + copies listed in dst/src/sizes, the first 6 of which have one set of + attributes and the remaining 4 another, then `numAttrs` will be 2, + `attrsIdxs` will be {0, 6} and `attrs` will contains the two sets of + attributes. Note that the first entry in `attrsIdxs` must always be 0. + Also, each entry must be greater than the previous entry and the last + entry should be less than `count`. Furthermore, `numAttrs` must be + lesser than or equal to `count`. + + The :py:obj:`~.CUmemcpyAttributes.srcAccessOrder` indicates the source + access ordering to be observed for copies associated with the + attribute. If the source access order is set to + :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`, then the source will be + accessed in stream order. If the source access order is set to + :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL` then it + 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. If the source access order + is set to :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_ANY` then it 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. Each memcpy operation in the batch must have a valid + :py:obj:`~.CUmemcpyAttributes` corresponding to it including the + appropriate srcAccessOrder setting, otherwise the API will return + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + The :py:obj:`~.CUmemcpyAttributes.srcLocHint` and + :py:obj:`~.CUmemcpyAttributes.dstLocHint` allows applications to + specify hint locations for operands of a copy when the operand doesn't + have a fixed location. That is, these hints are only applicable 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. For + other cases, these hints are ignored. + + The :py:obj:`~.CUmemcpyAttributes.flags` field can be used to specify + certain flags for copies. Setting the + :py:obj:`~.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE` flag indicates + that the associated copies should preferably overlap with any compute + work. Note that this flag is a hint and can be ignored depending on the + platform and other parameters of the copy. + + If any error is encountered while parsing the batch, the index within + the batch where the error was encountered will be returned in + `failIdx`. + + Parameters + ---------- + dsts : list[:py:obj:`~.CUdeviceptr`] + Array of destination pointers. + srcs : list[:py:obj:`~.CUdeviceptr`] + Array of memcpy source pointers. + sizes : list[int] + Array of sizes for memcpy operations. + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays + attrs : list[:py:obj:`~.CUmemcpyAttributes`] + Array of memcpy attributes. + attrsIdxs : list[int] + Array of indices to specify which copies each entry in the `attrs` + array applies to. The attributes specified in attrs[k] will be + applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] + - 1. Also attrs[numAttrs-1] will apply to copies starting from + attrsIdxs[numAttrs-1] through count - 1. + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + failIdx : int + Pointer to a location to return the index of the copy where a + failure was encountered. The value will be SIZE_MAX if the error + doesn't pertain to any specific copy. + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + if not all(isinstance(_x, (int)) for _x in attrsIdxs): + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") + attrs = [] if attrs is None else attrs + if not all(isinstance(_x, (CUmemcpyAttributes,)) for _x in attrs): + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cydriver.CUmemcpyAttributes,] or list[cydriver.CUmemcpyAttributes,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") + srcs = [] if srcs is None else srcs + if not all(isinstance(_x, (CUdeviceptr,)) for _x in srcs): + raise TypeError("Argument 'srcs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") + dsts = [] if dsts is None else dsts + if not all(isinstance(_x, (CUdeviceptr,)) for _x in dsts): + raise TypeError("Argument 'dsts' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") + cdef cydriver.CUdeviceptr* cydsts = NULL + if len(dsts) > 1: + cydsts = calloc(len(dsts), sizeof(cydriver.CUdeviceptr)) + if cydsts is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dsts)) + 'x' + str(sizeof(cydriver.CUdeviceptr))) + else: + for idx in range(len(dsts)): + cydsts[idx] = (dsts[idx])._pvt_ptr[0] + elif len(dsts) == 1: + cydsts = (dsts[0])._pvt_ptr + cdef cydriver.CUdeviceptr* cysrcs = NULL + if len(srcs) > 1: + cysrcs = calloc(len(srcs), sizeof(cydriver.CUdeviceptr)) + if cysrcs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(srcs)) + 'x' + str(sizeof(cydriver.CUdeviceptr))) + else: + for idx in range(len(srcs)): + cysrcs[idx] = (srcs[idx])._pvt_ptr[0] + elif len(srcs) == 1: + cysrcs = (srcs[0])._pvt_ptr + cdef vector[size_t] cysizes = sizes + if count > len(dsts): raise RuntimeError("List is too small: " + str(len(dsts)) + " < " + str(count)) + if count > len(srcs): raise RuntimeError("List is too small: " + str(len(srcs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cydriver.CUmemcpyAttributes* cyattrs = NULL + if len(attrs) > 1: + cyattrs = calloc(len(attrs), sizeof(cydriver.CUmemcpyAttributes)) + if cyattrs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(attrs)) + 'x' + str(sizeof(cydriver.CUmemcpyAttributes))) + for idx in range(len(attrs)): + string.memcpy(&cyattrs[idx], (attrs[idx])._pvt_ptr, sizeof(cydriver.CUmemcpyAttributes)) + elif len(attrs) == 1: + cyattrs = (attrs[0])._pvt_ptr + cdef vector[size_t] cyattrsIdxs = attrsIdxs + if numAttrs > len(attrs): raise RuntimeError("List is too small: " + str(len(attrs)) + " < " + str(numAttrs)) + if numAttrs > len(attrsIdxs): raise RuntimeError("List is too small: " + str(len(attrsIdxs)) + " < " + str(numAttrs)) + cdef size_t failIdx = 0 + with nogil: + err = cydriver.cuMemcpyBatchAsync(cydsts, cysrcs, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, &failIdx, cyhStream) + if len(dsts) > 1 and cydsts is not NULL: + free(cydsts) + if len(srcs) > 1 and cysrcs is not NULL: + free(cysrcs) + if len(attrs) > 1 and cyattrs is not NULL: + free(cyattrs) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, failIdx) + +@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): + """ Performs a batch of 3D memory copies asynchronously. + + Performs a batch of memory copies. The batch as a whole executes in + stream order but copies within a batch are not guaranteed to execute in + any specific order. Note that this means specifying any dependent + copies within a batch will result in undefined behavior. + + Performs memory copies as specified in the `opList` array. The length + of this array is specified in `numOps`. Each entry in this array + describes a copy operation. This includes among other things, the + source and destination operands for the copy as specified in + :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP.src` and + :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP.dst` respectively. The source and + destination operands of a copy can either be a pointer or a CUDA array. + The width, height and depth of a copy is specified in + :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP.extent`. The width, height and depth + of a copy are specified in elements and must not be zero. For pointer- + to-pointer copies, the element size is considered to be 1. For pointer + to CUDA array or vice versa copies, the element size is determined by + 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 + 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 + 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:`~.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. + + 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. + + The :py:obj:`~.CUmemcpyAttributes.srcAccessOrder` indicates the source + access ordering to be observed for copies associated with the + attribute. If the source access order is set to + :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`, then the source will be + accessed in stream order. If the source access order is set to + :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL` then it + 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. If the source access order + is set to :py:obj:`~.CU_MEMCPY_SRC_ACCESS_ORDER_ANY` then it 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. Each memcopy operation in `opList` must have a valid + srcAccessOrder setting, otherwise this API will return + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + The :py:obj:`~.CUmemcpyAttributes.flags` field can be used to specify + certain flags for copies. Setting the + :py:obj:`~.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE` flag indicates + that the associated copies should preferably overlap with any compute + work. Note that this flag is a hint and can be ignored depending on the + platform and other parameters of the copy. + + If any error is encountered while parsing the batch, the index within + the batch where the error was encountered will be returned in + `failIdx`. + + Parameters + ---------- + numOps : size_t + Total number of memcpy operations. + opList : list[:py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`] + Array of size `numOps` containing the actual memcpy operations. + flags : unsigned long long + Flags for future use, must be zero now. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be default NULL + stream. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + failIdx : int + Pointer to a location to return the index of the copy where a + failure was encountered. The value will be SIZE_MAX if the error + doesn't pertain to any specific copy. + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + opList = [] if opList is None else opList + if not all(isinstance(_x, (CUDA_MEMCPY3D_BATCH_OP,)) for _x in opList): + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cydriver.CUDA_MEMCPY3D_BATCH_OP,] or list[cydriver.CUDA_MEMCPY3D_BATCH_OP,]") + if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP* cyopList = NULL + if len(opList) > 1: + cyopList = calloc(len(opList), sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP)) + if cyopList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(opList)) + 'x' + str(sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP))) + for idx in range(len(opList)): + string.memcpy(&cyopList[idx], (opList[idx])._pvt_ptr, sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP)) + elif len(opList) == 1: + cyopList = (opList[0])._pvt_ptr + cdef size_t failIdx = 0 + with nogil: + err = cydriver.cuMemcpy3DBatchAsync(numOps, cyopList, &failIdx, flags, cyhStream) + if len(opList) > 1 and cyopList is not NULL: + free(cyopList) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, failIdx) + +@cython.embedsignature(True) +def cuMemsetD8(dstDevice, unsigned char uc, size_t N): + """ Initializes device memory. + + Sets the memory range of `N` 8-bit values to the specified value `uc`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + uc : unsigned char + Value to set + N : size_t + Number of elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD8(cydstDevice, uc, N) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD16(dstDevice, unsigned short us, size_t N): + """ Initializes device memory. + + Sets the memory range of `N` 16-bit values to the specified value `us`. + The `dstDevice` pointer must be two byte aligned. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + us : unsigned short + Value to set + N : size_t + Number of elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD16(cydstDevice, us, N) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD32(dstDevice, unsigned int ui, size_t N): + """ Initializes device memory. + + Sets the memory range of `N` 32-bit values to the specified value `ui`. + The `dstDevice` pointer must be four byte aligned. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + ui : unsigned int + Value to set + N : size_t + Number of elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD32(cydstDevice, ui, N) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D8(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height): + """ Initializes device memory. + + Sets the 2D memory range of `Width` 8-bit values to the specified value + `uc`. `Height` specifies the number of rows to set, and `dstPitch` + specifies the number of bytes between each row. This function performs + fastest when the pitch is one that has been passed back by + :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + uc : unsigned char + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2D` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D8(cydstDevice, dstPitch, uc, Width, Height) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D16(dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height): + """ Initializes device memory. + + Sets the 2D memory range of `Width` 16-bit values to the specified + value `us`. `Height` specifies the number of rows to set, and + `dstPitch` specifies the number of bytes between each row. The + `dstDevice` pointer and `dstPitch` offset must be two byte aligned. + This function performs fastest when the pitch is one that has been + passed back by :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + us : unsigned short + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2D` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D16(cydstDevice, dstPitch, us, Width, Height) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D32(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height): + """ Initializes device memory. + + Sets the 2D memory range of `Width` 32-bit values to the specified + value `ui`. `Height` specifies the number of rows to set, and + `dstPitch` specifies the number of bytes between each row. The + `dstDevice` pointer and `dstPitch` offset must be four byte aligned. + This function performs fastest when the pitch is one that has been + passed back by :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + ui : unsigned int + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2D` + """ + cdef cydriver.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D32(cydstDevice, dstPitch, ui, Width, Height) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD8Async(dstDevice, unsigned char uc, size_t N, hStream): + """ Sets device memory. + + Sets the memory range of `N` 8-bit values to the specified value `uc`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + uc : unsigned char + Value to set + N : size_t + Number of elements + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemsetAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD8Async(cydstDevice, uc, N, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD16Async(dstDevice, unsigned short us, size_t N, hStream): + """ Sets device memory. + + Sets the memory range of `N` 16-bit values to the specified value `us`. + The `dstDevice` pointer must be two byte aligned. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + us : unsigned short + Value to set + N : size_t + Number of elements + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemsetAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD16Async(cydstDevice, us, N, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD32Async(dstDevice, unsigned int ui, size_t N, hStream): + """ Sets device memory. + + Sets the memory range of `N` 32-bit values to the specified value `ui`. + The `dstDevice` pointer must be four byte aligned. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + ui : unsigned int + Value to set + N : size_t + Number of elements + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemsetAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD32Async(cydstDevice, ui, N, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D8Async(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, hStream): + """ Sets device memory. + + Sets the 2D memory range of `Width` 8-bit values to the specified value + `uc`. `Height` specifies the number of rows to set, and `dstPitch` + specifies the number of bytes between each row. This function performs + fastest when the pitch is one that has been passed back by + :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + uc : unsigned char + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2DAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D8Async(cydstDevice, dstPitch, uc, Width, Height, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D16Async(dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, hStream): + """ Sets device memory. + + Sets the 2D memory range of `Width` 16-bit values to the specified + value `us`. `Height` specifies the number of rows to set, and + `dstPitch` specifies the number of bytes between each row. The + `dstDevice` pointer and `dstPitch` offset must be two byte aligned. + This function performs fastest when the pitch is one that has been + passed back by :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + us : unsigned short + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD2D32Async`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2DAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D16Async(cydstDevice, dstPitch, us, Width, Height, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemsetD2D32Async(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, hStream): + """ Sets device memory. + + Sets the 2D memory range of `Width` 32-bit values to the specified + value `ui`. `Height` specifies the number of rows to set, and + `dstPitch` specifies the number of bytes between each row. The + `dstDevice` pointer and `dstPitch` offset must be four byte aligned. + This function performs fastest when the pitch is one that has been + passed back by :py:obj:`~.cuMemAllocPitch()`. + + Parameters + ---------- + dstDevice : :py:obj:`~.CUdeviceptr` + Destination device pointer + dstPitch : size_t + Pitch of destination device pointer(Unused if `Height` is 1) + ui : unsigned int + Value to set + Width : size_t + Width of row + Height : size_t + Number of rows + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cuMemsetD32Async`, :py:obj:`~.cudaMemset2DAsync` + """ + 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.CUdeviceptr cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdeviceptr,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdeviceptr(dstDevice)) + cydstDevice = pdstDevice + with nogil: + err = cydriver.cuMemsetD2D32Async(cydstDevice, dstPitch, ui, Width, Height, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuArrayCreate(pAllocateArray : Optional[CUDA_ARRAY_DESCRIPTOR]): + """ Creates a 1D or 2D CUDA array. + + Creates a CUDA array according to the :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` + structure `pAllocateArray` and returns a handle to the new CUDA array + in `*pHandle`. The :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - `Width`, and `Height` are the width, and height of the CUDA array (in + elements); the CUDA array is one-dimensional if height is 0, two- + dimensional otherwise; + + - :py:obj:`~.Format` specifies the format of the elements; + :py:obj:`~.CUarray_format` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `NumChannels` specifies the number of packed components per CUDA + array element; it may be 1, 2, or 4; + + Here are examples of CUDA array descriptions: + + Description for a CUDA array of 2048 floats: + + **View CUDA Toolkit Documentation for a C++ code example** + + Description for a 64 x 64 CUDA array of floats: + + **View CUDA Toolkit Documentation for a C++ code example** + + Description for a `width` x `height` CUDA array of 64-bit, 4x16-bit + float16's: + + **View CUDA Toolkit Documentation for a C++ code example** + + Description for a `width` x `height` CUDA array of 16-bit elements, + each of which is two 8-bit unsigned chars: + + **View CUDA Toolkit Documentation for a C++ code example** + + Parameters + ---------- + pAllocateArray : :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` + Array descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pHandle : :py:obj:`~.CUarray` + Returned array + + See Also + -------- + :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 + with nogil: + err = cydriver.cuArrayCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle) + +@cython.embedsignature(True) +def cuArrayGetDescriptor(hArray): + """ Get a 1D or 2D CUDA array descriptor. + + Returns in `*pArrayDescriptor` a descriptor containing information on + the format and dimensions of the CUDA array `hArray`. It is useful for + subroutines that have been passed a CUDA array, but need to know the + CUDA array parameters for validation or other purposes. + + Parameters + ---------- + hArray : :py:obj:`~.CUarray` + Array to get descriptor of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + pArrayDescriptor : :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` + Returned array descriptor + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :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:`~.cudaArrayGetInfo` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + cdef CUDA_ARRAY_DESCRIPTOR pArrayDescriptor = CUDA_ARRAY_DESCRIPTOR() + with nogil: + err = cydriver.cuArrayGetDescriptor(pArrayDescriptor._pvt_ptr, cyhArray) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pArrayDescriptor) + +@cython.embedsignature(True) +def cuArrayGetSparseProperties(array): + """ Returns the layout properties of a sparse CUDA array. + + Returns the layout properties of a sparse CUDA array in + `sparseProperties` If the CUDA array is not allocated with flag + :py:obj:`~.CUDA_ARRAY3D_SPARSE` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + will be returned. + + If the returned value in :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.flags` + contains :py:obj:`~.CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`, then + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailSize` represents the + total size of the array. Otherwise, it will be zero. Also, the returned + value in :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailFirstLevel` is + always zero. Note that the `array` must have been allocated using + :py:obj:`~.cuArrayCreate` or :py:obj:`~.cuArray3DCreate`. For CUDA + arrays obtained using :py:obj:`~.cuMipmappedArrayGetLevel`, + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned. Instead, + :py:obj:`~.cuMipmappedArrayGetSparseProperties` must be used to obtain + the sparse properties of the entire CUDA mipmapped array to which + `array` belongs to. + + Parameters + ---------- + array : :py:obj:`~.CUarray` + CUDA array to get the sparse properties of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + sparseProperties : :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES` + Pointer to :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES` + + See Also + -------- + :py:obj:`~.cuMipmappedArrayGetSparseProperties`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cydriver.CUarray cyarray + if array is None: + parray = 0 + elif isinstance(array, (CUarray,)): + parray = int(array) + else: + parray = int(CUarray(array)) + cyarray = parray + cdef CUDA_ARRAY_SPARSE_PROPERTIES sparseProperties = CUDA_ARRAY_SPARSE_PROPERTIES() + with nogil: + err = cydriver.cuArrayGetSparseProperties(sparseProperties._pvt_ptr, cyarray) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, sparseProperties) + +@cython.embedsignature(True) +def cuMipmappedArrayGetSparseProperties(mipmap): + """ Returns the layout properties of a sparse CUDA mipmapped array. + + Returns the sparse array layout properties in `sparseProperties` If the + CUDA mipmapped array is not allocated with flag + :py:obj:`~.CUDA_ARRAY3D_SPARSE` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + will be returned. + + For non-layered CUDA mipmapped arrays, + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailSize` returns the size + of the mip tail region. The mip tail region includes all mip levels + whose width, height or depth is less than that of the tile. For layered + CUDA mipmapped arrays, if + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.flags` contains + :py:obj:`~.CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`, then + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailSize` specifies the size + of the mip tail of all layers combined. Otherwise, + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailSize` specifies mip tail + size per layer. The returned value of + :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailFirstLevel` is valid + only if :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.miptailSize` is non- + zero. + + Parameters + ---------- + mipmap : :py:obj:`~.CUmipmappedArray` + CUDA mipmapped array to get the sparse properties of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + sparseProperties : :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES` + Pointer to :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES` + + See Also + -------- + :py:obj:`~.cuArrayGetSparseProperties`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cydriver.CUmipmappedArray cymipmap + if mipmap is None: + pmipmap = 0 + elif isinstance(mipmap, (CUmipmappedArray,)): + pmipmap = int(mipmap) + else: + pmipmap = int(CUmipmappedArray(mipmap)) + cymipmap = pmipmap + cdef CUDA_ARRAY_SPARSE_PROPERTIES sparseProperties = CUDA_ARRAY_SPARSE_PROPERTIES() + with nogil: + err = cydriver.cuMipmappedArrayGetSparseProperties(sparseProperties._pvt_ptr, cymipmap) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, sparseProperties) + +@cython.embedsignature(True) +def cuArrayGetMemoryRequirements(array, device): + """ Returns the memory requirements of a CUDA array. + + Returns the memory requirements of a CUDA array in `memoryRequirements` + If the CUDA array is not allocated with flag + :py:obj:`~.CUDA_ARRAY3D_DEFERRED_MAPPING` + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned. + + The returned value in :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS.size` + represents the total size of the CUDA array. The returned value in + :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS.alignment` represents the + alignment necessary for mapping the CUDA array. + + Parameters + ---------- + array : :py:obj:`~.CUarray` + CUDA array to get the memory requirements of + device : :py:obj:`~.CUdevice` + Device to get the memory requirements for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + memoryRequirements : :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS` + Pointer to :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS` + + See Also + -------- + :py:obj:`~.cuMipmappedArrayGetMemoryRequirements`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef cydriver.CUarray cyarray + if array is None: + parray = 0 + elif isinstance(array, (CUarray,)): + parray = int(array) + else: + parray = int(CUarray(array)) + cyarray = parray + cdef CUDA_ARRAY_MEMORY_REQUIREMENTS memoryRequirements = CUDA_ARRAY_MEMORY_REQUIREMENTS() + with nogil: + err = cydriver.cuArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cyarray, cydevice) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, memoryRequirements) + +@cython.embedsignature(True) +def cuMipmappedArrayGetMemoryRequirements(mipmap, device): + """ Returns the memory requirements of a CUDA mipmapped array. + + Returns the memory requirements of a CUDA mipmapped array in + `memoryRequirements` If the CUDA mipmapped array is not allocated with + flag :py:obj:`~.CUDA_ARRAY3D_DEFERRED_MAPPING` + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned. + + The returned value in :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS.size` + represents the total size of the CUDA mipmapped array. The returned + value in :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS.alignment` + represents the alignment necessary for mapping the CUDA mipmapped + array. + + Parameters + ---------- + mipmap : :py:obj:`~.CUmipmappedArray` + CUDA mipmapped array to get the memory requirements of + device : :py:obj:`~.CUdevice` + Device to get the memory requirements for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + memoryRequirements : :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS` + Pointer to :py:obj:`~.CUDA_ARRAY_MEMORY_REQUIREMENTS` + + See Also + -------- + :py:obj:`~.cuArrayGetMemoryRequirements`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef cydriver.CUmipmappedArray cymipmap + if mipmap is None: + pmipmap = 0 + elif isinstance(mipmap, (CUmipmappedArray,)): + pmipmap = int(mipmap) + else: + pmipmap = int(CUmipmappedArray(mipmap)) + cymipmap = pmipmap + cdef CUDA_ARRAY_MEMORY_REQUIREMENTS memoryRequirements = CUDA_ARRAY_MEMORY_REQUIREMENTS() + with nogil: + err = cydriver.cuMipmappedArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cymipmap, cydevice) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, memoryRequirements) + +@cython.embedsignature(True) +def cuArrayGetPlane(hArray, unsigned int planeIdx): + """ Gets a CUDA array plane from a CUDA array. + + Returns in `pPlaneArray` a CUDA array that represents a single format + plane of the CUDA array `hArray`. + + If `planeIdx` is greater than the maximum number of planes in this + array or if the array does not have a multi-planar format e.g: + :py:obj:`~.CU_AD_FORMAT_NV12`, then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + Note that if the `hArray` has format :py:obj:`~.CU_AD_FORMAT_NV12`, + then passing in 0 for `planeIdx` returns a CUDA array of the same size + as `hArray` but with one channel and + :py:obj:`~.CU_AD_FORMAT_UNSIGNED_INT8` as its format. If 1 is passed + for `planeIdx`, then the returned CUDA array has half the height and + width of `hArray` with two channels and + :py:obj:`~.CU_AD_FORMAT_UNSIGNED_INT8` as its format. + + Parameters + ---------- + hArray : :py:obj:`~.CUarray` + Multiplanar CUDA array + planeIdx : unsigned int + Plane index + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + pPlaneArray : :py:obj:`~.CUarray` + Returned CUDA array referenced by the `planeIdx` + + See Also + -------- + :py:obj:`~.cuArrayCreate`, :py:obj:`~.cudaArrayGetPlane` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + cdef CUarray pPlaneArray = CUarray() + with nogil: + err = cydriver.cuArrayGetPlane(pPlaneArray._pvt_ptr, cyhArray, planeIdx) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pPlaneArray) + +@cython.embedsignature(True) +def cuArrayDestroy(hArray): + """ Destroys a CUDA array. + + Destroys the CUDA array `hArray`. + + Parameters + ---------- + hArray : :py:obj:`~.CUarray` + Array to destroy + + 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_ARRAY_IS_MAPPED`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :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:`~.cudaFreeArray` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + with nogil: + err = cydriver.cuArrayDestroy(cyhArray) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuArray3DCreate(pAllocateArray : Optional[CUDA_ARRAY3D_DESCRIPTOR]): + """ Creates a 3D CUDA array. + + Creates a CUDA array according to the + :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` structure `pAllocateArray` and + returns a handle to the new CUDA array in `*pHandle`. The + :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - `Width`, `Height`, and `Depth` are the width, height, and depth of + the CUDA array (in elements); the following types of CUDA arrays can + be allocated: + + - A 1D array is allocated if `Height` and `Depth` extents are both + zero. + + - A 2D array is allocated if only `Depth` extent is zero. + + - A 3D array is allocated if all three extents are non-zero. + + - A 1D layered CUDA array is allocated if only `Height` is zero and + the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is set. Each layer is a + 1D array. The number of layers is determined by the depth extent. + + - A 2D layered CUDA array is allocated if all three extents are non- + zero and the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is set. Each + layer is a 2D array. The number of layers is determined by the + depth extent. + + - A cubemap CUDA array is allocated if all three extents are non-zero + and the :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` flag is set. `Width` must + be equal to `Height`, and `Depth` must be six. A cubemap is a + special type of 2D layered CUDA array, where the six layers + represent the six faces of a cube. The order of the six layers in + memory is the same as that listed in + :py:obj:`~.CUarray_cubemap_face`. + + - A cubemap layered CUDA array is allocated if all three extents are + non-zero, and both, :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` and + :py:obj:`~.CUDA_ARRAY3D_LAYERED` flags are set. `Width` must be + equal to `Height`, and `Depth` must be a multiple of six. A cubemap + layered CUDA array is a special type of 2D layered CUDA array that + consists of a collection of cubemaps. The first six layers + represent the first cubemap, the next six layers form the second + cubemap, and so on. + + - :py:obj:`~.Format` specifies the format of the elements; + :py:obj:`~.CUarray_format` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `NumChannels` specifies the number of packed components per CUDA + array element; it may be 1, 2, or 4; + + - :py:obj:`~.Flags` may be set to + + - :py:obj:`~.CUDA_ARRAY3D_LAYERED` to enable creation of layered CUDA + arrays. If this flag is set, `Depth` specifies the number of + layers, not the depth of a 3D array. + + - :py:obj:`~.CUDA_ARRAY3D_SURFACE_LDST` to enable surface references + to be bound to the CUDA array. If this flag is not set, + :py:obj:`~.cuSurfRefSetArray` will fail when attempting to bind the + CUDA array to a surface reference. + + - :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` to enable creation of cubemaps. If + this flag is set, `Width` must be equal to `Height`, and `Depth` + must be six. If the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is also + set, then `Depth` must be a multiple of six. + + - :py:obj:`~.CUDA_ARRAY3D_TEXTURE_GATHER` to indicate that the CUDA + array will be used for texture gather. Texture gather can only be + performed on 2D CUDA arrays. + + `Width`, `Height` and `Depth` must meet certain size requirements as + listed in the following table. All values are specified in elements. + Note that for brevity's sake, the full name of the device attribute is + not specified. For ex., TEXTURE1D_WIDTH refers to the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`. + + Note that 2D CUDA arrays have different size requirements if the + :py:obj:`~.CUDA_ARRAY3D_TEXTURE_GATHER` flag is set. `Width` and + `Height` must not be greater than + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH` and + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT` + respectively, in that case. + + **View CUDA Toolkit Documentation for a table example** + + Here are examples of CUDA array descriptions: + + Description for a CUDA array of 2048 floats: + + **View CUDA Toolkit Documentation for a C++ code example** + + Description for a 64 x 64 CUDA array of floats: + + **View CUDA Toolkit Documentation for a C++ code example** + + Description for a `width` x `height` x `depth` CUDA array of 64-bit, + 4x16-bit float16's: + + **View CUDA Toolkit Documentation for a C++ code example** + + Parameters + ---------- + pAllocateArray : :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` + 3D array descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pHandle : :py:obj:`~.CUarray` + Returned array + + See Also + -------- + :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 + with nogil: + err = cydriver.cuArray3DCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle) + +@cython.embedsignature(True) +def cuArray3DGetDescriptor(hArray): + """ Get a 3D CUDA array descriptor. + + Returns in `*pArrayDescriptor` a descriptor containing information on + the format and dimensions of the CUDA array `hArray`. It is useful for + subroutines that have been passed a CUDA array, but need to know the + CUDA array parameters for validation or other purposes. + + This function may be called on 1D and 2D arrays, in which case the + `Height` and/or `Depth` members of the descriptor struct will be set to + 0. + + Parameters + ---------- + hArray : :py:obj:`~.CUarray` + 3D array to get descriptor of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + pArrayDescriptor : :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` + Returned 3D array descriptor + + See Also + -------- + :py:obj:`~.cuArray3DCreate`, :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:`~.cudaArrayGetInfo` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + cdef CUDA_ARRAY3D_DESCRIPTOR pArrayDescriptor = CUDA_ARRAY3D_DESCRIPTOR() + with nogil: + err = cydriver.cuArray3DGetDescriptor(pArrayDescriptor._pvt_ptr, cyhArray) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pArrayDescriptor) + +@cython.embedsignature(True) +def cuMipmappedArrayCreate(pMipmappedArrayDesc : Optional[CUDA_ARRAY3D_DESCRIPTOR], unsigned int numMipmapLevels): + """ Creates a CUDA mipmapped array. + + Creates a CUDA mipmapped array according to the + :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` structure `pMipmappedArrayDesc` and + returns a handle to the new CUDA mipmapped array in `*pHandle`. + `numMipmapLevels` specifies the number of mipmap levels to be + allocated. This value is clamped to the range [1, 1 + + floor(log2(max(width, height, depth)))]. + + The :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - `Width`, `Height`, and `Depth` are the width, height, and depth of + the CUDA array (in elements); the following types of CUDA arrays can + be allocated: + + - A 1D mipmapped array is allocated if `Height` and `Depth` extents + are both zero. + + - A 2D mipmapped array is allocated if only `Depth` extent is zero. + + - A 3D mipmapped array is allocated if all three extents are non- + zero. + + - A 1D layered CUDA mipmapped array is allocated if only `Height` is + zero and the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is set. Each + layer is a 1D array. The number of layers is determined by the + depth extent. + + - A 2D layered CUDA mipmapped array is allocated if all three extents + are non-zero and the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is set. + Each layer is a 2D array. The number of layers is determined by the + depth extent. + + - A cubemap CUDA mipmapped array is allocated if all three extents + are non-zero and the :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` flag is set. + `Width` must be equal to `Height`, and `Depth` must be six. A + cubemap is a special type of 2D layered CUDA array, where the six + layers represent the six faces of a cube. The order of the six + layers in memory is the same as that listed in + :py:obj:`~.CUarray_cubemap_face`. + + - A cubemap layered CUDA mipmapped array is allocated if all three + extents are non-zero, and both, :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` + and :py:obj:`~.CUDA_ARRAY3D_LAYERED` flags are set. `Width` must be + equal to `Height`, and `Depth` must be a multiple of six. A cubemap + layered CUDA array is a special type of 2D layered CUDA array that + consists of a collection of cubemaps. The first six layers + represent the first cubemap, the next six layers form the second + cubemap, and so on. + + - :py:obj:`~.Format` specifies the format of the elements; + :py:obj:`~.CUarray_format` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `NumChannels` specifies the number of packed components per CUDA + array element; it may be 1, 2, or 4; + + - :py:obj:`~.Flags` may be set to + + - :py:obj:`~.CUDA_ARRAY3D_LAYERED` to enable creation of layered CUDA + mipmapped arrays. If this flag is set, `Depth` specifies the number + of layers, not the depth of a 3D array. + + - :py:obj:`~.CUDA_ARRAY3D_SURFACE_LDST` to enable surface references + to be bound to individual mipmap levels of the CUDA mipmapped + array. If this flag is not set, :py:obj:`~.cuSurfRefSetArray` will + fail when attempting to bind a mipmap level of the CUDA mipmapped + array to a surface reference. + + - :py:obj:`~.CUDA_ARRAY3D_CUBEMAP` to enable creation of mipmapped + cubemaps. If this flag is set, `Width` must be equal to `Height`, and + `Depth` must be six. If the :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is + also set, then `Depth` must be a multiple of six. + + - :py:obj:`~.CUDA_ARRAY3D_TEXTURE_GATHER` to indicate that the CUDA + mipmapped array will be used for texture gather. Texture gather can + only be performed on 2D CUDA mipmapped arrays. + + `Width`, `Height` and `Depth` must meet certain size requirements as + listed in the following table. All values are specified in elements. + Note that for brevity's sake, the full name of the device attribute is + not specified. For ex., TEXTURE1D_MIPMAPPED_WIDTH refers to the device + attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH`. + + **View CUDA Toolkit Documentation for a table example** + + Parameters + ---------- + pMipmappedArrayDesc : :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` + mipmapped array descriptor + numMipmapLevels : unsigned int + Number of mipmap levels + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pHandle : :py:obj:`~.CUmipmappedArray` + Returned mipmapped array + + See Also + -------- + :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 + with nogil: + err = cydriver.cuMipmappedArrayCreate(pHandle._pvt_ptr, cypMipmappedArrayDesc_ptr, numMipmapLevels) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle) + +@cython.embedsignature(True) +def cuMipmappedArrayGetLevel(hMipmappedArray, unsigned int level): + """ Gets a mipmap level of a CUDA mipmapped array. + + Returns in `*pLevelArray` a CUDA array that represents a single mipmap + level of the CUDA mipmapped array `hMipmappedArray`. + + If `level` is greater than the maximum number of levels in this + mipmapped array, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + Parameters + ---------- + hMipmappedArray : :py:obj:`~.CUmipmappedArray` + CUDA mipmapped array + level : unsigned int + Mipmap level + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + pLevelArray : :py:obj:`~.CUarray` + Returned mipmap level CUDA array + + See Also + -------- + :py:obj:`~.cuMipmappedArrayCreate`, :py:obj:`~.cuMipmappedArrayDestroy`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cudaGetMipmappedArrayLevel` + """ + cdef cydriver.CUmipmappedArray cyhMipmappedArray + if hMipmappedArray is None: + phMipmappedArray = 0 + elif isinstance(hMipmappedArray, (CUmipmappedArray,)): + phMipmappedArray = int(hMipmappedArray) + else: + phMipmappedArray = int(CUmipmappedArray(hMipmappedArray)) + cyhMipmappedArray = phMipmappedArray + cdef CUarray pLevelArray = CUarray() + with nogil: + err = cydriver.cuMipmappedArrayGetLevel(pLevelArray._pvt_ptr, cyhMipmappedArray, level) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pLevelArray) + +@cython.embedsignature(True) +def cuMipmappedArrayDestroy(hMipmappedArray): + """ Destroys a CUDA mipmapped array. + + Destroys the CUDA mipmapped array `hMipmappedArray`. + + Parameters + ---------- + hMipmappedArray : :py:obj:`~.CUmipmappedArray` + Mipmapped array to destroy + + 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_ARRAY_IS_MAPPED`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED` + + See Also + -------- + :py:obj:`~.cuMipmappedArrayCreate`, :py:obj:`~.cuMipmappedArrayGetLevel`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cudaFreeMipmappedArray` + """ + cdef cydriver.CUmipmappedArray cyhMipmappedArray + if hMipmappedArray is None: + phMipmappedArray = 0 + elif isinstance(hMipmappedArray, (CUmipmappedArray,)): + phMipmappedArray = int(hMipmappedArray) + else: + phMipmappedArray = int(CUmipmappedArray(hMipmappedArray)) + cyhMipmappedArray = phMipmappedArray + with nogil: + err = cydriver.cuMipmappedArrayDestroy(cyhMipmappedArray) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmemRangeHandleType, unsigned long long flags): + """ Retrieve handle for an address range. + + Get a handle of the specified type to an address range. The address + range must have been obtained by a prior call to either + :py:obj:`~.cuMemAlloc` or :py:obj:`~.cuMemAddressReserve`. If the + address range was obtained via :py:obj:`~.cuMemAddressReserve`, it must + also be fully mapped via :py:obj:`~.cuMemMap`. The address range must + have been obtained by a prior call to either :py:obj:`~.cuMemAllocHost` + or :py:obj:`~.cuMemHostAlloc` on Tegra. + + Users must ensure the `dptr` and `size` are aligned to the host page + size. + + When requesting + CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users are + expected to query for dma_buf support for the platform by using + :py:obj:`~.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED` device attribute + before calling this API. The `handle` will be interpreted as a pointer + to an integer to store the dma_buf file descriptor. Users must ensure + the entire address range is backed and mapped when the address range is + allocated by :py:obj:`~.cuMemAddressReserve`. All the physical + allocations backing the address range must be resident on the same + device and have identical allocation properties. Users are also + expected to retrieve a new handle every time the underlying physical + allocation(s) corresponding to a previously queried VA range are + changed. + + For CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users + may set flags to + :py:obj:`~.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`. Which when set + on a supported platform, will give a DMA_BUF handle mapped via PCIE + BAR1 or will return an error otherwise. + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + Pointer to a valid CUDA device allocation. Must be aligned to host + page size. + size : size_t + Length of the address range. Must be aligned to host page size. + handleType : :py:obj:`~.CUmemRangeHandleType` + Type of handle requested (defines type and size of the `handle` + output parameter) + flags : unsigned long long + When requesting + CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD the value + could be :py:obj:`~.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`, + otherwise 0. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + handle : Any + Pointer to the location where the returned handle will be stored. + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef int handle = 0 + cdef void* cyhandle_ptr = &handle + cdef cydriver.CUmemRangeHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuMemGetHandleForAddressRange(cyhandle_ptr, cydptr, size, cyhandleType, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, handle) + +@cython.embedsignature(True) +def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], size_t count, unsigned int flags, stream): + """ Submit a batch of `count` independent decompression operations. + + Each of the `count` decompression operations is described by a single + entry in the `paramsArray` array. Once the batch has been submitted, + the function will return, and decompression will happen asynchronously + w.r.t. the CPU. To the work completion tracking mechanisms in the CUDA + driver, the batch will be considered a single unit of work and + processed according to stream semantics, i.e., it is not possible to + query the completion of individual decompression operations within a + batch. + + The memory pointed to by each of :py:obj:`~.CUmemDecompressParams.src`, + :py:obj:`~.CUmemDecompressParams.dst`, and + :py:obj:`~.CUmemDecompressParams.dstActBytes`, must be capable of usage + with the hardware decompress feature. That is, for each of said + pointers, the pointer attribute + :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_MEM_DECOMPRESS_CAPABLE` should give + a non-zero value. To ensure this, the memory backing the pointers + should have been allocated using one of the following CUDA memory + allocators: + + - :py:obj:`~.cuMemAlloc()` + + - :py:obj:`~.cuMemCreate()` with the usage flag + :py:obj:`~.CU_MEM_CREATE_USAGE_HW_DECOMPRESS` + + - :py:obj:`~.cuMemAllocFromPoolAsync()` from a pool that was created + with the usage flag + :py:obj:`~.CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS` Additionally, + :py:obj:`~.CUmemDecompressParams.src`, + :py:obj:`~.CUmemDecompressParams.dst`, and + :py:obj:`~.CUmemDecompressParams.dstActBytes`, must all be accessible + from the device associated with the context where `stream` was + created. For information on how to ensure this, see the documentation + for the allocator of interest. + + Parameters + ---------- + paramsArray : :py:obj:`~.CUmemDecompressParams` + The array of structures describing the independent decompression + operations. + count : size_t + The number of entries in `paramsArray` array. + flags : unsigned int + Must be 0. + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream where the work will be enqueued. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + errorIndex : int + The index into `paramsArray` of the decompression operation for + which the error returned by this function pertains to. If `index` + is SIZE_MAX and the value returned is not :py:obj:`~.CUDA_SUCCESS`, + then the error returned by this function should be considered a + general error that does not pertain to a particular decompression + operation. May be `NULL`, in which case, no index will be recorded + in the event of error. + + See Also + -------- + :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemAllocFromPoolAsync` + """ + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + 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) + +@cython.embedsignature(True) +def cuMemAddressReserve(size_t size, size_t alignment, addr, unsigned long long flags): + """ Allocate an address range reservation. + + Reserves a virtual address range based on the given parameters, giving + the starting address of the range in `ptr`. This API requires a system + that supports UVA. The size and address parameters must be a multiple + of the host page size and the alignment must be a power of two or zero + for default alignment. If `addr` is 0, then the driver chooses the + address at which to place the start of the reservation whereas when it + is non-zero then the driver treats it as a hint about where to place + the reservation. + + Parameters + ---------- + size : size_t + Size of the reserved virtual address range requested + alignment : size_t + Alignment of the reserved virtual address range requested + addr : :py:obj:`~.CUdeviceptr` + Hint address for the start of the address range + flags : unsigned long long + Currently unused, must be zero + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + ptr : :py:obj:`~.CUdeviceptr` + Resulting pointer to start of virtual address range allocated + + See Also + -------- + :py:obj:`~.cuMemAddressFree` + """ + cdef cydriver.CUdeviceptr cyaddr + if addr is None: + paddr = 0 + elif isinstance(addr, (CUdeviceptr,)): + paddr = int(addr) + else: + paddr = int(CUdeviceptr(addr)) + cyaddr = paddr + cdef CUdeviceptr ptr = CUdeviceptr() + with nogil: + err = cydriver.cuMemAddressReserve(ptr._pvt_ptr, size, alignment, cyaddr, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, ptr) + +@cython.embedsignature(True) +def cuMemAddressFree(ptr, size_t size): + """ Free an address range reservation. + + Frees a virtual address range reserved by cuMemAddressReserve. The size + must match what was given to memAddressReserve and the ptr given must + match what was returned from memAddressReserve. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + Starting address of the virtual address range to free + size : size_t + Size of the virtual address region to free + + 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:`~.cuMemAddressReserve` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + with nogil: + err = cydriver.cuMemAddressFree(cyptr, size) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long long flags): + """ Create a CUDA memory handle representing a memory allocation of a given size described by the given properties. + + This creates a memory allocation on the target device specified through + the `prop` structure. The created allocation will not have any device + or host mappings. The generic memory `handle` for the allocation can be + mapped to the address space of calling process via + :py:obj:`~.cuMemMap`. This handle cannot be transmitted directly to + other processes (see :py:obj:`~.cuMemExportToShareableHandle`). On + Windows, the caller must also pass an LPSECURITYATTRIBUTE in `prop` to + be associated with this handle which limits or allows access to this + handle for a recipient process (see + :py:obj:`~.CUmemAllocationProp.win32HandleMetaData` for more). The + `size` of this allocation must be a multiple of the the value given via + :py:obj:`~.cuMemGetAllocationGranularity` with the + :py:obj:`~.CU_MEM_ALLOC_GRANULARITY_MINIMUM` flag. To create a CPU + allocation targeting a specific host NUMA node, applications must set + :py:obj:`~.CUmemAllocationProp.CUmemLocation.type` to + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and + :py:obj:`~.CUmemAllocationProp.CUmemLocation.id` must specify the NUMA + ID of the CPU. On systems where NUMA is not available + :py:obj:`~.CUmemAllocationProp.CUmemLocation.id` must be set to 0. + Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` as the + :py:obj:`~.CUmemLocation.type` will result in + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Applications that intend to use :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` + based memory sharing must ensure: (1) `nvidia-caps-imex-channels` + character device is created by the driver and is listed under + /proc/devices (2) have at least one IMEX channel file accessible by the + user launching the application. + + When exporter and importer CUDA processes have been granted access to + the same IMEX channel, they can securely share memory. + + The IMEX channel security model works on a per user basis. Which means + all processes under a user can share memory if the user has access to a + valid IMEX channel. When multi-user isolation is desired, a separate + IMEX channel is required for each user. + + These channel files exist in /dev/nvidia-caps-imex-channels/channel* + and can be created using standard OS native calls like mknod on Linux. + For example: To create channel0 with the major number from + /proc/devices users can execute the following command: `mknod + /dev/nvidia-caps-imex-channels/channel0 c 0` + + 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 + :py:obj:`~.cuMemMapArrayAsync`). + + Parameters + ---------- + size : size_t + Size of the allocation requested + prop : :py:obj:`~.CUmemAllocationProp` + Properties of the allocation to create. + flags : unsigned long long + flags for future use, must be zero now. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + handle : :py:obj:`~.CUmemGenericAllocationHandle` + Value of handle returned. All operations on this allocation are to + be performed using this handle. + + See Also + -------- + :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 + 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) + +@cython.embedsignature(True) +def cuMemRelease(handle): + """ Release a memory handle representing a memory allocation which was previously allocated through cuMemCreate. + + Frees the memory that was allocated on a device through cuMemCreate. + + The memory allocation will be freed when all outstanding mappings to + the memory are unmapped and when all outstanding references to the + handle (including it's shareable counterparts) are also released. The + generic memory handle can be freed when there are still outstanding + mappings made with this handle. Each time a recipient process imports a + shareable handle, it needs to pair it with :py:obj:`~.cuMemRelease` for + the handle to be freed. If `handle` is not a valid handle the behavior + is undefined. + + Parameters + ---------- + handle : :py:obj:`~.CUmemGenericAllocationHandle` + Value of handle which was returned previously by cuMemCreate. + + 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:`~.cuMemCreate` + """ + cdef cydriver.CUmemGenericAllocationHandle cyhandle + if handle is None: + phandle = 0 + elif isinstance(handle, (CUmemGenericAllocationHandle,)): + phandle = int(handle) + else: + phandle = int(CUmemGenericAllocationHandle(handle)) + cyhandle = phandle + with nogil: + err = cydriver.cuMemRelease(cyhandle) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): + """ Maps an allocation handle to a reserved virtual address range. + + Maps bytes of memory represented by `handle` starting from byte + `offset` to `size` to address range [`addr`, `addr` + `size`]. This + range must be an address reservation previously reserved with + :py:obj:`~.cuMemAddressReserve`, and `offset` + `size` must be less + than the size of the memory allocation. Both `ptr`, `size`, and + `offset` must be a multiple of the value given via + :py:obj:`~.cuMemGetAllocationGranularity` with the + :py:obj:`~.CU_MEM_ALLOC_GRANULARITY_MINIMUM` flag. If `handle` + represents a multicast object, `ptr`, `size` and `offset` must be + aligned to the value returned by :py:obj:`~.cuMulticastGetGranularity` + with the flag :py:obj:`~.CU_MULTICAST_MINIMUM_GRANULARITY`. For best + performance however, it is recommended that `ptr`, `size` and `offset` + be aligned to the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_RECOMMENDED_GRANULARITY`. + + When `handle` represents a multicast object, this call may return + CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal + state. In such cases, to continue using multicast, verify that the + system configuration is in a valid state and all required driver + daemons are running properly. + + Please note calling :py:obj:`~.cuMemMap` does not make the address + accessible, the caller needs to update accessibility of a contiguous + mapped VA range by calling :py:obj:`~.cuMemSetAccess`. + + Once a recipient process obtains a shareable memory handle from + :py:obj:`~.cuMemImportFromShareableHandle`, the process must use + :py:obj:`~.cuMemMap` to map the memory into its address ranges before + setting accessibility with :py:obj:`~.cuMemSetAccess`. + + :py:obj:`~.cuMemMap` can only create mappings on VA range reservations + that are not currently mapped. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + Address where memory will be mapped. + size : size_t + Size of the memory mapping. + offset : size_t + Offset into the memory represented by + handle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle to a shareable memory + flags : unsigned long long + flags for future use, must be zero now. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :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_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuMemUnmap`, :py:obj:`~.cuMemSetAccess`, :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemAddressReserve`, :py:obj:`~.cuMemImportFromShareableHandle` + """ + cdef cydriver.CUmemGenericAllocationHandle cyhandle + if handle is None: + phandle = 0 + elif isinstance(handle, (CUmemGenericAllocationHandle,)): + phandle = int(handle) + else: + phandle = int(CUmemGenericAllocationHandle(handle)) + cyhandle = phandle + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + with nogil: + err = cydriver.cuMemMap(cyptr, size, offset, cyhandle, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarrayMapInfo]], unsigned int count, hStream): + """ Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. + + Performs map or unmap operations on subregions of sparse CUDA arrays + and sparse CUDA mipmapped arrays. Each operation is specified by a + :py:obj:`~.CUarrayMapInfo` entry in the `mapInfoList` array of size + `count`. The structure :py:obj:`~.CUarrayMapInfo` is defined as follow: + + **View CUDA Toolkit Documentation for a C++ code example** + + 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 + :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 + 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 + :py:obj:`~.CUDA_ARRAY3D_SPARSE` or + :py:obj:`~.CUDA_ARRAY3D_DEFERRED_MAPPING`. + + :py:obj:`~.CUarrayMapInfo.subresourceType` specifies the type of + subresource within the resource. + :py:obj:`~.CUarraySparseSubresourceType_enum` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where + :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` + 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 + 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 + 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 + 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 + 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 + valid layer index. Otherwise, must be zero. + + 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.memOperationType` specifies the type of + operation. :py:obj:`~.CUmemOperationType` is defined as: + + **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 + subresource will be mapped onto the tile pool memory specified by + :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`. + + 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` + must be NULL. + + :py:obj:`~.CUarrayMapInfo.deviceBitMask` specifies the list of devices + that must map or unmap physical memory. Currently, this mask must have + 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 + must also match the device associated with the tile pool memory + allocation as specified by :py:obj:`~.CUarrayMapInfo.memHandle`. + + :py:obj:`~.CUarrayMapInfo.flags` and + :py:obj:`~.CUarrayMapInfo.reserved`[] are unused and must be set to + zero. + + Parameters + ---------- + mapInfoList : list[:py:obj:`~.CUarrayMapInfo`] + List of :py:obj:`~.CUarrayMapInfo` + count : unsigned int + Count of :py:obj:`~.CUarrayMapInfo` in `mapInfoList` + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier for the stream to use for map or unmap operations + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuMipmappedArrayCreate`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuMemCreate`, :py:obj:`~.cuArrayGetSparseProperties`, :py:obj:`~.cuMipmappedArrayGetSparseProperties` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + mapInfoList = [] if mapInfoList is None else mapInfoList + if not all(isinstance(_x, (CUarrayMapInfo,)) for _x in mapInfoList): + raise TypeError("Argument 'mapInfoList' is not instance of type (expected tuple[cydriver.CUarrayMapInfo,] or list[cydriver.CUarrayMapInfo,]") + cdef cydriver.CUarrayMapInfo* cymapInfoList = NULL + if len(mapInfoList) > 1: + cymapInfoList = calloc(len(mapInfoList), sizeof(cydriver.CUarrayMapInfo)) + if cymapInfoList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(mapInfoList)) + 'x' + str(sizeof(cydriver.CUarrayMapInfo))) + for idx in range(len(mapInfoList)): + string.memcpy(&cymapInfoList[idx], (mapInfoList[idx])._pvt_ptr, sizeof(cydriver.CUarrayMapInfo)) + elif len(mapInfoList) == 1: + cymapInfoList = (mapInfoList[0])._pvt_ptr + if count > len(mapInfoList): raise RuntimeError("List is too small: " + str(len(mapInfoList)) + " < " + str(count)) + with nogil: + err = cydriver.cuMemMapArrayAsync(cymapInfoList, count, cyhStream) + if len(mapInfoList) > 1 and cymapInfoList is not NULL: + free(cymapInfoList) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemUnmap(ptr, size_t size): + """ Unmap the backing memory of a given address range. + + The range must be the entire contiguous address range that was mapped + to. In other words, :py:obj:`~.cuMemUnmap` cannot unmap a sub-range of + an address range mapped by :py:obj:`~.cuMemCreate` / + :py:obj:`~.cuMemMap`. Any backing memory allocations will be freed if + there are no existing mappings and there are no unreleased memory + handles. + + When :py:obj:`~.cuMemUnmap` returns successfully the address range is + converted to an address reservation and can be used for a future calls + to :py:obj:`~.cuMemMap`. Any new mapping to this virtual address will + need to have access granted through :py:obj:`~.cuMemSetAccess`, as all + mappings start with no accessibility setup. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + Starting address for the virtual address range to unmap + size : size_t + Size of the virtual address range to unmap + + 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:`~.cuMemCreate`, :py:obj:`~.cuMemAddressReserve` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + with nogil: + err = cydriver.cuMemUnmap(cyptr, size) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): + """ Set the access flags for each location specified in `desc` for the given virtual address range. + + Given the virtual address range via `ptr` and `size`, and the locations + in the array given by `desc` and `count`, set the access flags for the + target locations. The range must be a fully mapped address range + containing all allocations created by :py:obj:`~.cuMemMap` / + :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:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, + :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 + :py:obj:`~.CU_MULTICAST_MINIMUM_GRANULARITY`. For best performance + however, it is recommended that `ptr` and `size` be aligned to the + value returned by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_RECOMMENDED_GRANULARITY`. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + Starting address for the virtual address range + size : size_t + Length of the virtual address range + desc : list[:py:obj:`~.CUmemAccessDesc`] + Array of :py:obj:`~.CUmemAccessDesc` that describe how to change + the + count : size_t + Number of :py:obj:`~.CUmemAccessDesc` in `desc` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuMemSetAccess`, :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` + """ + desc = [] if desc is None else desc + if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in desc): + raise TypeError("Argument 'desc' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + cdef cydriver.CUmemAccessDesc* cydesc = NULL + if len(desc) > 1: + cydesc = calloc(len(desc), sizeof(cydriver.CUmemAccessDesc)) + if cydesc is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(desc)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(desc)): + string.memcpy(&cydesc[idx], (desc[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + elif len(desc) == 1: + cydesc = (desc[0])._pvt_ptr + if count > len(desc): raise RuntimeError("List is too small: " + str(len(desc)) + " < " + str(count)) + with nogil: + err = cydriver.cuMemSetAccess(cyptr, size, cydesc, count) + if len(desc) > 1 and cydesc is not NULL: + free(cydesc) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemGetAccess(location : Optional[CUmemLocation], ptr): + """ Get the access `flags` set for the given `location` and `ptr`. + + Parameters + ---------- + location : :py:obj:`~.CUmemLocation` + Location in which to check the flags for + ptr : :py:obj:`~.CUdeviceptr` + Address in which to check the access flags for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + flags : unsigned long long + Flags set for this location + + See Also + -------- + :py:obj:`~.cuMemSetAccess` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + 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 + with nogil: + err = cydriver.cuMemGetAccess(&flags, cylocation_ptr, cyptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, flags) + +@cython.embedsignature(True) +def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHandleType, unsigned long long flags): + """ Exports an allocation to a requested shareable handle type. + + Given a CUDA memory handle, create a shareable memory allocation handle + that can be used to share the memory with other processes. The + recipient process can convert the shareable handle back into a CUDA + memory handle using :py:obj:`~.cuMemImportFromShareableHandle` and map + it with :py:obj:`~.cuMemMap`. The implementation of what this handle is + and how it can be transferred is defined by the requested handle type + in `handleType` + + Once all shareable handles are closed and the allocation is released, + the allocated memory referenced will be released back to the OS and + uses of the CUDA handle afterward will lead to undefined behavior. + + This API can also be used in conjunction with other APIs (e.g. Vulkan, + OpenGL) that support importing memory from the shareable type + + Parameters + ---------- + handle : :py:obj:`~.CUmemGenericAllocationHandle` + CUDA handle for the memory allocation + handleType : :py:obj:`~.CUmemAllocationHandleType` + Type of shareable handle requested (defines type and size of the + `shareableHandle` output parameter) + flags : unsigned long long + Reserved, must be zero + + 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` + shareableHandle : Any + Pointer to the location in which to store the requested handle type + + See Also + -------- + :py:obj:`~.cuMemImportFromShareableHandle` + """ + cdef cydriver.CUmemGenericAllocationHandle cyhandle + if handle is None: + phandle = 0 + elif isinstance(handle, (CUmemGenericAllocationHandle,)): + phandle = int(handle) + else: + phandle = int(CUmemGenericAllocationHandle(handle)) + cyhandle = phandle + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) + cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr + cdef cydriver.CUmemAllocationHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuMemExportToShareableHandle(cyshareableHandle_ptr, cyhandle, cyhandleType, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyshareableHandle.pyObj()) + +@cython.embedsignature(True) +def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAllocationHandleType): + """ Imports an allocation from a requested shareable handle type. + + If the current process cannot support the memory described by this + shareable handle, this API will error as + :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`. + + If `shHandleType` is :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` and the + importer process has not been granted access to the same IMEX channel + as the exporter process, this API will error as + :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`. + + Parameters + ---------- + osHandle : Any + Shareable Handle representing the memory allocation that is to be + imported. + shHandleType : :py:obj:`~.CUmemAllocationHandleType` + handle type of the exported handle + :py:obj:`~.CUmemAllocationHandleType`. + + 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` + handle : :py:obj:`~.CUmemGenericAllocationHandle` + CUDA Memory handle for the memory allocation. + + See Also + -------- + :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemMap`, :py:obj:`~.cuMemRelease` + + Notes + ----- + Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return CUDA_ERROR_NOT_SUPPORTED. There is no guarantee that the contents of `handle` will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation. + """ + cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() + cdef _HelperInputVoidPtrStruct cyosHandleHelper + cdef void* cyosHandle = _helper_input_void_ptr(osHandle, &cyosHandleHelper) + cdef cydriver.CUmemAllocationHandleType cyshHandleType = int(shHandleType) + with nogil: + err = cydriver.cuMemImportFromShareableHandle(handle._pvt_ptr, cyosHandle, cyshHandleType) + _helper_input_void_ptr_free(&cyosHandleHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, handle) + +@cython.embedsignature(True) +def cuMemGetAllocationGranularity(prop : Optional[CUmemAllocationProp], option not None : CUmemAllocationGranularity_flags): + """ Calculates either the minimal or recommended granularity. + + Calculates either the minimal or recommended granularity for a given + allocation specification and returns it in granularity. This + granularity can be used as a multiple for alignment, size, or address + mapping. + + Parameters + ---------- + prop : :py:obj:`~.CUmemAllocationProp` + Property for which to determine the granularity for + option : :py:obj:`~.CUmemAllocationGranularity_flags` + Determines which granularity to return + + 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` + granularity : int + Returned granularity. + + See Also + -------- + :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.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) + +@cython.embedsignature(True) +def cuMemGetAllocationPropertiesFromHandle(handle): + """ Retrieve the contents of the property structure defining properties for this handle. + + Parameters + ---------- + handle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle which to perform the query on + + 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` + prop : :py:obj:`~.CUmemAllocationProp` + Pointer to a properties structure which will hold the information + about this handle + + See Also + -------- + :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemImportFromShareableHandle` + """ + cdef cydriver.CUmemGenericAllocationHandle cyhandle + if handle is None: + phandle = 0 + elif isinstance(handle, (CUmemGenericAllocationHandle,)): + phandle = int(handle) + else: + phandle = int(CUmemGenericAllocationHandle(handle)) + cyhandle = phandle + cdef CUmemAllocationProp prop = CUmemAllocationProp() + with nogil: + err = cydriver.cuMemGetAllocationPropertiesFromHandle(prop._pvt_ptr, cyhandle) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, prop) + +@cython.embedsignature(True) +def cuMemRetainAllocationHandle(addr): + """ Given an address `addr`, returns the allocation handle of the backing memory allocation. + + The handle is guaranteed to be the same handle value used to map the + memory. If the address requested is not mapped, the function will fail. + The returned handle must be released with corresponding number of calls + to :py:obj:`~.cuMemRelease`. + + Parameters + ---------- + addr : Any + Memory address to query, that has been mapped previously. + + 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` + handle : :py:obj:`~.CUmemGenericAllocationHandle` + CUDA Memory handle for the backing memory allocation. + + See Also + -------- + :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemMap` + + Notes + ----- + The address `addr`, can be any address in a range previously mapped by :py:obj:`~.cuMemMap`, and not necessarily the start address. + """ + cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() + cdef _HelperInputVoidPtrStruct cyaddrHelper + cdef void* cyaddr = _helper_input_void_ptr(addr, &cyaddrHelper) + with nogil: + err = cydriver.cuMemRetainAllocationHandle(handle._pvt_ptr, cyaddr) + _helper_input_void_ptr_free(&cyaddrHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, handle) + +@cython.embedsignature(True) +def cuMemFreeAsync(dptr, hStream): + """ Frees memory with stream ordered semantics. + + Inserts a free operation into `hStream`. The allocation must not be + accessed after stream execution reaches the free. After this API + returns, accessing the memory from any subsequent work launched on the + GPU or querying its pointer attributes results in undefined behavior. + + Parameters + ---------- + dptr : :py:obj:`~.CUdeviceptr` + memory to free + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering contract. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` (default stream specified with no current context), :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + Notes + ----- + During stream capture, this function results in the creation of a free node and must therefore be passed the address of a graph allocation. + """ + 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.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + with nogil: + err = cydriver.cuMemFreeAsync(cydptr, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemAllocAsync(size_t bytesize, hStream): + """ Allocates memory with stream ordered semantics. + + Inserts an allocation operation into `hStream`. A pointer to the + allocated memory is returned immediately in *dptr. The allocation must + not be accessed until the the allocation operation completes. The + allocation comes from the memory pool current to the stream's device. + + Parameters + ---------- + bytesize : size_t + Number of bytes to allocate + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering contract and the memory + pool to allocate from + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` (default stream specified with no current context), :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + dptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuMemAllocFromPoolAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuMemPoolSetAttribute` + + Notes + ----- + The default memory pool of a device contains device memory from that device. + + Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs. + + During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. + """ + 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 CUdeviceptr dptr = CUdeviceptr() + with nogil: + err = cydriver.cuMemAllocAsync(dptr._pvt_ptr, bytesize, cyhStream) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dptr) + +@cython.embedsignature(True) +def cuMemPoolTrimTo(pool, size_t minBytesToKeep): + """ Tries to release memory back to the OS. + + Releases memory back to the OS until the pool contains fewer than + minBytesToKeep reserved bytes, or there is no more memory that the + allocator can safely release. The allocator cannot release OS + allocations that back outstanding asynchronous allocations. The OS + allocations may happen at different granularity from the user + allocations. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to trim + minBytesToKeep : size_t + If the pool has less than minBytesToKeep reserved, the TrimTo + operation is a no-op. Otherwise the pool will be guaranteed to have + at least minBytesToKeep bytes reserved after the operation. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + + Notes + ----- + : Allocations that have not been freed count as outstanding. + + : Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize) can count as outstanding. + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + with nogil: + err = cydriver.cuMemPoolTrimTo(cypool, minBytesToKeep) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): + """ Sets attributes of a memory pool. + + Supported attributes are: + + - :py:obj:`~.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`: (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) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`: (value + type = int) Allow :py:obj:`~.cuMemAllocAsync` to use memory + asynchronously freed in another stream 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) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`: (value type = + int) Allow reuse of already completed frees when there is no + dependency between the free and allocation. (default enabled) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`: (value + type = int) Allow :py:obj:`~.cuMemAllocAsync` to insert new stream + dependencies in order to establish the stream ordering required to + reuse a piece of memory released by :py:obj:`~.cuMemFreeAsync` + (default enabled). + + - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`: (value type = + :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 = + :py:obj:`~.cuuint64_t`) Reset the high watermark that tracks the + amount of used memory that was allocated for the memory pool. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to modify + attr : :py:obj:`~.CUmemPool_attribute` + The attribute to modify + value : Any + Pointer to the value to assign + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef cydriver.CUmemPool_attribute cyattr = int(attr) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cydriver.cuMemPoolSetAttribute(cypool, cyattr, cyvalue_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): + """ Gets attributes of a memory pool. + + Supported attributes are: + + - :py:obj:`~.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`: (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) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`: (value + type = int) Allow :py:obj:`~.cuMemAllocAsync` to use memory + asynchronously freed in another stream 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) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`: (value type = + int) Allow reuse of already completed frees when there is no + dependency between the free and allocation. (default enabled) + + - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`: (value + type = int) Allow :py:obj:`~.cuMemAllocAsync` to insert new stream + dependencies in order to establish the stream ordering required to + reuse a piece of memory released by :py:obj:`~.cuMemFreeAsync` + (default enabled). + + - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT`: (value type = + :py:obj:`~.cuuint64_t`) Amount of backing memory currently allocated + for the mempool + + - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`: (value type = + :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 = + :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 = + :py:obj:`~.cuuint64_t`) High watermark of the amount of memory from + the pool that was in use by the application. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to get attributes of + attr : :py:obj:`~.CUmemPool_attribute` + The attribute to get + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + value : Any + Retrieved value + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef cydriver.CUmemPool_attribute cyattr = int(attr) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cydriver.cuMemPoolGetAttribute(cypool, cyattr, cyvalue_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyvalue.pyObj()) + +@cython.embedsignature(True) +def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): + """ Controls visibility of pools between devices. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The pool being modified + map : list[:py:obj:`~.CUmemAccessDesc`] + Array of access descriptors. Each descriptor instructs the access + to enable for a single gpu. + count : size_t + Number of descriptors in the map array. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + map = [] if map is None else map + if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in map): + raise TypeError("Argument 'map' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef cydriver.CUmemAccessDesc* cymap = NULL + if len(map) > 1: + cymap = calloc(len(map), sizeof(cydriver.CUmemAccessDesc)) + if cymap is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(map)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(map)): + string.memcpy(&cymap[idx], (map[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + elif len(map) == 1: + cymap = (map[0])._pvt_ptr + if count > len(map): raise RuntimeError("List is too small: " + str(len(map)) + " < " + str(count)) + with nogil: + err = cydriver.cuMemPoolSetAccess(cypool, cymap, count) + if len(map) > 1 and cymap is not NULL: + free(cymap) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemPoolGetAccess(memPool, location : Optional[CUmemLocation]): + """ Returns the accessibility of a pool from a device. + + Returns the accessibility of the pool's memory from the specified + location. + + Parameters + ---------- + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + the pool being queried + location : :py:obj:`~.CUmemLocation` + the location accessing the pool + + Returns + ------- + CUresult + + flags : :py:obj:`~.CUmemAccess_flags` + the accessibility of the pool from the specified location + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate` + """ + cdef cydriver.CUmemoryPool cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (CUmemoryPool,)): + pmemPool = int(memPool) + else: + 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 + with nogil: + err = cydriver.cuMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUmemAccess_flags(flags)) + +@cython.embedsignature(True) +def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): + """ Creates a memory pool. + + Creates a CUDA memory pool and returns the handle in `pool`. The + `poolProps` determines the properties of the pool such as the backing + device and IPC capabilities. + + To create a memory pool targeting a specific host NUMA node, + applications must set :py:obj:`~.CUmemPoolProps.CUmemLocation.type` to + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and + :py:obj:`~.CUmemPoolProps.CUmemLocation.id` must specify the NUMA ID of + the host memory node. Specifying + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` as the + :py:obj:`~.CUmemPoolProps.CUmemLocation.type` will result in + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. By default, the pool's memory + will be accessible from the device it is allocated on. In the case of + pools created with :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, their + default accessibility will be from the host CPU. Applications can + control the maximum size of the pool by specifying a non-zero value for + :py:obj:`~.CUmemPoolProps.maxSize`. If set to 0, the maximum size of + the pool will default to a system dependent value. + + Applications that intend to use :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` + based memory sharing must ensure: (1) `nvidia-caps-imex-channels` + character device is created by the driver and is listed under + /proc/devices (2) have at least one IMEX channel file accessible by the + user launching the application. + + When exporter and importer CUDA processes have been granted access to + the same IMEX channel, they can securely share memory. + + The IMEX channel security model works on a per user basis. Which means + all processes under a user can share memory if the user has access to a + valid IMEX channel. When multi-user isolation is desired, a separate + IMEX channel is required for each user. + + These channel files exist in /dev/nvidia-caps-imex-channels/channel* + and can be created using standard OS native calls like mknod on Linux. + For example: To create channel0 with the major number from + /proc/devices users can execute the following command: `mknod + /dev/nvidia-caps-imex-channels/channel0 c 0` + + Parameters + ---------- + poolProps : :py:obj:`~.CUmemPoolProps` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pool : :py:obj:`~.CUmemoryPool` + None + + See Also + -------- + :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemAllocFromPoolAsync`, :py:obj:`~.cuMemPoolExportToShareableHandle` + + Notes + ----- + 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 + with nogil: + err = cydriver.cuMemPoolCreate(pool._pvt_ptr, cypoolProps_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pool) + +@cython.embedsignature(True) +def cuMemPoolDestroy(pool): + """ Destroys the specified memory pool. + + If any pointers obtained from this pool haven't been freed or the pool + has free operations that haven't completed when + :py:obj:`~.cuMemPoolDestroy` is invoked, the function will return + immediately and the resources associated with the pool will be released + automatically once there are no more outstanding allocations. + + Destroying the current mempool of a device sets the default mempool of + that device as the current mempool for that device. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuMemPoolCreate` + + Notes + ----- + A device's default memory pool cannot be destroyed. + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + with nogil: + err = cydriver.cuMemPoolDestroy(cypool) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemAllocFromPoolAsync(size_t bytesize, pool, hStream): + """ Allocates memory from a specified pool with stream ordered semantics. + + Inserts an allocation operation into `hStream`. A pointer to the + allocated memory is returned immediately in *dptr. The allocation must + not be accessed until the the allocation operation completes. The + allocation comes from the specified memory pool. + + Parameters + ---------- + bytesize : size_t + Number of bytes to allocate + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The pool to allocate from + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering semantic + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` (default stream specified with no current context), :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + dptr : :py:obj:`~.CUdeviceptr` + Returned device pointer + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuMemPoolSetAttribute` + + Notes + ----- + During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. + """ + 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.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef CUdeviceptr dptr = CUdeviceptr() + with nogil: + err = cydriver.cuMemAllocFromPoolAsync(dptr._pvt_ptr, bytesize, cypool, cyhStream) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dptr) + +@cython.embedsignature(True) +def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocationHandleType, unsigned long long flags): + """ Exports a memory pool to the requested handle type. + + Given an IPC capable mempool, create an OS handle to share the pool + with another process. A recipient process can convert the shareable + handle into a mempool with + :py:obj:`~.cuMemPoolImportFromShareableHandle`. Individual pointers can + then be shared with the :py:obj:`~.cuMemPoolExportPointer` and + :py:obj:`~.cuMemPoolImportPointer` APIs. The implementation of what the + shareable handle is and how it can be transferred is defined by the + requested handle type. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + pool to export + handleType : :py:obj:`~.CUmemAllocationHandleType` + the type of handle to create + flags : unsigned long long + must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + handle_out : Any + Returned OS handle + + See Also + -------- + :py:obj:`~.cuMemPoolImportFromShareableHandle`, :py:obj:`~.cuMemPoolExportPointer`, :py:obj:`~.cuMemPoolImportPointer`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cuMemPoolSetAttribute` + + Notes + ----- + : 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: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef _HelperCUmemAllocationHandleType cyhandle_out = _HelperCUmemAllocationHandleType(handleType) + cdef void* cyhandle_out_ptr = cyhandle_out.cptr + cdef cydriver.CUmemAllocationHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuMemPoolExportToShareableHandle(cyhandle_out_ptr, cypool, cyhandleType, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyhandle_out.pyObj()) + +@cython.embedsignature(True) +def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAllocationHandleType, unsigned long long flags): + """ imports a memory pool from a shared handle. + + Specific allocations can be imported from the imported pool with + cuMemPoolImportPointer. + + If `handleType` is :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` and the + importer process has not been granted access to the same IMEX channel + as the exporter process, this API will error as + :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`. + + Parameters + ---------- + handle : Any + OS handle of the pool to open + handleType : :py:obj:`~.CUmemAllocationHandleType` + The type of handle being imported + flags : unsigned long long + must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + pool_out : :py:obj:`~.CUmemoryPool` + Returned memory pool + + See Also + -------- + :py:obj:`~.cuMemPoolExportToShareableHandle`, :py:obj:`~.cuMemPoolExportPointer`, :py:obj:`~.cuMemPoolImportPointer` + + Notes + ----- + Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool or :py:obj:`~.cuMemAllocFromPoolAsync` calls. + """ + cdef CUmemoryPool pool_out = CUmemoryPool() + cdef _HelperInputVoidPtrStruct cyhandleHelper + cdef void* cyhandle = _helper_input_void_ptr(handle, &cyhandleHelper) + cdef cydriver.CUmemAllocationHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuMemPoolImportFromShareableHandle(pool_out._pvt_ptr, cyhandle, cyhandleType, flags) + _helper_input_void_ptr_free(&cyhandleHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pool_out) + +@cython.embedsignature(True) +def cuMemPoolExportPointer(ptr): + """ Export data to share a memory pool allocation between processes. + + Constructs `shareData_out` for sharing a specific allocation from an + already shared memory pool. The recipient process can import the + allocation with the :py:obj:`~.cuMemPoolImportPointer` api. The data is + not a handle and may be shared through any IPC mechanism. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + pointer to memory being exported + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + shareData_out : :py:obj:`~.CUmemPoolPtrExportData` + Returned export data + + See Also + -------- + :py:obj:`~.cuMemPoolExportToShareableHandle`, :py:obj:`~.cuMemPoolImportFromShareableHandle`, :py:obj:`~.cuMemPoolImportPointer` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + cdef CUmemPoolPtrExportData shareData_out = CUmemPoolPtrExportData() + with nogil: + err = cydriver.cuMemPoolExportPointer(shareData_out._pvt_ptr, cyptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, shareData_out) + +@cython.embedsignature(True) +def cuMemPoolImportPointer(pool, shareData : Optional[CUmemPoolPtrExportData]): + """ Import a memory pool allocation from another process. + + Returns in `ptr_out` a pointer to the imported memory. The imported + memory must not be accessed before the allocation operation completes + in the exporting process. The imported memory must be freed from all + importing processes before being freed in the exporting process. The + pointer may be freed with cuMemFree or cuMemFreeAsync. If + cuMemFreeAsync is used, the free must be completed on the importing + process before the free operation on the exporting process. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + pool from which to import + shareData : :py:obj:`~.CUmemPoolPtrExportData` + data specifying the memory to import + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + ptr_out : :py:obj:`~.CUdeviceptr` + pointer to imported memory + + See Also + -------- + :py:obj:`~.cuMemPoolExportToShareableHandle`, :py:obj:`~.cuMemPoolImportFromShareableHandle`, :py:obj:`~.cuMemPoolExportPointer` + + Notes + ----- + The cuMemFreeAsync api may be used in the exporting process before the cuMemFreeAsync operation completes in its stream as long as the cuMemFreeAsync in the exporting process specifies a stream with a stream dependency on the importing process's cuMemFreeAsync. + """ + cdef cydriver.CUmemoryPool cypool + if pool is None: + ppool = 0 + elif isinstance(pool, (CUmemoryPool,)): + ppool = int(pool) + else: + ppool = int(CUmemoryPool(pool)) + cypool = ppool + cdef CUdeviceptr ptr_out = CUdeviceptr() + 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) + +@cython.embedsignature(True) +def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): + """ Create a generic allocation handle representing a multicast object described by the given properties. + + This creates a multicast object as described by `prop`. The number of + participating devices is specified by + :py:obj:`~.CUmulticastObjectProp.numDevices`. Devices can be added to + the multicast object via :py:obj:`~.cuMulticastAddDevice`. All + participating devices must be added to the multicast object before + memory can be bound to it. Memory is bound to the multicast object via + either :py:obj:`~.cuMulticastBindMem` or + :py:obj:`~.cuMulticastBindAddr`, and can be unbound via + :py:obj:`~.cuMulticastUnbind`. The total amount of memory that can be + bound per device is specified by + :py:obj:`~.CUmulticastObjectProp.size`. This size must be a multiple of + the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. For best performance + however, the size should be aligned to the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. + + After all participating devices have been added, multicast objects can + also be mapped to a device's virtual address space using the virtual + memory management APIs (see :py:obj:`~.cuMemMap` and + :py:obj:`~.cuMemSetAccess`). Multicast objects can also be shared with + other processes by requesting a shareable handle via + :py:obj:`~.cuMemExportToShareableHandle`. Note that the desired types + of shareable handles must be specified in the bitmask + :py:obj:`~.CUmulticastObjectProp.handleTypes`. Multicast objects can be + released using the virtual memory management API + :py:obj:`~.cuMemRelease`. + + Parameters + ---------- + prop : :py:obj:`~.CUmulticastObjectProp` + Properties of the multicast object to create. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Value of handle returned. + + See Also + -------- + :py:obj:`~.cuMulticastAddDevice`, :py:obj:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr`, :py:obj:`~.cuMulticastUnbind` + + :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` + """ + cdef CUmemGenericAllocationHandle mcHandle = CUmemGenericAllocationHandle() + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop 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) + +@cython.embedsignature(True) +def cuMulticastAddDevice(mcHandle, dev): + """ Associate a device to a multicast object. + + Associates a device to a multicast object. The added device will be a + part of the multicast team of size specified by + :py:obj:`~.CUmulticastObjectProp.numDevices` during + :py:obj:`~.cuMulticastCreate`. The association of the device to the + multicast object is permanent during the life time of the multicast + object. All devices must be added to the multicast team before any + memory can be bound to any device in the team. Any calls to + :py:obj:`~.cuMulticastBindMem` or :py:obj:`~.cuMulticastBindAddr` will + block until all devices have been added. Similarly all devices must be + added to the multicast team before a virtual address range can be + mapped to the multicast object. A call to :py:obj:`~.cuMemMap` will + block until all devices have been added. + + Parameters + ---------- + mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a multicast object. + dev : :py:obj:`~.CUdevice` + Device that will be associated to the multicast object. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :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:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr` + """ + 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.CUmemGenericAllocationHandle cymcHandle + if mcHandle is None: + pmcHandle = 0 + elif isinstance(mcHandle, (CUmemGenericAllocationHandle,)): + pmcHandle = int(mcHandle) + else: + pmcHandle = int(CUmemGenericAllocationHandle(mcHandle)) + cymcHandle = pmcHandle + with nogil: + err = cydriver.cuMulticastAddDevice(cymcHandle, cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, size_t size, unsigned long long flags): + """ Bind a memory allocation represented by a handle to a multicast object. + + Binds a memory allocation specified by `memHandle` and created via + :py:obj:`~.cuMemCreate` to a multicast object represented by `mcHandle` + and created via :py:obj:`~.cuMulticastCreate`. The intended `size` of + the bind, the offset in the multicast range `mcOffset` as well as the + offset in the memory `memOffset` must be a multiple of the value + returned by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. For best performance + however, `size`, `mcOffset` and `memOffset` should be aligned to the + granularity of the memory allocation(see + :py:obj:`~.cuMemGetAllocationGranularity`) or to the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. + + The `size` + `memOffset` cannot be larger than the size of the + allocated memory. Similarly the `size` + `mcOffset` cannot be larger + than the size of the multicast object. The memory allocation must have + beeen created on one of the devices that was added to the multicast + team via :py:obj:`~.cuMulticastAddDevice`. Externally shareable as well + as imported multicast objects can be bound only to externally shareable + memory. Note that this call will return CUDA_ERROR_OUT_OF_MEMORY if + there are insufficient resources required to perform the bind. This + call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary + system software is not initialized or running. + + This call may return CUDA_ERROR_ILLEGAL_STATE if the system + configuration is in an illegal state. In such cases, to continue using + multicast, verify that the system configuration is in a valid state and + all required driver daemons are running properly. + + Parameters + ---------- + mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a multicast object. + mcOffset : size_t + Offset into the multicast object for attachment. + memHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a memory allocation. + memOffset : size_t + Offset into the memory for attachment. + size : size_t + Size of the memory that will be bound to the multicast object. + 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_INVALID_DEVICE`, :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:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastAddDevice`, :py:obj:`~.cuMemCreate` + """ + 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.CUmemGenericAllocationHandle cymcHandle + if mcHandle is None: + pmcHandle = 0 + elif isinstance(mcHandle, (CUmemGenericAllocationHandle,)): + pmcHandle = int(mcHandle) + else: + pmcHandle = int(CUmemGenericAllocationHandle(mcHandle)) + cymcHandle = pmcHandle + with nogil: + err = cydriver.cuMulticastBindMem(cymcHandle, mcOffset, cymemHandle, memOffset, size, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned long long flags): + """ Bind a memory allocation represented by a virtual address to a multicast object. + + Binds a memory allocation specified by its mapped address `memptr` to a + multicast object represented by `mcHandle`. The memory must have been + allocated via :py:obj:`~.cuMemCreate` or :py:obj:`~.cudaMallocAsync`. + The intended `size` of the bind, the offset in the multicast range + `mcOffset` and `memptr` must be a multiple of the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. For best performance + however, `size`, `mcOffset` and `memptr` should be aligned to the value + returned by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. + + The `size` cannot be larger than the size of the allocated memory. + Similarly the `size` + `mcOffset` cannot be larger than the total size + of the multicast object. The memory allocation must have beeen created + on one of the devices that was added to the multicast team via + :py:obj:`~.cuMulticastAddDevice`. Externally shareable as well as + imported multicast objects can be bound only to externally shareable + memory. Note that this call will return CUDA_ERROR_OUT_OF_MEMORY if + there are insufficient resources required to perform the bind. This + call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary + system software is not initialized or running. + + This call may return CUDA_ERROR_ILLEGAL_STATE if the system + configuration is in an illegal state. In such cases, to continue using + multicast, verify that the system configuration is in a valid state and + all required driver daemons are running properly. + + Parameters + ---------- + mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a multicast object. + mcOffset : size_t + Offset into multicast va range for attachment. + memptr : :py:obj:`~.CUdeviceptr` + Virtual address of the memory allocation. + size : size_t + Size of memory that will be bound to the multicast object. + flags : unsigned long long + Flags for future use, must be zero now. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :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:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastAddDevice`, :py:obj:`~.cuMemCreate` + """ + cdef cydriver.CUdeviceptr cymemptr + if memptr is None: + pmemptr = 0 + elif isinstance(memptr, (CUdeviceptr,)): + pmemptr = int(memptr) + else: + pmemptr = int(CUdeviceptr(memptr)) + cymemptr = pmemptr + cdef cydriver.CUmemGenericAllocationHandle cymcHandle + if mcHandle is None: + pmcHandle = 0 + elif isinstance(mcHandle, (CUmemGenericAllocationHandle,)): + pmcHandle = int(mcHandle) + else: + pmcHandle = int(CUmemGenericAllocationHandle(mcHandle)) + cymcHandle = pmcHandle + with nogil: + err = cydriver.cuMulticastBindAddr(cymcHandle, mcOffset, cymemptr, size, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMulticastUnbind(mcHandle, dev, size_t mcOffset, size_t size): + """ Unbind any memory allocations bound to a multicast object at a given offset and upto a given size. + + Unbinds any memory allocations hosted on `dev` and bound to a multicast + object at `mcOffset` and upto a given `size`. The intended `size` of + the unbind and the offset in the multicast range ( `mcOffset` ) must be + a multiple of the value returned by + :py:obj:`~.cuMulticastGetGranularity` flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. The `size` + `mcOffset` + cannot be larger than the total size of the multicast object. + + Parameters + ---------- + mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a multicast object. + dev : :py:obj:`~.CUdevice` + Device that hosts the memory allocation. + mcOffset : size_t + Offset into the multicast object. + size : size_t + Desired size to unbind. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :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:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr` + + Notes + ----- + Warning: The `mcOffset` and the `size` must match the corresponding values specified during the bind call. Any other values may result in undefined behavior. + """ + 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.CUmemGenericAllocationHandle cymcHandle + if mcHandle is None: + pmcHandle = 0 + elif isinstance(mcHandle, (CUmemGenericAllocationHandle,)): + pmcHandle = int(mcHandle) + else: + pmcHandle = int(CUmemGenericAllocationHandle(mcHandle)) + cymcHandle = pmcHandle + with nogil: + err = cydriver.cuMulticastUnbind(cymcHandle, cydev, mcOffset, size) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not None : CUmulticastGranularity_flags): + """ Calculates either the minimal or recommended granularity for multicast object. + + Calculates either the minimal or recommended granularity for a given + set of multicast object properties and returns it in granularity. This + granularity can be used as a multiple for size, bind offsets and + address mappings of the multicast object. + + Parameters + ---------- + prop : :py:obj:`~.CUmulticastObjectProp` + Properties of the multicast object. + option : :py:obj:`~.CUmulticastGranularity_flags` + Determines which granularity to return. + + 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` + granularity : int + Returned granularity. + + See Also + -------- + :py:obj:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr`, :py:obj:`~.cuMulticastUnbind` + """ + cdef size_t granularity = 0 + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop 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) + +@cython.embedsignature(True) +def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): + """ Returns information about a pointer. + + The supported attributes are: + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_CONTEXT`: + + - Returns in `*data` the :py:obj:`~.CUcontext` in which `ptr` was + allocated or registered. The type of `data` must be + :py:obj:`~.CUcontext` *. + + - If `ptr` was not allocated by, mapped by, or registered with a + :py:obj:`~.CUcontext` which uses unified virtual addressing then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMORY_TYPE`: + + - Returns in `*data` the physical memory type of the memory that `ptr` + addresses as a :py:obj:`~.CUmemorytype` enumerated value. The type of + `data` must be unsigned int. + + - If `ptr` addresses device memory then `*data` is set to + :py:obj:`~.CU_MEMORYTYPE_DEVICE`. The particular :py:obj:`~.CUdevice` + on which the memory resides is the :py:obj:`~.CUdevice` of the + :py:obj:`~.CUcontext` returned by the + :py:obj:`~.CU_POINTER_ATTRIBUTE_CONTEXT` attribute of `ptr`. + + - If `ptr` addresses host memory then `*data` is set to + :py:obj:`~.CU_MEMORYTYPE_HOST`. + + - If `ptr` was not allocated by, mapped by, or registered with a + :py:obj:`~.CUcontext` which uses unified virtual addressing then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + - If the current :py:obj:`~.CUcontext` does not support unified virtual + addressing then :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` is returned. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_DEVICE_POINTER`: + + - 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 :py:obj:`~.CUdeviceptr` *. + + - If there exists no device pointer value through which kernels running + in the current :py:obj:`~.CUcontext` may access `ptr` then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + - If there is no current :py:obj:`~.CUcontext` then + :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` is returned. + + - Except in the exceptional disjoint addressing cases discussed below, + the value returned in `*data` will equal the input value `ptr`. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_HOST_POINTER`: + + - Returns in `*data` the host pointer value through which `ptr` may be + accessed by by the host program. The type of `data` must be void **. + If there exists no host pointer value through which the host program + may directly access `ptr` then :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + is returned. + + - Except in the exceptional disjoint addressing cases discussed below, + the value returned in `*data` will equal the input value `ptr`. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_P2P_TOKENS`: + + - Returns in `*data` two tokens for use with the nv-p2p.h Linux kernel + interface. `data` must be a struct of type + :py:obj:`~.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS`. + + - `ptr` must be a pointer to memory obtained from + :py:obj:`~.cuMemAlloc()`. Note that p2pToken and vaSpaceToken are + only valid for the lifetime of the source allocation. A subsequent + allocation at the same address may return completely different + tokens. Querying this attribute has a side effect of setting the + attribute :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS` for the region + of memory that `ptr` points to. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`: + + - A boolean attribute which when set, ensures that synchronous memory + operations initiated on the region of memory that `ptr` points to + will always synchronize. See further documentation in the section + titled "API synchronization behavior" to learn more about cases when + synchronous memory operations can exhibit asynchronous behavior. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_BUFFER_ID`: + + - Returns in `*data` a buffer ID which is guaranteed to be unique + within the process. `data` must point to an unsigned long long. + + - `ptr` must be a pointer to memory obtained from a CUDA memory + allocation API. Every memory allocation from any of the CUDA memory + allocation APIs will have a unique ID over a process lifetime. + Subsequent allocations do not reuse IDs from previous freed + allocations. IDs are only unique within a single process. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_MANAGED`: + + - Returns in `*data` a boolean that indicates whether the pointer + points to managed memory or not. + + - If `ptr` is not a valid CUDA pointer then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`: + + - Returns in `*data` an integer representing a device ordinal of a + device against which the memory was allocated or registered. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE`: + + - Returns in `*data` a boolean that indicates if this pointer maps to + an allocation that is suitable for :py:obj:`~.cudaIpcGetMemHandle`. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR`: + + - Returns in `*data` the starting address for the allocation referenced + by the device pointer `ptr`. Note that this is not necessarily the + address of the mapped region, but the address of the mappable address + range `ptr` references (e.g. from :py:obj:`~.cuMemAddressReserve`). + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_RANGE_SIZE`: + + - Returns in `*data` the size for the allocation referenced by the + device pointer `ptr`. Note that this is not necessarily the size of + the mapped region, but the size of the mappable address range `ptr` + references (e.g. from :py:obj:`~.cuMemAddressReserve`). To retrieve + the size of the mapped region, see :py:obj:`~.cuMemGetAddressRange` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MAPPED`: + + - Returns in `*data` a boolean that indicates if this pointer is in a + valid address range that is mapped to a backing allocation. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES`: + + - Returns a bitmask of the allowed handle types for an allocation that + may be passed to :py:obj:`~.cuMemExportToShareableHandle`. + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`: + + - Returns in `*data` the handle to the mempool that the allocation was + obtained from. + + - :py:obj:`~.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. + + Note that for most allocations in the unified virtual address space the + host and device pointer for accessing the allocation will be the same. + The exceptions to this are + + - user memory registered using :py:obj:`~.cuMemHostRegister` + + - host memory allocated using :py:obj:`~.cuMemHostAlloc` with the + :py:obj:`~.CU_MEMHOSTALLOC_WRITECOMBINED` flag For these types of + allocation there will exist separate, disjoint host and device + addresses for accessing the allocation. In particular + + - The host address will correspond to an invalid unmapped device + address (which will result in an exception if accessed from the + device) + + - The device address will correspond to an invalid unmapped host + address (which will result in an exception if accessed from the + host). For these types of allocations, querying + :py:obj:`~.CU_POINTER_ATTRIBUTE_HOST_POINTER` and + :py:obj:`~.CU_POINTER_ATTRIBUTE_DEVICE_POINTER` may be used to + retrieve the host and device addresses from either address. + + Parameters + ---------- + attribute : :py:obj:`~.CUpointer_attribute` + Pointer attribute to query + ptr : :py:obj:`~.CUdeviceptr` + Pointer + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + data : Any + Returned pointer attribute value + + See Also + -------- + :py:obj:`~.cuPointerSetAttribute`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuMemHostUnregister`, :py:obj:`~.cudaPointerGetAttributes` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + cdef _HelperCUpointer_attribute cydata = _HelperCUpointer_attribute(attribute, 0, is_getter=True) + cdef void* cydata_ptr = cydata.cptr + cdef cydriver.CUpointer_attribute cyattribute = int(attribute) + with nogil: + err = cydriver.cuPointerGetAttribute(cydata_ptr, cyattribute, cyptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cydata.pyObj()) + +@cython.embedsignature(True) +def cuMemPrefetchAsync(devPtr, size_t count, dstDevice, hStream): + """ Prefetches memory to the specified destination device. + + Note there is a later version of this API, + :py:obj:`~.cuMemPrefetchAsync_v2`. It will supplant this version in + 13.0, which is retained for minor version compatibility. + + Prefetches memory to the specified destination device. `devPtr` is the + base device pointer of the memory to be prefetched and `dstDevice` is + the destination device. `count` specifies the number of bytes to copy. + `hStream` is the stream in which the operation is enqueued. The memory + range must refer to managed memory allocated via + :py:obj:`~.cuMemAllocManaged` or declared via managed variables or it + may also refer to system-allocated memory on systems with non-zero + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. + + Passing in CU_DEVICE_CPU for `dstDevice` will prefetch the data to host + memory. If `dstDevice` is a GPU, then the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` must be non- + zero. Additionally, `hStream` must be associated with a device that has + a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. + + The start address and end address of the memory range will be rounded + down and rounded up respectively to be aligned to CPU page size before + the prefetch operation is enqueued in the stream. + + If no physical memory has been allocated for this region, then this + memory region will be populated and mapped on the destination device. + If there's insufficient memory to prefetch the desired region, the + Unified Memory driver may evict pages from other + :py:obj:`~.cuMemAllocManaged` allocations to host memory in order to + make room. Device memory allocated using :py:obj:`~.cuMemAlloc` or + :py:obj:`~.cuArrayCreate` will not be evicted. + + By default, any mappings to the previous location of the migrated pages + are removed and mappings for the new location are only setup on + `dstDevice`. The exact behavior however also depends on the settings + applied to this memory range via :py:obj:`~.cuMemAdvise` as described + below: + + If :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` was set on any subset of + this memory range, then that subset will create a read-only copy of the + pages on `dstDevice`. + + If :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` was called on any + subset of this memory range, then the pages will be migrated to + `dstDevice` even if `dstDevice` is not the preferred location of any + pages in the memory range. + + If :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` was called on any subset + of this memory range, then mappings to those pages from all the + appropriate processors are updated to refer to the new location if + establishing such a mapping is possible. Otherwise, those mappings are + cleared. + + Note that this API is not required for functionality and only serves to + improve performance by allowing the application to migrate data to a + suitable location before it is accessed. Memory accesses to this range + are always coherent and are allowed even when the data is actively + being migrated. + + Note that this function is asynchronous with respect to the host and + all work on other devices. + + Parameters + ---------- + devPtr : :py:obj:`~.CUdeviceptr` + Pointer to be prefetched + count : size_t + Size in bytes + dstDevice : :py:obj:`~.CUdevice` + Destination device to prefetch to + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue prefetch operation + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemPrefetchAsync` :py:obj:`~.cudaMemPrefetchAsync_v2` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUdevice cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdevice,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdevice(dstDevice)) + cydstDevice = pdstDevice + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + with nogil: + err = cydriver.cuMemPrefetchAsync(cydevPtr, count, cydstDevice, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemPrefetchAsync_v2(devPtr, size_t count, location not None : CUmemLocation, unsigned int flags, hStream): + """ Prefetches memory to the specified destination location. + + Prefetches memory to the specified destination location. `devPtr` is + the base device pointer of the memory to be prefetched and `location` + specifies the destination location. `count` specifies the number of + bytes to copy. `hStream` is the stream in which the operation is + enqueued. The memory range must refer to managed memory allocated via + :py:obj:`~.cuMemAllocManaged` or declared via managed variables. + + 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 + value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. + Additionally, `hStream` must be associated with a device that has a + non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Specifying + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` as :py:obj:`~.CUmemLocation.type` + will prefetch data to host memory. Applications can request prefetching + 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 + 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. + + The start address and end address of the memory range will be rounded + down and rounded up respectively to be aligned to CPU page size before + the prefetch operation is enqueued in the stream. + + If no physical memory has been allocated for this region, then this + memory region will be populated and mapped on the destination device. + If there's insufficient memory to prefetch the desired region, the + Unified Memory driver may evict pages from other + :py:obj:`~.cuMemAllocManaged` allocations to host memory in order to + make room. Device memory allocated using :py:obj:`~.cuMemAlloc` or + :py:obj:`~.cuArrayCreate` will not be evicted. + + By default, any mappings to the previous location of the migrated pages + are removed and mappings for the new location are only setup on the + destination location. The exact behavior however also depends on the + settings applied to this memory range via :py:obj:`~.cuMemAdvise` as + described below: + + If :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` was set on any subset of + this memory range, then that subset will create a read-only copy of the + pages on destination location. If however the destination location is a + host NUMA node, then any pages of that subset that are already in + another host NUMA node will be transferred to the destination. + + If :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` was called on any + subset of this memory range, then the pages will be migrated to + `location` even if `location` is not the preferred location of any + pages in the memory range. + + If :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` was called on any subset + of this memory range, then mappings to those pages from all the + appropriate processors are updated to refer to the new location if + establishing such a mapping is possible. Otherwise, those mappings are + cleared. + + Note that this API is not required for functionality and only serves to + improve performance by allowing the application to migrate data to a + suitable location before it is accessed. Memory accesses to this range + are always coherent and are allowed even when the data is actively + being migrated. + + Note that this function is asynchronous with respect to the host and + all work on other devices. + + Parameters + ---------- + devPtr : :py:obj:`~.CUdeviceptr` + Pointer to be prefetched + count : size_t + Size in bytes + location : :py:obj:`~.CUmemLocation` + Location to prefetch to + flags : unsigned int + flags for future use, must be zero now. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue prefetch operation + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cudaMemPrefetchAsync_v2` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + with nogil: + err = cydriver.cuMemPrefetchAsync_v2(cydevPtr, count, location._pvt_ptr[0], flags, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, device): + """ Advise about the usage of a given memory range. + + Note there is a later version of this API, :py:obj:`~.cuMemAdvise_v2`. + It will supplant this version in 13.0, which is retained for minor + version compatibility. + + Advise the Unified Memory subsystem about the usage pattern for the + memory range starting at `devPtr` with a size of `count` bytes. The + start address and end address of the memory range will be rounded down + and rounded up respectively to be aligned to CPU page size before the + advice is applied. The memory range must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables. The memory range could also refer to system-allocated + pageable memory provided it represents a valid, host-accessible region + of memory and all additional constraints imposed by `advice` as + outlined below are also satisfied. Specifying an invalid system- + allocated pageable memory range results in an error being returned. + + The `advice` parameter can take the following values: + + - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`: This implies that the data + is mostly going to be read from and only occasionally written to. Any + read accesses from any processor to this region will create a read- + only copy of at least the accessed pages in that processor's memory. + Additionally, if :py:obj:`~.cuMemPrefetchAsync` is called on this + region, it will create a read-only copy of the data on the + destination processor. If any processor writes to this region, all + copies of the corresponding page will be invalidated except for the + one where the write occurred. The `device` argument is ignored for + this advice. Note that for a page to be read-duplicated, the + accessing processor must either be the CPU or a GPU that has a non- + zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Also, if a + context is created on a device that does not have the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` + set, then read-duplication will not occur until all such contexts are + destroyed. If the memory region refers to valid system-allocated + pageable memory, then the accessing device must have a non-zero value + for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS` for a read- + only copy to be created on that device. Note however that if the + accessing device also has a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, + then setting this advice will not create a read-only copy when that + device accesses this memory region. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_READ_MOSTLY`: Undoes the effect of + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` and also prevents the + Unified Memory driver from attempting heuristic read-duplication on + the memory range. Any read-duplicated copies of the data will be + collapsed into a single copy. The location for the collapsed copy + will be the preferred location if the page has a preferred location + and one of the read-duplicated copies was resident at that location. + Otherwise, the location chosen is arbitrary. + + - :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION`: This advice sets + the preferred location for the data to be the memory belonging to + `device`. Passing in CU_DEVICE_CPU for `device` sets the preferred + location as host memory. If `device` is a GPU, then it must have a + non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Setting + the preferred location does not cause data to migrate to that + location immediately. Instead, it guides the migration policy when a + fault occurs on that memory region. If the data is already in its + preferred location and the faulting processor can establish a mapping + without requiring the data to be migrated, then data migration will + be avoided. On the other hand, if the data is not in its preferred + location or if a direct mapping cannot be established, then it will + be migrated to the processor accessing it. It is important to note + that setting the preferred location does not prevent data prefetching + done using :py:obj:`~.cuMemPrefetchAsync`. Having a preferred + location can override the page thrash detection and resolution logic + in the Unified Memory driver. Normally, if a page is detected to be + constantly thrashing between for example host and device memory, the + page may eventually be pinned to host memory by the Unified Memory + driver. But if the preferred location is set as device memory, then + the page will continue to thrash indefinitely. If + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice, unless read + accesses from `device` will not result in a read-only copy being + created on that device as outlined in description for the advice + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`. If the memory region + refers to valid system-allocated pageable memory, then `device` must + have a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`: Undoes the effect + of :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` and changes the + preferred location to none. + + - :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`: This advice implies that + the data will be accessed by `device`. Passing in + :py:obj:`~.CU_DEVICE_CPU` for `device` will set the advice for the + CPU. If `device` is a GPU, then the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` must be + non-zero. This advice does not cause data migration and has no impact + on the location of the data per se. Instead, it causes the data to + always be mapped in the specified processor's page tables, as long as + the location of the data permits a mapping to be established. If the + data gets migrated for any reason, the mappings are updated + accordingly. This advice is recommended in scenarios where data + locality is not important, but avoiding faults is. Consider for + example a system containing multiple GPUs with peer-to-peer access + enabled, where the data located on one GPU is occasionally accessed + by peer GPUs. In such scenarios, migrating data over to the other + GPUs is not as important because the accesses are infrequent and the + overhead of migration may be too high. But preventing faults can + still help improve performance, and so having a mapping set up in + advance is useful. Note that on CPU access of this data, the data may + be migrated to host memory because the CPU typically cannot access + device memory directly. Any GPU that had the + :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` flag set for this data will + now have its mapping updated to point to the page in host memory. If + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice. Additionally, if + the preferred location of this memory region or any subset of it is + also `device`, then the policies associated with + :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` will override the + policies of this advice. If the memory region refers to valid system- + allocated pageable memory, then `device` must have a non-zero value + for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, + if `device` has a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, + then this call has no effect. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_ACCESSED_BY`: Undoes the effect of + :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`. Any mappings to the data + from `device` may be removed at any time causing accesses to result + in non-fatal page faults. If the memory region refers to valid + system-allocated pageable memory, then `device` must have a non-zero + value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, + if `device` has a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, + then this call has no effect. + + Parameters + ---------- + devPtr : :py:obj:`~.CUdeviceptr` + Pointer to memory to set the advice for + count : size_t + Size in bytes of the memory range + advice : :py:obj:`~.CUmem_advise` + Advice to be applied for the specified memory range + device : :py:obj:`~.CUdevice` + Device to apply the advice for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cuMemAdvise_v2`, :py:obj:`~.cudaMemAdvise` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + cdef cydriver.CUmem_advise cyadvice = int(advice) + with nogil: + err = cydriver.cuMemAdvise(cydevPtr, count, cyadvice, cydevice) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemAdvise_v2(devPtr, size_t count, advice not None : CUmem_advise, location not None : CUmemLocation): + """ Advise about the usage of a given memory range. + + Advise the Unified Memory subsystem about the usage pattern for the + memory range starting at `devPtr` with a size of `count` bytes. The + start address and end address of the memory range will be rounded down + and rounded up respectively to be aligned to CPU page size before the + advice is applied. The memory range must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables. The memory range could also refer to system-allocated + pageable memory provided it represents a valid, host-accessible region + of memory and all additional constraints imposed by `advice` as + outlined below are also satisfied. Specifying an invalid system- + allocated pageable memory range results in an error being returned. + + The `advice` parameter can take the following values: + + - :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`: This implies that the data + is mostly going to be read from and only occasionally written to. Any + read accesses from any processor to this region will create a read- + only copy of at least the accessed pages in that processor's memory. + Additionally, if :py:obj:`~.cuMemPrefetchAsync` or + :py:obj:`~.cuMemPrefetchAsync_v2` is called on this region, it will + create a read-only copy of the data on the destination processor. If + the target location for :py:obj:`~.cuMemPrefetchAsync_v2` is a host + NUMA node and a read-only copy already exists on another host NUMA + node, that copy will be migrated to the targeted host NUMA node. If + any processor writes to this region, all copies of the corresponding + page will be invalidated except for the one where the write occurred. + If the writing processor is the CPU and the preferred location of the + page is a host NUMA node, then the page will also be migrated to that + host NUMA node. The `location` argument is ignored for this advice. + Note that for a page to be read-duplicated, the accessing processor + must either be the CPU or a GPU that has a non-zero value for the + device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Also, if a + context is created on a device that does not have the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` + set, then read-duplication will not occur until all such contexts are + destroyed. If the memory region refers to valid system-allocated + pageable memory, then the accessing device must have a non-zero value + for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS` for a read- + only copy to be created on that device. Note however that if the + accessing device also has a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, + then setting this advice will not create a read-only copy when that + device accesses this memory region. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_READ_MOSTLY`: Undoes the effect of + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` and also prevents the + Unified Memory driver from attempting heuristic read-duplication on + the memory range. Any read-duplicated copies of the data will be + collapsed into a single copy. The location for the collapsed copy + will be the preferred location if the page has a preferred location + and one of the read-duplicated copies was resident at that location. + Otherwise, the location chosen is arbitrary. Note: The `location` + argument is ignored for this advice. + + - :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` + 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 + 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 + 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 + 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 + location immediately. Instead, it guides the migration policy when a + fault occurs on that memory region. If the data is already in its + preferred location and the faulting processor can establish a mapping + without requiring the data to be migrated, then data migration will + be avoided. On the other hand, if the data is not in its preferred + location or if a direct mapping cannot be established, then it will + be migrated to the processor accessing it. It is important to note + that setting the preferred location does not prevent data prefetching + done using :py:obj:`~.cuMemPrefetchAsync`. Having a preferred + location can override the page thrash detection and resolution logic + in the Unified Memory driver. Normally, if a page is detected to be + constantly thrashing between for example host and device memory, the + page may eventually be pinned to host memory by the Unified Memory + driver. But if the preferred location is set as device memory, then + the page will continue to thrash indefinitely. If + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice, unless read + accesses from `location` will not result in a read-only copy being + created on that procesor as outlined in description for the advice + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`. If the memory region + refers to valid system-allocated pageable memory, 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- + zero alue for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`: Undoes the effect + of :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` and changes the + preferred location to none. The `location` argument is ignored for + this advice. + + - :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`: This advice implies that + 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:`~.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:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` must be + non-zero. This advice does not cause data migration and has no impact + on the location of the data per se. Instead, it causes the data to + always be mapped in the specified processor's page tables, as long as + the location of the data permits a mapping to be established. If the + data gets migrated for any reason, the mappings are updated + accordingly. This advice is recommended in scenarios where data + locality is not important, but avoiding faults is. Consider for + example a system containing multiple GPUs with peer-to-peer access + enabled, where the data located on one GPU is occasionally accessed + by peer GPUs. In such scenarios, migrating data over to the other + GPUs is not as important because the accesses are infrequent and the + overhead of migration may be too high. But preventing faults can + still help improve performance, and so having a mapping set up in + advance is useful. Note that on CPU access of this data, the data may + be migrated to host memory because the CPU typically cannot access + device memory directly. Any GPU that had the + :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` flag set for this data will + now have its mapping updated to point to the page in host memory. If + :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice. Additionally, if + the preferred location of this memory region or any subset of it is + also `location`, then the policies associated with + :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` will override the + policies of this advice. If the memory region refers to valid system- + allocated pageable memory, 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 + device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, + 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. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_ACCESSED_BY`: Undoes the effect of + :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY`. Any mappings to the data + from `location` may be removed at any time causing accesses to result + in non-fatal page faults. If the memory region refers to valid + system-allocated pageable memory, 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 + device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, + 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. + + Parameters + ---------- + devPtr : :py:obj:`~.CUdeviceptr` + Pointer to memory to set the advice for + count : size_t + Size in bytes of the memory range + advice : :py:obj:`~.CUmem_advise` + Advice to be applied for the specified memory range + location : :py:obj:`~.CUmemLocation` + location to apply the advice for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuMemcpy`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cudaMemAdvise` + """ + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + cdef cydriver.CUmem_advise cyadvice = int(advice) + with nogil: + err = cydriver.cuMemAdvise_v2(cydevPtr, count, cyadvice, location._pvt_ptr[0]) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_attribute, devPtr, size_t count): + """ Query an attribute of a given memory range. + + Query an attribute about the memory range starting at `devPtr` with a + size of `count` bytes. The memory range must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables. + + The `attribute` parameter can take the following values: + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`: If this attribute is + specified, `data` will be interpreted as a 32-bit integer, and + `dataSize` must be 4. The result returned will be 1 if all pages in + the given memory range have read-duplication enabled, or 0 otherwise. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. The result returned will be a GPU + device id if all pages in the memory range have that GPU as their + preferred location, or it will be CU_DEVICE_CPU if all pages in the + memory range have the CPU as their preferred location, or it will be + CU_DEVICE_INVALID if either all the pages don't have the same + preferred location or some of the pages don't have a preferred + location at all. Note that the actual location of the pages in the + memory range at the time of the query may be different from the + preferred location. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`: If this attribute is + specified, `data` will be interpreted as an array of 32-bit integers, + and `dataSize` must be a non-zero multiple of 4. The result returned + will be a list of device ids that had + :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` set for that entire memory + range. If any device does not have that advice set for the entire + memory range, that device will not be included. If `data` is larger + than the number of devices that have that advice set for that memory + range, CU_DEVICE_INVALID will be returned in all the extra space + provided. For ex., if `dataSize` is 12 (i.e. `data` has 3 elements) + and only device 0 has the advice set, then the result returned will + be { 0, CU_DEVICE_INVALID, CU_DEVICE_INVALID }. If `data` is smaller + than the number of devices that have that advice set, then only as + many devices will be returned as can fit in the array. There is no + guarantee on which specific devices will be returned, however. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. The result returned will be the + last location to which all pages in the memory range were prefetched + explicitly via :py:obj:`~.cuMemPrefetchAsync`. This will either be a + GPU id or CU_DEVICE_CPU depending on whether the last location for + prefetch was a GPU or the CPU respectively. If any page in the memory + range was never explicitly prefetched or if all pages were not + prefetched to the same location, CU_DEVICE_INVALID will be returned. + Note that this simply returns the last location that the application + requested to prefetch the memory range to. It gives no indication as + to whether the prefetch operation to that location has completed or + even begun. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`: If this + attribute is specified, `data` will be interpreted as a + :py:obj:`~.CUmemLocationType`, and `dataSize` must be + sizeof(CUmemLocationType). The :py:obj:`~.CUmemLocationType` returned + will be :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` if all pages in the + memory range have the same GPU as their preferred location, or + :py:obj:`~.CUmemLocationType` will be + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` if all pages in the memory + range have the CPU as their preferred location, or it will be + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` if all the pages in the + memory range have the same host NUMA node ID as their preferred + location or it will be :py:obj:`~.CU_MEM_LOCATION_TYPE_INVALID` if + either all the pages don't have the same preferred location or some + of the pages don't have a preferred location at all. Note that the + actual location type of the pages in the memory range at the time of + the query may be different from the preferred location type. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. If the + :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE` query + for the same address range returns + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, it will be a valid device + ordinal or if it returns + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, it will be a valid host + NUMA node ID or if it returns any other location type, the id + should be ignored. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`: If + this attribute is specified, `data` will be interpreted as a + :py:obj:`~.CUmemLocationType`, and `dataSize` must be + sizeof(CUmemLocationType). The result returned will be the last + location to which all pages in the memory range were prefetched + explicitly via :py:obj:`~.cuMemPrefetchAsync`. The + :py:obj:`~.CUmemLocationType` returned will be + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` if the last prefetch location + was a GPU or :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` if it was the CPU + or :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` if the last prefetch + location was a specific host NUMA node. If any page in the memory + range was never explicitly prefetched or if all pages were not + prefetched to the same location, :py:obj:`~.CUmemLocationType` will + be :py:obj:`~.CU_MEM_LOCATION_TYPE_INVALID`. Note that this simply + returns the last location type that the application requested to + prefetch the memory range to. It gives no indication as to whether + the prefetch operation to that location has completed or even begun. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID`: If + this attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. If the + :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE` + query for the same address range returns + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, it will be a valid device + ordinal or if it returns + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, it will be a valid host + NUMA node ID or if it returns any other location type, the id + should be ignored. + + Parameters + ---------- + dataSize : size_t + Array containing the size of data + attribute : :py:obj:`~.CUmem_range_attribute` + The attribute to query + devPtr : :py:obj:`~.CUdeviceptr` + Start of the range to query + count : size_t + Size of the range to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + data : Any + A pointers to a memory location where the result of each attribute + query will be written to. + + See Also + -------- + :py:obj:`~.cuMemRangeGetAttributes`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cudaMemRangeGetAttribute` + """ + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) + cdef void* cydata_ptr = cydata.cptr + cdef cydriver.CUmem_range_attribute cyattribute = int(attribute) + with nogil: + err = cydriver.cuMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr, count) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cydata.pyObj()) + +@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): + """ Query attributes of a given memory range. + + Query attributes of the memory range starting at `devPtr` with a size + of `count` bytes. The memory range must refer to managed memory + allocated via :py:obj:`~.cuMemAllocManaged` or declared via managed + variables. The `attributes` array will be interpreted to have + `numAttributes` entries. The `dataSizes` array will also be interpreted + to have `numAttributes` entries. The results of the query will be + stored in `data`. + + The list of supported attributes are given below. Please refer to + :py:obj:`~.cuMemRangeGetAttribute` for attribute descriptions and + restrictions. + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE` + + - :py:obj:`~.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID` + + Parameters + ---------- + dataSizes : list[int] + Array containing the sizes of each result + attributes : list[:py:obj:`~.CUmem_range_attribute`] + An array of attributes to query (numAttributes and the number of + attributes in this array should match) + numAttributes : size_t + Number of attributes to query + devPtr : :py:obj:`~.CUdeviceptr` + Start of the range to query + count : size_t + Size of the range to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + data : list[Any] + A two-dimensional array containing pointers to memory locations + where the result of each attribute query will be written to. + + See Also + -------- + :py:obj:`~.cuMemRangeGetAttribute`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemPrefetchAsync`, :py:obj:`~.cudaMemRangeGetAttributes` + """ + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + pdevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr,)): + pdevPtr = int(devPtr) + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + attributes = [] if attributes is None else attributes + if not all(isinstance(_x, (CUmem_range_attribute)) for _x in attributes): + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUmem_range_attribute] or list[cydriver.CUmem_range_attribute]") + if not all(isinstance(_x, (int)) for _x in dataSizes): + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) + cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr + cdef vector[size_t] cydataSizes = dataSizes + cdef vector[cydriver.CUmem_range_attribute] cyattributes = attributes + if numAttributes > len(dataSizes): raise RuntimeError("List is too small: " + str(len(dataSizes)) + " < " + str(numAttributes)) + if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) + with nogil: + err = cydriver.cuMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr, count) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, [obj.pyObj() for obj in pylist]) + +@cython.embedsignature(True) +def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): + """ Set attributes on a previously allocated memory region. + + The supported attributes are: + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`: + + - A boolean attribute that can either be set (1) or unset (0). When + set, the region of memory that `ptr` points to is guaranteed to + always synchronize memory operations that are synchronous. If there + are some previously initiated synchronous memory operations that are + pending when this attribute is set, the function does not return + until those memory operations are complete. See further documentation + in the section titled "API synchronization behavior" to learn more + about cases when synchronous memory operations can exhibit + asynchronous behavior. `value` will be considered as a pointer to an + unsigned integer to which this attribute is to be set. + + Parameters + ---------- + value : Any + Pointer to memory containing the value to be set + attribute : :py:obj:`~.CUpointer_attribute` + Pointer attribute to set + ptr : :py:obj:`~.CUdeviceptr` + Pointer to a memory region allocated using CUDA memory allocation + APIs + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuPointerGetAttribute`, :py:obj:`~.cuPointerGetAttributes`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuMemHostUnregister` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + cdef _HelperCUpointer_attribute cyvalue = _HelperCUpointer_attribute(attribute, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + cdef cydriver.CUpointer_attribute cyattribute = int(attribute) + with nogil: + err = cydriver.cuPointerSetAttribute(cyvalue_ptr, cyattribute, cyptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tuple[CUpointer_attribute] | list[CUpointer_attribute]], ptr): + """ Returns information about a pointer. + + The supported attributes are (refer to + :py:obj:`~.cuPointerGetAttribute` for attribute descriptions and + restrictions): + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_CONTEXT` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMORY_TYPE` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_DEVICE_POINTER` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_HOST_POINTER` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_BUFFER_ID` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_MANAGED` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_RANGE_SIZE` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MAPPED` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE` + + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE` + + Unlike :py:obj:`~.cuPointerGetAttribute`, this function will not return + an error when the `ptr` encountered is not a valid CUDA pointer. + Instead, the attributes are assigned default NULL values and + CUDA_SUCCESS is returned. + + If `ptr` was not allocated by, mapped by, or registered with a + :py:obj:`~.CUcontext` which uses UVA (Unified Virtual Addressing), + :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` is returned. + + Parameters + ---------- + numAttributes : unsigned int + Number of attributes to query + attributes : list[:py:obj:`~.CUpointer_attribute`] + An array of attributes to query (numAttributes and the number of + attributes in this array should match) + ptr : :py:obj:`~.CUdeviceptr` + Pointer to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + data : list[Any] + A two-dimensional array containing pointers to memory locations + where the result of each attribute query will be written to. + + See Also + -------- + :py:obj:`~.cuPointerGetAttribute`, :py:obj:`~.cuPointerSetAttribute`, :py:obj:`~.cudaPointerGetAttributes` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + attributes = [] if attributes is None else attributes + if not all(isinstance(_x, (CUpointer_attribute)) for _x in attributes): + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUpointer_attribute] or list[cydriver.CUpointer_attribute]") + if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) + cdef vector[cydriver.CUpointer_attribute] cyattributes = attributes + pylist = [_HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) + cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr + with nogil: + err = cydriver.cuPointerGetAttributes(numAttributes, cyattributes.data(), cyvoidStarHelper_ptr, cyptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, [obj.pyObj() for obj in pylist]) + +@cython.embedsignature(True) +def cuStreamCreate(unsigned int Flags): + """ Create a stream. + + Creates a stream and returns a handle in `phStream`. The `Flags` + argument determines behaviors of the stream. + + Valid values for `Flags` are: + + - :py:obj:`~.CU_STREAM_DEFAULT`: Default stream creation flag. + + - :py:obj:`~.CU_STREAM_NON_BLOCKING`: Specifies that work running in + the created stream may run concurrently with work in stream 0 (the + NULL stream), and that the created stream should perform no implicit + synchronization with stream 0. + + Parameters + ---------- + Flags : unsigned int + Parameters for stream creation + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phStream : :py:obj:`~.CUstream` + Returned newly created stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice` :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` + """ + cdef CUstream phStream = CUstream() + with nogil: + err = cydriver.cuStreamCreate(phStream._pvt_ptr, Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phStream) + +@cython.embedsignature(True) +def cuStreamCreateWithPriority(unsigned int flags, int priority): + """ Create a stream with the given priority. + + Creates a stream with the specified priority and returns a handle in + `phStream`. This affects the scheduling priority of work in the stream. + Priorities provide a hint to preferentially run work with higher + priority when possible, but do not preempt already-running work or + provide any other functional guarantee on execution order. + + `priority` follows a convention where lower numbers represent higher + priorities. '0' represents default priority. The range of meaningful + numerical priorities can be queried using + :py:obj:`~.cuCtxGetStreamPriorityRange`. If the specified priority is + outside the numerical range returned by + :py:obj:`~.cuCtxGetStreamPriorityRange`, it will automatically be + clamped to the lowest or the highest number in the range. + + Parameters + ---------- + flags : unsigned int + Flags for stream creation. See :py:obj:`~.cuStreamCreate` for a + list of valid flags + priority : int + Stream priority. Lower numbers represent higher priorities. See + :py:obj:`~.cuCtxGetStreamPriorityRange` for more information about + meaningful stream priorities that can be passed. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phStream : :py:obj:`~.CUstream` + Returned newly created stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuCtxGetStreamPriorityRange`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreateWithPriority` + + Notes + ----- + Stream priorities are supported only on GPUs with compute capability 3.5 or higher. + + In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream priorities have no effect on host-to-device and device-to-host memory operations. + """ + cdef CUstream phStream = CUstream() + with nogil: + err = cydriver.cuStreamCreateWithPriority(phStream._pvt_ptr, flags, priority) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phStream) + +@cython.embedsignature(True) +def cuStreamGetPriority(hStream): + """ Query the priority of a given stream. + + Query the priority of a stream created using + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority` or + :py:obj:`~.cuGreenCtxStreamCreate` and return the priority in + `priority`. Note that if the stream was created with a priority outside + the numerical range returned by + :py:obj:`~.cuCtxGetStreamPriorityRange`, this function returns the + clamped priority. See :py:obj:`~.cuStreamCreateWithPriority` for + details about priority clamping. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + priority : int + Pointer to a signed integer in which the stream's priority is + returned + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuCtxGetStreamPriorityRange`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cudaStreamGetPriority` + """ + 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 int priority = 0 + with nogil: + err = cydriver.cuStreamGetPriority(cyhStream, &priority) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, priority) + +@cython.embedsignature(True) +def cuStreamGetDevice(hStream): + """ Returns the device handle of the stream. + + Returns in `*device` the device handle of the stream + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + device : :py:obj:`~.CUdevice` + Returns the device to which a stream belongs + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetFlags` + """ + 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 CUdevice device = CUdevice() + with nogil: + err = cydriver.cuStreamGetDevice(cyhStream, device._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, device) + +@cython.embedsignature(True) +def cuStreamGetFlags(hStream): + """ Query the flags of a given stream. + + Query the flags of a stream created using :py:obj:`~.cuStreamCreate`, + :py:obj:`~.cuStreamCreateWithPriority` or + :py:obj:`~.cuGreenCtxStreamCreate` and return the flags in `flags`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + flags : unsigned int + Pointer to an unsigned integer in which the stream's flags are + returned The value returned in `flags` is a logical 'OR' of all + flags that were used while creating this stream. See + :py:obj:`~.cuStreamCreate` for the list of valid flags + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cuStreamGetDevice` + """ + 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 unsigned int flags = 0 + with nogil: + err = cydriver.cuStreamGetFlags(cyhStream, &flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, flags) + +@cython.embedsignature(True) +def cuStreamGetId(hStream): + """ Returns the unique Id associated with the stream handle supplied. + + Returns in `streamId` the unique Id which is associated with the given + stream handle. The Id is unique for the life of the program. + + The stream handle `hStream` can refer to any of the following: + + - a stream created via any of the CUDA driver APIs such as + :py:obj:`~.cuStreamCreate` and + :py:obj:`~.cuStreamCreateWithPriority`, or their runtime API + equivalents such as :py:obj:`~.cudaStreamCreate`, + :py:obj:`~.cudaStreamCreateWithFlags` and + :py:obj:`~.cudaStreamCreateWithPriority`. Passing an invalid handle + will result in undefined behavior. + + - any of the special streams such as the NULL stream, + :py:obj:`~.CU_STREAM_LEGACY` and :py:obj:`~.CU_STREAM_PER_THREAD`. + The runtime API equivalents of these are also accepted, which are + NULL, :py:obj:`~.cudaStreamLegacy` and + :py:obj:`~.cudaStreamPerThread` respectively. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + streamId : unsigned long long + Pointer to store the Id of the stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cudaStreamGetId` + """ + 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 unsigned long long streamId = 0 + with nogil: + err = cydriver.cuStreamGetId(cyhStream, &streamId) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, streamId) + +@cython.embedsignature(True) +def cuStreamGetCtx(hStream): + """ Query the context associated with a stream. + + Returns the CUDA context that the stream is associated with. + + Note there is a later version of this API, + :py:obj:`~.cuStreamGetCtx_v2`. It will supplant this version in CUDA + 13.0. It is recommended to use :py:obj:`~.cuStreamGetCtx_v2` till then + as this version will return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` for + streams created via the API :py:obj:`~.cuGreenCtxStreamCreate`. + + The stream handle `hStream` can refer to any of the following: + + - a stream created via any of the CUDA driver APIs such as + :py:obj:`~.cuStreamCreate` and + :py:obj:`~.cuStreamCreateWithPriority`, or their runtime API + equivalents such as :py:obj:`~.cudaStreamCreate`, + :py:obj:`~.cudaStreamCreateWithFlags` and + :py:obj:`~.cudaStreamCreateWithPriority`. The returned context is the + context that was active in the calling thread when the stream was + created. Passing an invalid handle will result in undefined behavior. + + - any of the special streams such as the NULL stream, + :py:obj:`~.CU_STREAM_LEGACY` and :py:obj:`~.CU_STREAM_PER_THREAD`. + The runtime API equivalents of these are also accepted, which are + NULL, :py:obj:`~.cudaStreamLegacy` and + :py:obj:`~.cudaStreamPerThread` respectively. Specifying any of the + special handles will return the context current to the calling + thread. If no context is current to the calling thread, + :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` is returned. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pctx : :py:obj:`~.CUcontext` + Returned context associated with the stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice` :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cuStreamGetCtx_v2`, :py:obj:`~.cudaStreamCreateWithFlags` + """ + 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 CUcontext pctx = CUcontext() + with nogil: + err = cydriver.cuStreamGetCtx(cyhStream, pctx._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pctx) + +@cython.embedsignature(True) +def cuStreamGetCtx_v2(hStream): + """ Query the contexts associated with a stream. + + Returns the contexts that the stream is associated with. + + If the stream is associated with a green context, the API returns the + green context in `pGreenCtx` and the primary context of the associated + device in `pCtx`. + + If the stream is associated with a regular context, the API returns the + regular context in `pCtx` and NULL in `pGreenCtx`. + + The stream handle `hStream` can refer to any of the following: + + - a stream created via any of the CUDA driver APIs such as + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority` + and :py:obj:`~.cuGreenCtxStreamCreate`, or their runtime API + equivalents such as :py:obj:`~.cudaStreamCreate`, + :py:obj:`~.cudaStreamCreateWithFlags` and + :py:obj:`~.cudaStreamCreateWithPriority`. Passing an invalid handle + will result in undefined behavior. + + - any of the special streams such as the NULL stream, + :py:obj:`~.CU_STREAM_LEGACY` and :py:obj:`~.CU_STREAM_PER_THREAD`. + The runtime API equivalents of these are also accepted, which are + NULL, :py:obj:`~.cudaStreamLegacy` and + :py:obj:`~.cudaStreamPerThread` respectively. If any of the special + handles are specified, the API will operate on the context current to + the calling thread. If a green context (that was converted via + :py:obj:`~.cuCtxFromGreenCtx()` before setting it current) is current + to the calling thread, the API will return the green context in + `pGreenCtx` and the primary context of the associated device in + `pCtx`. If a regular context is current, the API returns the regular + context in `pCtx` and NULL in `pGreenCtx`. Note that specifying + :py:obj:`~.CU_STREAM_PER_THREAD` or :py:obj:`~.cudaStreamPerThread` + will return :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` if a green context + is current to the calling thread. If no context is current to the + calling thread, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` is returned. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + 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` + pCtx : :py:obj:`~.CUcontext` + Returned regular context associated with the stream + pGreenCtx : :py:obj:`~.CUgreenCtx` + Returned green context if the stream is associated with a green + context or NULL if not + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate` :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef CUcontext pCtx = CUcontext() + cdef CUgreenCtx pGreenCtx = CUgreenCtx() + with nogil: + err = cydriver.cuStreamGetCtx_v2(cyhStream, pCtx._pvt_ptr, pGreenCtx._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pCtx, pGreenCtx) + +@cython.embedsignature(True) +def cuStreamWaitEvent(hStream, hEvent, unsigned int Flags): + """ Make a compute stream wait on an event. + + Makes all future work submitted to `hStream` wait for all work captured + in `hEvent`. See :py:obj:`~.cuEventRecord()` for details on what is + captured by an event. The synchronization will be performed efficiently + on the device when applicable. `hEvent` may be from a different context + or device than `hStream`. + + flags include: + + - :py:obj:`~.CU_EVENT_WAIT_DEFAULT`: Default event creation flag. + + - :py:obj:`~.CU_EVENT_WAIT_EXTERNAL`: Event is captured in the graph as + an external event node when performing stream capture. This flag is + invalid outside of stream capture. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to wait + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait on (may not be NULL) + Flags : unsigned int + See :py:obj:`~.CUevent_capture_flags` + + 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`, + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cudaStreamWaitEvent` + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + with nogil: + err = cydriver.cuStreamWaitEvent(cyhStream, cyhEvent, Flags) + return (_CUresult(err),) + +ctypedef struct cuStreamCallbackData_st: + cydriver.CUstreamCallback callback + void *userData + +ctypedef cuStreamCallbackData_st cuStreamCallbackData + +@cython.show_performance_hints(False) +cdef void cuStreamCallbackWrapper(cydriver.CUstream stream, cydriver.CUresult status, void *data) nogil: + cdef cuStreamCallbackData *cbData = data + with gil: + cbData.callback(stream, status, cbData.userData) + free(cbData) + +@cython.embedsignature(True) +def cuStreamAddCallback(hStream, callback, userData, unsigned int flags): + """ Add a callback to a compute stream. + + Adds a callback to be called on the host after all currently enqueued + items in the stream have completed. For each cuStreamAddCallback call, + the callback will be executed exactly once. The callback will block + later work in the stream until it is finished. + + The callback may be passed :py:obj:`~.CUDA_SUCCESS` or an error code. + In the event of a device error, all subsequently executed callbacks + will receive an appropriate :py:obj:`~.CUresult`. + + Callbacks must not make any CUDA API calls. Attempting to use a CUDA + API will result in :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`. Callbacks must + not perform any synchronization that may depend on outstanding device + work or other callbacks that are not mandated to run earlier. Callbacks + without a mandated order (in independent streams) execute in undefined + order and may be serialized. + + For the purposes of Unified Memory, callback execution makes a number + of guarantees: + + - The callback stream is considered idle for the duration of the + callback. Thus, for example, a callback may always use memory + attached to the callback stream. + + - The start of execution of a callback has the same effect as + synchronizing an event recorded in the same stream immediately prior + to the callback. It thus synchronizes streams which have been + "joined" prior to the callback. + + - Adding device work to any stream does not have the effect of making + the stream active until all preceding host functions and stream + callbacks have executed. Thus, for example, a callback might use + global attached memory even if work has been added to another stream, + if the work has been ordered behind the callback with an event. + + - Completion of a callback does not cause a stream to become active + except as described above. The callback stream will remain idle if no + device work follows the callback, and will remain idle across + consecutive callbacks without device work in between. Thus, for + example, stream synchronization can be done by signaling from a + callback at the end of the stream. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to add callback to + callback : :py:obj:`~.CUstreamCallback` + The function to call once preceding stream operations are complete + userData : Any + User specified data to be passed to the callback function + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuMemAllocManaged`, :py:obj:`~.cuStreamAttachMemAsync`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cudaStreamAddCallback` + + Notes + ----- + This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device error, consider using :py:obj:`~.cuLaunchHostFunc`. Additionally, this function is not supported with :py:obj:`~.cuStreamBeginCapture` and :py:obj:`~.cuStreamEndCapture`, unlike :py:obj:`~.cuLaunchHostFunc`. + """ + cdef cydriver.CUstreamCallback cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (CUstreamCallback,)): + pcallback = int(callback) + else: + pcallback = int(CUstreamCallback(callback)) + cycallback = pcallback + 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 _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cuStreamCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (CUresult.CUDA_ERROR_OUT_OF_MEMORY,) + cbData.callback = cycallback + cbData.userData = cyuserData + + with nogil: + err = cydriver.cuStreamAddCallback(cyhStream, cuStreamCallbackWrapper, cbData, flags) + if err != cydriver.CUDA_SUCCESS: + free(cbData) + _helper_input_void_ptr_free(&cyuserDataHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): + """ Begins graph capture on a stream. + + Begin graph capture on `hStream`. When a stream is in capture mode, all + operations pushed into the stream will not be executed, but will + instead be captured into a graph, which will be returned via + :py:obj:`~.cuStreamEndCapture`. Capture may not be initiated if + `stream` is CU_STREAM_LEGACY. Capture must be ended on the same stream + in which it was initiated, and it may only be initiated if the stream + is not already in capture mode. The capture mode may be queried via + :py:obj:`~.cuStreamIsCapturing`. A unique id representing the capture + sequence may be queried via :py:obj:`~.cuStreamGetCaptureInfo`. + + If `mode` is not :py:obj:`~.CU_STREAM_CAPTURE_MODE_RELAXED`, + :py:obj:`~.cuStreamEndCapture` must be called on this stream from the + same thread. + + 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`. + + 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:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamEndCapture`, :py:obj:`~.cuThreadExchangeStreamCaptureMode` + + Notes + ----- + Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + 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) + with nogil: + err = cydriver.cuStreamBeginCapture(cyhStream, cymode) + 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): + """ Begins graph capture on a stream to an existing graph. + + Begin graph capture on `hStream`, placing new nodes into an existing + graph. When a stream is in capture mode, all operations pushed into the + stream will not be executed, but will instead be captured into + `hGraph`. The graph will not be instantiable until the user calls + :py:obj:`~.cuStreamEndCapture`. + + Capture may not be initiated if `stream` is CU_STREAM_LEGACY. Capture + must be ended on the same stream in which it was initiated, and it may + only be initiated if the stream is not already in capture mode. The + capture mode may be queried via :py:obj:`~.cuStreamIsCapturing`. A + unique id representing the capture sequence may be queried via + :py:obj:`~.cuStreamGetCaptureInfo`. + + If `mode` is not :py:obj:`~.CU_STREAM_CAPTURE_MODE_RELAXED`, + :py:obj:`~.cuStreamEndCapture` must be called on this stream from the + same thread. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to initiate capture. + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to capture into. + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the first node captured in the stream. Can be NULL + if numDependencies is 0. + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] + Optional array of data associated with each dependency. + numDependencies : size_t + Number of dependencies. + 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`. + + 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:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamEndCapture`, :py:obj:`~.cuThreadExchangeStreamCaptureMode`, :py:obj:`~.cuGraphAddNode` + + Notes + ----- + Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cydriver.CUgraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.CUstreamCaptureMode cymode = int(mode) + with nogil: + err = cydriver.cuStreamBeginCaptureToGraph(cyhStream, cyhGraph, cydependencies, cydependencyData, numDependencies, cymode) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuThreadExchangeStreamCaptureMode(mode not None : CUstreamCaptureMode): + """ Swaps the stream capture interaction mode for a thread. + + Sets the calling thread's stream capture interaction mode to the value + contained in `*mode`, and overwrites `*mode` with the previous mode for + the thread. To facilitate deterministic behavior across function or + module boundaries, callers are encouraged to use this API in a push-pop + fashion: + + **View CUDA Toolkit Documentation for a C++ code example** + + During stream capture (see :py:obj:`~.cuStreamBeginCapture`), some + actions, such as a call to :py:obj:`~.cudaMalloc`, may be unsafe. In + the case of :py:obj:`~.cudaMalloc`, the operation is not enqueued + asynchronously to a stream, and is not observed by stream capture. + Therefore, if the sequence of operations captured via + :py:obj:`~.cuStreamBeginCapture` depended on the allocation being + replayed whenever the graph is launched, the captured graph would be + invalid. + + Therefore, stream capture places restrictions on API calls that can be + made within or concurrently to a + :py:obj:`~.cuStreamBeginCapture`-:py:obj:`~.cuStreamEndCapture` + sequence. This behavior can be controlled via this API and flags to + :py:obj:`~.cuStreamBeginCapture`. + + A thread's mode is one of the following: + + - `CU_STREAM_CAPTURE_MODE_GLOBAL:` This is the default mode. If the + local thread has an ongoing capture sequence that was not initiated + with `CU_STREAM_CAPTURE_MODE_RELAXED` at `cuStreamBeginCapture`, or + if any other thread has a concurrent capture sequence initiated with + `CU_STREAM_CAPTURE_MODE_GLOBAL`, this thread is prohibited from + potentially unsafe API calls. + + - `CU_STREAM_CAPTURE_MODE_THREAD_LOCAL:` If the local thread has an + ongoing capture sequence not initiated with + `CU_STREAM_CAPTURE_MODE_RELAXED`, it is prohibited from potentially + unsafe API calls. Concurrent capture sequences in other threads are + ignored. + + - `CU_STREAM_CAPTURE_MODE_RELAXED:` The local thread is not prohibited + from potentially unsafe API calls. Note that the thread is still + prohibited from API calls which necessarily conflict with stream + capture, for example, attempting :py:obj:`~.cuEventQuery` on an event + that was last recorded inside a capture sequence. + + Parameters + ---------- + mode : :py:obj:`~.CUstreamCaptureMode` + Pointer to mode value to swap with the current mode + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + mode : :py:obj:`~.CUstreamCaptureMode` + Pointer to mode value to swap with the current mode + + See Also + -------- + :py:obj:`~.cuStreamBeginCapture` + """ + cdef cydriver.CUstreamCaptureMode cymode = int(mode) + with nogil: + err = cydriver.cuThreadExchangeStreamCaptureMode(&cymode) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUstreamCaptureMode(cymode)) + +@cython.embedsignature(True) +def cuStreamEndCapture(hStream): + """ Ends capture on a stream, returning the captured graph. + + End capture on `hStream`, returning the captured graph via `phGraph`. + Capture must have been initiated on `hStream` via a call to + :py:obj:`~.cuStreamBeginCapture`. If capture was invalidated, due to a + violation of the rules of stream capture, then a NULL graph will be + returned. + + If the `mode` argument to :py:obj:`~.cuStreamBeginCapture` was not + :py:obj:`~.CU_STREAM_CAPTURE_MODE_RELAXED`, this call must be from the + same thread as :py:obj:`~.cuStreamBeginCapture`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD` + phGraph : :py:obj:`~.CUgraph` + The captured graph + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuGraphDestroy` + """ + 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 CUgraph phGraph = CUgraph() + with nogil: + err = cydriver.cuStreamEndCapture(cyhStream, phGraph._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraph) + +@cython.embedsignature(True) +def cuStreamIsCapturing(hStream): + """ Returns a stream's capture status. + + Return the capture status of `hStream` via `captureStatus`. After a + successful call, `*captureStatus` will contain one of the following: + + - :py:obj:`~.CU_STREAM_CAPTURE_STATUS_NONE`: The stream is not + capturing. + + - :py:obj:`~.CU_STREAM_CAPTURE_STATUS_ACTIVE`: The stream is capturing. + + - :py:obj:`~.CU_STREAM_CAPTURE_STATUS_INVALIDATED`: The stream was + capturing but an error has invalidated the capture sequence. The + capture sequence must be terminated with + :py:obj:`~.cuStreamEndCapture` on the stream where it was initiated + in order to continue using `hStream`. + + Note that, if this is called on :py:obj:`~.CU_STREAM_LEGACY` (the "null + stream") while a blocking stream in the same context is capturing, it + will return :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT` and + `*captureStatus` is unspecified after the call. The blocking stream + capture is not invalidated. + + When a blocking stream is capturing, the legacy stream is in an + unusable state until the blocking stream capture is terminated. The + legacy stream is not supported for stream capture, but attempted use + would have an implicit dependency on the capturing stream(s). + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT` + captureStatus : :py:obj:`~.CUstreamCaptureStatus` + Returns the stream's capture status + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamEndCapture` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUstreamCaptureStatus captureStatus + with nogil: + err = cydriver.cuStreamIsCapturing(cyhStream, &captureStatus) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus)) + +@cython.embedsignature(True) +def cuStreamGetCaptureInfo(hStream): + """ Query a stream's capture state. + + Query stream state related to stream capture. + + If called on :py:obj:`~.CU_STREAM_LEGACY` (the "null stream") while a + stream not created with :py:obj:`~.CU_STREAM_NON_BLOCKING` is + capturing, returns :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`. + + Valid data (other than capture status) is returned only if both of the + following are true: + + - the call returns CUDA_SUCCESS + + - the returned capture status is + :py:obj:`~.CU_STREAM_CAPTURE_STATUS_ACTIVE` + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT` + captureStatus_out : :py:obj:`~.CUstreamCaptureStatus` + Location to return the capture status of the stream; required + id_out : :py:obj:`~.cuuint64_t` + Optional location to return an id for the capture sequence, which + is unique over the lifetime of the process + graph_out : :py:obj:`~.CUgraph` + Optional location to return the graph being captured into. All + operations other than destroy and node removal are permitted on the + graph while the capture sequence is in progress. This API does not + transfer ownership of the graph, which is transferred or destroyed + at :py:obj:`~.cuStreamEndCapture`. Note that the graph handle may + be invalidated before end of capture for certain errors. Nodes that + are or become unreachable from the original stream at + :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph + do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. + dependencies_out : list[:py:obj:`~.CUgraphNode`] + Optional location to store a pointer to an array of nodes. The next + node to be captured in the stream will depend on this set of nodes, + absent operations such as event wait which modify this set. The + array pointer is valid until the next API call which operates on + the stream or until the capture is terminated. The node handles may + be copied out and are valid until they or the graph is destroyed. + The driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. + numDependencies_out : int + Optional location to store the size of the array returned in + dependencies_out. + + See Also + -------- + :py:obj:`~.cuStreamGetCaptureInfo_v3` :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamUpdateCaptureDependencies` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUstreamCaptureStatus captureStatus_out + cdef cuuint64_t id_out = cuuint64_t() + cdef CUgraph graph_out = CUgraph() + cdef const cydriver.CUgraphNode* cydependencies_out = NULL + pydependencies_out = [] + cdef size_t numDependencies_out = 0 + with nogil: + err = cydriver.cuStreamGetCaptureInfo(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) + if CUresult(err) == CUresult(0): + pydependencies_out = [CUgraphNode() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None, None, None, None) + return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) + +@cython.embedsignature(True) +def cuStreamGetCaptureInfo_v3(hStream): + """ Query a stream's capture state (12.3+). + + Query stream state related to stream capture. + + If called on :py:obj:`~.CU_STREAM_LEGACY` (the "null stream") while a + stream not created with :py:obj:`~.CU_STREAM_NON_BLOCKING` is + capturing, returns :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`. + + Valid data (other than capture status) is returned only if both of the + following are true: + + - the call returns CUDA_SUCCESS + + - the returned capture status is + :py:obj:`~.CU_STREAM_CAPTURE_STATUS_ACTIVE` + + If `edgeData_out` is non-NULL then `dependencies_out` must be as well. + If `dependencies_out` is non-NULL and `edgeData_out` is NULL, but there + is non-zero edge data for one or more of the current stream + dependencies, the call will return :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY` + captureStatus_out : :py:obj:`~.CUstreamCaptureStatus` + Location to return the capture status of the stream; required + id_out : :py:obj:`~.cuuint64_t` + Optional location to return an id for the capture sequence, which + is unique over the lifetime of the process + graph_out : :py:obj:`~.CUgraph` + Optional location to return the graph being captured into. All + operations other than destroy and node removal are permitted on the + graph while the capture sequence is in progress. This API does not + transfer ownership of the graph, which is transferred or destroyed + at :py:obj:`~.cuStreamEndCapture`. Note that the graph handle may + be invalidated before end of capture for certain errors. Nodes that + are or become unreachable from the original stream at + :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph + do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. + dependencies_out : list[:py:obj:`~.CUgraphNode`] + Optional location to store a pointer to an array of nodes. The next + node to be captured in the stream will depend on this set of nodes, + absent operations such as event wait which modify this set. The + array pointer is valid until the next API call which operates on + the stream or until the capture is terminated. The node handles may + be copied out and are valid until they or the graph is destroyed. + The driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. + edgeData_out : list[:py:obj:`~.CUgraphEdgeData`] + Optional location to store a pointer to an array of graph edge + data. This array parallels `dependencies_out`; the next node to be + added has an edge to `dependencies_out`[i] with annotation + `edgeData_out`[i] for each `i`. The array pointer is valid until + the next API call which operates on the stream or until the capture + is terminated. + numDependencies_out : int + Optional location to store the size of the array returned in + dependencies_out. + + See Also + -------- + :py:obj:`~.cuStreamGetCaptureInfo`, :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamUpdateCaptureDependencies` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUstreamCaptureStatus captureStatus_out + cdef cuuint64_t id_out = cuuint64_t() + cdef CUgraph graph_out = CUgraph() + cdef const cydriver.CUgraphNode* cydependencies_out = NULL + pydependencies_out = [] + cdef const cydriver.CUgraphEdgeData* cyedgeData_out = NULL + pyedgeData_out = [] + cdef size_t numDependencies_out = 0 + with nogil: + err = cydriver.cuStreamGetCaptureInfo_v3(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) + if CUresult(err) == CUresult(0): + 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() 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) + +@cython.embedsignature(True) +def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream (11.3+). + + Modifies the dependency set of a capturing stream. The dependency set + is the set of nodes that the next captured node in the stream will + depend on. + + Valid flags are :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES` and + :py:obj:`~.CU_STREAM_SET_CAPTURE_DEPENDENCIES`. These control whether + the set passed to the API is added to the existing set or replaces it. + A flags value of 0 defaults to + :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES`. + + Nodes that are removed from the dependency set via this API do not + result in :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED` if they are + unreachable from the stream at :py:obj:`~.cuStreamEndCapture`. + + Returns :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if the stream is not + capturing. + + This API is new in CUDA 11.3. Developers requiring compatibility across + minor versions to CUDA 11.0 should not use this API or provide a + fallback. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to update + dependencies : list[:py:obj:`~.CUgraphNode`] + The set of dependencies to add + numDependencies : size_t + The size of the dependencies array + flags : unsigned int + See above + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamGetCaptureInfo`, + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuStreamUpdateCaptureDependencies(cyhStream, cydependencies, numDependencies, flags) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream (12.3+). + + Modifies the dependency set of a capturing stream. The dependency set + is the set of nodes that the next captured node in the stream will + depend on along with the edge data for those dependencies. + + Valid flags are :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES` and + :py:obj:`~.CU_STREAM_SET_CAPTURE_DEPENDENCIES`. These control whether + the set passed to the API is added to the existing set or replaces it. + A flags value of 0 defaults to + :py:obj:`~.CU_STREAM_ADD_CAPTURE_DEPENDENCIES`. + + Nodes that are removed from the dependency set via this API do not + result in :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED` if they are + unreachable from the stream at :py:obj:`~.cuStreamEndCapture`. + + Returns :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if the stream is not + capturing. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to update + dependencies : list[:py:obj:`~.CUgraphNode`] + The set of dependencies to add + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] + Optional array of data associated with each dependency. + numDependencies : size_t + The size of the dependencies array + flags : unsigned int + See above + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamGetCaptureInfo` + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cydriver.CUgraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + with nogil: + err = cydriver.cuStreamUpdateCaptureDependencies_v2(cyhStream, cydependencies, cydependencyData, numDependencies, flags) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamAttachMemAsync(hStream, dptr, size_t length, unsigned int flags): + """ Attach memory to a stream asynchronously. + + Enqueues an operation in `hStream` to specify stream association of + `length` bytes of memory starting from `dptr`. This function is a + stream-ordered operation, meaning that it is dependent on, and will + only take effect when, previous work in stream has completed. Any + previous association is automatically replaced. + + `dptr` must point to one of the following types of memories: + + - managed memory declared using the managed keyword or allocated with + :py:obj:`~.cuMemAllocManaged`. + + - a valid host-accessible region of system-allocated pageable memory. + This type of memory may only be specified if the device associated + with the stream reports a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. + + For managed allocations, `length` must be either zero or the entire + allocation's size. Both indicate that the entire allocation's stream + association is being changed. Currently, it is not possible to change + stream association for a portion of a managed allocation. + + For pageable host allocations, `length` must be non-zero. + + The stream association is specified using `flags` which must be one of + :py:obj:`~.CUmemAttach_flags`. If the :py:obj:`~.CU_MEM_ATTACH_GLOBAL` + flag is specified, the memory can be accessed by any stream on any + device. If the :py:obj:`~.CU_MEM_ATTACH_HOST` flag is specified, the + program makes a guarantee that it won't access the memory on the device + from any stream on a device that has a zero value for the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. If + the :py:obj:`~.CU_MEM_ATTACH_SINGLE` flag is specified and `hStream` is + associated with a device that has a zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`, the program + makes a guarantee that it will only access the memory on the device + from `hStream`. It is illegal to attach singly to the NULL stream, + because the NULL stream is a virtual global stream and not a specific + stream. An error will be returned in this case. + + When memory is associated with a single stream, the Unified Memory + system will allow CPU access to this memory region so long as all + operations in `hStream` have completed, regardless of whether other + streams are active. In effect, this constrains exclusive ownership of + the managed memory region by an active GPU to per-stream activity + instead of whole-GPU activity. + + Accessing memory on the device from streams that are not associated + with it will produce undefined results. No error checking is performed + by the Unified Memory system to ensure that kernels launched into other + streams do not access this region. + + It is a program's responsibility to order calls to + :py:obj:`~.cuStreamAttachMemAsync` via events, synchronization or other + means to ensure legal access to memory at all times. Data visibility + and coherency will be changed appropriately for all kernels which + follow a stream-association change. + + If `hStream` is destroyed while data is associated with it, the + association is removed and the association reverts to the default + visibility of the allocation as specified at + :py:obj:`~.cuMemAllocManaged`. For managed variables, the default + association is always :py:obj:`~.CU_MEM_ATTACH_GLOBAL`. Note that + destroying a stream is an asynchronous operation, and as a result, the + change to default association won't happen until all work in the stream + has completed. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to enqueue the attach operation + dptr : :py:obj:`~.CUdeviceptr` + Pointer to memory (must be a pointer to managed memory or to a + valid host-accessible region of system-allocated pageable memory) + length : size_t + Length of memory + flags : unsigned int + Must be one of :py:obj:`~.CUmemAttach_flags` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuMemAllocManaged`, :py:obj:`~.cudaStreamAttachMemAsync` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + with nogil: + err = cydriver.cuStreamAttachMemAsync(cyhStream, cydptr, length, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamQuery(hStream): + """ Determine status of a compute stream. + + Returns :py:obj:`~.CUDA_SUCCESS` if all operations in the stream + specified by `hStream` have completed, or + :py:obj:`~.CUDA_ERROR_NOT_READY` if not. + + For the purposes of Unified Memory, a return value of + :py:obj:`~.CUDA_SUCCESS` is equivalent to having called + :py:obj:`~.cuStreamSynchronize()`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to query status of + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_READY` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamQuery` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + with nogil: + err = cydriver.cuStreamQuery(cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamSynchronize(hStream): + """ Wait until a stream's tasks are completed. + + Waits until the device has completed all operations in the stream + specified by `hStream`. If the context was created with the + :py:obj:`~.CU_CTX_SCHED_BLOCKING_SYNC` flag, the CPU thread will block + until the stream is finished with all of its tasks. + + \note_null_stream + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to wait for + + 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` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamSynchronize` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + with nogil: + err = cydriver.cuStreamSynchronize(cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamDestroy(hStream): + """ Destroys a stream. + + Destroys the stream specified by `hStream`. + + In case the device is still doing work in the stream `hStream` when + :py:obj:`~.cuStreamDestroy()` is called, the function will return + immediately and the resources associated with `hStream` will be + released automatically once the device has completed all work in + `hStream`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamDestroy` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + with nogil: + err = cydriver.cuStreamDestroy(cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamCopyAttributes(dst, src): + """ Copies attributes from source stream to destination stream. + + Copies attributes from source stream `src` to destination stream `dst`. + Both streams must have the same context. + + Parameters + ---------- + dst : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Destination stream + src : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Source stream For list of attributes see :py:obj:`~.CUstreamAttrID` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.CUaccessPolicyWindow` + """ + cdef cydriver.CUstream cysrc + if src is None: + psrc = 0 + elif isinstance(src, (CUstream,)): + psrc = int(src) + else: + psrc = int(CUstream(src)) + cysrc = psrc + cdef cydriver.CUstream cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (CUstream,)): + pdst = int(dst) + else: + pdst = int(CUstream(dst)) + cydst = pdst + with nogil: + err = cydriver.cuStreamCopyAttributes(cydst, cysrc) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamGetAttribute(hStream, attr not None : CUstreamAttrID): + """ Queries stream attribute. + + Queries attribute `attr` from `hStream` and stores it in corresponding + member of `value_out`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + + 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` + """ + 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.CUstreamAttrID cyattr = int(attr) + cdef CUstreamAttrValue value_out = CUstreamAttrValue() + with nogil: + err = cydriver.cuStreamGetAttribute(cyhStream, cyattr, value_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, value_out) + +@cython.embedsignature(True) +def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Optional[CUstreamAttrValue]): + """ Sets stream attribute. + + Sets attribute `attr` on `hStream` from corresponding attribute of + `value`. The updated attribute will be applied to subsequent work + submitted to the stream. It will not affect previously submitted work. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + + attr : :py:obj:`~.CUstreamAttrID` + + value : :py:obj:`~.CUstreamAttrValue` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.CUaccessPolicyWindow` + """ + 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.CUstreamAttrID cyattr = int(attr) + 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),) + +@cython.embedsignature(True) +def cuEventCreate(unsigned int Flags): + """ Creates an event. + + Creates an event *phEvent for the current context with the flags + specified via `Flags`. Valid flags include: + + - :py:obj:`~.CU_EVENT_DEFAULT`: Default event creation flag. + + - :py:obj:`~.CU_EVENT_BLOCKING_SYNC`: Specifies that the created event + should use blocking synchronization. A CPU thread that uses + :py:obj:`~.cuEventSynchronize()` to wait on an event created with + this flag will block until the event has actually been recorded. + + - :py:obj:`~.CU_EVENT_DISABLE_TIMING`: Specifies that the created event + does not need to record timing data. Events created with this flag + specified and the :py:obj:`~.CU_EVENT_BLOCKING_SYNC` flag not + specified will provide the best performance when used with + :py:obj:`~.cuStreamWaitEvent()` and :py:obj:`~.cuEventQuery()`. + + - :py:obj:`~.CU_EVENT_INTERPROCESS`: Specifies that the created event + may be used as an interprocess event by + :py:obj:`~.cuIpcGetEventHandle()`. :py:obj:`~.CU_EVENT_INTERPROCESS` + must be specified along with :py:obj:`~.CU_EVENT_DISABLE_TIMING`. + + Parameters + ---------- + Flags : unsigned int + Event creation flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phEvent : :py:obj:`~.CUevent` + Returns newly created event + + See Also + -------- + :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cudaEventCreate`, :py:obj:`~.cudaEventCreateWithFlags` + """ + cdef CUevent phEvent = CUevent() + with nogil: + err = cydriver.cuEventCreate(phEvent._pvt_ptr, Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phEvent) + +@cython.embedsignature(True) +def cuEventRecord(hEvent, hStream): + """ Records an event. + + Captures in `hEvent` the contents of `hStream` at the time of this + call. `hEvent` and `hStream` must be from the same context otherwise + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. Calls such as + :py:obj:`~.cuEventQuery()` or :py:obj:`~.cuStreamWaitEvent()` will then + examine or wait for completion of the work that was captured. Uses of + `hStream` after this call do not modify `hEvent`. See note on default + stream behavior for what is captured in the default case. + + :py:obj:`~.cuEventRecord()` can be called multiple times on the same + event and will overwrite the previously captured state. Other APIs such + as :py:obj:`~.cuStreamWaitEvent()` use the most recently captured state + at the time of the API call, and are not affected by later calls to + :py:obj:`~.cuEventRecord()`. Before the first call to + :py:obj:`~.cuEventRecord()`, an event represents an empty set of work, + so for example :py:obj:`~.cuEventQuery()` would return + :py:obj:`~.CUDA_SUCCESS`. + + Parameters + ---------- + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to record event for + + 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_VALUE` + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cuEventRecordWithFlags` + """ + 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.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + with nogil: + err = cydriver.cuEventRecord(cyhEvent, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEventRecordWithFlags(hEvent, hStream, unsigned int flags): + """ Records an event. + + Captures in `hEvent` the contents of `hStream` at the time of this + call. `hEvent` and `hStream` must be from the same context otherwise + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. Calls such as + :py:obj:`~.cuEventQuery()` or :py:obj:`~.cuStreamWaitEvent()` will then + examine or wait for completion of the work that was captured. Uses of + `hStream` after this call do not modify `hEvent`. See note on default + stream behavior for what is captured in the default case. + + :py:obj:`~.cuEventRecordWithFlags()` can be called multiple times on + the same event and will overwrite the previously captured state. Other + APIs such as :py:obj:`~.cuStreamWaitEvent()` use the most recently + captured state at the time of the API call, and are not affected by + later calls to :py:obj:`~.cuEventRecordWithFlags()`. Before the first + call to :py:obj:`~.cuEventRecordWithFlags()`, an event represents an + empty set of work, so for example :py:obj:`~.cuEventQuery()` would + return :py:obj:`~.CUDA_SUCCESS`. + + flags include: + + - :py:obj:`~.CU_EVENT_RECORD_DEFAULT`: Default event creation flag. + + - :py:obj:`~.CU_EVENT_RECORD_EXTERNAL`: Event is captured in the graph + as an external event node when performing stream capture. This flag + is invalid outside of stream capture. + + Parameters + ---------- + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to record event for + flags : unsigned int + See :py:obj:`~.CUevent_capture_flags` + + 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_VALUE` + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cudaEventRecord` + """ + 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.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + with nogil: + err = cydriver.cuEventRecordWithFlags(cyhEvent, cyhStream, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEventQuery(hEvent): + """ Queries an event's status. + + Queries the status of all work currently captured by `hEvent`. See + :py:obj:`~.cuEventRecord()` for details on what is captured by an + event. + + Returns :py:obj:`~.CUDA_SUCCESS` if all captured work has been + completed, or :py:obj:`~.CUDA_ERROR_NOT_READY` if any captured work is + incomplete. + + For the purposes of Unified Memory, a return value of + :py:obj:`~.CUDA_SUCCESS` is equivalent to having called + :py:obj:`~.cuEventSynchronize()`. + + Parameters + ---------- + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_READY` + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cudaEventQuery` + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + with nogil: + err = cydriver.cuEventQuery(cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEventSynchronize(hEvent): + """ Waits for an event to complete. + + Waits until the completion of all work currently captured in `hEvent`. + See :py:obj:`~.cuEventRecord()` for details on what is captured by an + event. + + Waiting for an event that was created with the + :py:obj:`~.CU_EVENT_BLOCKING_SYNC` flag will cause the calling CPU + thread to block until the event has been completed by the device. If + the :py:obj:`~.CU_EVENT_BLOCKING_SYNC` flag has not been set, then the + CPU thread will busy-wait until the event has been completed by the + device. + + Parameters + ---------- + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait for + + 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` + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cudaEventSynchronize` + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + with nogil: + err = cydriver.cuEventSynchronize(cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEventDestroy(hEvent): + """ Destroys an event. + + Destroys the event specified by `hEvent`. + + An event may be destroyed before it is complete (i.e., while + :py:obj:`~.cuEventQuery()` would return + :py:obj:`~.CUDA_ERROR_NOT_READY`). In this case, the call does not + block on completion of the event, and any associated resources will + automatically be released asynchronously at completion. + + Parameters + ---------- + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to destroy + + 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` + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventElapsedTime`, :py:obj:`~.cudaEventDestroy` + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + with nogil: + err = cydriver.cuEventDestroy(cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEventElapsedTime(hStart, hEnd): + """ Computes the elapsed time between two events. + + Computes the elapsed time between two events (in milliseconds with a + resolution of around 0.5 microseconds). + + If either event was last recorded in a non-NULL stream, the resulting + time may be greater than expected (even if both used the same stream + handle). This happens because the :py:obj:`~.cuEventRecord()` operation + takes place asynchronously and there is no guarantee that the measured + latency is actually just between the two events. Any number of other + different stream operations could execute in between the two measured + events, thus altering the timing in a significant way. + + If :py:obj:`~.cuEventRecord()` has not been called on either event then + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. If + :py:obj:`~.cuEventRecord()` has been called on both events but one or + both of them has not yet been completed (that is, + :py:obj:`~.cuEventQuery()` would return + :py:obj:`~.CUDA_ERROR_NOT_READY` on at least one of the events), + :py:obj:`~.CUDA_ERROR_NOT_READY` is returned. If either event was + created with the :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag, then this + function will return :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`. + + Note there is a later version of this API, + :py:obj:`~.cuEventElapsedTime_v2`. It will supplant this version in + CUDA 13.0, which is retained for minor version compatibility. + + Parameters + ---------- + hStart : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Starting event + hEnd : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Ending event + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_READY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pMilliseconds : float + Time between `hStart` and `hEnd` in ms + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cudaEventElapsedTime` + """ + cdef cydriver.CUevent cyhEnd + if hEnd is None: + phEnd = 0 + elif isinstance(hEnd, (CUevent,)): + phEnd = int(hEnd) + else: + phEnd = int(CUevent(hEnd)) + cyhEnd = phEnd + cdef cydriver.CUevent cyhStart + if hStart is None: + phStart = 0 + elif isinstance(hStart, (CUevent,)): + phStart = int(hStart) + else: + phStart = int(CUevent(hStart)) + cyhStart = phStart + cdef float pMilliseconds = 0 + with nogil: + err = cydriver.cuEventElapsedTime(&pMilliseconds, cyhStart, cyhEnd) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pMilliseconds) + +@cython.embedsignature(True) +def cuEventElapsedTime_v2(hStart, hEnd): + """ Computes the elapsed time between two events. + + Computes the elapsed time between two events (in milliseconds with a + resolution of around 0.5 microseconds). Note this API is not guaranteed + to return the latest errors for pending work. As such this API is + intended to serve as an elapsed time calculation only and any polling + for completion on the events to be compared should be done with + :py:obj:`~.cuEventQuery` instead. + + If either event was last recorded in a non-NULL stream, the resulting + time may be greater than expected (even if both used the same stream + handle). This happens because the :py:obj:`~.cuEventRecord()` operation + takes place asynchronously and there is no guarantee that the measured + latency is actually just between the two events. Any number of other + different stream operations could execute in between the two measured + events, thus altering the timing in a significant way. + + If :py:obj:`~.cuEventRecord()` has not been called on either event then + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. If + :py:obj:`~.cuEventRecord()` has been called on both events but one or + both of them has not yet been completed (that is, + :py:obj:`~.cuEventQuery()` would return + :py:obj:`~.CUDA_ERROR_NOT_READY` on at least one of the events), + :py:obj:`~.CUDA_ERROR_NOT_READY` is returned. If either event was + created with the :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag, then this + function will return :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`. + + Parameters + ---------- + hStart : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Starting event + hEnd : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Ending event + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_READY`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + pMilliseconds : float + Time between `hStart` and `hEnd` in ms + + See Also + -------- + :py:obj:`~.cuEventCreate`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy`, :py:obj:`~.cudaEventElapsedTime` + """ + cdef cydriver.CUevent cyhEnd + if hEnd is None: + phEnd = 0 + elif isinstance(hEnd, (CUevent,)): + phEnd = int(hEnd) + else: + phEnd = int(CUevent(hEnd)) + cyhEnd = phEnd + cdef cydriver.CUevent cyhStart + if hStart is None: + phStart = 0 + elif isinstance(hStart, (CUevent,)): + phStart = int(hStart) + else: + phStart = int(CUevent(hStart)) + cyhStart = phStart + cdef float pMilliseconds = 0 + with nogil: + err = cydriver.cuEventElapsedTime_v2(&pMilliseconds, cyhStart, cyhEnd) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pMilliseconds) + +@cython.embedsignature(True) +def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_DESC]): + """ Imports an external memory object. + + Imports an externally allocated memory object and returns a handle to + that in `extMem_out`. + + The properties of the handle being imported must be described in + `memHandleDesc`. The :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC` + structure is defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` specifies the + type of handle being imported. :py:obj:`~.CUexternalMemoryHandleType` + is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + 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 + 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 + 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 + 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. + + 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 + 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 + 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 + 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 + 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 + 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 + IDXGIResource::GetSharedHandle when referring to a ID3D11Resource + object and + :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 + 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 + maintain coherence between CUDA and the other drivers. See + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC` and + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC` for + memory synchronization. + + The size of the memory object must be specified in + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.size`. + + Specifying the flag :py:obj:`~.CUDA_EXTERNAL_MEMORY_DEDICATED` in + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.flags` indicates that the + resource is a dedicated resource. The definition of what a dedicated + resource is outside the scope of this extension. This flag must be set + if :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is one of the + following: :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE` + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE` + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT` + + Parameters + ---------- + memHandleDesc : :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC` + Memory import handle descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OPERATING_SYSTEM` + extMem_out : :py:obj:`~.CUexternalMemory` + Returned handle to an external memory object + + See Also + -------- + :py:obj:`~.cuDestroyExternalMemory`, :py:obj:`~.cuExternalMemoryGetMappedBuffer`, :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` + + Notes + ----- + If the Vulkan memory imported into CUDA is mapped on the CPU then the application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges as well as appropriate Vulkan pipeline barriers to maintain coherence between CPU and GPU. For more information on these APIs, please refer to "Synchronization + 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 + 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) + +@cython.embedsignature(True) +def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_MEMORY_BUFFER_DESC]): + """ Maps a buffer onto an imported memory object. + + Maps a buffer onto an imported memory object and returns a device + pointer in `devPtr`. + + The properties of the buffer being mapped must be described in + `bufferDesc`. The :py:obj:`~.CUDA_EXTERNAL_MEMORY_BUFFER_DESC` + structure is defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.CUDA_EXTERNAL_MEMORY_BUFFER_DESC.offset` is the offset + in the memory object where the buffer's base address is. + :py:obj:`~.CUDA_EXTERNAL_MEMORY_BUFFER_DESC.size` is the size of the + buffer. :py:obj:`~.CUDA_EXTERNAL_MEMORY_BUFFER_DESC.flags` must be + zero. + + The offset and size have to be suitably aligned to match the + requirements of the external API. Mapping two buffers whose ranges + overlap may or may not result in the same virtual address being + returned for the overlapped portion. In such cases, the application + must ensure that all accesses to that region from the GPU are volatile. + Otherwise writes made via one address are not guaranteed to be visible + via the other address, even if they're issued by the same thread. It is + recommended that applications map the combined range instead of mapping + separate buffers and then apply the appropriate offsets to the returned + pointer to derive the individual buffers. + + The returned pointer `devPtr` must be freed using + :py:obj:`~.cuMemFree`. + + Parameters + ---------- + extMem : :py:obj:`~.CUexternalMemory` + Handle to external memory object + bufferDesc : :py:obj:`~.CUDA_EXTERNAL_MEMORY_BUFFER_DESC` + Buffer descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + devPtr : :py:obj:`~.CUdeviceptr` + Returned device pointer to buffer + + See Also + -------- + :py:obj:`~.cuImportExternalMemory`, :py:obj:`~.cuDestroyExternalMemory`, :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` + """ + cdef cydriver.CUexternalMemory cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (CUexternalMemory,)): + pextMem = int(extMem) + else: + 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 + with nogil: + err = cydriver.cuExternalMemoryGetMappedBuffer(devPtr._pvt_ptr, cyextMem, cybufferDesc_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, devPtr) + +@cython.embedsignature(True) +def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC]): + """ Maps a CUDA mipmapped array onto an external memory object. + + Maps a CUDA mipmapped array onto an external object and returns a + handle to it in `mipmap`. + + The properties of the CUDA mipmapped array being mapped must be + described in `mipmapDesc`. The structure + :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC` is defined as + follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.offset` is + the offset in the memory object where the base level of the mipmap + chain is. + :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.arrayDesc` + describes the format, dimensions and type of the base level of the + mipmap chain. For further details on these parameters, please refer to + the documentation for :py:obj:`~.cuMipmappedArrayCreate`. Note that if + 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.numLevels` + specifies the total number of levels in the mipmap chain. + + If `extMem` was imported from a handle of type + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, then + :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.numLevels` must be + equal to 1. + + The returned CUDA mipmapped array must be freed using + :py:obj:`~.cuMipmappedArrayDestroy`. + + Parameters + ---------- + extMem : :py:obj:`~.CUexternalMemory` + Handle to external memory object + mipmapDesc : :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC` + CUDA array descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + mipmap : :py:obj:`~.CUmipmappedArray` + Returned CUDA mipmapped array + + See Also + -------- + :py:obj:`~.cuImportExternalMemory`, :py:obj:`~.cuDestroyExternalMemory`, :py:obj:`~.cuExternalMemoryGetMappedBuffer` + """ + cdef cydriver.CUexternalMemory cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (CUexternalMemory,)): + pextMem = int(extMem) + else: + 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 + with nogil: + err = cydriver.cuExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, mipmap) + +@cython.embedsignature(True) +def cuDestroyExternalMemory(extMem): + """ Destroys an external memory object. + + Destroys the specified external memory object. Any existing buffers and + CUDA mipmapped arrays mapped onto this object must no longer be used + and must be explicitly freed using :py:obj:`~.cuMemFree` and + :py:obj:`~.cuMipmappedArrayDestroy` respectively. + + Parameters + ---------- + extMem : :py:obj:`~.CUexternalMemory` + External memory object to be destroyed + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuImportExternalMemory`, :py:obj:`~.cuExternalMemoryGetMappedBuffer`, :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` + """ + cdef cydriver.CUexternalMemory cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (CUexternalMemory,)): + pextMem = int(extMem) + else: + pextMem = int(CUexternalMemory(extMem)) + cyextMem = pextMem + with nogil: + err = cydriver.cuDestroyExternalMemory(cyextMem) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC]): + """ Imports an external semaphore. + + Imports an externally allocated synchronization object and returns a + handle to that in `extSem_out`. + + The properties of the handle being imported must be described in + `semHandleDesc`. The :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC` is + defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` specifies + the type of handle being imported. + :py:obj:`~.CUexternalSemaphoreHandleType` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + 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 + 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_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 + 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 + 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` + 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. + + 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 + 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 + 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` + represents a valid shared NT handle that is returned by + ID3D11Fence::CreateSharedHandle. If + :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` + 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` + 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 + 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` + 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. + + 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. + + 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 + 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 + not NULL, then it must name a valid synchronization object. + + Parameters + ---------- + semHandleDesc : :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC` + Semaphore import handle descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OPERATING_SYSTEM` + extSem_out : :py:obj:`~.CUexternalSemaphore` + Returned handle to an external semaphore + + See Also + -------- + :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 + 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) + +@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): + """ Signals a set of external semaphore objects. + + Enqueues a signal operation on a set of externally allocated semaphore + object in the specified stream. The operations will be executed when + all prior operations in the stream complete. + + The exact semantics of signaling a semaphore depends on the type of the + object. + + If the semaphore object is any one of the following types: + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT` then + signaling the semaphore will set it to the signaled state. + + If the semaphore object is any one of the following types: + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`, + :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`. + + 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` + 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`. + 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 + :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`. This ensures that + any subsequent accesses made by other importers of the same set of + NvSciBuf memory object(s) are coherent. These operations can be skipped + by specifying the flag + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`, which + can be used as a performance optimization when data coherency is not + required. But specifying this flag in scenarios where data coherency is + required results in undefined behavior. Also, for semaphore object of + the type :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`, if + the NvSciSyncAttrList used to create the NvSciSyncObj had not set the + flags in :py:obj:`~.cuDeviceGetNvSciSyncAttributes` to + CUDA_NVSCISYNC_ATTR_SIGNAL, this API will return + CUDA_ERROR_NOT_SUPPORTED. NvSciSyncFence associated with semaphore + object of the type + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC` can be + deterministic. For this the NvSciSyncAttrList used to create the + semaphore object must have value of + NvSciSyncAttrKey_RequireDeterministicFences key set to true. + Deterministic fences allow users to enqueue a wait over the semaphore + object even before corresponding signal is enqueued. For such a + semaphore object, CUDA guarantees that each signal operation will + increment the fence value by '1'. Users are expected to track count of + signals enqueued on the semaphore object and insert waits accordingly. + When such a semaphore object is signaled from multiple streams, due to + concurrent stream execution, it is possible that the order in which the + semaphore gets signaled is indeterministic. This could lead to waiters + of the semaphore getting unblocked incorrectly. Users are expected to + handle such situations, either by not using the same semaphore object + with deterministic fence support enabled in different streams or by + adding explicit dependency amongst such streams so that the semaphore + is signaled in order. + + If the semaphore object is any one of the following types: + :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`. + + Parameters + ---------- + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] + Set of external semaphores to be signaled + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`] + Array of semaphore parameters + numExtSems : unsigned int + Number of semaphores to signal + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue the signal operations in + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + paramsArray = [] if paramsArray is None else paramsArray + if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,)) for _x in paramsArray): + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,]") + extSemArray = [] if extSemArray is None else extSemArray + if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") + cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL + if len(extSemArray) > 1: + cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) + if cyextSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(extSemArray)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + else: + for idx in range(len(extSemArray)): + cyextSemArray[idx] = (extSemArray[idx])._pvt_ptr[0] + elif len(extSemArray) == 1: + cyextSemArray = (extSemArray[0])._pvt_ptr + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* cyparamsArray = NULL + if len(paramsArray) > 1: + cyparamsArray = calloc(len(paramsArray), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + if cyparamsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS))) + for idx in range(len(paramsArray)): + string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + elif len(paramsArray) == 1: + cyparamsArray = (paramsArray[0])._pvt_ptr + if numExtSems > len(extSemArray): raise RuntimeError("List is too small: " + str(len(extSemArray)) + " < " + str(numExtSems)) + if numExtSems > len(paramsArray): raise RuntimeError("List is too small: " + str(len(paramsArray)) + " < " + str(numExtSems)) + with nogil: + err = cydriver.cuSignalExternalSemaphoresAsync(cyextSemArray, cyparamsArray, numExtSems, cystream) + if len(extSemArray) > 1 and cyextSemArray is not NULL: + free(cyextSemArray) + if len(paramsArray) > 1 and cyparamsArray is not NULL: + free(cyparamsArray) + return (_CUresult(err),) + +@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): + """ Waits on a set of external semaphore objects. + + Enqueues a wait operation on a set of externally allocated semaphore + object in the specified stream. The operations will be executed when + all prior operations in the stream complete. + + The exact semantics of waiting on a semaphore depends on the type of + the object. + + If the semaphore object is any one of the following types: + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT` then + waiting on the semaphore will wait until the semaphore reaches the + signaled state. The semaphore will then be reset to the unsignaled + state. Therefore for every signal operation, there can only be one wait + operation. + + If the semaphore object is any one of the following types: + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`, + :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`, + :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`. + + 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` + 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:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`. This ensures that + any subsequent accesses made by other importers of the same set of + NvSciBuf memory object(s) are coherent. These operations can be skipped + by specifying the flag + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`, which + can be used as a performance optimization when data coherency is not + required. But specifying this flag in scenarios where data coherency is + required results in undefined behavior. Also, for semaphore object of + the type :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`, if + the NvSciSyncAttrList used to create the NvSciSyncObj had not set the + flags in :py:obj:`~.cuDeviceGetNvSciSyncAttributes` to + CUDA_NVSCISYNC_ATTR_WAIT, this API will return + CUDA_ERROR_NOT_SUPPORTED. + + If the semaphore object is any one of the following types: + :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 acquired when it is released with the key + specified in + :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` + 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 + used to specify infinite timeout. + + Parameters + ---------- + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] + External semaphores to be waited on + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`] + Array of semaphore parameters + numExtSems : unsigned int + Number of semaphores to wait on + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue the wait operations in + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_TIMEOUT` + + See Also + -------- + :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync` + """ + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + paramsArray = [] if paramsArray is None else paramsArray + if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,)) for _x in paramsArray): + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,]") + extSemArray = [] if extSemArray is None else extSemArray + if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") + cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL + if len(extSemArray) > 1: + cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) + if cyextSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(extSemArray)) + 'x' + str(sizeof(cydriver.CUexternalSemaphore))) + else: + for idx in range(len(extSemArray)): + cyextSemArray[idx] = (extSemArray[idx])._pvt_ptr[0] + elif len(extSemArray) == 1: + cyextSemArray = (extSemArray[0])._pvt_ptr + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* cyparamsArray = NULL + if len(paramsArray) > 1: + cyparamsArray = calloc(len(paramsArray), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + if cyparamsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS))) + for idx in range(len(paramsArray)): + string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + elif len(paramsArray) == 1: + cyparamsArray = (paramsArray[0])._pvt_ptr + if numExtSems > len(extSemArray): raise RuntimeError("List is too small: " + str(len(extSemArray)) + " < " + str(numExtSems)) + if numExtSems > len(paramsArray): raise RuntimeError("List is too small: " + str(len(paramsArray)) + " < " + str(numExtSems)) + with nogil: + err = cydriver.cuWaitExternalSemaphoresAsync(cyextSemArray, cyparamsArray, numExtSems, cystream) + if len(extSemArray) > 1 and cyextSemArray is not NULL: + free(cyextSemArray) + if len(paramsArray) > 1 and cyparamsArray is not NULL: + free(cyparamsArray) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDestroyExternalSemaphore(extSem): + """ Destroys an external semaphore. + + Destroys an external semaphore object and releases any references to + the underlying resource. Any outstanding signals or waits must have + completed before the semaphore is destroyed. + + Parameters + ---------- + extSem : :py:obj:`~.CUexternalSemaphore` + External semaphore to be destroyed + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUexternalSemaphore cyextSem + if extSem is None: + pextSem = 0 + elif isinstance(extSem, (CUexternalSemaphore,)): + pextSem = int(extSem) + else: + pextSem = int(CUexternalSemaphore(extSem)) + cyextSem = pextSem + with nogil: + err = cydriver.cuDestroyExternalSemaphore(cyextSem) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamWaitValue32(stream, addr, value, unsigned int flags): + """ Wait on a memory location. + + Enqueues a synchronization of the stream on the given memory location. + Work ordered after the operation will block until the given condition + on the memory is satisfied. By default, the condition is to wait for + (int32_t)(*addr - value) >= 0, a cyclic greater-or-equal. Other + condition types can be specified via `flags`. + + If the memory was registered via :py:obj:`~.cuMemHostRegister()`, the + device pointer should be obtained with + :py:obj:`~.cuMemHostGetDevicePointer()`. This function cannot be used + with managed memory (:py:obj:`~.cuMemAllocManaged`). + + Support for CU_STREAM_WAIT_VALUE_NOR can be queried with + :py:obj:`~.cuDeviceGetAttribute()` and + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V2`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to synchronize on the memory location. + addr : :py:obj:`~.CUdeviceptr` + The memory location to wait on. + value : Any + The value to compare with the memory location. + flags : unsigned int + See :py:obj:`~.CUstreamWaitValue_flags`. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamWaitValue64`, :py:obj:`~.cuStreamWriteValue32`, :py:obj:`~.cuStreamWriteValue64`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. + """ + cdef cydriver.cuuint32_t cyvalue + if value is None: + pvalue = 0 + elif isinstance(value, (cuuint32_t,)): + pvalue = int(value) + else: + pvalue = int(cuuint32_t(value)) + cyvalue = pvalue + cdef cydriver.CUdeviceptr cyaddr + if addr is None: + paddr = 0 + elif isinstance(addr, (CUdeviceptr,)): + paddr = int(addr) + else: + paddr = int(CUdeviceptr(addr)) + cyaddr = paddr + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + with nogil: + err = cydriver.cuStreamWaitValue32(cystream, cyaddr, cyvalue, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamWaitValue64(stream, addr, value, unsigned int flags): + """ Wait on a memory location. + + Enqueues a synchronization of the stream on the given memory location. + Work ordered after the operation will block until the given condition + on the memory is satisfied. By default, the condition is to wait for + (int64_t)(*addr - value) >= 0, a cyclic greater-or-equal. Other + condition types can be specified via `flags`. + + If the memory was registered via :py:obj:`~.cuMemHostRegister()`, the + device pointer should be obtained with + :py:obj:`~.cuMemHostGetDevicePointer()`. + + Support for this can be queried with :py:obj:`~.cuDeviceGetAttribute()` + and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to synchronize on the memory location. + addr : :py:obj:`~.CUdeviceptr` + The memory location to wait on. + value : Any + The value to compare with the memory location. + flags : unsigned int + See :py:obj:`~.CUstreamWaitValue_flags`. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamWaitValue32`, :py:obj:`~.cuStreamWriteValue32`, :py:obj:`~.cuStreamWriteValue64`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. + """ + cdef cydriver.cuuint64_t cyvalue + if value is None: + pvalue = 0 + elif isinstance(value, (cuuint64_t,)): + pvalue = int(value) + else: + pvalue = int(cuuint64_t(value)) + cyvalue = pvalue + cdef cydriver.CUdeviceptr cyaddr + if addr is None: + paddr = 0 + elif isinstance(addr, (CUdeviceptr,)): + paddr = int(addr) + else: + paddr = int(CUdeviceptr(addr)) + cyaddr = paddr + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + with nogil: + err = cydriver.cuStreamWaitValue64(cystream, cyaddr, cyvalue, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamWriteValue32(stream, addr, value, unsigned int flags): + """ Write a value to memory. + + Write a value to memory. + + If the memory was registered via :py:obj:`~.cuMemHostRegister()`, the + device pointer should be obtained with + :py:obj:`~.cuMemHostGetDevicePointer()`. This function cannot be used + with managed memory (:py:obj:`~.cuMemAllocManaged`). + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to do the write in. + addr : :py:obj:`~.CUdeviceptr` + The device address to write to. + value : Any + The value to write. + flags : unsigned int + See :py:obj:`~.CUstreamWriteValue_flags`. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamWriteValue64`, :py:obj:`~.cuStreamWaitValue32`, :py:obj:`~.cuStreamWaitValue64`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuEventRecord` + """ + cdef cydriver.cuuint32_t cyvalue + if value is None: + pvalue = 0 + elif isinstance(value, (cuuint32_t,)): + pvalue = int(value) + else: + pvalue = int(cuuint32_t(value)) + cyvalue = pvalue + cdef cydriver.CUdeviceptr cyaddr + if addr is None: + paddr = 0 + elif isinstance(addr, (CUdeviceptr,)): + paddr = int(addr) + else: + paddr = int(CUdeviceptr(addr)) + cyaddr = paddr + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + with nogil: + err = cydriver.cuStreamWriteValue32(cystream, cyaddr, cyvalue, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamWriteValue64(stream, addr, value, unsigned int flags): + """ Write a value to memory. + + Write a value to memory. + + If the memory was registered via :py:obj:`~.cuMemHostRegister()`, the + device pointer should be obtained with + :py:obj:`~.cuMemHostGetDevicePointer()`. + + Support for this can be queried with :py:obj:`~.cuDeviceGetAttribute()` + and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to do the write in. + addr : :py:obj:`~.CUdeviceptr` + The device address to write to. + value : Any + The value to write. + flags : unsigned int + See :py:obj:`~.CUstreamWriteValue_flags`. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamWriteValue32`, :py:obj:`~.cuStreamWaitValue32`, :py:obj:`~.cuStreamWaitValue64`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cuEventRecord` + """ + cdef cydriver.cuuint64_t cyvalue + if value is None: + pvalue = 0 + elif isinstance(value, (cuuint64_t,)): + pvalue = int(value) + else: + pvalue = int(cuuint64_t(value)) + cyvalue = pvalue + cdef cydriver.CUdeviceptr cyaddr + if addr is None: + paddr = 0 + elif isinstance(addr, (CUdeviceptr,)): + paddr = int(addr) + else: + paddr = int(CUdeviceptr(addr)) + cyaddr = paddr + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + with nogil: + err = cydriver.cuStreamWriteValue64(cystream, cyaddr, cyvalue, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[CUstreamBatchMemOpParams] | list[CUstreamBatchMemOpParams]], unsigned int flags): + """ Batch operations to synchronize the stream via memory operations. + + This is a batch version of :py:obj:`~.cuStreamWaitValue32()` and + :py:obj:`~.cuStreamWriteValue32()`. Batching operations may avoid some + performance overhead in both the API call and the device execution + versus adding them to the stream in separate API calls. The operations + are enqueued in the order they appear in the array. + + See :py:obj:`~.CUstreamBatchMemOpType` for the full set of supported + operations, and :py:obj:`~.cuStreamWaitValue32()`, + :py:obj:`~.cuStreamWaitValue64()`, :py:obj:`~.cuStreamWriteValue32()`, + and :py:obj:`~.cuStreamWriteValue64()` for details of specific + operations. + + See related APIs for details on querying support for specific + operations. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. + count : unsigned int + The number of operations in the array. Must be less than 256. + paramArray : list[:py:obj:`~.CUstreamBatchMemOpParams`] + The types and parameters of the individual operations. + flags : unsigned int + Reserved for future expansion; must be 0. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamWaitValue32`, :py:obj:`~.cuStreamWaitValue64`, :py:obj:`~.cuStreamWriteValue32`, :py:obj:`~.cuStreamWriteValue64`, :py:obj:`~.cuMemHostRegister` + + Notes + ----- + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. For more information, see the Stream Memory Operations section in the programming guide(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html). + """ + paramArray = [] if paramArray is None else paramArray + if not all(isinstance(_x, (CUstreamBatchMemOpParams,)) for _x in paramArray): + raise TypeError("Argument 'paramArray' is not instance of type (expected tuple[cydriver.CUstreamBatchMemOpParams,] or list[cydriver.CUstreamBatchMemOpParams,]") + cdef cydriver.CUstream cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + else: + pstream = int(CUstream(stream)) + cystream = pstream + if count > len(paramArray): raise RuntimeError("List is too small: " + str(len(paramArray)) + " < " + str(count)) + cdef cydriver.CUstreamBatchMemOpParams* cyparamArray = NULL + if len(paramArray) > 1: + cyparamArray = calloc(len(paramArray), sizeof(cydriver.CUstreamBatchMemOpParams)) + if cyparamArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramArray)) + 'x' + str(sizeof(cydriver.CUstreamBatchMemOpParams))) + for idx in range(len(paramArray)): + string.memcpy(&cyparamArray[idx], (paramArray[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + elif len(paramArray) == 1: + cyparamArray = (paramArray[0])._pvt_ptr + with nogil: + err = cydriver.cuStreamBatchMemOp(cystream, count, cyparamArray, flags) + if len(paramArray) > 1 and cyparamArray is not NULL: + free(cyparamArray) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): + """ Returns information about a function. + + Returns in `*pi` the integer value of the attribute `attrib` on the + kernel given by `hfunc`. The supported attributes are: + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`: The maximum + number of threads per block, beyond which a launch of the function + would fail. This number depends on both the function and the device + on which the function is currently loaded. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`: The size in bytes of + statically-allocated shared memory per block required by this + function. This does not include dynamically-allocated shared memory + requested by the user at runtime. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`: The size in bytes of + user-allocated constant memory required by this function. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`: The size in bytes of + local memory used by each thread of this function. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NUM_REGS`: The number of registers used + by each thread of this function. + + - :py:obj:`~.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. + + - :py:obj:`~.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. + + - :py:obj:`~.CU_FUNC_CACHE_MODE_CA`: The attribute to indicate whether + the function has been compiled with user specified option "-Xptxas + --dlcm=ca" set . + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`: The + maximum size in bytes of dynamically-allocated shared memory. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`: + Preferred shared memory-L1 cache split ratio in percent of total + shared memory. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`: If this + attribute is set, the kernel must launch with a valid cluster size + specified. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`: The required + cluster width in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`: The required + cluster height in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`: The required + cluster depth in blocks. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`: + Indicates whether the function can be launched with non-portable + cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster + size may only function on the specific SKUs the program is tested on. + The launch might fail if the program is run on a different hardware + platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist + with checking whether the desired size can be launched on the current + device. A portable cluster size is guaranteed to be functional on all + compute capabilities higher than the target compute capability. The + portable cluster size for sm_90 is 8 blocks per cluster. This value + may increase for future compute capabilities. The specific hardware + unit may support higher cluster sizes that’s not guaranteed to be + portable. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: + The block scheduling policy of a function. The value type is + :py:obj:`~.CUclusterSchedulingPolicy`. + + With a few execeptions, function attributes may also be queried on + unloaded function handles returned from + :py:obj:`~.cuModuleEnumerateFunctions`. + :py:obj:`~.CUDA_ERROR_FUNCTION_NOT_LOADED` is returned if the attribute + requires a fully loaded function but the function is not loaded. The + loading state of a function may be queried using + :py:obj:`~.cuFuncIsloaded`. :py:obj:`~.cuFuncLoad` may be called to + explicitly load a function before querying the following attributes + that require the function to be loaded: + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK` + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES` + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES` + + Parameters + ---------- + attrib : :py:obj:`~.CUfunction_attribute` + Attribute requested + hfunc : :py:obj:`~.CUfunction` + Function to query attribute of + + 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_VALUE`, :py:obj:`~.CUDA_ERROR_FUNCTION_NOT_LOADED` + pi : int + Returned attribute value + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cudaFuncGetAttributes`, :py:obj:`~.cudaFuncSetAttribute`, :py:obj:`~.cuFuncIsLoaded`, :py:obj:`~.cuFuncLoad`, :py:obj:`~.cuKernelGetAttribute` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef int pi = 0 + cdef cydriver.CUfunction_attribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuFuncGetAttribute(&pi, cyattrib, cyhfunc) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pi) + +@cython.embedsignature(True) +def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value): + """ Sets information about a function. + + This call sets the value of a specified attribute `attrib` on the + kernel given by `hfunc` to an integer value specified by `val` This + function returns CUDA_SUCCESS if the new value of the attribute could + be successfully set. If the set fails, this call will return an error. + Not all attributes can have values set. Attempting to set a value on a + read-only attribute will result in an error (CUDA_ERROR_INVALID_VALUE) + + Supported attributes for the cuFuncSetAttribute call are: + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`: This + maximum size in bytes of dynamically-allocated shared memory. The + value should contain the requested maximum size of dynamically- + allocated shared memory. The sum of this value and the function + attribute :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` cannot + exceed the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`. + The maximal size of requestable dynamic shared memory may differ by + GPU architecture. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`: On + devices where the L1 cache and shared memory use the same hardware + resources, this sets the shared memory carveout preference, in + percent of the total shared memory. See + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR` + This is only a hint, and the driver can choose a different ratio if + required to execute the function. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`: The required + cluster width in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`: The required + cluster height in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`: The required + cluster depth in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return CUDA_ERROR_NOT_PERMITTED. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`: + Indicates whether the function can be launched with non-portable + cluster size. 1 is allowed, 0 is disallowed. + + - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: + The block scheduling policy of a function. The value type is + :py:obj:`~.CUclusterSchedulingPolicy`. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Function to query attribute of + attrib : :py:obj:`~.CUfunction_attribute` + Attribute requested + value : int + The value to set + + 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_VALUE` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cudaFuncGetAttributes`, :py:obj:`~.cudaFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef cydriver.CUfunction_attribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuFuncSetAttribute(cyhfunc, cyattrib, value) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncSetCacheConfig(hfunc, config not None : CUfunc_cache): + """ Sets the preferred cache configuration for a device function. + + On devices where the L1 cache and shared memory use the same hardware + resources, this sets through `config` the preferred cache configuration + for the device function `hfunc`. This is only a preference. The driver + will use the requested configuration if possible, but it is free to + choose a different configuration if required to execute `hfunc`. Any + context-wide preference set via :py:obj:`~.cuCtxSetCacheConfig()` will + be overridden by this per-function setting unless the per-function + setting is :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE`. In that case, the + current context-wide setting will be used. + + This setting does nothing on devices where the size of the L1 cache and + shared memory are fixed. + + Launching a kernel with a different preference than the most recent + preference setting may insert a device-side synchronization point. + + The supported cache configurations are: + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_NONE`: no preference for shared + memory or L1 (default) + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_SHARED`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_L1`: prefer larger L1 cache and + smaller shared memory + + - :py:obj:`~.CU_FUNC_CACHE_PREFER_EQUAL`: prefer equal sized L1 cache + and shared memory + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to configure cache for + config : :py:obj:`~.CUfunc_cache` + Requested cache configuration + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuKernelSetCacheConfig` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef cydriver.CUfunc_cache cyconfig = int(config) + with nogil: + err = cydriver.cuFuncSetCacheConfig(cyhfunc, cyconfig) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncGetModule(hfunc): + """ Returns a module handle. + + Returns in `*hmod` the handle of the module that function `hfunc` is + located in. The lifetime of the module corresponds to the lifetime of + the context it was loaded in or until the module is explicitly + unloaded. + + The CUDA runtime manages its own modules loaded into the primary + context. If the handle returned by this API refers to a module loaded + by the CUDA runtime, calling :py:obj:`~.cuModuleUnload()` on that + module will result in undefined behavior. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Function to retrieve module for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + hmod : :py:obj:`~.CUmodule` + Returned module handle + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef CUmodule hmod = CUmodule() + with nogil: + err = cydriver.cuFuncGetModule(hmod._pvt_ptr, cyhfunc) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, hmod) + +@cython.embedsignature(True) +def cuFuncGetName(hfunc): + """ Returns the function name for a :py:obj:`~.CUfunction` handle. + + Returns in `**name` the function name associated with the function + handle `hfunc` . The function name is returned as a null-terminated + string. The returned name is only valid when the function handle is + valid. If the module is unloaded or reloaded, one must call the API + again to get the updated name. This API may return a mangled name if + the function is not declared as having C linkage. If either `**name` or + `hfunc` is NULL, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + The function handle to retrieve the name for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + name : bytes + The returned name of the function + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef const char* name = NULL + with nogil: + err = cydriver.cuFuncGetName(&name, cyhfunc) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, name if name != NULL else None) + +@cython.embedsignature(True) +def cuFuncGetParamInfo(func, size_t paramIndex): + """ Returns the offset and size of a kernel parameter in the device-side parameter layout. + + Queries the kernel parameter at `paramIndex` into `func's` list of + parameters, and returns in `paramOffset` and `paramSize` the offset and + size, respectively, where the parameter will reside in the device-side + parameter layout. This information can be used to update kernel node + parameters from the device via + :py:obj:`~.cudaGraphKernelNodeSetParam()` and + :py:obj:`~.cudaGraphKernelNodeUpdatesApply()`. `paramIndex` must be + less than the number of parameters that `func` takes. `paramSize` can + be set to NULL if only the parameter offset is desired. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + The function to query + paramIndex : size_t + The parameter index to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + paramOffset : int + Returns the offset into the device-side parameter layout at which + the parameter resides + paramSize : int + Optionally returns the size of the parameter in the device-side + parameter layout + + See Also + -------- + :py:obj:`~.cuKernelGetParamInfo` + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef size_t paramOffset = 0 + cdef size_t paramSize = 0 + with nogil: + err = cydriver.cuFuncGetParamInfo(cyfunc, paramIndex, ¶mOffset, ¶mSize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, paramOffset, paramSize) + +@cython.embedsignature(True) +def cuFuncIsLoaded(function): + """ Returns if the function is loaded. + + Returns in `state` the loading state of `function`. + + Parameters + ---------- + function : :py:obj:`~.CUfunction` + the function to check + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + state : :py:obj:`~.CUfunctionLoadingState` + returned loading state + + See Also + -------- + :py:obj:`~.cuFuncLoad`, :py:obj:`~.cuModuleEnumerateFunctions` + """ + cdef cydriver.CUfunction cyfunction + if function is None: + pfunction = 0 + elif isinstance(function, (CUfunction,)): + pfunction = int(function) + else: + pfunction = int(CUfunction(function)) + cyfunction = pfunction + cdef cydriver.CUfunctionLoadingState state + with nogil: + err = cydriver.cuFuncIsLoaded(&state, cyfunction) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUfunctionLoadingState(state)) + +@cython.embedsignature(True) +def cuFuncLoad(function): + """ Loads a function. + + Finalizes function loading for `function`. Calling this API with a + fully loaded function has no effect. + + Parameters + ---------- + function : :py:obj:`~.CUfunction` + the function to load + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuModuleEnumerateFunctions`, :py:obj:`~.cuFuncIsLoaded` + """ + cdef cydriver.CUfunction cyfunction + if function is None: + pfunction = 0 + elif isinstance(function, (CUfunction,)): + pfunction = int(function) + else: + pfunction = int(CUfunction(function)) + cyfunction = pfunction + with nogil: + err = cydriver.cuFuncLoad(cyfunction) + return (_CUresult(err),) + +@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): + """ Launches a CUDA function :py:obj:`~.CUfunction` or a CUDA kernel :py:obj:`~.CUkernel`. + + Invokes the function :py:obj:`~.CUfunction` or the kernel + :py:obj:`~.CUkernel` `f` on a `gridDimX` x `gridDimY` x `gridDimZ` grid + of blocks. Each block contains `blockDimX` x `blockDimY` x `blockDimZ` + threads. + + `sharedMemBytes` sets the amount of dynamic shared memory that will be + available to each thread block. + + Kernel parameters to `f` can be specified in one of two ways: + + 1) Kernel parameters can be specified via `kernelParams`. If `f` has N + parameters, then `kernelParams` needs to be an array of N pointers. + Each of `kernelParams`[0] through `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. + + 2) Kernel parameters can also be packaged by the application into a + single buffer that is passed in via the `extra` parameter. This places + the burden on the application of knowing each kernel parameter's size + and alignment/padding within the buffer. Here is an example of using + the `extra` parameter in this manner: + + **View CUDA Toolkit Documentation for a C++ code example** + + The `extra` parameter exists to allow :py:obj:`~.cuLaunchKernel` to + take additional less commonly used arguments. `extra` specifies a list + of names of extra settings and their corresponding values. Each extra + setting name is immediately followed by the corresponding value. The + list must be terminated with either NULL or + :py:obj:`~.CU_LAUNCH_PARAM_END`. + + - :py:obj:`~.CU_LAUNCH_PARAM_END`, which indicates the end of the + `extra` array; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the + next value in `extra` will be a pointer to a buffer containing all + the kernel parameters for launching kernel `f`; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE`, which specifies that the + next value in `extra` will be a pointer to a size_t containing the + size of the buffer specified with + :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`; + + The error :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned if + kernel parameters are specified with both `kernelParams` and `extra` + (i.e. both `kernelParams` and `extra` are non-NULL). + + Calling :py:obj:`~.cuLaunchKernel()` invalidates the persistent + function state set through the following deprecated APIs: + :py:obj:`~.cuFuncSetBlockShape()`, :py:obj:`~.cuFuncSetSharedSize()`, + :py:obj:`~.cuParamSetSize()`, :py:obj:`~.cuParamSeti()`, + :py:obj:`~.cuParamSetf()`, :py:obj:`~.cuParamSetv()`. + + Note that to use :py:obj:`~.cuLaunchKernel()`, the kernel `f` 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:`~.cuLaunchKernel()` will return + :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`. + + Note that the API can also be used to launch context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to launch the + kernel on will either be taken from the specified stream `hStream` or + the current context in case of NULL stream. + + Parameters + ---------- + f : :py:obj:`~.CUfunction` + Function :py:obj:`~.CUfunction` or Kernel :py:obj:`~.CUkernel` to + launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + kernelParams : Any + Array of pointers to kernel parameters + extra : list[Any] + Extra options + + 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_SHARED_OBJECT_INIT_FAILED`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuKernelSetCacheConfig`, :py:obj:`~.cuKernelGetAttribute`, :py:obj:`~.cuKernelSetAttribute` + """ + 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.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + cykernelParams = _HelperKernelParams(kernelParams) + cdef void** cykernelParams_ptr = cykernelParams.ckernelParams + with nogil: + err = cydriver.cuLaunchKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr, extra) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_ptr extra): + """ Launches a CUDA function :py:obj:`~.CUfunction` or a CUDA kernel :py:obj:`~.CUkernel` with launch-time configuration. + + Invokes the function :py:obj:`~.CUfunction` or the kernel + :py:obj:`~.CUkernel` `f` with the specified launch-time configuration + `config`. + + The :py:obj:`~.CUlaunchConfig` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.CUlaunchConfig.gridDimX` is the width of the grid in + blocks. + + - :py:obj:`~.CUlaunchConfig.gridDimY` is the height of the grid in + blocks. + + - :py:obj:`~.CUlaunchConfig.gridDimZ` is the depth of the grid in + blocks. + + - :py:obj:`~.CUlaunchConfig.blockDimX` is the X dimension of each + thread block. + + - :py:obj:`~.CUlaunchConfig.blockDimX` is the Y dimension of each + thread block. + + - :py:obj:`~.CUlaunchConfig.blockDimZ` is the Z dimension of each + thread block. + + - :py:obj:`~.CUlaunchConfig.sharedMemBytes` is the dynamic shared- + memory size per thread block in bytes. + + - :py:obj:`~.CUlaunchConfig.hStream` is the handle to the stream to + perform the launch in. The CUDA context associated with this stream + must match that associated with function f. + + - :py:obj:`~.CUlaunchConfig.attrs` is an array of + :py:obj:`~.CUlaunchConfig.numAttrs` continguous + :py:obj:`~.CUlaunchAttribute` elements. The value of this pointer is + not considered if :py:obj:`~.CUlaunchConfig.numAttrs` is zero. + However, in that case, it is recommended to set the pointer to NULL. + + - :py:obj:`~.CUlaunchConfig.numAttrs` is the number of attributes + populating the first :py:obj:`~.CUlaunchConfig.numAttrs` positions of + the :py:obj:`~.CUlaunchConfig.attrs` array. + + Launch-time configuration is specified by adding entries to + :py:obj:`~.CUlaunchConfig.attrs`. Each entry is an attribute ID and a + corresponding attribute value. + + The :py:obj:`~.CUlaunchAttribute` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.CUlaunchAttribute.id` is a unique enum identifying the + attribute. + + - :py:obj:`~.CUlaunchAttribute.value` is a union that hold the + attribute value. + + An example of using the `config` parameter: + + **View CUDA Toolkit Documentation for a C++ code example** + + The :py:obj:`~.CUlaunchAttributeID` enum is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + and the corresponding :py:obj:`~.CUlaunchAttributeValue` union as : + + **View CUDA Toolkit Documentation for a C++ code example** + + Setting :py:obj:`~.CU_LAUNCH_ATTRIBUTE_COOPERATIVE` to a non-zero value + causes the kernel launch to be a cooperative launch, with exactly the + same usage and semantics of :py:obj:`~.cuLaunchCooperativeKernel`. + + Setting + :py:obj:`~.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION` to a + non-zero values causes the kernel to use programmatic means to resolve + its stream dependency -- enabling the CUDA runtime to opportunistically + allow the grid's execution to overlap with the previous kernel in the + stream, if that kernel requests the overlap. + + :py:obj:`~.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT` records an event + along with the kernel launch. 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 + through PTX launchdep.release or CUDA builtin function + cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be + inserted at the beginning of each block's execution if + triggerAtBlockStart is set to non-0. Note that dependents (including + the CPU thread calling :py:obj:`~.cuEventSynchronize()`) are not + guaranteed to observe the release precisely when it is released. For + example, :py:obj:`~.cuEventSynchronize()` 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. The event supplied must not be an interprocess or + interop event. The event must disable timing (i.e. created with + :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set). + + :py:obj:`~.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT` records an + event along with the kernel launch. 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, for example if + they run on different GPUs. + + - If B is a higher priority than A. + + Exercise caution if such an ordering inversion could lead to deadlock. + 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). + + Setting :py:obj:`~.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE` to + 1 on a captured launch causes the resulting kernel node to be device- + updatable. This attribute is specific to graphs, and passing it to a + launch in a non-capturing stream results in an error. Passing a value + other than 0 or 1 is not allowed. + + 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`. + + Kernel 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 attribute to 0 will result in an error. + Graphs containing one or more device-updatable node also do not allow + multiple instantiation. + + :py:obj:`~.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION` allows 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:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION` + 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. + + 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 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. + + The effect of other attributes is consistent with their effect when set + via persistent APIs. + + See :py:obj:`~.cuStreamSetAttribute` for + + - :py:obj:`~.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW` + + - :py:obj:`~.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY` + + See :py:obj:`~.cuFuncSetAttribute` for + + - :py:obj:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION` + + - :py:obj:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE` + + Kernel parameters to `f` can be specified in the same ways that they + can be using :py:obj:`~.cuLaunchKernel`. + + Note that the API can also be used to launch context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to launch the + kernel on will either be taken from the specified stream + :py:obj:`~.CUlaunchConfig.hStream` or the current context in case of + NULL stream. + + Parameters + ---------- + config : :py:obj:`~.CUlaunchConfig` + Config to launch + f : :py:obj:`~.CUfunction` + Function :py:obj:`~.CUfunction` or Kernel :py:obj:`~.CUkernel` to + launch + kernelParams : Any + Array of pointers to kernel parameters + extra : list[Any] + Extra options + + 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`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaLaunchKernelEx`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuKernelSetCacheConfig`, :py:obj:`~.cuKernelGetAttribute`, :py:obj:`~.cuKernelSetAttribute` + """ + cdef cydriver.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + 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),) + +@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): + """ Launches a CUDA function :py:obj:`~.CUfunction` or a CUDA kernel :py:obj:`~.CUkernel` where thread blocks can cooperate and synchronize as they execute. + + Invokes the function :py:obj:`~.CUfunction` or the kernel + :py:obj:`~.CUkernel` `f` on a `gridDimX` x `gridDimY` x `gridDimZ` grid + of blocks. Each block contains `blockDimX` x `blockDimY` x `blockDimZ` + threads. + + `sharedMemBytes` sets the amount of dynamic shared memory that will be + available to each thread block. + + The device on which this kernel is invoked must have a non-zero value + for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH`. + + The total number of blocks launched 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`. + + The kernel cannot make use of CUDA dynamic parallelism. + + Kernel parameters must be specified via `kernelParams`. If `f` has N + parameters, then `kernelParams` needs to be an array of N pointers. + Each of `kernelParams`[0] through `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. + + Calling :py:obj:`~.cuLaunchCooperativeKernel()` sets persistent + function state that is the same as function state set through + :py:obj:`~.cuLaunchKernel` API + + When the kernel `f` is launched via + :py:obj:`~.cuLaunchCooperativeKernel()`, the previous block shape, + shared size and parameter info associated with `f` is overwritten. + + Note that to use :py:obj:`~.cuLaunchCooperativeKernel()`, the kernel + `f` 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:`~.cuLaunchCooperativeKernel()` will return + :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`. + + Note that the API can also be used to launch context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to launch the + kernel on will either be taken from the specified stream `hStream` or + the current context in case of NULL stream. + + Parameters + ---------- + f : :py:obj:`~.CUfunction` + Function :py:obj:`~.CUfunction` or Kernel :py:obj:`~.CUkernel` to + launch + gridDimX : unsigned int + Width of grid in blocks + gridDimY : unsigned int + Height of grid in blocks + gridDimZ : unsigned int + Depth of grid in blocks + blockDimX : unsigned int + X dimension of each thread block + blockDimY : unsigned int + Y dimension of each thread block + blockDimZ : unsigned int + Z dimension of each thread block + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + kernelParams : Any + Array of pointers to kernel parameters + + 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`, :py:obj:`~.CUDA_ERROR_NOT_FOUND` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuLaunchCooperativeKernelMultiDevice`, :py:obj:`~.cudaLaunchCooperativeKernel`, :py:obj:`~.cuLibraryGetKernel`, :py:obj:`~.cuKernelSetCacheConfig`, :py:obj:`~.cuKernelGetAttribute`, :py:obj:`~.cuKernelSetAttribute` + """ + 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.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + cykernelParams = _HelperKernelParams(kernelParams) + cdef void** cykernelParams_ptr = cykernelParams.ckernelParams + with nogil: + err = cydriver.cuLaunchCooperativeKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr) + return (_CUresult(err),) + +@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),) + +ctypedef struct cuHostCallbackData_st: + cydriver.CUhostFn callback + void *userData + +ctypedef cuHostCallbackData_st cuHostCallbackData + +@cython.show_performance_hints(False) +cdef void cuHostCallbackWrapper(void *data) nogil: + cdef cuHostCallbackData *cbData = data + with gil: + cbData.callback(cbData.userData) + free(cbData) + +@cython.embedsignature(True) +def cuLaunchHostFunc(hStream, fn, userData): + """ Enqueues a host function call in a stream. + + Enqueues a host function to run in a stream. The function will be + called after currently enqueued work and will block work added after + it. + + The host function must not make any CUDA API calls. Attempting to use a + CUDA API may result in :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, but this + is not required. The host function must not perform any synchronization + that may depend on outstanding CUDA work not mandated to run earlier. + Host functions without a mandated order (such as in independent + streams) execute in undefined order and may be serialized. + + For the purposes of Unified Memory, execution makes a number of + guarantees: + + - The stream is considered idle for the duration of the function's + execution. Thus, for example, the function may always use memory + attached to the stream it was enqueued in. + + - The start of execution of the function has the same effect as + synchronizing an event recorded in the same stream immediately prior + to the function. It thus synchronizes streams which have been + "joined" prior to the function. + + - Adding device work to any stream does not have the effect of making + the stream active until all preceding host functions and stream + callbacks have executed. Thus, for example, a function might use + global attached memory even if work has been added to another stream, + if the work has been ordered behind the function call with an event. + + - Completion of the function does not cause a stream to become active + except as described above. The stream will remain idle if no device + work follows the function, and will remain idle across consecutive + host functions or stream callbacks without device work in between. + Thus, for example, stream synchronization can be done by signaling + from a host function at the end of the stream. + + Note that, in contrast to :py:obj:`~.cuStreamAddCallback`, the function + will not be called in the event of an error in the CUDA context. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue function call in + fn : :py:obj:`~.CUhostFn` + The function to call once preceding stream operations are complete + userData : Any + User-specified data to be passed to the function + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuMemAllocManaged`, :py:obj:`~.cuStreamAttachMemAsync`, :py:obj:`~.cuStreamAddCallback` + """ + cdef cydriver.CUhostFn cyfn + if fn is None: + pfn = 0 + elif isinstance(fn, (CUhostFn,)): + pfn = int(fn) + else: + pfn = int(CUhostFn(fn)) + cyfn = pfn + 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 _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cuHostCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (CUresult.CUDA_ERROR_OUT_OF_MEMORY,) + cbData.callback = cyfn + cbData.userData = cyuserData + + with nogil: + err = cydriver.cuLaunchHostFunc(cyhStream, cuHostCallbackWrapper, cbData) + if err != cydriver.CUDA_SUCCESS: + free(cbData) + _helper_input_void_ptr_free(&cyuserDataHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncSetBlockShape(hfunc, int x, int y, int z): + """ Sets the block-dimensions for the function. + + [Deprecated] + + Specifies the `x`, `y`, and `z` dimensions of the thread blocks that + are created when the kernel given by `hfunc` is launched. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to specify dimensions of + x : int + X dimension + y : int + Y dimension + z : int + Z dimension + + 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_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuFuncSetBlockShape(cyhfunc, x, y, z) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncSetSharedSize(hfunc, unsigned int numbytes): + """ Sets the dynamic shared-memory size for the function. + + [Deprecated] + + Sets through `numbytes` the amount of dynamic shared memory that will + be available to each thread block when the kernel given by `hfunc` is + launched. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to specify dynamic shared-memory size for + numbytes : unsigned int + Dynamic shared-memory size per thread in bytes + + 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_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuFuncSetSharedSize(cyhfunc, numbytes) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuParamSetSize(hfunc, unsigned int numbytes): + """ Sets the parameter size for the function. + + [Deprecated] + + Sets through `numbytes` the total size in bytes needed by the function + parameters of the kernel corresponding to `hfunc`. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to set parameter size for + numbytes : unsigned int + Size of parameter list in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuParamSetSize(cyhfunc, numbytes) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuParamSeti(hfunc, int offset, unsigned int value): + """ Adds an integer parameter to the function's argument list. + + [Deprecated] + + Sets an integer parameter that will be specified the next time the + kernel corresponding to `hfunc` will be invoked. `offset` is a byte + offset. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to add parameter to + offset : int + Offset to add parameter to argument list + value : unsigned int + Value of parameter + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuParamSeti(cyhfunc, offset, value) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuParamSetf(hfunc, int offset, float value): + """ Adds a floating-point parameter to the function's argument list. + + [Deprecated] + + Sets a floating-point parameter that will be specified the next time + the kernel corresponding to `hfunc` will be invoked. `offset` is a byte + offset. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to add parameter to + offset : int + Offset to add parameter to argument list + value : float + Value of parameter + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuParamSetf(cyhfunc, offset, value) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): + """ Adds arbitrary data to the function's argument list. + + [Deprecated] + + Copies an arbitrary amount of data (specified in `numbytes`) from `ptr` + into the parameter space of the kernel corresponding to `hfunc`. + `offset` is a byte offset. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to add data to + offset : int + Offset to add data to argument list + ptr : Any + Pointer to arbitrary data + numbytes : unsigned int + Size of data to copy in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cydriver.cuParamSetv(cyhfunc, offset, cyptr, numbytes) + _helper_input_void_ptr_free(&cyptrHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLaunch(f): + """ Launches a CUDA function. + + [Deprecated] + + Invokes the kernel `f` on a 1 x 1 x 1 grid of blocks. The block + contains the number of threads specified by a previous call to + :py:obj:`~.cuFuncSetBlockShape()`. + + The block shape, dynamic shared memory size, and parameter information + must be set using :py:obj:`~.cuFuncSetBlockShape()`, + :py:obj:`~.cuFuncSetSharedSize()`, :py:obj:`~.cuParamSetSize()`, + :py:obj:`~.cuParamSeti()`, :py:obj:`~.cuParamSetf()`, and + :py:obj:`~.cuParamSetv()` prior to calling this function. + + Launching a function via :py:obj:`~.cuLaunchKernel()` invalidates the + function's block shape, dynamic shared memory size, and parameter + information. After launching via cuLaunchKernel, this state must be re- + initialized prior to calling this function. Failure to do so results in + undefined behavior. + + Parameters + ---------- + f : :py:obj:`~.CUfunction` + Kernel to launch + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :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_SHARED_OBJECT_INIT_FAILED` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + with nogil: + err = cydriver.cuLaunch(cyf) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLaunchGrid(f, int grid_width, int grid_height): + """ Launches a CUDA function. + + [Deprecated] + + Invokes the kernel `f` on a `grid_width` x `grid_height` grid of + blocks. Each block contains the number of threads specified by a + previous call to :py:obj:`~.cuFuncSetBlockShape()`. + + The block shape, dynamic shared memory size, and parameter information + must be set using :py:obj:`~.cuFuncSetBlockShape()`, + :py:obj:`~.cuFuncSetSharedSize()`, :py:obj:`~.cuParamSetSize()`, + :py:obj:`~.cuParamSeti()`, :py:obj:`~.cuParamSetf()`, and + :py:obj:`~.cuParamSetv()` prior to calling this function. + + Launching a function via :py:obj:`~.cuLaunchKernel()` invalidates the + function's block shape, dynamic shared memory size, and parameter + information. After launching via cuLaunchKernel, this state must be re- + initialized prior to calling this function. Failure to do so results in + undefined behavior. + + Parameters + ---------- + f : :py:obj:`~.CUfunction` + Kernel to launch + grid_width : int + Width of grid in blocks + grid_height : int + Height of grid in blocks + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :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_SHARED_OBJECT_INIT_FAILED` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGridAsync`, :py:obj:`~.cuLaunchKernel` + """ + cdef cydriver.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + with nogil: + err = cydriver.cuLaunchGrid(cyf, grid_width, grid_height) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLaunchGridAsync(f, int grid_width, int grid_height, hStream): + """ Launches a CUDA function. + + [Deprecated] + + Invokes the kernel `f` on a `grid_width` x `grid_height` grid of + blocks. Each block contains the number of threads specified by a + previous call to :py:obj:`~.cuFuncSetBlockShape()`. + + The block shape, dynamic shared memory size, and parameter information + must be set using :py:obj:`~.cuFuncSetBlockShape()`, + :py:obj:`~.cuFuncSetSharedSize()`, :py:obj:`~.cuParamSetSize()`, + :py:obj:`~.cuParamSeti()`, :py:obj:`~.cuParamSetf()`, and + :py:obj:`~.cuParamSetv()` prior to calling this function. + + Launching a function via :py:obj:`~.cuLaunchKernel()` invalidates the + function's block shape, dynamic shared memory size, and parameter + information. After launching via cuLaunchKernel, this state must be re- + initialized prior to calling this function. Failure to do so results in + undefined behavior. + + \note_null_stream + + Parameters + ---------- + f : :py:obj:`~.CUfunction` + Kernel to launch + grid_width : int + Width of grid in blocks + grid_height : int + Height of grid in blocks + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + 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_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_SHARED_OBJECT_INIT_FAILED` + + See Also + -------- + :py:obj:`~.cuFuncSetBlockShape`, :py:obj:`~.cuFuncSetSharedSize`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuParamSetSize`, :py:obj:`~.cuParamSetf`, :py:obj:`~.cuParamSeti`, :py:obj:`~.cuParamSetv`, :py:obj:`~.cuLaunch`, :py:obj:`~.cuLaunchGrid`, :py:obj:`~.cuLaunchKernel` + + Notes + ----- + 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: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUfunction cyf + if f is None: + pf = 0 + elif isinstance(f, (CUfunction,)): + pf = int(f) + else: + pf = int(CUfunction(f)) + cyf = pf + with nogil: + err = cydriver.cuLaunchGridAsync(cyf, grid_width, grid_height, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuParamSetTexRef(hfunc, int texunit, hTexRef): + """ Adds a texture-reference to the function's argument list. + + [Deprecated] + + Makes the CUDA array or linear memory bound to the texture reference + `hTexRef` available to a device program as a texture. In this version + of CUDA, the texture-reference must be obtained via + :py:obj:`~.cuModuleGetTexRef()` and the `texunit` parameter must be set + to :py:obj:`~.CU_PARAM_TR_DEFAULT`. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + Kernel to add texture-reference to + texunit : int + Texture unit (must be :py:obj:`~.CU_PARAM_TR_DEFAULT`) + hTexRef : :py:obj:`~.CUtexref` + Texture-reference to add to argument list + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + with nogil: + err = cydriver.cuParamSetTexRef(cyhfunc, texunit, cyhTexRef) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuFuncSetSharedMemConfig(hfunc, config not None : CUsharedconfig): + """ Sets the shared memory configuration for a device function. + + [Deprecated] + + On devices with configurable shared memory banks, this function will + force all subsequent launches of the specified device function to have + the given shared memory bank size configuration. On any given launch of + the function, the shared memory configuration of the device will be + temporarily changed if needed to suit the function's preferred + configuration. Changes in shared memory configuration between + subsequent launches of functions, may introduce a device side + synchronization point. + + Any per-function setting of shared memory bank size set via + :py:obj:`~.cuFuncSetSharedMemConfig` will override the context wide + setting set with :py:obj:`~.cuCtxSetSharedMemConfig`. + + Changing the shared memory bank size will not increase shared memory + usage or affect occupancy of kernels, but may have major effects on + performance. Larger bank sizes will allow for greater potential + bandwidth to shared memory, but will change what kinds of accesses to + shared memory will result in bank conflicts. + + This function will do nothing on devices with fixed shared memory bank + size. + + The supported bank configurations are: + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`: use the context's + shared memory configuration when launching this function. + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`: set shared + memory bank width to be natively four bytes when launching this + function. + + - :py:obj:`~.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`: set shared + memory bank width to be natively eight bytes when launching this + function. + + Parameters + ---------- + hfunc : :py:obj:`~.CUfunction` + kernel to be given a shared memory config + config : :py:obj:`~.CUsharedconfig` + requested shared memory configuration + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxGetSharedMemConfig`, :py:obj:`~.cuCtxSetSharedMemConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cudaFuncSetSharedMemConfig` + """ + cdef cydriver.CUfunction cyhfunc + if hfunc is None: + phfunc = 0 + elif isinstance(hfunc, (CUfunction,)): + phfunc = int(hfunc) + else: + phfunc = int(CUfunction(hfunc)) + cyhfunc = phfunc + cdef cydriver.CUsharedconfig cyconfig = int(config) + with nogil: + err = cydriver.cuFuncSetSharedMemConfig(cyhfunc, cyconfig) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphCreate(unsigned int flags): + """ Creates a graph. + + Creates an empty graph, which is returned via `phGraph`. + + Parameters + ---------- + flags : unsigned int + Graph creation flags, must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phGraph : :py:obj:`~.CUgraph` + Returns newly created graph + + See Also + -------- + :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphDestroy`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphClone` + """ + cdef CUgraph phGraph = CUgraph() + with nogil: + err = cydriver.cuGraphCreate(phGraph._pvt_ptr, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraph) + +@cython.embedsignature(True) +def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): + """ Creates a kernel execution node and adds it to a graph. + + Creates a new kernel execution node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + The :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + When the graph is launched, the node will invoke kernel `func` on a + (`gridDimX` x `gridDimY` x `gridDimZ`) grid of blocks. Each block + contains (`blockDimX` x `blockDimY` x `blockDimZ`) threads. + + `sharedMemBytes` sets the amount of dynamic shared memory that will be + available to each thread block. + + Kernel parameters to `func` can be specified in one of two ways: + + 1) Kernel parameters can be specified via `kernelParams`. If the kernel + has N parameters, then `kernelParams` needs to be an array of N + pointers. Each pointer, from `kernelParams`[0] to `kernelParams`[N-1], + points to the region of memory from which the actual 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. + + 2) Kernel parameters for non-cooperative kernels can also be packaged + by the application into a single buffer that is passed in via `extra`. + This places the burden on the application of knowing each kernel + parameter's size and alignment/padding within the buffer. The `extra` + parameter exists to allow this function to take additional less + commonly used arguments. `extra` specifies a list of names of extra + settings and their corresponding values. Each extra setting name is + immediately followed by the corresponding value. The list must be + terminated with either NULL or CU_LAUNCH_PARAM_END. + + - :py:obj:`~.CU_LAUNCH_PARAM_END`, which indicates the end of the + `extra` array; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the + next value in `extra` will be a pointer to a buffer containing all + the kernel parameters for launching kernel `func`; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE`, which specifies that the + next value in `extra` will be a pointer to a size_t containing the + size of the buffer specified with + :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`; + + The error :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned if + kernel parameters are specified with both `kernelParams` and `extra` + (i.e. both `kernelParams` and `extra` are non-NULL). + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned if `extra` is + used for a cooperative kernel. + + The `kernelParams` or `extra` array, as well as the argument values it + points to, are copied during this call. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` + Parameters for the GPU execution node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuLaunchCooperativeKernel`, :py:obj:`~.cuGraphKernelNodeGetParams`, :py:obj:`~.cuGraphKernelNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphKernelNodeGetParams(hNode): + """ Returns a kernel node's parameters. + + Returns the parameters of kernel node `hNode` in `nodeParams`. The + `kernelParams` or `extra` array returned in `nodeParams`, as well as + the argument values it points to, are owned by the node. This memory + remains valid until the node is destroyed or its parameters are + modified, and should not be modified directly. Use + :py:obj:`~.cuGraphKernelNodeSetParams` to update the parameters of this + node. + + The params will contain either `kernelParams` or `extra`, according to + which of these was most recently set on the node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodeParams : :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_KERNEL_NODE_PARAMS nodeParams = CUDA_KERNEL_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphKernelNodeGetParams(cyhNode, nodeParams._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, nodeParams) + +@cython.embedsignature(True) +def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): + """ Sets a kernel node's parameters. + + Sets the parameters of kernel node `hNode` to `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, copyParams : Optional[CUDA_MEMCPY3D], ctx): + """ Creates a memcpy node and adds it to a graph. + + Creates a new memcpy node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies`. It is + possible for `numDependencies` to be 0, in which case the node will be + placed at the root of the graph. `dependencies` may not have any + duplicate entries. A handle to the new node will be returned in + `phGraphNode`. + + When the graph is launched, the node will perform the memcpy described + by `copyParams`. See :py:obj:`~.cuMemcpy3D()` for a description of the + structure and its restrictions. + + Memcpy nodes have some additional restrictions with regards to managed + memory, if the system contains at least one device which has a zero + value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. If one or + more of the operands refer to managed memory, then using the memory + type :py:obj:`~.CU_MEMORYTYPE_UNIFIED` is disallowed for those + operand(s). The managed memory will be treated as residing on either + the host or the device, depending on which memory type is specified. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + copyParams : :py:obj:`~.CUDA_MEMCPY3D` + Parameters for the memory copy + ctx : :py:obj:`~.CUcontext` + Context on which to run the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphMemcpyNodeGetParams`, :py:obj:`~.cuGraphMemcpyNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphMemcpyNodeGetParams(hNode): + """ Returns a memcpy node's parameters. + + Returns the parameters of memcpy node `hNode` in `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodeParams : :py:obj:`~.CUDA_MEMCPY3D` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_MEMCPY3D nodeParams = CUDA_MEMCPY3D() + with nogil: + err = cydriver.cuGraphMemcpyNodeGetParams(cyhNode, nodeParams._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, nodeParams) + +@cython.embedsignature(True) +def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): + """ Sets a memcpy node's parameters. + + Sets the parameters of memcpy node `hNode` to `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_MEMCPY3D` + Parameters to copy + + 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:`~.cuGraphNodeSetParams`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): + """ Creates a memset node and adds it to a graph. + + Creates a new memset node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies`. It is + possible for `numDependencies` to be 0, in which case the node will be + placed at the root of the graph. `dependencies` may not have any + duplicate entries. A handle to the new node will be returned in + `phGraphNode`. + + The element size must be 1, 2, or 4 bytes. When the graph is launched, + the node will perform the memset described by `memsetParams`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + memsetParams : :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` + Parameters for the memory set + ctx : :py:obj:`~.CUcontext` + Context on which to run the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphMemsetNodeGetParams`, :py:obj:`~.cuGraphMemsetNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphMemsetNodeGetParams(hNode): + """ Returns a memset node's parameters. + + Returns the parameters of memset node `hNode` in `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodeParams : :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_MEMSET_NODE_PARAMS nodeParams = CUDA_MEMSET_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphMemsetNodeGetParams(cyhNode, nodeParams._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, nodeParams) + +@cython.embedsignature(True) +def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PARAMS]): + """ Sets a memset node's parameters. + + Sets the parameters of memset node `hNode` to `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` + Parameters to copy + + 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:`~.cuGraphNodeSetParams`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): + """ Creates a host execution node and adds it to a graph. + + Creates a new CPU execution node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + When the graph is launched, the node will invoke the specified CPU + function. Host nodes are not supported under MPS with pre-Volta GPUs. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_HOST_NODE_PARAMS` + Parameters for the host node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphHostNodeGetParams`, :py:obj:`~.cuGraphHostNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphHostNodeGetParams(hNode): + """ Returns a host node's parameters. + + Returns the parameters of host node `hNode` in `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodeParams : :py:obj:`~.CUDA_HOST_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_HOST_NODE_PARAMS nodeParams = CUDA_HOST_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphHostNodeGetParams(cyhNode, nodeParams._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, nodeParams) + +@cython.embedsignature(True) +def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): + """ Sets a host node's parameters. + + Sets the parameters of host node `hNode` to `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_HOST_NODE_PARAMS` + Parameters to copy + + 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:`~.cuGraphNodeSetParams`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, childGraph): + """ Creates a child graph node and adds it to a graph. + + Creates a new node which executes an embedded graph, and adds it to + `hGraph` with `numDependencies` dependencies specified via + `dependencies`. It is possible for `numDependencies` to be 0, in which + case the node will be placed at the root of the graph. `dependencies` + may not have any duplicate entries. A handle to the new node will be + returned in `phGraphNode`. + + If `childGraph` contains allocation nodes, free nodes, or conditional + nodes, this call will return an error. + + The node executes an embedded child graph. The child graph is cloned in + this call. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + childGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to clone into this node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphChildGraphNodeGetGraph`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphClone` + """ + cdef cydriver.CUgraph cychildGraph + if childGraph is None: + pchildGraph = 0 + elif isinstance(childGraph, (CUgraph,)): + pchildGraph = int(childGraph) + else: + pchildGraph = int(CUgraph(childGraph)) + cychildGraph = pchildGraph + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuGraphAddChildGraphNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cychildGraph) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphChildGraphNodeGetGraph(hNode): + """ Gets a handle to the embedded graph of a child graph node. + + Gets a handle to the embedded graph in a child graph node. This call + does not clone the graph. Changes to the graph will be reflected in the + node, and the node retains ownership of the graph. + + Allocation and free nodes cannot be added to the returned graph. + Attempting to do so will return an error. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the embedded graph for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + phGraph : :py:obj:`~.CUgraph` + Location to store a handle to the graph + + See Also + -------- + :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphNodeFindInClone` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUgraph phGraph = CUgraph() + with nogil: + err = cydriver.cuGraphChildGraphNodeGetGraph(cyhNode, phGraph._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraph) + +@cython.embedsignature(True) +def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): + """ Creates an empty node and adds it to a graph. + + Creates a new node which performs no operation, and adds it to `hGraph` + with `numDependencies` dependencies specified via `dependencies`. It is + possible for `numDependencies` to be 0, in which case the node will be + placed at the root of the graph. `dependencies` may not have any + duplicate entries. A handle to the new node will be returned in + `phGraphNode`. + + An empty node performs no operation during execution, but can be used + for transitive ordering. For example, a phased execution graph with 2 + groups of n nodes with a barrier between them can be represented using + an empty node and 2*n dependency edges, rather than no empty node and + n^2 dependency edges. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuGraphAddEmptyNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): + """ Creates an event record node and adds it to a graph. + + Creates a new event record node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and event + specified in `event`. It is possible for `numDependencies` to be 0, in + which case the node will be placed at the root of the graph. + `dependencies` may not have any duplicate entries. A handle to the new + node will be returned in `phGraphNode`. + + Each launch of the graph will record `event` to capture execution of + the node's dependencies. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuGraphAddEventRecordNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cyevent) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphEventRecordNodeGetEvent(hNode): + """ Returns the event associated with an event record node. + + Returns the event of event record node `hNode` in `event_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the event for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + event_out : :py:obj:`~.CUevent` + Pointer to return the event + + See Also + -------- + :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUevent event_out = CUevent() + with nogil: + err = cydriver.cuGraphEventRecordNodeGetEvent(cyhNode, event_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, event_out) + +@cython.embedsignature(True) +def cuGraphEventRecordNodeSetEvent(hNode, event): + """ Sets an event record node's event. + + Sets the event of event record node `hNode` to `event`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the event for + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to use + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + with nogil: + err = cydriver.cuGraphEventRecordNodeSetEvent(cyhNode, cyevent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): + """ Creates an event wait node and adds it to a graph. + + Creates a new event wait node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and event + specified in `event`. It is possible for `numDependencies` to be 0, in + which case the node will be placed at the root of the graph. + `dependencies` may not have any duplicate entries. A handle to the new + node will be returned in `phGraphNode`. + + The graph node will wait for all work captured in `event`. See + :py:obj:`~.cuEventRecord()` for details on what is captured by an + event. `event` may be from a different context or device than the + launch stream. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuGraphAddEventWaitNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cyevent) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphEventWaitNodeGetEvent(hNode): + """ Returns the event associated with an event wait node. + + Returns the event of event wait node `hNode` in `event_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the event for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + event_out : :py:obj:`~.CUevent` + Pointer to return the event + + See Also + -------- + :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUevent event_out = CUevent() + with nogil: + err = cydriver.cuGraphEventWaitNodeGetEvent(cyhNode, event_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, event_out) + +@cython.embedsignature(True) +def cuGraphEventWaitNodeSetEvent(hNode, event): + """ Sets an event wait node's event. + + Sets the event of event wait node `hNode` to `event`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the event for + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to use + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + with nogil: + err = cydriver.cuGraphEventWaitNodeSetEvent(cyhNode, cyevent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): + """ Creates an external semaphore signal node and adds it to a graph. + + Creates a new external semaphore signal node and adds it to `hGraph` + with `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + Performs a signal operation on a set of externally allocated semaphore + objects when the node is launched. The operation(s) will occur after + all of the node's dependencies have completed. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` + Parameters for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeGetParams`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphExternalSemaphoresSignalNodeGetParams(hNode): + """ Returns an external semaphore signal node's parameters. + + Returns the parameters of an external semaphore signal node `hNode` in + `params_out`. The `extSemArray` and `paramsArray` returned in + `params_out`, are owned by the node. This memory remains valid until + the node is destroyed or its parameters are modified, and should not be + modified directly. Use + :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams` to update the + parameters of this node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + params_out : :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS params_out = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphExternalSemaphoresSignalNodeGetParams(cyhNode, params_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, params_out) + +@cython.embedsignature(True) +def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): + """ Sets an external semaphore signal node's parameters. + + Sets the parameters of an external semaphore signal node `hNode` to + `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): + """ Creates an external semaphore wait node and adds it to a graph. + + Creates a new external semaphore wait node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + Performs a wait operation on a set of externally allocated semaphore + objects when the node is launched. The node's dependencies will not be + launched until the wait operation has completed. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` + Parameters for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeGetParams`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphExternalSemaphoresWaitNodeGetParams(hNode): + """ Returns an external semaphore wait node's parameters. + + Returns the parameters of an external semaphore wait node `hNode` in + `params_out`. The `extSemArray` and `paramsArray` returned in + `params_out`, are owned by the node. This memory remains valid until + the node is destroyed or its parameters are modified, and should not be + modified directly. Use + :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams` to update the + parameters of this node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + params_out : :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS params_out = CUDA_EXT_SEM_WAIT_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphExternalSemaphoresWaitNodeGetParams(cyhNode, params_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, params_out) + +@cython.embedsignature(True) +def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): + """ Sets an external semaphore wait node's parameters. + + Sets the parameters of an external semaphore wait node `hNode` to + `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): + """ Creates a batch memory operation node and adds it to a graph. + + Creates a new batch memory operation node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + When the node is added, the paramArray inside `nodeParams` is copied + and therefore it can be freed after the call returns. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_BATCH_MEM_OP_NODE_PARAMS` + Parameters for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuStreamWaitValue32`, :py:obj:`~.cuStreamWriteValue32`, :py:obj:`~.cuStreamWaitValue64`, :py:obj:`~.cuStreamWriteValue64`, :py:obj:`~.cuGraphBatchMemOpNodeGetParams`, :py:obj:`~.cuGraphBatchMemOpNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. For more information, see the Stream Memory Operations section in the programming guide(https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html). + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphBatchMemOpNodeGetParams(hNode): + """ Returns a batch mem op node's parameters. + + Returns the parameters of batch mem op node `hNode` in + `nodeParams_out`. The `paramArray` returned in `nodeParams_out` is + owned by the node. This memory remains valid until the node is + destroyed or its parameters are modified, and should not be modified + directly. Use :py:obj:`~.cuGraphBatchMemOpNodeSetParams` to update the + parameters of this node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodeParams_out : :py:obj:`~.CUDA_BATCH_MEM_OP_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS nodeParams_out = CUDA_BATCH_MEM_OP_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphBatchMemOpNodeGetParams(cyhNode, nodeParams_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, nodeParams_out) + +@cython.embedsignature(True) +def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): + """ Sets a batch mem op node's parameters. + + Sets the parameters of batch mem op node `hNode` to `nodeParams`. + + The paramArray inside `nodeParams` is copied and therefore it can be + freed after the call returns. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUDA_BATCH_MEM_OP_NODE_PARAMS` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + + See Also + -------- + :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.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),) + +@cython.embedsignature(True) +def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): + """ Sets the parameters for a batch mem op node in the given graphExec. + + Sets the parameters of a batch mem op node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + The following fields on operations may be modified on an executable + graph: + + op.waitValue.address op.waitValue.value[64] op.waitValue.flags bits + corresponding to wait type (i.e. CU_STREAM_WAIT_VALUE_FLUSH bit cannot + be modified) op.writeValue.address op.writeValue.value[64] + + Other fields, such as the context, count or type of operations, and + other types of operations such as membars, may not be modified. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + The paramArray inside `nodeParams` is copied and therefore it can be + freed after the call returns. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Batch mem op node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.CUDA_BATCH_MEM_OP_NODE_PARAMS` + Updated Parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeGetParams`, :py:obj:`~.cuGraphBatchMemOpNodeSetParams`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecBatchMemOpNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_MEM_ALLOC_NODE_PARAMS]): + """ Creates an allocation node and adds it to a graph. + + Creates a new allocation node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + When :py:obj:`~.cuGraphAddMemAllocNode` creates an allocation node, it + returns the address of the allocation in `nodeParams.dptr`. The + allocation's address remains fixed across instantiations and launches. + + If the allocation is freed in the same graph, by creating a free node + using :py:obj:`~.cuGraphAddMemFreeNode`, the allocation can be accessed + by nodes ordered after the allocation node but before the free node. + These allocations cannot be freed outside the owning graph, and they + can only be freed once in the owning graph. + + If the allocation is not freed in the same graph, then it can be + accessed not only by nodes in the graph which are ordered after the + allocation node, but also by stream operations ordered after the + graph's execution but before the allocation is freed. + + Allocations which are not freed in the same graph can be freed by: + + - passing the allocation to :py:obj:`~.cuMemFreeAsync` or + :py:obj:`~.cuMemFree`; + + - launching a graph with a free node for that allocation; or + + - specifying + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH` during + instantiation, which makes each launch behave as though it called + :py:obj:`~.cuMemFreeAsync` for every unfreed allocation. + + It is not possible to free an allocation in both the owning graph and + another graph. If the allocation is freed in the same graph, a free + node cannot be added to another graph. If the allocation is freed in + another graph, a free node can no longer be added to the owning graph. + + The following restrictions apply to graphs which contain allocation + and/or memory free nodes: + + - Nodes and edges of the graph cannot be deleted. + + - The graph can only be used in a child node if the ownership is moved + to the parent. + + - Only one instantiation of the graph may exist at any point in time. + + - The graph cannot be cloned. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUDA_MEM_ALLOC_NODE_PARAMS` + Parameters for the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddMemFreeNode`, :py:obj:`~.cuGraphMemAllocNodeGetParams`, :py:obj:`~.cuDeviceGraphMemTrim`, :py:obj:`~.cuDeviceGetGraphMemAttribute`, :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.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: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphMemAllocNodeGetParams(hNode): + """ Returns a memory alloc node's parameters. + + Returns the parameters of a memory alloc node `hNode` in `params_out`. + The `poolProps` and `accessDescs` returned in `params_out`, are owned + by the node. This memory remains valid until the node is destroyed. The + returned parameters must not be modified. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + params_out : :py:obj:`~.CUDA_MEM_ALLOC_NODE_PARAMS` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphMemFreeNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUDA_MEM_ALLOC_NODE_PARAMS params_out = CUDA_MEM_ALLOC_NODE_PARAMS() + with nogil: + err = cydriver.cuGraphMemAllocNodeGetParams(cyhNode, params_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, params_out) + +@cython.embedsignature(True) +def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, dptr): + """ Creates a memory free node and adds it to a graph. + + Creates a new memory free node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `phGraphNode`. + + :py:obj:`~.cuGraphAddMemFreeNode` will return + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if the user attempts to free: + + - an allocation twice in the same graph. + + - an address that was not returned by an allocation node. + + - an invalid address. + + The following restrictions apply to graphs which contain allocation + and/or memory free nodes: + + - Nodes and edges of the graph cannot be deleted. + + - The graph can only be used in a child node if the ownership is moved + to the parent. + + - Only one instantiation of the graph may exist at any point in time. + + - The graph cannot be cloned. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + dptr : :py:obj:`~.CUdeviceptr` + Address of memory to free + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphMemFreeNodeGetParams`, :py:obj:`~.cuDeviceGraphMemTrim`, :py:obj:`~.cuDeviceGetGraphMemAttribute`, :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cydriver.cuGraphAddMemFreeNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cydptr) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphMemFreeNodeGetParams(hNode): + """ Returns a memory free node's parameters. + + Returns the address of a memory free node `hNode` in `dptr_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + dptr_out : :py:obj:`~.CUdeviceptr` + Pointer to return the device address + + See Also + -------- + :py:obj:`~.cuGraphAddMemFreeNode`, :py:obj:`~.cuGraphMemAllocNodeGetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef CUdeviceptr dptr_out = CUdeviceptr() + with nogil: + err = cydriver.cuGraphMemFreeNodeGetParams(cyhNode, dptr_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dptr_out) + +@cython.embedsignature(True) +def cuDeviceGraphMemTrim(device): + """ Free unused memory that was cached on the specified device for use with graphs back to the OS. + + Blocks which are not in use by a graph that is either currently + executing or scheduled to execute are freed back to the operating + system. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + The device for which cached memory should be freed. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphAddMemFreeNode`, :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuDeviceGetGraphMemAttribute` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + with nogil: + err = cydriver.cuDeviceGraphMemTrim(cydevice) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): + """ Query asynchronous allocation attributes related to graphs. + + Valid attributes are: + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT`: Amount of memory, in + bytes, currently associated with graphs + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`: High watermark of + memory, in bytes, associated with graphs since the last time it was + reset. High watermark can only be reset to zero. + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT`: Amount of memory, + in bytes, currently allocated for use by the CUDA graphs asynchronous + allocator. + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`: High watermark of + memory, in bytes, currently allocated for use by the CUDA graphs + asynchronous allocator. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + Specifies the scope of the query + attr : :py:obj:`~.CUgraphMem_attribute` + attribute to get + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + value : Any + retrieved value + + See Also + -------- + :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphAddMemFreeNode` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef cydriver.CUgraphMem_attribute cyattr = int(attr) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cydriver.cuDeviceGetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyvalue.pyObj()) + +@cython.embedsignature(True) +def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, value): + """ Set asynchronous allocation attributes related to graphs. + + Valid attributes are: + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`: High watermark of + memory, in bytes, associated with graphs since the last time it was + reset. High watermark can only be reset to zero. + + - :py:obj:`~.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`: High watermark of + memory, in bytes, currently allocated for use by the CUDA graphs + asynchronous allocator. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + Specifies the scope of the query + attr : :py:obj:`~.CUgraphMem_attribute` + attribute to get + value : Any + pointer to value to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + + See Also + -------- + :py:obj:`~.cuDeviceGetGraphMemAttribute`, :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphAddMemFreeNode` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef cydriver.CUgraphMem_attribute cyattr = int(attr) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cydriver.cuDeviceSetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphClone(originalGraph): + """ Clones a graph. + + This function creates a copy of `originalGraph` and returns it in + `phGraphClone`. All parameters are copied into the cloned graph. The + original graph may be modified after this call without affecting the + clone. + + Child graph nodes in the original graph are recursively copied into the + clone. + + Parameters + ---------- + originalGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to clone + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phGraphClone : :py:obj:`~.CUgraph` + Returns newly created cloned graph + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphNodeFindInClone` + + Notes + ----- + : Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes. + """ + cdef cydriver.CUgraph cyoriginalGraph + if originalGraph is None: + poriginalGraph = 0 + elif isinstance(originalGraph, (CUgraph,)): + poriginalGraph = int(originalGraph) + else: + poriginalGraph = int(CUgraph(originalGraph)) + cyoriginalGraph = poriginalGraph + cdef CUgraph phGraphClone = CUgraph() + with nogil: + err = cydriver.cuGraphClone(phGraphClone._pvt_ptr, cyoriginalGraph) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphClone) + +@cython.embedsignature(True) +def cuGraphNodeFindInClone(hOriginalNode, hClonedGraph): + """ Finds a cloned version of a node. + + This function returns the node in `hClonedGraph` corresponding to + `hOriginalNode` in the original graph. + + `hClonedGraph` must have been cloned from `hOriginalGraph` via + :py:obj:`~.cuGraphClone`. `hOriginalNode` must have been in + `hOriginalGraph` at the time of the call to :py:obj:`~.cuGraphClone`, + and the corresponding cloned node in `hClonedGraph` must not have been + removed. The cloned node is then returned via `phClonedNode`. + + Parameters + ---------- + hOriginalNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Handle to the original node + hClonedGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Cloned graph to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + phNode : :py:obj:`~.CUgraphNode` + Returns handle to the cloned node + + See Also + -------- + :py:obj:`~.cuGraphClone` + """ + cdef cydriver.CUgraph cyhClonedGraph + if hClonedGraph is None: + phClonedGraph = 0 + elif isinstance(hClonedGraph, (CUgraph,)): + phClonedGraph = int(hClonedGraph) + else: + phClonedGraph = int(CUgraph(hClonedGraph)) + cyhClonedGraph = phClonedGraph + cdef cydriver.CUgraphNode cyhOriginalNode + if hOriginalNode is None: + phOriginalNode = 0 + elif isinstance(hOriginalNode, (CUgraphNode,)): + phOriginalNode = int(hOriginalNode) + else: + phOriginalNode = int(CUgraphNode(hOriginalNode)) + cyhOriginalNode = phOriginalNode + cdef CUgraphNode phNode = CUgraphNode() + with nogil: + err = cydriver.cuGraphNodeFindInClone(phNode._pvt_ptr, cyhOriginalNode, cyhClonedGraph) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phNode) + +@cython.embedsignature(True) +def cuGraphNodeGetType(hNode): + """ Returns a node's type. + + Returns the node type of `hNode` in `typename`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + typename : :py:obj:`~.CUgraphNodeType` + Pointer to return the node type + + See Also + -------- + :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphChildGraphNodeGetGraph`, :py:obj:`~.cuGraphKernelNodeGetParams`, :py:obj:`~.cuGraphKernelNodeSetParams`, :py:obj:`~.cuGraphHostNodeGetParams`, :py:obj:`~.cuGraphHostNodeSetParams`, :py:obj:`~.cuGraphMemcpyNodeGetParams`, :py:obj:`~.cuGraphMemcpyNodeSetParams`, :py:obj:`~.cuGraphMemsetNodeGetParams`, :py:obj:`~.cuGraphMemsetNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNodeType typename + with nogil: + err = cydriver.cuGraphNodeGetType(cyhNode, &typename) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUgraphNodeType(typename)) + +@cython.embedsignature(True) +def cuGraphGetNodes(hGraph, size_t numNodes = 0): + """ Returns a graph's nodes. + + Returns a list of `hGraph's` nodes. `nodes` may be NULL, in which case + this function will return the number of nodes in `numNodes`. Otherwise, + `numNodes` entries will be filled in. If `numNodes` is higher than the + actual number of nodes, the remaining entries in `nodes` will be set to + NULL, and the number of nodes actually obtained will be returned in + `numNodes`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to query + numNodes : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + nodes : list[:py:obj:`~.CUgraphNode`] + Pointer to return the nodes + numNodes : int + See description + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetType`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numNodes + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cynodes = NULL + pynodes = [] + if _graph_length != 0: + cynodes = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cynodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + with nogil: + err = cydriver.cuGraphGetNodes(cyhGraph, cynodes, &numNodes) + if CUresult(err) == CUresult(0): + 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) + +@cython.embedsignature(True) +def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): + """ Returns a graph's root nodes. + + Returns a list of `hGraph's` root nodes. `rootNodes` may be NULL, in + which case this function will return the number of root nodes in + `numRootNodes`. Otherwise, `numRootNodes` entries will be filled in. If + `numRootNodes` is higher than the actual number of root nodes, the + remaining entries in `rootNodes` will be set to NULL, and the number of + nodes actually obtained will be returned in `numRootNodes`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to query + numRootNodes : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + rootNodes : list[:py:obj:`~.CUgraphNode`] + Pointer to return the root nodes + numRootNodes : int + See description + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetType`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numRootNodes + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyrootNodes = NULL + pyrootNodes = [] + if _graph_length != 0: + cyrootNodes = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cyrootNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + with nogil: + err = cydriver.cuGraphGetRootNodes(cyhGraph, cyrootNodes, &numRootNodes) + if CUresult(err) == CUresult(0): + 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) + +@cython.embedsignature(True) +def cuGraphGetEdges(hGraph, size_t numEdges = 0): + """ Returns a graph's dependency edges. + + Returns a list of `hGraph's` dependency edges. Edges are returned via + corresponding indices in `from` and `to`; that is, the node in `to`[i] + has a dependency on the node in `from`[i]. `from` and `to` may both be + NULL, in which case this function only returns the number of edges in + `numEdges`. Otherwise, `numEdges` entries will be filled in. If + `numEdges` is higher than the actual number of edges, the remaining + entries in `from` and `to` will be set to NULL, and the number of edges + actually returned will be written to `numEdges`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to get the edges from + numEdges : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + from : list[:py:obj:`~.CUgraphNode`] + Location to return edge endpoints + to : list[:py:obj:`~.CUgraphNode`] + Location to return edge endpoints + numEdges : int + See description + + See Also + -------- + :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numEdges + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + pyfrom_ = [] + if _graph_length != 0: + cyfrom_ = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + cdef cydriver.CUgraphNode* cyto = NULL + pyto = [] + if _graph_length != 0: + cyto = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + with nogil: + err = cydriver.cuGraphGetEdges(cyhGraph, cyfrom_, cyto, &numEdges) + if CUresult(err) == CUresult(0): + pyfrom_ = [CUgraphNode() 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() 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 err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None, None) + return (_CUresult_SUCCESS, pyfrom_, pyto, numEdges) + +@cython.embedsignature(True) +def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): + """ Returns a graph's dependency edges (12.3+). + + Returns a list of `hGraph's` dependency edges. Edges are returned via + corresponding indices in `from`, `to` and `edgeData`; that is, the node + in `to`[i] has a dependency on the node in `from`[i] with data + `edgeData`[i]. `from` and `to` may both be NULL, in which case this + function only returns the number of edges in `numEdges`. Otherwise, + `numEdges` entries will be filled in. If `numEdges` is higher than the + actual number of edges, the remaining entries in `from` and `to` will + be set to NULL, and the number of edges actually returned will be + written to `numEdges`. `edgeData` may alone be NULL, in which case the + edges must all have default (zeroed) edge data. Attempting a lossy + query via NULL `edgeData` will result in + :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. If `edgeData` is non-NULL then + `from` and `to` must be as well. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to get the edges from + numEdges : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + from : list[:py:obj:`~.CUgraphNode`] + Location to return edge endpoints + to : list[:py:obj:`~.CUgraphNode`] + Location to return edge endpoints + edgeData : list[:py:obj:`~.CUgraphEdgeData`] + Optional location to return edge data + numEdges : int + See description + + See Also + -------- + :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numEdges + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + pyfrom_ = [] + if _graph_length != 0: + cyfrom_ = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + cdef cydriver.CUgraphNode* cyto = NULL + pyto = [] + if _graph_length != 0: + cyto = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + cdef cydriver.CUgraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cydriver.CUgraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + with nogil: + err = cydriver.cuGraphGetEdges_v2(cyhGraph, cyfrom_, cyto, cyedgeData, &numEdges) + if CUresult(err) == CUresult(0): + 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() 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() 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) + +@cython.embedsignature(True) +def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): + """ Returns a node's dependencies. + + Returns a list of `node's` dependencies. `dependencies` may be NULL, in + which case this function will return the number of dependencies in + `numDependencies`. Otherwise, `numDependencies` entries will be filled + in. If `numDependencies` is higher than the actual number of + dependencies, the remaining entries in `dependencies` will be set to + NULL, and the number of nodes actually obtained will be returned in + `numDependencies`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + numDependencies : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + dependencies : list[:py:obj:`~.CUgraphNode`] + Pointer to return the dependencies + numDependencies : int + See description + + See Also + -------- + :py:obj:`~.cuGraphNodeGetDependentNodes`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` + """ + cdef size_t _graph_length = numDependencies + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNode* cydependencies = NULL + pydependencies = [] + if _graph_length != 0: + cydependencies = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + with nogil: + err = cydriver.cuGraphNodeGetDependencies(cyhNode, cydependencies, &numDependencies) + if CUresult(err) == CUresult(0): + pydependencies = [CUgraphNode() 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 err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pydependencies, numDependencies) + +@cython.embedsignature(True) +def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): + """ Returns a node's dependencies (12.3+). + + Returns a list of `node's` dependencies. `dependencies` may be NULL, in + which case this function will return the number of dependencies in + `numDependencies`. Otherwise, `numDependencies` entries will be filled + in. If `numDependencies` is higher than the actual number of + dependencies, the remaining entries in `dependencies` will be set to + NULL, and the number of nodes actually obtained will be returned in + `numDependencies`. + + Note that if an edge has non-zero (non-default) edge data and + `edgeData` is NULL, this API will return + :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. If `edgeData` is non-NULL, then + `dependencies` must be as well. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + numDependencies : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + dependencies : list[:py:obj:`~.CUgraphNode`] + Pointer to return the dependencies + edgeData : list[:py:obj:`~.CUgraphEdgeData`] + Optional array to return edge data for each dependency + numDependencies : int + See description + + See Also + -------- + :py:obj:`~.cuGraphNodeGetDependentNodes`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` + """ + cdef size_t _graph_length = numDependencies + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNode* cydependencies = NULL + pydependencies = [] + if _graph_length != 0: + cydependencies = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + cdef cydriver.CUgraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cydriver.CUgraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + with nogil: + err = cydriver.cuGraphNodeGetDependencies_v2(cyhNode, cydependencies, cyedgeData, &numDependencies) + if CUresult(err) == CUresult(0): + 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() 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) + +@cython.embedsignature(True) +def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): + """ Returns a node's dependent nodes. + + Returns a list of `node's` dependent nodes. `dependentNodes` may be + NULL, in which case this function will return the number of dependent + nodes in `numDependentNodes`. Otherwise, `numDependentNodes` entries + will be filled in. If `numDependentNodes` is higher than the actual + number of dependent nodes, the remaining entries in `dependentNodes` + will be set to NULL, and the number of nodes actually obtained will be + returned in `numDependentNodes`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + numDependentNodes : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + dependentNodes : list[:py:obj:`~.CUgraphNode`] + Pointer to return the dependent nodes + numDependentNodes : int + See description + + See Also + -------- + :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` + """ + cdef size_t _graph_length = numDependentNodes + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNode* cydependentNodes = NULL + pydependentNodes = [] + if _graph_length != 0: + cydependentNodes = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cydependentNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + with nogil: + err = cydriver.cuGraphNodeGetDependentNodes(cyhNode, cydependentNodes, &numDependentNodes) + if CUresult(err) == CUresult(0): + pydependentNodes = [CUgraphNode() 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 err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pydependentNodes, numDependentNodes) + +@cython.embedsignature(True) +def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): + """ Returns a node's dependent nodes (12.3+). + + Returns a list of `node's` dependent nodes. `dependentNodes` may be + NULL, in which case this function will return the number of dependent + nodes in `numDependentNodes`. Otherwise, `numDependentNodes` entries + will be filled in. If `numDependentNodes` is higher than the actual + number of dependent nodes, the remaining entries in `dependentNodes` + will be set to NULL, and the number of nodes actually obtained will be + returned in `numDependentNodes`. + + Note that if an edge has non-zero (non-default) edge data and + `edgeData` is NULL, this API will return + :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`. If `edgeData` is non-NULL, then + `dependentNodes` must be as well. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + numDependentNodes : int + See description + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + dependentNodes : list[:py:obj:`~.CUgraphNode`] + Pointer to return the dependent nodes + edgeData : list[:py:obj:`~.CUgraphEdgeData`] + Optional pointer to return edge data for dependent nodes + numDependentNodes : int + See description + + See Also + -------- + :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphGetNodes`, :py:obj:`~.cuGraphGetRootNodes`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphRemoveDependencies` + """ + cdef size_t _graph_length = numDependentNodes + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNode* cydependentNodes = NULL + pydependentNodes = [] + if _graph_length != 0: + cydependentNodes = calloc(_graph_length, sizeof(cydriver.CUgraphNode)) + if cydependentNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphNode))) + cdef cydriver.CUgraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cydriver.CUgraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + with nogil: + err = cydriver.cuGraphNodeGetDependentNodes_v2(cyhNode, cydependentNodes, cyedgeData, &numDependentNodes) + if CUresult(err) == CUresult(0): + 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() 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) + +@cython.embedsignature(True) +def cuGraphAddDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): + """ Adds dependency edges to a graph. + + The number of dependencies to be added is defined by `numDependencies` + Elements in `from` and `to` at corresponding indices define a + dependency. Each node in `from` and `to` must belong to `hGraph`. + + If `numDependencies` is 0, elements in `from` and `to` will be ignored. + Specifying an existing dependency will return an error. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which dependencies are added + from : list[:py:obj:`~.CUgraphNode`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.CUgraphNode`] + Array of dependent nodes + numDependencies : size_t + Number of dependencies to be added + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + to = [] if to is None else to + if not all(isinstance(_x, (CUgraphNode,)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cydriver.CUgraphNode* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + with nogil: + err = cydriver.cuGraphAddDependencies(cyhGraph, cyfrom_, cyto, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphAddDependencies_v2(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): + """ Adds dependency edges to a graph (12.3+). + + The number of dependencies to be added is defined by `numDependencies` + Elements in `from` and `to` at corresponding indices define a + dependency. Each node in `from` and `to` must belong to `hGraph`. + + If `numDependencies` is 0, elements in `from` and `to` will be ignored. + Specifying an existing dependency will return an error. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which dependencies are added + from : list[:py:obj:`~.CUgraphNode`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.CUgraphNode`] + Array of dependent nodes + edgeData : list[:py:obj:`~.CUgraphEdgeData`] + Optional array of edge data. If NULL, default (zeroed) edge data is + assumed. + numDependencies : size_t + Number of dependencies to be added + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuGraphRemoveDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + edgeData = [] if edgeData is None else edgeData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + to = [] if to is None else to + if not all(isinstance(_x, (CUgraphNode,)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cydriver.CUgraphNode* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cyedgeData = NULL + if len(edgeData) > 1: + cyedgeData = calloc(len(edgeData), sizeof(cydriver.CUgraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(edgeData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(edgeData)): + string.memcpy(&cyedgeData[idx], (edgeData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(edgeData) == 1: + cyedgeData = (edgeData[0])._pvt_ptr + with nogil: + err = cydriver.cuGraphAddDependencies_v2(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + if len(edgeData) > 1 and cyedgeData is not NULL: + free(cyedgeData) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphRemoveDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): + """ Removes dependency edges from a graph. + + The number of `dependencies` to be removed is defined by + `numDependencies`. Elements in `from` and `to` at corresponding indices + define a dependency. Each node in `from` and `to` must belong to + `hGraph`. + + If `numDependencies` is 0, elements in `from` and `to` will be ignored. + Specifying a non-existing dependency will return an error. + + Dependencies cannot be removed from graphs which contain allocation or + free nodes. Any attempt to do so will return an error. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph from which to remove dependencies + from : list[:py:obj:`~.CUgraphNode`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.CUgraphNode`] + Array of dependent nodes + numDependencies : size_t + Number of dependencies to be removed + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + to = [] if to is None else to + if not all(isinstance(_x, (CUgraphNode,)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cydriver.CUgraphNode* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + with nogil: + err = cydriver.cuGraphRemoveDependencies(cyhGraph, cyfrom_, cyto, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): + """ Removes dependency edges from a graph (12.3+). + + The number of `dependencies` to be removed is defined by + `numDependencies`. Elements in `from` and `to` at corresponding indices + define a dependency. Each node in `from` and `to` must belong to + `hGraph`. + + If `numDependencies` is 0, elements in `from` and `to` will be ignored. + Specifying an edge that does not exist in the graph, with data matching + `edgeData`, results in an error. `edgeData` is nullable, which is + equivalent to passing default (zeroed) data for each edge. + + Dependencies cannot be removed from graphs which contain allocation or + free nodes. Any attempt to do so will return an error. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph from which to remove dependencies + from : list[:py:obj:`~.CUgraphNode`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.CUgraphNode`] + Array of dependent nodes + edgeData : list[:py:obj:`~.CUgraphEdgeData`] + Optional array of edge data. If NULL, edge data is assumed to be + default (zeroed). + numDependencies : size_t + Number of dependencies to be removed + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuGraphAddDependencies`, :py:obj:`~.cuGraphGetEdges`, :py:obj:`~.cuGraphNodeGetDependencies`, :py:obj:`~.cuGraphNodeGetDependentNodes` + """ + edgeData = [] if edgeData is None else edgeData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + to = [] if to is None else to + if not all(isinstance(_x, (CUgraphNode,)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef cydriver.CUgraphNode* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cydriver.CUgraphNode)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cydriver.CUgraphNode* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cydriver.CUgraphNode)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cyedgeData = NULL + if len(edgeData) > 1: + cyedgeData = calloc(len(edgeData), sizeof(cydriver.CUgraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(edgeData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(edgeData)): + string.memcpy(&cyedgeData[idx], (edgeData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(edgeData) == 1: + cyedgeData = (edgeData[0])._pvt_ptr + with nogil: + err = cydriver.cuGraphRemoveDependencies_v2(cyhGraph, cyfrom_, cyto, cyedgeData, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + if len(edgeData) > 1 and cyedgeData is not NULL: + free(cyedgeData) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphDestroyNode(hNode): + """ Remove a node from the graph. + + Removes `hNode` from its graph. This operation also severs any + dependencies of other nodes on `hNode` and vice versa. + + Nodes which belong to a graph which contains allocation or free nodes + cannot be destroyed. Any attempt to do so will return an error. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to remove + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + with nogil: + err = cydriver.cuGraphDestroyNode(cyhNode) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphInstantiate(hGraph, unsigned long long flags): + """ Creates an executable graph from a graph. + + Instantiates `hGraph` as an executable graph. The graph is validated + for any structural constraints or intra-node constraints which were not + previously validated. If instantiation is successful, a handle to the + instantiated graph is returned in `phGraphExec`. + + The `flags` parameter controls the behavior of instantiation and + subsequent graph launches. Valid flags are: + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`, which + configures a graph containing memory allocation nodes to + automatically free any unfreed memory allocations before the graph is + relaunched. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH`, which + configures the graph for launch from the device. If this flag is + passed, the executable graph handle returned can be used to launch + the graph from both the host and device. This flag can only be used + on platforms which support unified addressing. This flag cannot be + used in conjunction with + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`, which + causes the graph to use the priorities from the per-node attributes + rather than the priority of the launch stream during execution. Note + that priorities are only available on kernel nodes, and are copied + from stream priority during stream capture. + + If `hGraph` contains any allocation or free nodes, there can be at most + one executable graph in existence for that graph at a time. An attempt + to instantiate a second executable graph before destroying the first + with :py:obj:`~.cuGraphExecDestroy` will result in an error. The same + also applies if `hGraph` contains any device-updatable kernel nodes. + + If `hGraph` contains kernels which call device-side cudaGraphLaunch() + from multiple contexts, this will result in an error. + + Graphs instantiated for launch on the device have additional + restrictions which do not apply to host graphs: + + - The graph's nodes must reside on a single context. + + - The graph can only contain kernel nodes, memcpy nodes, memset nodes, + and child graph nodes. + + - The graph cannot be empty and must contain at least one kernel, + memcpy, or memset node. Operation-specific restrictions are outlined + below. + + - Kernel nodes: + + - Use of CUDA Dynamic Parallelism is not permitted. + + - Cooperative launches are permitted as long as MPS is not in use. + + - Memcpy nodes: + + - Only copies involving device memory and/or pinned device-mapped + host memory are permitted. + + - Copies involving CUDA arrays are not permitted. + + - Both operands must be accessible from the current context, and the + current context must match the context of other nodes in the graph. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to instantiate + flags : unsigned long long + Flags to control instantiation. See + :py:obj:`~.CUgraphInstantiate_flags`. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phGraphExec : :py:obj:`~.CUgraphExec` + Returns instantiated graph + + See Also + -------- + :py:obj:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphUpload`, :py:obj:`~.cuGraphLaunch`, :py:obj:`~.cuGraphExecDestroy` + """ + 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 CUgraphExec phGraphExec = CUgraphExec() + with nogil: + err = cydriver.cuGraphInstantiate(phGraphExec._pvt_ptr, cyhGraph, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphExec) + +@cython.embedsignature(True) +def cuGraphInstantiateWithParams(hGraph, instantiateParams : Optional[CUDA_GRAPH_INSTANTIATE_PARAMS]): + """ Creates an executable graph from a graph. + + Instantiates `hGraph` as an executable graph according to the + `instantiateParams` structure. The graph is validated for any + structural constraints or intra-node constraints which were not + previously validated. If instantiation is successful, a handle to the + instantiated graph is returned in `phGraphExec`. + + `instantiateParams` controls the behavior of instantiation and + subsequent graph launches, as well as returning more detailed + information in the event of an error. + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_PARAMS` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + The `flags` field controls the behavior of instantiation and subsequent + graph launches. Valid flags are: + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`, which + configures a graph containing memory allocation nodes to + automatically free any unfreed memory allocations before the graph is + relaunched. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD`, which will perform an + upload of the graph into `hUploadStream` once the graph has been + instantiated. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH`, which + configures the graph for launch from the device. If this flag is + passed, the executable graph handle returned can be used to launch + the graph from both the host and device. This flag can only be used + on platforms which support unified addressing. This flag cannot be + used in conjunction with + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`, which + causes the graph to use the priorities from the per-node attributes + rather than the priority of the launch stream during execution. Note + that priorities are only available on kernel nodes, and are copied + from stream priority during stream capture. + + If `hGraph` contains any allocation or free nodes, there can be at most + one executable graph in existence for that graph at a time. An attempt + to instantiate a second executable graph before destroying the first + with :py:obj:`~.cuGraphExecDestroy` will result in an error. The same + also applies if `hGraph` contains any device-updatable kernel nodes. + + If `hGraph` contains kernels which call device-side cudaGraphLaunch() + from multiple contexts, this will result in an error. + + Graphs instantiated for launch on the device have additional + restrictions which do not apply to host graphs: + + - The graph's nodes must reside on a single context. + + - The graph can only contain kernel nodes, memcpy nodes, memset nodes, + and child graph nodes. + + - The graph cannot be empty and must contain at least one kernel, + memcpy, or memset node. Operation-specific restrictions are outlined + below. + + - Kernel nodes: + + - Use of CUDA Dynamic Parallelism is not permitted. + + - Cooperative launches are permitted as long as MPS is not in use. + + - Memcpy nodes: + + - Only copies involving device memory and/or pinned device-mapped + host memory are permitted. + + - Copies involving CUDA arrays are not permitted. + + - Both operands must be accessible from the current context, and the + current context must match the context of other nodes in the graph. + + In the event of an error, the `result_out` and `hErrNode_out` fields + will contain more information about the nature of the error. Possible + error reporting includes: + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_ERROR`, if passed an invalid value + or if an unexpected error occurred which is described by the return + value of the function. `hErrNode_out` will be set to NULL. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE`, if the graph + structure is invalid. `hErrNode_out` will be set to one of the + offending nodes. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED`, if + the graph is instantiated for device launch but contains a node of an + unsupported node type, or a node which performs unsupported + operations, such as use of CUDA dynamic parallelism within a kernel + node. `hErrNode_out` will be set to this node. + + - :py:obj:`~.CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED`, if + the graph is instantiated for device launch but a node’s context + differs from that of another node. This error can also be returned if + a graph is not instantiated for device launch and it contains kernels + which call device-side cudaGraphLaunch() from multiple contexts. + `hErrNode_out` will be set to this node. + + If instantiation is successful, `result_out` will be set to + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_SUCCESS`, and `hErrNode_out` will be + set to NULL. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to instantiate + instantiateParams : :py:obj:`~.CUDA_GRAPH_INSTANTIATE_PARAMS` + Instantiation parameters + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + phGraphExec : :py:obj:`~.CUgraphExec` + Returns instantiated graph + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphExecDestroy` + """ + 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 CUgraphExec phGraphExec = CUgraphExec() + 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) + +@cython.embedsignature(True) +def cuGraphExecGetFlags(hGraphExec): + """ Query the instantiation flags of an executable graph. + + Returns the flags that were passed to instantiation for the given + executable graph. :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD` will + not be returned by this API as it does not affect the resulting + executable graph. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph to query + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + flags : :py:obj:`~.cuuint64_t` + Returns the instantiation flags + + See Also + -------- + :py:obj:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphInstantiateWithParams` + """ + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + cdef cuuint64_t flags = cuuint64_t() + with nogil: + err = cydriver.cuGraphExecGetFlags(cyhGraphExec, flags._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, flags) + +@cython.embedsignature(True) +def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): + """ Sets the parameters for a kernel node in the given graphExec. + + Sets the parameters of a kernel node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + `hNode` must not have been removed from the original graph. All + `nodeParams` fields may change, but the following restrictions apply to + `func` updates: + + - The owning context of the function cannot change. + + - A node whose function originally did not use CUDA dynamic parallelism + cannot be updated to a function which uses CDP + + - A node whose function originally did not make device-side update + calls cannot be updated to a function which makes device-side update + calls. + + - If `hGraphExec` was not instantiated for device launch, a node whose + function originally did not use device-side cudaGraphLaunch() cannot + be updated to a function which uses device-side cudaGraphLaunch() + unless the node resides on the same context as nodes which contained + such calls at instantiate-time. If no such calls were present at + instantiation, these updates cannot be performed at all. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + If `hNode` is a device-updatable kernel node, the next upload/launch of + `hGraphExec` will overwrite any previous device-side updates. + Additionally, applying host updates to a device-updatable kernel node + while it is being updated from the device will result in undefined + behavior. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + kernel node from the graph from which graphExec was instantiated + nodeParams : :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` + Updated Parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecKernelNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA_MEMCPY3D], ctx): + """ Sets the parameters for a memcpy node in the given graphExec. + + Updates the work represented by `hNode` in `hGraphExec` as though + `hNode` had contained `copyParams` at instantiation. hNode must remain + in the graph which was used to instantiate `hGraphExec`. Changed edges + to and from hNode are ignored. + + The source and destination memory in `copyParams` must be allocated + from the same contexts as the original source and destination memory. + Both the instantiation-time memory operands and the memory operands in + `copyParams` must be 1-dimensional. Zero-length operations are not + supported. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. hNode is also not modified by this call. + + Returns CUDA_ERROR_INVALID_VALUE if the memory operands' mappings + changed or either the original or new memory operands are + multidimensional. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Memcpy node from the graph which was used to instantiate graphExec + copyParams : :py:obj:`~.CUDA_MEMCPY3D` + The updated parameters to set + ctx : :py:obj:`~.CUcontext` + Context on which to run the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) + +@cython.embedsignature(True) +def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): + """ Sets the parameters for a memset node in the given graphExec. + + Updates the work represented by `hNode` in `hGraphExec` as though + `hNode` had contained `memsetParams` at instantiation. hNode must + remain in the graph which was used to instantiate `hGraphExec`. Changed + edges to and from hNode are ignored. + + Zero sized operations are not supported. + + The new destination pointer in memsetParams must be to the same kind of + allocation as the original destination pointer and have the same + context association and device mapping as the original destination + pointer. + + Both the value and pointer address may be updated. Changing other + aspects of the memset (width, height, element size or pitch) may cause + the update to be rejected. Specifically, for 2d memsets, all dimension + changes are rejected. For 1d memsets, changes in height are explicitly + rejected and other changes are opportunistically allowed if the + resulting work maps onto the work resources already allocated for the + node. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. hNode is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Memset node from the graph which was used to instantiate graphExec + memsetParams : :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` + The updated parameters to set + ctx : :py:obj:`~.CUcontext` + Context on which to run the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecMemsetNodeSetParams(cyhGraphExec, cyhNode, cymemsetParams_ptr, cyctx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): + """ Sets the parameters for a host node in the given graphExec. + + Updates the work represented by `hNode` in `hGraphExec` as though + `hNode` had contained `nodeParams` at instantiation. hNode must remain + in the graph which was used to instantiate `hGraphExec`. Changed edges + to and from hNode are ignored. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. hNode is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Host node from the graph which was used to instantiate graphExec + nodeParams : :py:obj:`~.CUDA_HOST_NODE_PARAMS` + The updated parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecHostNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph): + """ Updates node parameters in the child graph node in the given graphExec. + + Updates the work represented by `hNode` in `hGraphExec` as though the + nodes contained in `hNode's` graph had the parameters contained in + `childGraph's` nodes at instantiation. `hNode` must remain in the graph + which was used to instantiate `hGraphExec`. Changed edges to and from + `hNode` are ignored. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + The topology of `childGraph`, as well as the node insertion order, must + match that of the graph contained in `hNode`. See + :py:obj:`~.cuGraphExecUpdate()` for a list of restrictions on what can + be updated in an instantiated graph. The update is recursive, so child + graph nodes contained within the top level child graph will also be + updated. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Host node from the graph which was used to instantiate graphExec + childGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph supplying the updated parameters + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphChildGraphNodeGetGraph`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraph cychildGraph + if childGraph is None: + pchildGraph = 0 + elif isinstance(childGraph, (CUgraph,)): + pchildGraph = int(childGraph) + else: + pchildGraph = int(CUgraph(childGraph)) + cychildGraph = pchildGraph + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphExecChildGraphNodeSetParams(cyhGraphExec, cyhNode, cychildGraph) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): + """ Sets the event for an event record node in the given graphExec. + + Sets the event of an event record node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + event record node from the graph from which graphExec was + instantiated + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Updated event to use + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphExecEventRecordNodeSetEvent(cyhGraphExec, cyhNode, cyevent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): + """ Sets the event for an event wait node in the given graphExec. + + Sets the event of an event wait node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + event wait node from the graph from which graphExec was + instantiated + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Updated event to use + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUevent cyevent + if event is None: + pevent = 0 + elif isinstance(event, (CUevent,)): + pevent = int(event) + else: + pevent = int(CUevent(event)) + cyevent = pevent + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphExecEventWaitNodeSetEvent(cyhGraphExec, cyhNode, cyevent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): + """ Sets the parameters for an external semaphore signal node in the given graphExec. + + Sets the parameters of an external semaphore signal node in an + executable graph `hGraphExec`. The node is identified by the + corresponding node `hNode` in the non-executable graph, from which the + executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Changing `nodeParams->numExtSems` is not supported. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + semaphore signal node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` + Updated Parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): + """ Sets the parameters for an external semaphore wait node in the given graphExec. + + Sets the parameters of an external semaphore wait node in an executable + graph `hGraphExec`. The node is identified by the corresponding node + `hNode` in the non-executable graph, from which the executable graph + was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Changing `nodeParams->numExtSems` is not supported. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + semaphore wait node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` + Updated Parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + 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 + with nogil: + err = cydriver.cuGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): + """ Enables or disables the specified node in the given graphExec. + + Sets `hNode` to be either enabled or disabled. Disabled nodes are + functionally equivalent to empty nodes until they are reenabled. + Existing node parameters are not affected by disabling/enabling the + node. + + The node is identified by the corresponding node `hNode` in the non- + executable graph, from which the executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + If `hNode` is a device-updatable kernel node, the next upload/launch of + `hGraphExec` will overwrite any previous device-side updates. + Additionally, applying host updates to a device-updatable kernel node + while it is being updated from the device will result in undefined + behavior. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node from the graph from which graphExec was instantiated + isEnabled : unsigned int + Node is enabled if != 0, otherwise the node is disabled + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuGraphNodeGetEnabled`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` :py:obj:`~.cuGraphLaunch` + + Notes + ----- + Currently only kernel, memset and memcpy nodes are supported. + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphNodeSetEnabled(cyhGraphExec, cyhNode, isEnabled) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphNodeGetEnabled(hGraphExec, hNode): + """ Query whether a node in the given graphExec is enabled. + + Sets isEnabled to 1 if `hNode` is enabled, or 0 if `hNode` is disabled. + + The node is identified by the corresponding node `hNode` in the non- + executable graph, from which the executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node from the graph from which graphExec was instantiated + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + isEnabled : unsigned int + Location to return the enabled status of the node + + See Also + -------- + :py:obj:`~.cuGraphNodeSetEnabled`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` :py:obj:`~.cuGraphLaunch` + + Notes + ----- + Currently only kernel, memset and memcpy nodes are supported. + + This function will not reflect device-side updates for device-updatable kernel nodes. + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + cdef unsigned int isEnabled = 0 + with nogil: + err = cydriver.cuGraphNodeGetEnabled(cyhGraphExec, cyhNode, &isEnabled) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, isEnabled) + +@cython.embedsignature(True) +def cuGraphUpload(hGraphExec, hStream): + """ Uploads an executable graph in a stream. + + Uploads `hGraphExec` to the device in `hStream` without executing it. + Uploads of the same `hGraphExec` will be serialized. Each upload is + ordered behind both any previous work in `hStream` and any previous + launches of `hGraphExec`. Uses memory cached by `stream` to back the + allocations owned by `hGraphExec`. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to upload + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to upload the graph + + 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:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphLaunch`, :py:obj:`~.cuGraphExecDestroy` + """ + 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.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphUpload(cyhGraphExec, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphLaunch(hGraphExec, hStream): + """ Launches an executable graph in a stream. + + Executes `hGraphExec` in `hStream`. Only one instance of `hGraphExec` + may be executing at a time. Each launch is ordered behind both any + previous work in `hStream` and any previous launches of `hGraphExec`. + To execute a graph concurrently, it must be instantiated multiple times + into multiple executable graphs. + + If any allocations created by `hGraphExec` remain unfreed (from a + previous launch) and `hGraphExec` was not instantiated with + :py:obj:`~.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`, the launch + will fail with :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to launch + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to launch the graph + + 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:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphUpload`, :py:obj:`~.cuGraphExecDestroy` + """ + 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.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphLaunch(cyhGraphExec, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecDestroy(hGraphExec): + """ Destroys an executable graph. + + Destroys the executable graph specified by `hGraphExec`, as well as all + of its executable nodes. If the executable graph is in-flight, it will + not be terminated, but rather freed asynchronously on completion. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to destroy + + 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:`~.cuGraphInstantiate`, :py:obj:`~.cuGraphUpload`, :py:obj:`~.cuGraphLaunch` + """ + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cydriver.cuGraphExecDestroy(cyhGraphExec) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphDestroy(hGraph): + """ Destroys a graph. + + Destroys the graph specified by `hGraph`, as well as all of its nodes. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to destroy + + 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:`~.cuGraphCreate` + """ + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + with nogil: + err = cydriver.cuGraphDestroy(cyhGraph) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecUpdate(hGraphExec, hGraph): + """ Check whether an executable graph can be updated with a graph and perform the update if possible. + + Updates the node parameters in the instantiated graph specified by + `hGraphExec` with the node parameters in a topologically identical + graph specified by `hGraph`. + + Limitations: + + - Kernel nodes: + + - The owning context of the function cannot change. + + - A node whose function originally did not use CUDA dynamic + parallelism cannot be updated to a function which uses CDP. + + - A node whose function originally did not make device-side update + calls cannot be updated to a function which makes device-side + update calls. + + - A cooperative node cannot be updated to a non-cooperative node, and + vice-versa. + + - If the graph was instantiated with + CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, the priority + attribute cannot change. Equality is checked on the originally + requested priority values, before they are clamped to the device's + supported range. + + - If `hGraphExec` was not instantiated for device launch, a node + whose function originally did not use device-side cudaGraphLaunch() + cannot be updated to a function which uses device-side + cudaGraphLaunch() unless the node resides on the same context as + nodes which contained such calls at instantiate-time. If no such + calls were present at instantiation, these updates cannot be + performed at all. + + - Neither `hGraph` nor `hGraphExec` may contain device-updatable + kernel nodes. + + - Memset and memcpy nodes: + + - The CUDA device(s) to which the operand(s) was allocated/mapped + cannot change. + + - The source/destination memory must be allocated from the same + contexts as the original source/destination memory. + + - For 2d memsets, only address and assigned value may be updated. + + - For 1d memsets, updating dimensions is also allowed, but may fail + if the resulting operation doesn't map onto the work resources + already allocated for the node. + + - Additional memcpy node restrictions: + + - Changing either the source or destination memory type(i.e. + CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) is not supported. + + - External semaphore wait nodes and record nodes: + + - Changing the number of semaphores is not supported. + + - Conditional nodes: + + - Changing node parameters is not supported. + + - Changing parameters of nodes within the conditional body graph is + subject to the rules above. + + - Conditional handle flags and default values are updated as part of + the graph update. + + Note: The API may add further restrictions in future releases. The + return code should always be checked. + + cuGraphExecUpdate sets the result member of `resultInfo` to + CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED under the following + conditions: + + - The count of nodes directly in `hGraphExec` and `hGraph` differ, in + which case resultInfo->errorNode is set to NULL. + + - `hGraph` has more exit nodes than `hGraph`, in which case + resultInfo->errorNode is set to one of the exit nodes in hGraph. + + - A node in `hGraph` has a different number of dependencies than the + node from `hGraphExec` it is paired with, in which case + resultInfo->errorNode is set to the node from `hGraph`. + + - A node in `hGraph` has a dependency that does not match with the + corresponding dependency of the paired node from `hGraphExec`. + resultInfo->errorNode will be set to the node from `hGraph`. + resultInfo->errorFromNode will be set to the mismatched dependency. + The dependencies are paired based on edge order and a dependency does + not match when the nodes are already paired based on other edges + examined in the graph. + + cuGraphExecUpdate sets the result member of `resultInfo` to: + + - CU_GRAPH_EXEC_UPDATE_ERROR if passed an invalid value. + + - CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED if the graph topology + changed + + - CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED if the type of a node + changed, in which case `hErrorNode_out` is set to the node from + `hGraph`. + + - CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE if the + function changed in an unsupported way(see note above), in which case + `hErrorNode_out` is set to the node from `hGraph` + + - CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED if any parameters to a + node changed in a way that is not supported, in which case + `hErrorNode_out` is set to the node from `hGraph`. + + - CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED if any attributes of a + node changed in a way that is not supported, in which case + `hErrorNode_out` is set to the node from `hGraph`. + + - CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED if something about a node is + unsupported, like the node's type or configuration, in which case + `hErrorNode_out` is set to the node from `hGraph` + + If the update fails for a reason not listed above, the result member of + `resultInfo` will be set to CU_GRAPH_EXEC_UPDATE_ERROR. If the update + succeeds, the result member will be set to + CU_GRAPH_EXEC_UPDATE_SUCCESS. + + cuGraphExecUpdate returns CUDA_SUCCESS when the updated was performed + successfully. It returns CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE if the + graph update was not performed because it included changes which + violated constraints specific to instantiated graph update. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The instantiated graph to be updated + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph containing the updated parameters + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE`, + resultInfo : :py:obj:`~.CUgraphExecUpdateResultInfo` + the error info structure + + See Also + -------- + :py:obj:`~.cuGraphInstantiate` + """ + 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.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + cdef CUgraphExecUpdateResultInfo resultInfo = CUgraphExecUpdateResultInfo() + with nogil: + err = cydriver.cuGraphExecUpdate(cyhGraphExec, cyhGraph, resultInfo._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, resultInfo) + +@cython.embedsignature(True) +def cuGraphKernelNodeCopyAttributes(dst, src): + """ Copies attributes from source node to destination node. + + Copies attributes from source node `src` to destination node `dst`. + Both node must have the same context. + + Parameters + ---------- + dst : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Destination node + src : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Source node For list of attributes see + :py:obj:`~.CUkernelNodeAttrID` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.CUaccessPolicyWindow` + """ + cdef cydriver.CUgraphNode cysrc + if src is None: + psrc = 0 + elif isinstance(src, (CUgraphNode,)): + psrc = int(src) + else: + psrc = int(CUgraphNode(src)) + cysrc = psrc + cdef cydriver.CUgraphNode cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (CUgraphNode,)): + pdst = int(dst) + else: + pdst = int(CUgraphNode(dst)) + cydst = pdst + with nogil: + err = cydriver.cuGraphKernelNodeCopyAttributes(cydst, cysrc) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphKernelNodeGetAttribute(hNode, attr not None : CUkernelNodeAttrID): + """ Queries node attribute. + + Queries attribute `attr` from node `hNode` and stores it in + corresponding member of `value_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + + 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` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUkernelNodeAttrID cyattr = int(attr) + cdef CUkernelNodeAttrValue value_out = CUkernelNodeAttrValue() + with nogil: + err = cydriver.cuGraphKernelNodeGetAttribute(cyhNode, cyattr, value_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, value_out) + +@cython.embedsignature(True) +def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, value : Optional[CUkernelNodeAttrValue]): + """ Sets node attribute. + + Sets attribute `attr` on node `hNode` from corresponding attribute of + `value`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + + attr : :py:obj:`~.CUkernelNodeAttrID` + + value : :py:obj:`~.CUkernelNodeAttrValue` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + + See Also + -------- + :py:obj:`~.CUaccessPolicyWindow` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUkernelNodeAttrID cyattr = int(attr) + 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),) + +@cython.embedsignature(True) +def cuGraphDebugDotPrint(hGraph, char* path, unsigned int flags): + """ Write a DOT file describing graph structure. + + Using the provided `hGraph`, write to `path` a DOT formatted + description of the graph. By default this includes the graph topology, + node types, node id, kernel names and memcpy direction. `flags` can be + specified to write more detailed information about each node type such + as parameter values, kernel attributes, node and function handles. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to create a DOT file from + path : bytes + The path to write the DOT file to + flags : unsigned int + Flags from :py:obj:`~.CUgraphDebugDot_flags` for specifying which + additional node information to write + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OPERATING_SYSTEM` + """ + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + with nogil: + err = cydriver.cuGraphDebugDotPrint(cyhGraph, path, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int flags): + """ Create a user object. + + Create a user object with the specified destructor callback and initial + reference count. The initial references are owned by the caller. + + Destructor callbacks cannot make CUDA API calls and should avoid + blocking behavior, as they are executed by a shared internal thread. + Another thread may be signaled to perform such actions, if it does not + block forward progress of tasks scheduled through CUDA. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + ptr : Any + The pointer to pass to the destroy function + destroy : :py:obj:`~.CUhostFn` + Callback to free the user object when it is no longer in use + initialRefcount : unsigned int + The initial refcount to create the object with, typically 1. The + initial references are owned by the calling thread. + flags : unsigned int + Currently it is required to pass + :py:obj:`~.CU_USER_OBJECT_NO_DESTRUCTOR_SYNC`, which is the only + defined flag. This indicates that the destroy callback cannot be + waited on by any CUDA API. Users requiring synchronization of the + callback should signal its completion manually. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + object_out : :py:obj:`~.CUuserObject` + Location to return the user object handle + + See Also + -------- + :py:obj:`~.cuUserObjectRetain`, :py:obj:`~.cuUserObjectRelease`, :py:obj:`~.cuGraphRetainUserObject`, :py:obj:`~.cuGraphReleaseUserObject`, :py:obj:`~.cuGraphCreate` + """ + cdef cydriver.CUhostFn cydestroy + if destroy is None: + pdestroy = 0 + elif isinstance(destroy, (CUhostFn,)): + pdestroy = int(destroy) + else: + pdestroy = int(CUhostFn(destroy)) + cydestroy = pdestroy + cdef CUuserObject object_out = CUuserObject() + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cydriver.cuUserObjectCreate(object_out._pvt_ptr, cyptr, cydestroy, initialRefcount, flags) + _helper_input_void_ptr_free(&cyptrHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, object_out) + +@cython.embedsignature(True) +def cuUserObjectRetain(object, unsigned int count): + """ Retain a reference to a user object. + + Retains new references to a user object. The new references are owned + by the caller. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + object : :py:obj:`~.CUuserObject` + The object to retain + count : unsigned int + The number of references to retain, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuUserObjectCreate`, :py:obj:`~.cuUserObjectRelease`, :py:obj:`~.cuGraphRetainUserObject`, :py:obj:`~.cuGraphReleaseUserObject`, :py:obj:`~.cuGraphCreate` + """ + cdef cydriver.CUuserObject cyobject + if object is None: + pobject = 0 + elif isinstance(object, (CUuserObject,)): + pobject = int(object) + else: + pobject = int(CUuserObject(object)) + cyobject = pobject + with nogil: + err = cydriver.cuUserObjectRetain(cyobject, count) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuUserObjectRelease(object, unsigned int count): + """ Release a reference to a user object. + + Releases user object references owned by the caller. The object's + destructor is invoked if the reference count reaches zero. + + It is undefined behavior to release references not owned by the caller, + or to use a user object handle after all references are released. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + object : :py:obj:`~.CUuserObject` + The object to release + count : unsigned int + The number of references to release, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuUserObjectCreate`, :py:obj:`~.cuUserObjectRetain`, :py:obj:`~.cuGraphRetainUserObject`, :py:obj:`~.cuGraphReleaseUserObject`, :py:obj:`~.cuGraphCreate` + """ + cdef cydriver.CUuserObject cyobject + if object is None: + pobject = 0 + elif isinstance(object, (CUuserObject,)): + pobject = int(object) + else: + pobject = int(CUuserObject(object)) + cyobject = pobject + with nogil: + err = cydriver.cuUserObjectRelease(cyobject, count) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphRetainUserObject(graph, object, unsigned int count, unsigned int flags): + """ Retain a reference to a user object from a graph. + + Creates or moves user object references that will be owned by a CUDA + graph. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to associate the reference with + object : :py:obj:`~.CUuserObject` + The user object to retain a reference for + count : unsigned int + The number of references to add to the graph, typically 1. Must be + nonzero and not larger than INT_MAX. + flags : unsigned int + The optional flag :py:obj:`~.CU_GRAPH_USER_OBJECT_MOVE` transfers + references from the calling thread, rather than create new + references. Pass 0 to create new references. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuUserObjectCreate`, :py:obj:`~.cuUserObjectRetain`, :py:obj:`~.cuUserObjectRelease`, :py:obj:`~.cuGraphReleaseUserObject`, :py:obj:`~.cuGraphCreate` + """ + cdef cydriver.CUuserObject cyobject + if object is None: + pobject = 0 + elif isinstance(object, (CUuserObject,)): + pobject = int(object) + else: + pobject = int(CUuserObject(object)) + cyobject = pobject + cdef cydriver.CUgraph cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (CUgraph,)): + pgraph = int(graph) + else: + pgraph = int(CUgraph(graph)) + cygraph = pgraph + with nogil: + err = cydriver.cuGraphRetainUserObject(cygraph, cyobject, count, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphReleaseUserObject(graph, object, unsigned int count): + """ Release a user object reference from a graph. + + Releases user object references owned by a graph. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph that will release the reference + object : :py:obj:`~.CUuserObject` + The user object to release a reference for + count : unsigned int + The number of references to release, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuUserObjectCreate`, :py:obj:`~.cuUserObjectRetain`, :py:obj:`~.cuUserObjectRelease`, :py:obj:`~.cuGraphRetainUserObject`, :py:obj:`~.cuGraphCreate` + """ + cdef cydriver.CUuserObject cyobject + if object is None: + pobject = 0 + elif isinstance(object, (CUuserObject,)): + pobject = int(object) + else: + pobject = int(CUuserObject(object)) + cyobject = pobject + cdef cydriver.CUgraph cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (CUgraph,)): + pgraph = int(graph) + else: + pgraph = int(CUgraph(graph)) + cygraph = pgraph + with nogil: + err = cydriver.cuGraphReleaseUserObject(cygraph, cyobject, count) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): + """ Adds a node of arbitrary type to a graph. + + Creates a new node in `hGraph` described by `nodeParams` with + `numDependencies` dependencies specified via `dependencies`. + `numDependencies` may be 0. `dependencies` may be null if + `numDependencies` is 0. `dependencies` may not have any duplicate + entries. + + `nodeParams` is a tagged union. The node type should be specified in + the `typename` field, and type-specific parameters in the corresponding + union member. All unused bytes - that is, `reserved0` and all bytes + past the utilized union member - must be set to zero. It is recommended + to use brace initialization or memset to ensure all bytes are + initialized. + + Note that for some node types, `nodeParams` may contain "out + parameters" which are modified during the call, such as + `nodeParams->alloc.dptr`. + + A handle to the new node will be returned in `phGraphNode`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUgraphNodeParams` + Specification of the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphExecNodeSetParams` + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cydriver.cuGraphAddNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphAddNode_v2(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): + """ Adds a node of arbitrary type to a graph (12.3+). + + Creates a new node in `hGraph` described by `nodeParams` with + `numDependencies` dependencies specified via `dependencies`. + `numDependencies` may be 0. `dependencies` may be null if + `numDependencies` is 0. `dependencies` may not have any duplicate + entries. + + `nodeParams` is a tagged union. The node type should be specified in + the `typename` field, and type-specific parameters in the corresponding + union member. All unused bytes - that is, `reserved0` and all bytes + past the utilized union member - must be set to zero. It is recommended + to use brace initialization or memset to ensure all bytes are + initialized. + + Note that for some node types, `nodeParams` may contain "out + parameters" which are modified during the call, such as + `nodeParams->alloc.dptr`. + + A handle to the new node will be returned in `phGraphNode`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] + Optional edge data for the dependencies. If NULL, the data is + assumed to be default (zeroed) for all dependencies. + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUgraphNodeParams` + Specification of the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphExecNodeSetParams` + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cydriver.CUgraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cydriver.cuGraphAddNode_v2(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + +@cython.embedsignature(True) +def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): + """ Update's a graph node's parameters. + + Sets the parameters of graph node `hNode` to `nodeParams`. The node + type specified by `nodeParams->type` must match the type of `hNode`. + `nodeParams` must be fully initialized and all unused bytes (reserved, + padding) zeroed. + + Modifying parameters is not supported for node types + CU_GRAPH_NODE_TYPE_MEM_ALLOC and CU_GRAPH_NODE_TYPE_MEM_FREE. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUgraphNodeParams` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphExecNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cydriver.cuGraphNodeSetParams(cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNodeParams]): + """ Update's a graph node's parameters in an instantiated graph. + + Sets the parameters of a node in an executable graph `hGraphExec`. The + node is identified by the corresponding node `hNode` in the non- + executable graph from which the executable graph was instantiated. + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Allowed changes to parameters on executable graphs are as follows: + + **View CUDA Toolkit Documentation for a table example** + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to update the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Corresponding node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.CUgraphNodeParams` + Updated Parameters to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphNodeSetParams` :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphExec cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (CUgraphExec,)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(CUgraphExec(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) + +@cython.embedsignature(True) +def cuGraphConditionalHandleCreate(hGraph, ctx, unsigned int defaultLaunchValue, unsigned int flags): + """ Create a conditional handle. + + Creates a conditional handle associated with `hGraph`. + + The conditional handle must be associated with a conditional node in + this graph or one of its children. + + Handles not associated with a conditional node may cause graph + instantiation to fail. + + Handles can only be set from the context with which they are + associated. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph which will contain the conditional node using this handle. + ctx : :py:obj:`~.CUcontext` + Context for the handle and associated conditional node. + defaultLaunchValue : unsigned int + Optional initial value for the conditional variable. Applied at the + beginning of each graph execution if CU_GRAPH_COND_ASSIGN_DEFAULT + is set in `flags`. + flags : unsigned int + Currently must be CU_GRAPH_COND_ASSIGN_DEFAULT or 0. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pHandle_out : :py:obj:`~.CUgraphConditionalHandle` + Pointer used to return the handle to the caller. + + See Also + -------- + :py:obj:`~.cuGraphAddNode` + """ + cdef cydriver.CUcontext cyctx + if ctx is None: + pctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphConditionalHandle pHandle_out = CUgraphConditionalHandle() + with nogil: + err = cydriver.cuGraphConditionalHandleCreate(pHandle_out._pvt_ptr, cyhGraph, cyctx, defaultLaunchValue, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pHandle_out) + +@cython.embedsignature(True) +def cuOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dynamicSMemSize): + """ Returns occupancy of a function. + + Returns in `*numBlocks` the number of the maximum active blocks per + streaming multiprocessor. + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will be the current context. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel for which occupancy is calculated + blockSize : int + Block size the kernel is intended to be launched with + dynamicSMemSize : size_t + Per-block dynamic shared memory usage intended, in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + numBlocks : int + Returned occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef int numBlocks = 0 + with nogil: + err = cydriver.cuOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc, blockSize, dynamicSMemSize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, numBlocks) + +@cython.embedsignature(True) +def cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, size_t dynamicSMemSize, unsigned int flags): + """ Returns occupancy of a function. + + Returns in `*numBlocks` the number of the maximum active blocks per + streaming multiprocessor. + + The `Flags` parameter controls how special cases are handled. The valid + flags are: + + - :py:obj:`~.CU_OCCUPANCY_DEFAULT`, which maintains the default + behavior as :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor`; + + - :py:obj:`~.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`, which suppresses + the default behavior on platform where global caching affects + occupancy. On such platforms, if caching is enabled, but per-block SM + resource usage would result in zero occupancy, the occupancy + calculator will calculate the occupancy as if caching is disabled. + Setting :py:obj:`~.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE` makes the + occupancy calculator to return 0 in such cases. More information can + be found about this feature in the "Unified L1/Texture Cache" section + of the Maxwell tuning guide. + + Note that the API can also be with launch context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will be the current context. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel for which occupancy is calculated + blockSize : int + Block size the kernel is intended to be launched with + dynamicSMemSize : size_t + Per-block dynamic shared memory usage intended, in bytes + flags : unsigned int + Requested behavior for the occupancy calculator + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + numBlocks : int + Returned occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef int numBlocks = 0 + with nogil: + err = cydriver.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc, blockSize, dynamicSMemSize, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, numBlocks) + +@cython.embedsignature(True) +def cuOccupancyMaxPotentialBlockSize(func, blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit): + """ Suggest a launch configuration with reasonable occupancy. + + Returns in `*blockSize` a reasonable block size that can achieve the + maximum occupancy (or, the maximum number of active warps with the + fewest blocks per multiprocessor), and in `*minGridSize` the minimum + grid size to achieve the maximum occupancy. + + If `blockSizeLimit` is 0, the configurator will use the maximum block + size permitted by the device / function instead. + + If per-block dynamic shared memory allocation is not needed, the user + should leave both `blockSizeToDynamicSMemSize` and `dynamicSMemSize` as + 0. + + If per-block dynamic shared memory allocation is needed, then if the + dynamic shared memory size is constant regardless of block size, the + size should be passed through `dynamicSMemSize`, and + `blockSizeToDynamicSMemSize` should be NULL. + + Otherwise, if the per-block dynamic shared memory size varies with + different block sizes, the user needs to provide a unary function + through `blockSizeToDynamicSMemSize` that computes the dynamic shared + memory needed by `func` for any given block size. `dynamicSMemSize` is + ignored. An example signature is: + + **View CUDA Toolkit Documentation for a C++ code example** + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will be the current context. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel for which launch configuration is calculated + blockSizeToDynamicSMemSize : :py:obj:`~.CUoccupancyB2DSize` + A function that calculates how much per-block dynamic shared memory + `func` uses based on the block size + dynamicSMemSize : size_t + Dynamic shared memory usage intended, in bytes + blockSizeLimit : int + The maximum block size `func` is designed to handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + minGridSize : int + Returned minimum grid size needed to achieve the maximum occupancy + blockSize : int + Returned maximum block size that can achieve the maximum occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxPotentialBlockSize` + """ + cdef cydriver.CUoccupancyB2DSize cyblockSizeToDynamicSMemSize + if blockSizeToDynamicSMemSize is None: + pblockSizeToDynamicSMemSize = 0 + elif isinstance(blockSizeToDynamicSMemSize, (CUoccupancyB2DSize,)): + pblockSizeToDynamicSMemSize = int(blockSizeToDynamicSMemSize) + else: + pblockSizeToDynamicSMemSize = int(CUoccupancyB2DSize(blockSizeToDynamicSMemSize)) + cyblockSizeToDynamicSMemSize = pblockSizeToDynamicSMemSize + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef int minGridSize = 0 + cdef int blockSize = 0 + with nogil: + err = cydriver.cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cyfunc, cyblockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, minGridSize, blockSize) + +@cython.embedsignature(True) +def cuOccupancyMaxPotentialBlockSizeWithFlags(func, blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags): + """ Suggest a launch configuration with reasonable occupancy. + + An extended version of :py:obj:`~.cuOccupancyMaxPotentialBlockSize`. In + addition to arguments passed to + :py:obj:`~.cuOccupancyMaxPotentialBlockSize`, + :py:obj:`~.cuOccupancyMaxPotentialBlockSizeWithFlags` also takes a + `Flags` parameter. + + The `Flags` parameter controls how special cases are handled. The valid + flags are: + + - :py:obj:`~.CU_OCCUPANCY_DEFAULT`, which maintains the default + behavior as :py:obj:`~.cuOccupancyMaxPotentialBlockSize`; + + - :py:obj:`~.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`, which suppresses + the default behavior on platform where global caching affects + occupancy. On such platforms, the launch configurations that produces + maximal occupancy might not support global caching. Setting + :py:obj:`~.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE` guarantees that the + the produced launch configuration is global caching compatible at a + potential cost of occupancy. More information can be found about this + feature in the "Unified L1/Texture Cache" section of the Maxwell + tuning guide. + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will be the current context. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel for which launch configuration is calculated + blockSizeToDynamicSMemSize : :py:obj:`~.CUoccupancyB2DSize` + A function that calculates how much per-block dynamic shared memory + `func` uses based on the block size + dynamicSMemSize : size_t + Dynamic shared memory usage intended, in bytes + blockSizeLimit : int + The maximum block size `func` is designed to handle + flags : unsigned int + Options + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + minGridSize : int + Returned minimum grid size needed to achieve the maximum occupancy + blockSize : int + Returned maximum block size that can achieve the maximum occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxPotentialBlockSizeWithFlags` + """ + cdef cydriver.CUoccupancyB2DSize cyblockSizeToDynamicSMemSize + if blockSizeToDynamicSMemSize is None: + pblockSizeToDynamicSMemSize = 0 + elif isinstance(blockSizeToDynamicSMemSize, (CUoccupancyB2DSize,)): + pblockSizeToDynamicSMemSize = int(blockSizeToDynamicSMemSize) + else: + pblockSizeToDynamicSMemSize = int(CUoccupancyB2DSize(blockSizeToDynamicSMemSize)) + cyblockSizeToDynamicSMemSize = pblockSizeToDynamicSMemSize + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef int minGridSize = 0 + cdef int blockSize = 0 + with nogil: + err = cydriver.cuOccupancyMaxPotentialBlockSizeWithFlags(&minGridSize, &blockSize, cyfunc, cyblockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, minGridSize, blockSize) + +@cython.embedsignature(True) +def cuOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize): + """ Returns dynamic shared memory available per block when launching `numBlocks` blocks on SM. + + Returns in `*dynamicSmemSize` the maximum size of dynamic shared memory + to allow `numBlocks` blocks per SM. + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will be the current context. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel function for which occupancy is calculated + numBlocks : int + Number of blocks to fit on SM + blockSize : int + Size of the blocks + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + dynamicSmemSize : int + Returned maximum dynamic shared memory + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + pfunc = int(CUfunction(func)) + cyfunc = pfunc + cdef size_t dynamicSmemSize = 0 + with nogil: + err = cydriver.cuOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc, numBlocks, blockSize) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, dynamicSmemSize) + +@cython.embedsignature(True) +def cuOccupancyMaxPotentialClusterSize(func, config : Optional[CUlaunchConfig]): + """ Given the kernel function (`func`) and launch configuration (`config`), return the maximum cluster size in `*clusterSize`. + + The cluster dimensions in `config` are ignored. If func has a required + cluster size set (see :py:obj:`~.cudaFuncGetAttributes` / + :py:obj:`~.cuFuncGetAttribute`),`*clusterSize` will reflect the + required cluster size. + + By default this function will always return a value that's portable on + future hardware. A higher value may be returned if the kernel function + allows non-portable cluster sizes. + + This function will respect the compile time launch bounds. + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will either be taken from the specified stream + `config->hStream` or the current context in case of NULL stream. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel function for which maximum cluster size is calculated + config : :py:obj:`~.CUlaunchConfig` + Launch configuration for the given kernel function + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + clusterSize : int + Returned maximum cluster size that can be launched for the given + kernel function and launch configuration + + See Also + -------- + :py:obj:`~.cudaFuncGetAttributes`, :py:obj:`~.cuFuncGetAttribute` + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + 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 + with nogil: + err = cydriver.cuOccupancyMaxPotentialClusterSize(&clusterSize, cyfunc, cyconfig_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, clusterSize) + +@cython.embedsignature(True) +def cuOccupancyMaxActiveClusters(func, config : Optional[CUlaunchConfig]): + """ Given the kernel function (`func`) and launch configuration (`config`), return the maximum number of clusters that could co-exist on the target device in `*numClusters`. + + If the function has required cluster size already set (see + :py:obj:`~.cudaFuncGetAttributes` / :py:obj:`~.cuFuncGetAttribute`), + the cluster size from config must either be unspecified or match the + required size. Without required sizes, the cluster size must be + specified in config, else the function will return an error. + + Note that various attributes of the kernel function may affect + occupancy calculation. Runtime environment may affect how the hardware + schedules the clusters, so the calculated occupancy is not guaranteed + to be achievable. + + Note that the API can also be used with context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then passing it to the API by + casting to :py:obj:`~.CUfunction`. Here, the context to use for + calculations will either be taken from the specified stream + `config->hStream` or the current context in case of NULL stream. + + Parameters + ---------- + func : :py:obj:`~.CUfunction` + Kernel function for which maximum number of clusters are calculated + config : :py:obj:`~.CUlaunchConfig` + Launch configuration for the given kernel function + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CLUSTER_SIZE`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + numClusters : int + Returned maximum number of clusters that could co-exist on the + target device + + See Also + -------- + :py:obj:`~.cudaFuncGetAttributes`, :py:obj:`~.cuFuncGetAttribute` + """ + cdef cydriver.CUfunction cyfunc + if func is None: + pfunc = 0 + elif isinstance(func, (CUfunction,)): + pfunc = int(func) + else: + 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 + with nogil: + err = cydriver.cuOccupancyMaxActiveClusters(&numClusters, cyfunc, cyconfig_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, numClusters) + +@cython.embedsignature(True) +def cuTexRefSetArray(hTexRef, hArray, unsigned int Flags): + """ Binds an array as a texture reference. + + [Deprecated] + + Binds the CUDA array `hArray` to the texture reference `hTexRef`. Any + previous address or CUDA array state associated with the texture + reference is superseded by this function. `Flags` must be set to + :py:obj:`~.CU_TRSA_OVERRIDE_FORMAT`. Any CUDA array previously bound to + `hTexRef` is unbound. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference to bind + hArray : :py:obj:`~.CUarray` + Array to bind + Flags : unsigned int + Options (must be :py:obj:`~.CU_TRSA_OVERRIDE_FORMAT`) + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetArray(cyhTexRef, cyhArray, Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, unsigned int Flags): + """ Binds a mipmapped array to a texture reference. + + [Deprecated] + + Binds the CUDA mipmapped array `hMipmappedArray` to the texture + reference `hTexRef`. Any previous address or CUDA array state + associated with the texture reference is superseded by this function. + `Flags` must be set to :py:obj:`~.CU_TRSA_OVERRIDE_FORMAT`. Any CUDA + array previously bound to `hTexRef` is unbound. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference to bind + hMipmappedArray : :py:obj:`~.CUmipmappedArray` + Mipmapped array to bind + Flags : unsigned int + Options (must be :py:obj:`~.CU_TRSA_OVERRIDE_FORMAT`) + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUmipmappedArray cyhMipmappedArray + if hMipmappedArray is None: + phMipmappedArray = 0 + elif isinstance(hMipmappedArray, (CUmipmappedArray,)): + phMipmappedArray = int(hMipmappedArray) + else: + phMipmappedArray = int(CUmipmappedArray(hMipmappedArray)) + cyhMipmappedArray = phMipmappedArray + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetMipmappedArray(cyhTexRef, cyhMipmappedArray, Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetAddress(hTexRef, dptr, size_t numbytes): + """ Binds an address as a texture reference. + + [Deprecated] + + Binds a linear address range to the texture reference `hTexRef`. Any + previous address or CUDA array state associated with the texture + reference is superseded by this function. Any memory previously bound + to `hTexRef` is unbound. + + Since the hardware enforces an alignment requirement on texture base + addresses, :py:obj:`~.cuTexRefSetAddress()` passes back a byte offset + in `*ByteOffset` that must be applied to texture fetches in order to + read from the desired memory. This offset must be divided by the texel + size and passed to kernels that read from the texture so they can be + applied to the :py:obj:`~.tex1Dfetch()` function. + + If the device memory pointer was returned from + :py:obj:`~.cuMemAlloc()`, the offset is guaranteed to be 0 and NULL may + be passed as the `ByteOffset` parameter. + + The total number of elements (or texels) in the linear address range + cannot exceed + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`. The + number of elements is computed as (`numbytes` / bytesPerElement), where + bytesPerElement is determined from the data format and number of + components set using :py:obj:`~.cuTexRefSetFormat()`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference to bind + dptr : :py:obj:`~.CUdeviceptr` + Device pointer to bind + numbytes : size_t + Size of memory to bind in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + ByteOffset : int + Returned byte offset + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef size_t ByteOffset = 0 + with nogil: + err = cydriver.cuTexRefSetAddress(&ByteOffset, cyhTexRef, cydptr, numbytes) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, ByteOffset) + +@cython.embedsignature(True) +def cuTexRefSetAddress2D(hTexRef, desc : Optional[CUDA_ARRAY_DESCRIPTOR], dptr, size_t Pitch): + """ Binds an address as a 2D texture reference. + + [Deprecated] + + Binds a linear address range to the texture reference `hTexRef`. Any + previous address or CUDA array state associated with the texture + reference is superseded by this function. Any memory previously bound + to `hTexRef` is unbound. + + Using a :py:obj:`~.tex2D()` function inside a kernel requires a call to + either :py:obj:`~.cuTexRefSetArray()` to bind the corresponding texture + reference to an array, or :py:obj:`~.cuTexRefSetAddress2D()` to bind + the texture reference to linear memory. + + Function calls to :py:obj:`~.cuTexRefSetFormat()` cannot follow calls + to :py:obj:`~.cuTexRefSetAddress2D()` for the same texture reference. + + It is required that `dptr` be aligned to the appropriate hardware- + specific texture alignment. You can query this value using the device + attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`. If an + unaligned `dptr` is supplied, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is + returned. + + `Pitch` has to be aligned to the hardware-specific texture pitch + alignment. This value can be queried using the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`. If an + unaligned `Pitch` is supplied, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is + returned. + + Width and Height, which are specified in elements (or texels), cannot + exceed :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH` + and :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT` + respectively. `Pitch`, which is specified in bytes, cannot exceed + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference to bind + desc : :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` + Descriptor of CUDA array + dptr : :py:obj:`~.CUdeviceptr` + Device pointer to bind + Pitch : size_t + Line pitch in bytes + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + pdptr = 0 + elif isinstance(dptr, (CUdeviceptr,)): + pdptr = int(dptr) + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + 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),) + +@cython.embedsignature(True) +def cuTexRefSetFormat(hTexRef, fmt not None : CUarray_format, int NumPackedComponents): + """ Sets the format for a texture reference. + + [Deprecated] + + Specifies the format of the data to be read by the texture reference + `hTexRef`. `fmt` and `NumPackedComponents` are exactly analogous to the + :py:obj:`~.Format` and :py:obj:`~.NumChannels` members of the + :py:obj:`~.CUDA_ARRAY_DESCRIPTOR` structure: They specify the format of + each component and the number of components per array element. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + fmt : :py:obj:`~.CUarray_format` + Format to set + NumPackedComponents : int + Number of components per array element + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat`, :py:obj:`~.cudaCreateChannelDesc` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUarray_format cyfmt = int(fmt) + with nogil: + err = cydriver.cuTexRefSetFormat(cyhTexRef, cyfmt, NumPackedComponents) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetAddressMode(hTexRef, int dim, am not None : CUaddress_mode): + """ Sets the addressing mode for a texture reference. + + [Deprecated] + + Specifies the addressing mode `am` for the given dimension `dim` of the + texture reference `hTexRef`. If `dim` is zero, the addressing mode is + applied to the first parameter of the functions used to fetch from the + texture; if `dim` is 1, the second, and so on. + :py:obj:`~.CUaddress_mode` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + Note that this call has no effect if `hTexRef` is bound to linear + memory. Also, if the flag, :py:obj:`~.CU_TRSF_NORMALIZED_COORDINATES`, + is not set, the only supported address mode is + :py:obj:`~.CU_TR_ADDRESS_MODE_CLAMP`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + dim : int + Dimension + am : :py:obj:`~.CUaddress_mode` + Addressing mode to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUaddress_mode cyam = int(am) + with nogil: + err = cydriver.cuTexRefSetAddressMode(cyhTexRef, dim, cyam) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetFilterMode(hTexRef, fm not None : CUfilter_mode): + """ Sets the filtering mode for a texture reference. + + [Deprecated] + + Specifies the filtering mode `fm` to be used when reading memory + through the texture reference `hTexRef`. :py:obj:`~.CUfilter_mode_enum` + is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + Note that this call has no effect if `hTexRef` is bound to linear + memory. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + fm : :py:obj:`~.CUfilter_mode` + Filtering mode to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUfilter_mode cyfm = int(fm) + with nogil: + err = cydriver.cuTexRefSetFilterMode(cyhTexRef, cyfm) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetMipmapFilterMode(hTexRef, fm not None : CUfilter_mode): + """ Sets the mipmap filtering mode for a texture reference. + + [Deprecated] + + Specifies the mipmap filtering mode `fm` to be used when reading memory + through the texture reference `hTexRef`. :py:obj:`~.CUfilter_mode_enum` + is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + Note that this call has no effect if `hTexRef` is not bound to a + mipmapped array. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + fm : :py:obj:`~.CUfilter_mode` + Filtering mode to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUfilter_mode cyfm = int(fm) + with nogil: + err = cydriver.cuTexRefSetMipmapFilterMode(cyhTexRef, cyfm) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetMipmapLevelBias(hTexRef, float bias): + """ Sets the mipmap level bias for a texture reference. + + [Deprecated] + + Specifies the mipmap level bias `bias` to be added to the specified + mipmap level when reading memory through the texture reference + `hTexRef`. + + Note that this call has no effect if `hTexRef` is not bound to a + mipmapped array. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + bias : float + Mipmap level bias + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetMipmapLevelBias(cyhTexRef, bias) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetMipmapLevelClamp(hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp): + """ Sets the mipmap min/max mipmap level clamps for a texture reference. + + [Deprecated] + + Specifies the min/max mipmap level clamps, `minMipmapLevelClamp` and + `maxMipmapLevelClamp` respectively, to be used when reading memory + through the texture reference `hTexRef`. + + Note that this call has no effect if `hTexRef` is not bound to a + mipmapped array. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + minMipmapLevelClamp : float + Mipmap min level clamp + maxMipmapLevelClamp : float + Mipmap max level clamp + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetMipmapLevelClamp(cyhTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetMaxAnisotropy(hTexRef, unsigned int maxAniso): + """ Sets the maximum anisotropy for a texture reference. + + [Deprecated] + + Specifies the maximum anisotropy `maxAniso` to be used when reading + memory through the texture reference `hTexRef`. + + Note that this call has no effect if `hTexRef` is bound to linear + memory. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + maxAniso : unsigned int + Maximum anisotropy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetMaxAnisotropy(cyhTexRef, maxAniso) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetBorderColor(hTexRef, float pBorderColor): + """ Sets the border color for a texture reference. + + [Deprecated] + + Specifies the value of the RGBA color via the `pBorderColor` to the + texture reference `hTexRef`. The color value supports only float type + and holds color components in the following sequence: pBorderColor[0] + holds 'R' component pBorderColor[1] holds 'G' component pBorderColor[2] + holds 'B' component pBorderColor[3] holds 'A' component + + Note that the color values can be set only when the Address mode is set + to CU_TR_ADDRESS_MODE_BORDER using :py:obj:`~.cuTexRefSetAddressMode`. + Applications using integer border color values have to + "reinterpret_cast" their values to float. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + pBorderColor : float + RGBA color + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetBorderColor` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetBorderColor(cyhTexRef, &pBorderColor) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefSetFlags(hTexRef, unsigned int Flags): + """ Sets the flags for a texture reference. + + [Deprecated] + + Specifies optional flags via `Flags` to specify the behavior of data + returned through the texture reference `hTexRef`. The valid flags are: + + - :py:obj:`~.CU_TRSF_READ_AS_INTEGER`, which suppresses the default + behavior of having the texture promote integer data to floating point + data in the range [0, 1]. Note that texture with 32-bit integer + format would not be promoted, regardless of whether or not this flag + is specified; + + - :py:obj:`~.CU_TRSF_NORMALIZED_COORDINATES`, which suppresses the + default behavior of having the texture coordinates range from [0, + Dim) where Dim is the width or height of the CUDA array. Instead, the + texture coordinates [0, 1.0) reference the entire breadth of the + array dimension; + + - :py:obj:`~.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION`, which disables + any trilinear filtering optimizations. Trilinear optimizations + improve texture filtering performance by allowing bilinear filtering + on textures in scenarios where it can closely approximate the + expected results. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + Flags : unsigned int + Optional flags to set + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefSetFlags(cyhTexRef, Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexRefGetAddress(hTexRef): + """ Gets the address associated with a texture reference. + + [Deprecated] + + Returns in `*pdptr` the base address bound to the texture reference + `hTexRef`, or returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if the + texture reference is not bound to any device memory range. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pdptr : :py:obj:`~.CUdeviceptr` + Returned device address + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef CUdeviceptr pdptr = CUdeviceptr() + with nogil: + err = cydriver.cuTexRefGetAddress(pdptr._pvt_ptr, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pdptr) + +@cython.embedsignature(True) +def cuTexRefGetArray(hTexRef): + """ Gets the array bound to a texture reference. + + [Deprecated] + + Returns in `*phArray` the CUDA array bound to the texture reference + `hTexRef`, or returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if the + texture reference is not bound to any CUDA array. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phArray : :py:obj:`~.CUarray` + Returned array + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef CUarray phArray = CUarray() + with nogil: + err = cydriver.cuTexRefGetArray(phArray._pvt_ptr, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phArray) + +@cython.embedsignature(True) +def cuTexRefGetMipmappedArray(hTexRef): + """ Gets the mipmapped array bound to a texture reference. + + [Deprecated] + + Returns in `*phMipmappedArray` the CUDA mipmapped array bound to the + texture reference `hTexRef`, or returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if the texture reference is not + bound to any CUDA mipmapped array. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phMipmappedArray : :py:obj:`~.CUmipmappedArray` + Returned mipmapped array + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef CUmipmappedArray phMipmappedArray = CUmipmappedArray() + with nogil: + err = cydriver.cuTexRefGetMipmappedArray(phMipmappedArray._pvt_ptr, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phMipmappedArray) + +@cython.embedsignature(True) +def cuTexRefGetAddressMode(hTexRef, int dim): + """ Gets the addressing mode used by a texture reference. + + [Deprecated] + + Returns in `*pam` the addressing mode corresponding to the dimension + `dim` of the texture reference `hTexRef`. Currently, the only valid + value for `dim` are 0 and 1. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + dim : int + Dimension + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pam : :py:obj:`~.CUaddress_mode` + Returned addressing mode + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUaddress_mode pam + with nogil: + err = cydriver.cuTexRefGetAddressMode(&pam, cyhTexRef, dim) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUaddress_mode(pam)) + +@cython.embedsignature(True) +def cuTexRefGetFilterMode(hTexRef): + """ Gets the filter-mode used by a texture reference. + + [Deprecated] + + Returns in `*pfm` the filtering mode of the texture reference + `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pfm : :py:obj:`~.CUfilter_mode` + Returned filtering mode + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUfilter_mode pfm + with nogil: + err = cydriver.cuTexRefGetFilterMode(&pfm, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUfilter_mode(pfm)) + +@cython.embedsignature(True) +def cuTexRefGetFormat(hTexRef): + """ Gets the format used by a texture reference. + + [Deprecated] + + Returns in `*pFormat` and `*pNumChannels` the format and number of + components of the CUDA array bound to the texture reference `hTexRef`. + If `pFormat` or `pNumChannels` is NULL, it will be ignored. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pFormat : :py:obj:`~.CUarray_format` + Returned format + pNumChannels : int + Returned number of components + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUarray_format pFormat + cdef int pNumChannels = 0 + with nogil: + err = cydriver.cuTexRefGetFormat(&pFormat, &pNumChannels, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, CUarray_format(pFormat), pNumChannels) + +@cython.embedsignature(True) +def cuTexRefGetMipmapFilterMode(hTexRef): + """ Gets the mipmap filtering mode for a texture reference. + + [Deprecated] + + Returns the mipmap filtering mode in `pfm` that's used when reading + memory through the texture reference `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pfm : :py:obj:`~.CUfilter_mode` + Returned mipmap filtering mode + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef cydriver.CUfilter_mode pfm + with nogil: + err = cydriver.cuTexRefGetMipmapFilterMode(&pfm, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUfilter_mode(pfm)) + +@cython.embedsignature(True) +def cuTexRefGetMipmapLevelBias(hTexRef): + """ Gets the mipmap level bias for a texture reference. + + [Deprecated] + + Returns the mipmap level bias in `pBias` that's added to the specified + mipmap level when reading memory through the texture reference + `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pbias : float + Returned mipmap level bias + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef float pbias = 0 + with nogil: + err = cydriver.cuTexRefGetMipmapLevelBias(&pbias, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pbias) + +@cython.embedsignature(True) +def cuTexRefGetMipmapLevelClamp(hTexRef): + """ Gets the min/max mipmap level clamps for a texture reference. + + [Deprecated] + + Returns the min/max mipmap level clamps in `pminMipmapLevelClamp` and + `pmaxMipmapLevelClamp` that's used when reading memory through the + texture reference `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pminMipmapLevelClamp : float + Returned mipmap min level clamp + pmaxMipmapLevelClamp : float + Returned mipmap max level clamp + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef float pminMipmapLevelClamp = 0 + cdef float pmaxMipmapLevelClamp = 0 + with nogil: + err = cydriver.cuTexRefGetMipmapLevelClamp(&pminMipmapLevelClamp, &pmaxMipmapLevelClamp, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pminMipmapLevelClamp, pmaxMipmapLevelClamp) + +@cython.embedsignature(True) +def cuTexRefGetMaxAnisotropy(hTexRef): + """ Gets the maximum anisotropy for a texture reference. + + [Deprecated] + + Returns the maximum anisotropy in `pmaxAniso` that's used when reading + memory through the texture reference `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pmaxAniso : int + Returned maximum anisotropy + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFlags`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef int pmaxAniso = 0 + with nogil: + err = cydriver.cuTexRefGetMaxAnisotropy(&pmaxAniso, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pmaxAniso) + +@cython.embedsignature(True) +def cuTexRefGetBorderColor(hTexRef): + """ Gets the border color used by a texture reference. + + [Deprecated] + + Returns in `pBorderColor`, values of the RGBA color used by the texture + reference `hTexRef`. The color value is of type float and holds color + components in the following sequence: pBorderColor[0] holds 'R' + component pBorderColor[1] holds 'G' component pBorderColor[2] holds 'B' + component pBorderColor[3] holds 'A' component + + Parameters + ---------- + pBorderColor : :py:obj:`~.CUtexref` + Returned Type and Value of RGBA color + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + hTexRef : float + Texture reference + + See Also + -------- + :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetBorderColor` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef float pBorderColor = 0 + with nogil: + err = cydriver.cuTexRefGetBorderColor(&pBorderColor, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pBorderColor) + +@cython.embedsignature(True) +def cuTexRefGetFlags(hTexRef): + """ Gets the flags used by a texture reference. + + [Deprecated] + + Returns in `*pFlags` the flags of the texture reference `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pFlags : unsigned int + Returned flags + + See Also + -------- + :py:obj:`~.cuTexRefSetAddress`, :py:obj:`~.cuTexRefSetAddress2D`, :py:obj:`~.cuTexRefSetAddressMode`, :py:obj:`~.cuTexRefSetArray`, :py:obj:`~.cuTexRefSetFilterMode`, :py:obj:`~.cuTexRefSetFlags`, :py:obj:`~.cuTexRefSetFormat`, :py:obj:`~.cuTexRefGetAddress`, :py:obj:`~.cuTexRefGetAddressMode`, :py:obj:`~.cuTexRefGetArray`, :py:obj:`~.cuTexRefGetFilterMode`, :py:obj:`~.cuTexRefGetFormat` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + cdef unsigned int pFlags = 0 + with nogil: + err = cydriver.cuTexRefGetFlags(&pFlags, cyhTexRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pFlags) + +@cython.embedsignature(True) +def cuTexRefCreate(): + """ Creates a texture reference. + + [Deprecated] + + Creates a texture reference and returns its handle in `*pTexRef`. Once + created, the application must call :py:obj:`~.cuTexRefSetArray()` or + :py:obj:`~.cuTexRefSetAddress()` to associate the reference with + allocated memory. Other texture reference functions are used to specify + the format and interpretation (addressing, filtering, etc.) to be used + when the memory is read through this texture reference. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pTexRef : :py:obj:`~.CUtexref` + Returned texture reference + + See Also + -------- + :py:obj:`~.cuTexRefDestroy` + """ + cdef CUtexref pTexRef = CUtexref() + with nogil: + err = cydriver.cuTexRefCreate(pTexRef._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pTexRef) + +@cython.embedsignature(True) +def cuTexRefDestroy(hTexRef): + """ Destroys a texture reference. + + [Deprecated] + + Destroys the texture reference specified by `hTexRef`. + + Parameters + ---------- + hTexRef : :py:obj:`~.CUtexref` + Texture reference to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexRefCreate` + """ + cdef cydriver.CUtexref cyhTexRef + if hTexRef is None: + phTexRef = 0 + elif isinstance(hTexRef, (CUtexref,)): + phTexRef = int(hTexRef) + else: + phTexRef = int(CUtexref(hTexRef)) + cyhTexRef = phTexRef + with nogil: + err = cydriver.cuTexRefDestroy(cyhTexRef) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuSurfRefSetArray(hSurfRef, hArray, unsigned int Flags): + """ Sets the CUDA array for a surface reference. + + [Deprecated] + + Sets the CUDA array `hArray` to be read and written by the surface + reference `hSurfRef`. Any previous CUDA array state associated with the + surface reference is superseded by this function. `Flags` must be set + to 0. The :py:obj:`~.CUDA_ARRAY3D_SURFACE_LDST` flag must have been set + for the CUDA array. Any CUDA array previously bound to `hSurfRef` is + unbound. + + Parameters + ---------- + hSurfRef : :py:obj:`~.CUsurfref` + Surface reference handle + hArray : :py:obj:`~.CUarray` + CUDA array handle + Flags : unsigned int + set to 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuModuleGetSurfRef`, :py:obj:`~.cuSurfRefGetArray` + """ + cdef cydriver.CUarray cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (CUarray,)): + phArray = int(hArray) + else: + phArray = int(CUarray(hArray)) + cyhArray = phArray + cdef cydriver.CUsurfref cyhSurfRef + if hSurfRef is None: + phSurfRef = 0 + elif isinstance(hSurfRef, (CUsurfref,)): + phSurfRef = int(hSurfRef) + else: + phSurfRef = int(CUsurfref(hSurfRef)) + cyhSurfRef = phSurfRef + with nogil: + err = cydriver.cuSurfRefSetArray(cyhSurfRef, cyhArray, Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuSurfRefGetArray(hSurfRef): + """ Passes back the CUDA array bound to a surface reference. + + [Deprecated] + + Returns in `*phArray` the CUDA array bound to the surface reference + `hSurfRef`, or returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if the + surface reference is not bound to any CUDA array. + + Parameters + ---------- + hSurfRef : :py:obj:`~.CUsurfref` + Surface reference handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + phArray : :py:obj:`~.CUarray` + Surface reference handle + + See Also + -------- + :py:obj:`~.cuModuleGetSurfRef`, :py:obj:`~.cuSurfRefSetArray` + """ + cdef cydriver.CUsurfref cyhSurfRef + if hSurfRef is None: + phSurfRef = 0 + elif isinstance(hSurfRef, (CUsurfref,)): + phSurfRef = int(hSurfRef) + else: + phSurfRef = int(CUsurfref(hSurfRef)) + cyhSurfRef = phSurfRef + cdef CUarray phArray = CUarray() + with nogil: + err = cydriver.cuSurfRefGetArray(phArray._pvt_ptr, cyhSurfRef) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phArray) + +@cython.embedsignature(True) +def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Optional[CUDA_TEXTURE_DESC], pResViewDesc : Optional[CUDA_RESOURCE_VIEW_DESC]): + """ Creates a texture object. + + Creates a texture object and returns it in `pTexObject`. `pResDesc` + describes the data to texture from. `pTexDesc` describes how the data + should be sampled. `pResViewDesc` is an optional argument that + specifies an alternate format for the data described by `pResDesc`, and + also describes the subresource region to restrict access to when + texturing. `pResViewDesc` can only be specified if the type of resource + is a CUDA array or a CUDA mipmapped array not in a block compressed + format. + + Texture objects are only supported on devices of compute capability 3.0 + or higher. Additionally, a texture object is an opaque value, and, as + such, should only be accessed through CUDA API calls. + + The :py:obj:`~.CUDA_RESOURCE_DESC` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.CUDA_RESOURCE_DESC.resType` specifies the type of resource + to texture from. CUresourceType is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + 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. + + 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. + + 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:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`. + :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` + 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 + number of elements is computed as (sizeInBytes / (sizeof(format) * + numChannels)). + + 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 + 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 + 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 + :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 + :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`. Pitch cannot + exceed :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`. + + - :py:obj:`~.flags` must be set to zero. + + The :py:obj:`~.CUDA_TEXTURE_DESC` struct is defined as + + **View CUDA Toolkit Documentation for a C++ code example** + + where + + - :py:obj:`~.CUDA_TEXTURE_DESC.addressMode` specifies the addressing + mode for each dimension of the texture data. + :py:obj:`~.CUaddress_mode` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - This is ignored if :py:obj:`~.CUDA_RESOURCE_DESC.resType` is + :py:obj:`~.CU_RESOURCE_TYPE_LINEAR`. Also, if the flag, + :py:obj:`~.CU_TRSF_NORMALIZED_COORDINATES` is not set, the only + 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. :py:obj:`~.CUfilter_mode` + is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - This is ignored if :py:obj:`~.CUDA_RESOURCE_DESC.resType` is + :py:obj:`~.CU_RESOURCE_TYPE_LINEAR`. + + - :py:obj:`~.CUDA_TEXTURE_DESC.flags` can be any combination of the + following: + + - :py:obj:`~.CU_TRSF_READ_AS_INTEGER`, which suppresses the default + behavior of having the texture promote integer data to floating + point data in the range [0, 1]. Note that texture with 32-bit + integer format would not be promoted, regardless of whether or not + this flag is specified. + + - :py:obj:`~.CU_TRSF_NORMALIZED_COORDINATES`, which suppresses the + default behavior of having the texture coordinates range from [0, + Dim) where Dim is the width or height of the CUDA array. Instead, + the texture coordinates [0, 1.0) reference the entire breadth of + the array dimension; Note that for CUDA mipmapped arrays, this flag + has to be set. + + - :py:obj:`~.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION`, which disables + any trilinear filtering optimizations. Trilinear optimizations + improve texture filtering performance by allowing bilinear + filtering on textures in scenarios where it can closely approximate + the expected results. + + - :py:obj:`~.CU_TRSF_SEAMLESS_CUBEMAP`, which enables seamless cube + map filtering. This flag can only be specified if the underlying + resource is a CUDA array or a CUDA mipmapped array that was created + with the flag :py:obj:`~.CUDA_ARRAY3D_CUBEMAP`. When seamless cube + map filtering is enabled, texture address modes specified by + :py:obj:`~.CUDA_TEXTURE_DESC.addressMode` are ignored. Instead, if + the :py:obj:`~.CUDA_TEXTURE_DESC.filterMode` is set to + :py:obj:`~.CU_TR_FILTER_MODE_POINT` the address mode + :py:obj:`~.CU_TR_ADDRESS_MODE_CLAMP` will be applied for all + dimensions. If the :py:obj:`~.CUDA_TEXTURE_DESC.filterMode` is set + to :py:obj:`~.CU_TR_FILTER_MODE_LINEAR` seamless cube map filtering + will be performed when sampling along the cube face borders. + + - :py:obj:`~.CUDA_TEXTURE_DESC.maxAnisotropy` specifies the maximum + anisotropy ratio to be used when doing anisotropic filtering. This + value will be clamped to the range [1,16]. + + - :py:obj:`~.CUDA_TEXTURE_DESC.mipmapFilterMode` specifies the filter + mode when the calculated mipmap level lies between two defined mipmap + levels. + + - :py:obj:`~.CUDA_TEXTURE_DESC.mipmapLevelBias` specifies the offset to + be applied to the calculated mipmap level. + + - :py:obj:`~.CUDA_TEXTURE_DESC.minMipmapLevelClamp` specifies the lower + end of the mipmap level range to clamp access to. + + - :py:obj:`~.CUDA_TEXTURE_DESC.maxMipmapLevelClamp` specifies the upper + end of the mipmap level range to clamp access to. + + The :py:obj:`~.CUDA_RESOURCE_VIEW_DESC` struct is defined as + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.format` specifies how the data + contained in the CUDA array or CUDA mipmapped array should be + interpreted. Note that this can incur a change in size of the texture + data. If the resource view format is a block compressed format, then + the underlying CUDA array or CUDA mipmapped array has to have a base + of format :py:obj:`~.CU_AD_FORMAT_UNSIGNED_INT32`. with 2 or 4 + channels, depending on the block compressed format. For ex., BC1 and + BC4 require the underlying CUDA array to have a format of + :py:obj:`~.CU_AD_FORMAT_UNSIGNED_INT32` with 2 channels. The other BC + formats require the underlying resource to have the same base format + but with 4 channels. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.width` specifies the new width of + the texture data. If the resource view format is a block compressed + format, this value has to be 4 times the original width of the + resource. For non block compressed formats, this value has to be + equal to that of the original resource. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.height` specifies the new height + of the texture data. If the resource view format is a block + compressed format, this value has to be 4 times the original height + of the resource. For non block compressed formats, this value has to + be equal to that of the original resource. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.depth` specifies the new depth of + the texture data. This value has to be equal to that of the original + resource. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.firstMipmapLevel` specifies the + most detailed mipmap level. This will be the new mipmap level zero. + For non-mipmapped resources, this value has to be + zero.:py:obj:`~.CUDA_TEXTURE_DESC.minMipmapLevelClamp` and + :py:obj:`~.CUDA_TEXTURE_DESC.maxMipmapLevelClamp` will be relative to + this value. For ex., if the firstMipmapLevel is set to 2, and a + minMipmapLevelClamp of 1.2 is specified, then the actual minimum + mipmap level clamp will be 3.2. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.lastMipmapLevel` specifies the + least detailed mipmap level. For non-mipmapped resources, this value + has to be zero. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.firstLayer` specifies the first + layer index for layered textures. This will be the new layer zero. + For non-layered resources, this value has to be zero. + + - :py:obj:`~.CUDA_RESOURCE_VIEW_DESC.lastLayer` specifies the last + layer index for layered textures. For non-layered resources, this + value has to be zero. + + Parameters + ---------- + pResDesc : :py:obj:`~.CUDA_RESOURCE_DESC` + Resource descriptor + pTexDesc : :py:obj:`~.CUDA_TEXTURE_DESC` + Texture descriptor + pResViewDesc : :py:obj:`~.CUDA_RESOURCE_VIEW_DESC` + Resource view descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pTexObject : :py:obj:`~.CUtexObject` + Texture object to create + + See Also + -------- + :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 + 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) + +@cython.embedsignature(True) +def cuTexObjectDestroy(texObject): + """ Destroys a texture object. + + Destroys the texture object specified by `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.CUtexObject` + Texture object to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTexObjectCreate`, :py:obj:`~.cudaDestroyTextureObject` + """ + cdef cydriver.CUtexObject cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (CUtexObject,)): + ptexObject = int(texObject) + else: + ptexObject = int(CUtexObject(texObject)) + cytexObject = ptexObject + with nogil: + err = cydriver.cuTexObjectDestroy(cytexObject) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuTexObjectGetResourceDesc(texObject): + """ Returns a texture object's resource descriptor. + + Returns the resource descriptor for the texture object specified by + `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.CUtexObject` + Texture object + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pResDesc : :py:obj:`~.CUDA_RESOURCE_DESC` + Resource descriptor + + See Also + -------- + :py:obj:`~.cuTexObjectCreate`, :py:obj:`~.cudaGetTextureObjectResourceDesc`, + """ + cdef cydriver.CUtexObject cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (CUtexObject,)): + ptexObject = int(texObject) + else: + ptexObject = int(CUtexObject(texObject)) + cytexObject = ptexObject + cdef CUDA_RESOURCE_DESC pResDesc = CUDA_RESOURCE_DESC() + with nogil: + err = cydriver.cuTexObjectGetResourceDesc(pResDesc._pvt_ptr, cytexObject) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pResDesc) + +@cython.embedsignature(True) +def cuTexObjectGetTextureDesc(texObject): + """ Returns a texture object's texture descriptor. + + Returns the texture descriptor for the texture object specified by + `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.CUtexObject` + Texture object + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pTexDesc : :py:obj:`~.CUDA_TEXTURE_DESC` + Texture descriptor + + See Also + -------- + :py:obj:`~.cuTexObjectCreate`, :py:obj:`~.cudaGetTextureObjectTextureDesc` + """ + cdef cydriver.CUtexObject cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (CUtexObject,)): + ptexObject = int(texObject) + else: + ptexObject = int(CUtexObject(texObject)) + cytexObject = ptexObject + cdef CUDA_TEXTURE_DESC pTexDesc = CUDA_TEXTURE_DESC() + with nogil: + err = cydriver.cuTexObjectGetTextureDesc(pTexDesc._pvt_ptr, cytexObject) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pTexDesc) + +@cython.embedsignature(True) +def cuTexObjectGetResourceViewDesc(texObject): + """ Returns a texture object's resource view descriptor. + + Returns the resource view descriptor for the texture object specified + by `texObject`. If no resource view was set for `texObject`, the + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. + + Parameters + ---------- + texObject : :py:obj:`~.CUtexObject` + Texture object + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pResViewDesc : :py:obj:`~.CUDA_RESOURCE_VIEW_DESC` + Resource view descriptor + + See Also + -------- + :py:obj:`~.cuTexObjectCreate`, :py:obj:`~.cudaGetTextureObjectResourceViewDesc` + """ + cdef cydriver.CUtexObject cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (CUtexObject,)): + ptexObject = int(texObject) + else: + ptexObject = int(CUtexObject(texObject)) + cytexObject = ptexObject + cdef CUDA_RESOURCE_VIEW_DESC pResViewDesc = CUDA_RESOURCE_VIEW_DESC() + with nogil: + err = cydriver.cuTexObjectGetResourceViewDesc(pResViewDesc._pvt_ptr, cytexObject) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pResViewDesc) + +@cython.embedsignature(True) +def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): + """ Creates a surface object. + + Creates a surface object and returns it in `pSurfObject`. `pResDesc` + 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. + + Surface objects are only supported on devices of compute capability 3.0 + or higher. Additionally, a surface object is an opaque value, and, as + such, should only be accessed through CUDA API calls. + + Parameters + ---------- + pResDesc : :py:obj:`~.CUDA_RESOURCE_DESC` + Resource descriptor + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pSurfObject : :py:obj:`~.CUsurfObject` + Surface object to create + + See Also + -------- + :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 + with nogil: + err = cydriver.cuSurfObjectCreate(pSurfObject._pvt_ptr, cypResDesc_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pSurfObject) + +@cython.embedsignature(True) +def cuSurfObjectDestroy(surfObject): + """ Destroys a surface object. + + Destroys the surface object specified by `surfObject`. + + Parameters + ---------- + surfObject : :py:obj:`~.CUsurfObject` + Surface object to destroy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuSurfObjectCreate`, :py:obj:`~.cudaDestroySurfaceObject` + """ + cdef cydriver.CUsurfObject cysurfObject + if surfObject is None: + psurfObject = 0 + elif isinstance(surfObject, (CUsurfObject,)): + psurfObject = int(surfObject) + else: + psurfObject = int(CUsurfObject(surfObject)) + cysurfObject = psurfObject + with nogil: + err = cydriver.cuSurfObjectDestroy(cysurfObject) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuSurfObjectGetResourceDesc(surfObject): + """ Returns a surface object's resource descriptor. + + Returns the resource descriptor for the surface object specified by + `surfObject`. + + Parameters + ---------- + surfObject : :py:obj:`~.CUsurfObject` + Surface object + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pResDesc : :py:obj:`~.CUDA_RESOURCE_DESC` + Resource descriptor + + See Also + -------- + :py:obj:`~.cuSurfObjectCreate`, :py:obj:`~.cudaGetSurfaceObjectResourceDesc` + """ + cdef cydriver.CUsurfObject cysurfObject + if surfObject is None: + psurfObject = 0 + elif isinstance(surfObject, (CUsurfObject,)): + psurfObject = int(surfObject) + else: + psurfObject = int(CUsurfObject(surfObject)) + cysurfObject = psurfObject + cdef CUDA_RESOURCE_DESC pResDesc = CUDA_RESOURCE_DESC() + with nogil: + err = cydriver.cuSurfObjectGetResourceDesc(pResDesc._pvt_ptr, cysurfObject) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pResDesc) + +@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): + """ Create a tensor map descriptor object representing tiled memory region. + + Creates a descriptor for Tensor Memory Access (TMA) object specified by + the parameters describing a tiled region and returns it in `tensorMap`. + + Tensor map objects are only supported on devices of compute capability + 9.0 or higher. Additionally, a tensor map object is an opaque value, + and, as such, should only be accessed through CUDA APIs and PTX. + + The parameters passed are bound to the following requirements: + + - `tensorMap` address must be aligned to 64 bytes. + + - `tensorDataType` has to be an enum from + :py:obj:`~.CUtensorMapDataType` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B` copies '16 x U4' + packed values to memory aligned as 8 bytes. There are no gaps between + packed values. :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B` + copies '16 x U4' packed values to memory aligned as 16 bytes. There + are 8 byte gaps between every 8 byte chunk of packed values. + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` copies '16 x U6' + packed values to memory aligned as 16 bytes. There are 4 byte gaps + between every 12 byte chunk of packed values. + + - `tensorRank` must be non-zero and less than or equal to the maximum + supported dimensionality of 5. If `interleave` is not + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, then `tensorRank` must + additionally be greater than or equal to 3. + + - `globalAddress`, which specifies the starting address of the memory + region described, must be 16 byte aligned. The following requirements + need to also be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, + `globalAddress` must be 32 byte aligned. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `globalAddress` + must be 32 byte aligned. + + `globalDim` array, which specifies tensor size of each of the + `tensorRank` dimensions, must be non-zero and less than or equal to + 2^32. Additionally, the following requirements need to be met for the + packed data types: + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, globalDim[0] must + be a multiple of 128. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, `globalDim`[0] must + be a multiple of 2. + + - Dimension for the packed data types must reflect the number of + individual U# values. + + `globalStrides` array, which specifies tensor stride of each of the + lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 + and less than 2^40. Additionally, the following requirements need to be + met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, the + strides must be a multiple of 32. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, the strides must + be a multiple of 32. Each following dimension specified includes + previous dimension stride: + + - **View CUDA Toolkit Documentation for a C++ code example** + + `boxDim` array, which specifies number of elements to be traversed + along each of the `tensorRank` dimensions, must be non-zero and less + than or equal to 256. Additionally, the following requirements need to + be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, { + `boxDim`[0] * elementSizeInBytes( `tensorDataType` ) } must be a + multiple of 16 bytes. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, boxDim[0] must be + 128. + + `elementStrides` array, which specifies the iteration step along each + of the `tensorRank` dimensions, must be non-zero and less than or equal + to 8. Note that when `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the first element of this + array is ignored since TMA doesn’t support the stride for dimension + zero. When all elements of `elementStrides` array is one, `boxDim` + specifies the number of elements to load. However, if the + `elementStrides`[i] is not equal to one, then TMA loads ceil( + `boxDim`[i] / `elementStrides`[i]) number of elements along i-th + dimension. To load N elements along i-th dimension, `boxDim`[i] must be + set to N * `elementStrides`[i]. + + - `interleave` specifies the interleaved layout of type + :py:obj:`~.CUtensorMapInterleave`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 + bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 + uses 32 bytes. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE` and `swizzle` is not + :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_NONE`, the bounding box inner + dimension (computed as `boxDim`[0] multiplied by element size derived + from `tensorDataType`) must be less than or equal to the swizzle + size. + + - CU_TENSOR_MAP_SWIZZLE_32B requires the bounding box inner dimension + to be <= 32. + + - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension + to be <= 64. + + - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner + dimension to be <= 128. Additionally, `tensorDataType` of + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` requires + `interleave` to be :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`. + + - `swizzle`, which specifies the shared memory bank swizzling pattern, + has to be of type :py:obj:`~.CUtensorMapSwizzle` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Data are organized in a specific order in global memory; however, + this may not match the order in which the application accesses data + in shared memory. This difference in data organization may cause bank + conflicts when shared memory is accessed. In order to avoid this + problem, data can be loaded to shared memory with shuffling across + shared memory banks. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, `swizzle` must be + :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_32B`. Other interleave modes can + have any swizzling pattern. When the `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`, only the following + swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_NONE (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B (Store only) When the + `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, only the + following swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_NONE (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) + + - `l2Promotion` specifies L2 fetch size which indicates the byte + granurality at which L2 requests is filled from DRAM. It must be of + type :py:obj:`~.CUtensorMapL2promotion`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `oobFill`, which indicates whether zero or a special NaN constant + should be used to fill out-of-bound elements, must be of type + :py:obj:`~.CUtensorMapFloatOOBfill` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Note that + :py:obj:`~.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA` can + only be used when `tensorDataType` represents a floating-point data + type, and when `tensorDataType` is not + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, and + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`. + + Parameters + ---------- + tensorDataType : :py:obj:`~.CUtensorMapDataType` + Tensor data type + tensorRank : Any + Dimensionality of tensor + globalAddress : Any + Starting address of memory region described by tensor + globalDim : list[:py:obj:`~.cuuint64_t`] + Array containing tensor size (number of elements) along each of the + `tensorRank` dimensions + globalStrides : list[:py:obj:`~.cuuint64_t`] + Array containing stride size (in bytes) along each of the + `tensorRank` - 1 dimensions + boxDim : list[:py:obj:`~.cuuint32_t`] + Array containing traversal box size (number of elments) along each + of the `tensorRank` dimensions. Specifies how many elements to be + traversed along each tensor dimension. + elementStrides : list[:py:obj:`~.cuuint32_t`] + Array containing traversal stride in each of the `tensorRank` + dimensions + interleave : :py:obj:`~.CUtensorMapInterleave` + Type of interleaved layout the tensor addresses + swizzle : :py:obj:`~.CUtensorMapSwizzle` + Bank swizzling pattern inside shared memory + l2Promotion : :py:obj:`~.CUtensorMapL2promotion` + L2 promotion size + oobFill : :py:obj:`~.CUtensorMapFloatOOBfill` + Indicate whether zero or special NaN constant must be used to fill + out-of-bound elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to create + + See Also + -------- + :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide`, :py:obj:`~.cuTensorMapReplaceAddress` + """ + cdef cydriver.cuuint32_t* cyelementStrides + cdef size_t elementStridesLen + cdef cydriver.cuuint32_t[5] elementStridesStatic + elementStridesLen = 0 if elementStrides is None else len(elementStrides) + if elementStridesLen == 0: + cyelementStrides = NULL + elif elementStridesLen == 1: + cyelementStrides = ( elementStrides[0])._pvt_ptr + elif elementStridesLen <= 5: + for idx in range(elementStridesLen): + elementStridesStatic[idx] = ( elementStrides[idx])._pvt_ptr[0] + cyelementStrides = elementStridesStatic + else: + raise ValueError("Argument 'elementStrides' too long, must be <= 5") + cdef cydriver.cuuint32_t* cyboxDim + cdef size_t boxDimLen + cdef cydriver.cuuint32_t[5] boxDimStatic + boxDimLen = 0 if boxDim is None else len(boxDim) + if boxDimLen == 0: + cyboxDim = NULL + elif boxDimLen == 1: + cyboxDim = ( boxDim[0])._pvt_ptr + elif boxDimLen <= 5: + for idx in range(boxDimLen): + boxDimStatic[idx] = ( boxDim[idx])._pvt_ptr[0] + cyboxDim = boxDimStatic + else: + raise ValueError("Argument 'boxDim' too long, must be <= 5") + cdef cydriver.cuuint64_t* cyglobalStrides + cdef size_t globalStridesLen + cdef cydriver.cuuint64_t[5] globalStridesStatic + globalStridesLen = 0 if globalStrides is None else len(globalStrides) + if globalStridesLen == 0: + cyglobalStrides = NULL + elif globalStridesLen == 1: + cyglobalStrides = ( globalStrides[0])._pvt_ptr + elif globalStridesLen <= 5: + for idx in range(globalStridesLen): + globalStridesStatic[idx] = ( globalStrides[idx])._pvt_ptr[0] + cyglobalStrides = globalStridesStatic + else: + raise ValueError("Argument 'globalStrides' too long, must be <= 5") + cdef cydriver.cuuint64_t* cyglobalDim + cdef size_t globalDimLen + cdef cydriver.cuuint64_t[5] globalDimStatic + globalDimLen = 0 if globalDim is None else len(globalDim) + if globalDimLen == 0: + cyglobalDim = NULL + elif globalDimLen == 1: + cyglobalDim = ( globalDim[0])._pvt_ptr + elif globalDimLen <= 5: + for idx in range(globalDimLen): + globalDimStatic[idx] = ( globalDim[idx])._pvt_ptr[0] + cyglobalDim = globalDimStatic + else: + raise ValueError("Argument 'globalDim' too long, must be <= 5") + cdef cydriver.cuuint32_t cytensorRank + if tensorRank is None: + ptensorRank = 0 + elif isinstance(tensorRank, (cuuint32_t,)): + ptensorRank = int(tensorRank) + else: + ptensorRank = int(cuuint32_t(tensorRank)) + cytensorRank = ptensorRank + cdef CUtensorMap tensorMap = CUtensorMap() + cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) + cdef _HelperInputVoidPtrStruct cyglobalAddressHelper + cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) + cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) + cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) + cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) + cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) + with nogil: + err = cydriver.cuTensorMapEncodeTiled(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, cyboxDim, cyelementStrides, cyinterleave, cyswizzle, cyl2Promotion, cyoobFill) + _helper_input_void_ptr_free(&cyglobalAddressHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, tensorMap) + +@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): + """ Create a tensor map descriptor object representing im2col memory region. + + Creates a descriptor for Tensor Memory Access (TMA) object specified by + the parameters describing a im2col memory layout and returns it in + `tensorMap`. + + Tensor map objects are only supported on devices of compute capability + 9.0 or higher. Additionally, a tensor map object is an opaque value, + and, as such, should only be accessed through CUDA APIs and PTX. + + The parameters passed are bound to the following requirements: + + - `tensorMap` address must be aligned to 64 bytes. + + - `tensorDataType` has to be an enum from + :py:obj:`~.CUtensorMapDataType` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B` copies '16 x U4' + packed values to memory aligned as 8 bytes. There are no gaps between + packed values. :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B` + copies '16 x U4' packed values to memory aligned as 16 bytes. There + are 8 byte gaps between every 8 byte chunk of packed values. + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` copies '16 x U6' + packed values to memory aligned as 16 bytes. There are 4 byte gaps + between every 12 byte chunk of packed values. + + - `tensorRank`, which specifies the number of tensor dimensions, must + be 3, 4, or 5. + + - `globalAddress`, which specifies the starting address of the memory + region described, must be 16 byte aligned. The following requirements + need to also be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, + `globalAddress` must be 32 byte aligned. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `globalAddress` + must be 32 byte aligned. + + - `globalDim` array, which specifies tensor size of each of the + `tensorRank` dimensions, must be non-zero and less than or equal to + 2^32. Additionally, the following requirements need to be met for the + packed data types: + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, globalDim[0] + must be a multiple of 128. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, `globalDim`[0] + must be a multiple of 2. + + - Dimension for the packed data types must reflect the number of + individual U# values. + + - `globalStrides` array, which specifies tensor stride of each of the + lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 + and less than 2^40. Additionally, the following requirements need to + be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, the + strides must be a multiple of 32. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, the strides must + be a multiple of 32. Each following dimension specified includes + previous dimension stride: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `pixelBoxLowerCorner` array specifies the coordinate offsets {D, H, + W} of the bounding box from top/left/front corner. The number of + offsets and their precision depend on the tensor dimensionality: + + - When `tensorRank` is 3, one signed offset within range [-32768, + 32767] is supported. + + - When `tensorRank` is 4, two signed offsets each within range [-128, + 127] are supported. + + - When `tensorRank` is 5, three offsets each within range [-16, 15] + are supported. + + - `pixelBoxUpperCorner` array specifies the coordinate offsets {D, H, + W} of the bounding box from bottom/right/back corner. The number of + offsets and their precision depend on the tensor dimensionality: + + - When `tensorRank` is 3, one signed offset within range [-32768, + 32767] is supported. + + - When `tensorRank` is 4, two signed offsets each within range [-128, + 127] are supported. + + - When `tensorRank` is 5, three offsets each within range [-16, 15] + are supported. The bounding box specified by `pixelBoxLowerCorner` + and `pixelBoxUpperCorner` must have non-zero area. + + - `channelsPerPixel`, which specifies the number of elements which must + be accessed along C dimension, must be less than or equal to 256. + Additionally, when `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `channelsPerPixel` + must be 128. + + - `pixelsPerColumn`, which specifies the number of elements that must + be accessed along the {N, D, H, W} dimensions, must be less than or + equal to 1024. + + - `elementStrides` array, which specifies the iteration step along each + of the `tensorRank` dimensions, must be non-zero and less than or + equal to 8. Note that when `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the first element of this + array is ignored since TMA doesn’t support the stride for dimension + zero. When all elements of the `elementStrides` array are one, + `boxDim` specifies the number of elements to load. However, if + `elementStrides`[i] is not equal to one for some `i`, then TMA loads + ceil( `boxDim`[i] / `elementStrides`[i]) number of elements along + i-th dimension. To load N elements along i-th dimension, `boxDim`[i] + must be set to N * `elementStrides`[i]. + + - `interleave` specifies the interleaved layout of type + :py:obj:`~.CUtensorMapInterleave`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 + bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 + uses 32 bytes. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE` and `swizzle` is not + :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_NONE`, the bounding box inner + dimension (computed as `channelsPerPixel` multiplied by element size + in bytes derived from `tensorDataType`) must be less than or equal to + the swizzle size. + + - CU_TENSOR_MAP_SWIZZLE_32B requires the bounding box inner dimension + to be <= 32. + + - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension + to be <= 64. + + - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner + dimension to be <= 128. Additionally, `tensorDataType` of + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` requires + `interleave` to be :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`. + + - `swizzle`, which specifies the shared memory bank swizzling pattern, + has to be of type :py:obj:`~.CUtensorMapSwizzle` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Data are organized in a specific order in global memory; however, + this may not match the order in which the application accesses data + in shared memory. This difference in data organization may cause bank + conflicts when shared memory is accessed. In order to avoid this + problem, data can be loaded to shared memory with shuffling across + shared memory banks. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, `swizzle` must be + :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_32B`. Other interleave modes can + have any swizzling pattern. When the `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`, only the following + swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_NONE (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B (Store only) When the + `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, only the + following swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_NONE (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) + + - `l2Promotion` specifies L2 fetch size which indicates the byte + granularity at which L2 requests are filled from DRAM. It must be of + type :py:obj:`~.CUtensorMapL2promotion`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `oobFill`, which indicates whether zero or a special NaN constant + should be used to fill out-of-bound elements, must be of type + :py:obj:`~.CUtensorMapFloatOOBfill` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Note that + :py:obj:`~.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA` can + only be used when `tensorDataType` represents a floating-point data + type, and when `tensorDataType` is not + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, and + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`. + + Parameters + ---------- + tensorDataType : :py:obj:`~.CUtensorMapDataType` + Tensor data type + tensorRank : Any + Dimensionality of tensor; must be at least 3 + globalAddress : Any + Starting address of memory region described by tensor + globalDim : list[:py:obj:`~.cuuint64_t`] + Array containing tensor size (number of elements) along each of the + `tensorRank` dimensions + globalStrides : list[:py:obj:`~.cuuint64_t`] + Array containing stride size (in bytes) along each of the + `tensorRank` - 1 dimensions + pixelBoxLowerCorner : list[int] + Array containing DHW dimensions of lower box corner + pixelBoxUpperCorner : list[int] + Array containing DHW dimensions of upper box corner + channelsPerPixel : Any + Number of channels per pixel + pixelsPerColumn : Any + Number of pixels per column + elementStrides : list[:py:obj:`~.cuuint32_t`] + Array containing traversal stride in each of the `tensorRank` + dimensions + interleave : :py:obj:`~.CUtensorMapInterleave` + Type of interleaved layout the tensor addresses + swizzle : :py:obj:`~.CUtensorMapSwizzle` + Bank swizzling pattern inside shared memory + l2Promotion : :py:obj:`~.CUtensorMapL2promotion` + L2 promotion size + oobFill : :py:obj:`~.CUtensorMapFloatOOBfill` + Indicate whether zero or special NaN constant will be used to fill + out-of-bound elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to create + + See Also + -------- + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2colWide`, :py:obj:`~.cuTensorMapReplaceAddress` + """ + cdef cydriver.cuuint32_t* cyelementStrides + cdef size_t elementStridesLen + cdef cydriver.cuuint32_t[5] elementStridesStatic + elementStridesLen = 0 if elementStrides is None else len(elementStrides) + if elementStridesLen == 0: + cyelementStrides = NULL + elif elementStridesLen == 1: + cyelementStrides = ( elementStrides[0])._pvt_ptr + elif elementStridesLen <= 5: + for idx in range(elementStridesLen): + elementStridesStatic[idx] = ( elementStrides[idx])._pvt_ptr[0] + cyelementStrides = elementStridesStatic + else: + raise ValueError("Argument 'elementStrides' too long, must be <= 5") + cdef cydriver.cuuint32_t cypixelsPerColumn + if pixelsPerColumn is None: + ppixelsPerColumn = 0 + elif isinstance(pixelsPerColumn, (cuuint32_t,)): + ppixelsPerColumn = int(pixelsPerColumn) + else: + ppixelsPerColumn = int(cuuint32_t(pixelsPerColumn)) + cypixelsPerColumn = ppixelsPerColumn + cdef cydriver.cuuint32_t cychannelsPerPixel + if channelsPerPixel is None: + pchannelsPerPixel = 0 + elif isinstance(channelsPerPixel, (cuuint32_t,)): + pchannelsPerPixel = int(channelsPerPixel) + else: + pchannelsPerPixel = int(cuuint32_t(channelsPerPixel)) + cychannelsPerPixel = pchannelsPerPixel + pixelBoxUpperCorner = [] if pixelBoxUpperCorner is None else pixelBoxUpperCorner + if not all(isinstance(_x, (int)) for _x in pixelBoxUpperCorner): + raise TypeError("Argument 'pixelBoxUpperCorner' is not instance of type (expected tuple[int] or list[int]") + pixelBoxLowerCorner = [] if pixelBoxLowerCorner is None else pixelBoxLowerCorner + if not all(isinstance(_x, (int)) for _x in pixelBoxLowerCorner): + raise TypeError("Argument 'pixelBoxLowerCorner' is not instance of type (expected tuple[int] or list[int]") + cdef cydriver.cuuint64_t* cyglobalStrides + cdef size_t globalStridesLen + cdef cydriver.cuuint64_t[5] globalStridesStatic + globalStridesLen = 0 if globalStrides is None else len(globalStrides) + if globalStridesLen == 0: + cyglobalStrides = NULL + elif globalStridesLen == 1: + cyglobalStrides = ( globalStrides[0])._pvt_ptr + elif globalStridesLen <= 5: + for idx in range(globalStridesLen): + globalStridesStatic[idx] = ( globalStrides[idx])._pvt_ptr[0] + cyglobalStrides = globalStridesStatic + else: + raise ValueError("Argument 'globalStrides' too long, must be <= 5") + cdef cydriver.cuuint64_t* cyglobalDim + cdef size_t globalDimLen + cdef cydriver.cuuint64_t[5] globalDimStatic + globalDimLen = 0 if globalDim is None else len(globalDim) + if globalDimLen == 0: + cyglobalDim = NULL + elif globalDimLen == 1: + cyglobalDim = ( globalDim[0])._pvt_ptr + elif globalDimLen <= 5: + for idx in range(globalDimLen): + globalDimStatic[idx] = ( globalDim[idx])._pvt_ptr[0] + cyglobalDim = globalDimStatic + else: + raise ValueError("Argument 'globalDim' too long, must be <= 5") + cdef cydriver.cuuint32_t cytensorRank + if tensorRank is None: + ptensorRank = 0 + elif isinstance(tensorRank, (cuuint32_t,)): + ptensorRank = int(tensorRank) + else: + ptensorRank = int(cuuint32_t(tensorRank)) + cytensorRank = ptensorRank + cdef CUtensorMap tensorMap = CUtensorMap() + cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) + cdef _HelperInputVoidPtrStruct cyglobalAddressHelper + cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) + cdef vector[int] cypixelBoxLowerCorner = pixelBoxLowerCorner + cdef vector[int] cypixelBoxUpperCorner = pixelBoxUpperCorner + cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) + cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) + cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) + cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) + with nogil: + err = cydriver.cuTensorMapEncodeIm2col(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, cypixelBoxLowerCorner.data(), cypixelBoxUpperCorner.data(), cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cyswizzle, cyl2Promotion, cyoobFill) + _helper_input_void_ptr_free(&cyglobalAddressHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, tensorMap) + +@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): + """ Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. + + Creates a descriptor for Tensor Memory Access (TMA) object specified by + the parameters describing a im2col memory layout and where the row is + always loaded along the W dimensuin and returns it in `tensorMap`. This + assumes the tensor layout in memory is either NDHWC, NHWC, or NWC. + + This API is only supported on devices of compute capability 10.0 or + higher. Additionally, a tensor map object is an opaque value, and, as + such, should only be accessed through CUDA APIs and PTX. + + The parameters passed are bound to the following requirements: + + - `tensorMap` address must be aligned to 64 bytes. + + - `tensorDataType` has to be an enum from + :py:obj:`~.CUtensorMapDataType` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B` copies '16 x U4' + packed values to memory aligned as 8 bytes. There are no gaps between + packed values. :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B` + copies '16 x U4' packed values to memory aligned as 16 bytes. There + are 8 byte gaps between every 8 byte chunk of packed values. + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` copies '16 x U6' + packed values to memory aligned as 16 bytes. There are 4 byte gaps + between every 12 byte chunk of packed values. + + - `tensorRank`, which specifies the number of tensor dimensions, must + be 3, 4, or 5. + + - `globalAddress`, which specifies the starting address of the memory + region described, must be 16 byte aligned. The following requirements + need to also be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, + `globalAddress` must be 32 byte aligned. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `globalAddress` + must be 32 byte aligned. + + `globalDim` array, which specifies tensor size of each of the + `tensorRank` dimensions, must be non-zero and less than or equal to + 2^32. Additionally, the following requirements need to be met for the + packed data types: + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, globalDim[0] must + be a multiple of 128. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, `globalDim`[0] must + be a multiple of 2. + + - Dimension for the packed data types must reflect the number of + individual U# values. + + `globalStrides` array, which specifies tensor stride of each of the + lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 + and less than 2^40. Additionally, the following requirements need to be + met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, the + strides must be a multiple of 32. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, the strides must + be a multiple of 32. Each following dimension specified includes + previous dimension stride: + + - **View CUDA Toolkit Documentation for a C++ code example** + + `pixelBoxLowerCornerWidth` specifies the coordinate offset W of the + bounding box from left corner. The offset must be within range [-32768, + 32767]. + + - `pixelBoxUpperCornerWidth` specifies the coordinate offset W of the + bounding box from right corner. The offset must be within range + [-32768, 32767]. + + The bounding box specified by `pixelBoxLowerCornerWidth` and + `pixelBoxUpperCornerWidth` must have non-zero area. Note that the size + of the box along D and H dimensions is always equal to one. + + - `channelsPerPixel`, which specifies the number of elements which must + be accessed along C dimension, must be less than or equal to 256. + Additionally, when `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `channelsPerPixel` + must be 128. + + - `pixelsPerColumn`, which specifies the number of elements that must + be accessed along the W dimension, must be less than or equal to + 1024. This field is ignored when `mode` is + :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128`. + + - `elementStrides` array, which specifies the iteration step along each + of the `tensorRank` dimensions, must be non-zero and less than or + equal to 8. Note that when `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the first element of this + array is ignored since TMA doesn’t support the stride for dimension + zero. When all elements of the `elementStrides` array are one, + `boxDim` specifies the number of elements to load. However, if + `elementStrides`[i] is not equal to one for some `i`, then TMA loads + ceil( `boxDim`[i] / `elementStrides`[i]) number of elements along + i-th dimension. To load N elements along i-th dimension, `boxDim`[i] + must be set to N * `elementStrides`[i]. + + - `interleave` specifies the interleaved layout of type + :py:obj:`~.CUtensorMapInterleave`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 + bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 + uses 32 bytes. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the bounding box inner + dimension (computed as `channelsPerPixel` multiplied by element size + in bytes derived from `tensorDataType`) must be less than or equal to + the swizzle size. + + - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension + to be <= 64. + + - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner + dimension to be <= 128. Additionally, `tensorDataType` of + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` requires + `interleave` to be :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`. + + - `mode`, which describes loading of elements loaded along the W + dimension, has to be one of the following + :py:obj:`~.CUtensorMapIm2ColWideMode` types: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W` allows the number of + elements loaded along the W dimension to be specified via the + `pixelsPerColumn` field. + + - `swizzle`, which specifies the shared memory bank swizzling pattern, + must be one of the following :py:obj:`~.CUtensorMapSwizzle` modes + (other swizzle modes are not supported): + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Data are organized in a specific order in global memory; however, + this may not match the order in which the application accesses data + in shared memory. This difference in data organization may cause bank + conflicts when shared memory is accessed. In order to avoid this + problem, data can be loaded to shared memory with shuffling across + shared memory banks. When the `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`, only the following + swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) When the + `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, only the + following swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_128B (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) + + - `l2Promotion` specifies L2 fetch size which indicates the byte + granularity at which L2 requests are filled from DRAM. It must be of + type :py:obj:`~.CUtensorMapL2promotion`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `oobFill`, which indicates whether zero or a special NaN constant + should be used to fill out-of-bound elements, must be of type + :py:obj:`~.CUtensorMapFloatOOBfill` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Note that + :py:obj:`~.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA` can + only be used when `tensorDataType` represents a floating-point data + type, and when `tensorDataType` is not + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, and + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`. + + Parameters + ---------- + tensorDataType : :py:obj:`~.CUtensorMapDataType` + Tensor data type + tensorRank : Any + Dimensionality of tensor; must be at least 3 + globalAddress : Any + Starting address of memory region described by tensor + globalDim : list[:py:obj:`~.cuuint64_t`] + Array containing tensor size (number of elements) along each of the + `tensorRank` dimensions + globalStrides : list[:py:obj:`~.cuuint64_t`] + Array containing stride size (in bytes) along each of the + `tensorRank` - 1 dimensions + pixelBoxLowerCornerWidth : int + Width offset of left box corner + pixelBoxUpperCornerWidth : int + Width offset of right box corner + channelsPerPixel : Any + Number of channels per pixel + pixelsPerColumn : Any + Number of pixels per column + elementStrides : list[:py:obj:`~.cuuint32_t`] + Array containing traversal stride in each of the `tensorRank` + dimensions + interleave : :py:obj:`~.CUtensorMapInterleave` + Type of interleaved layout the tensor addresses + mode : :py:obj:`~.CUtensorMapIm2ColWideMode` + W or W128 mode + swizzle : :py:obj:`~.CUtensorMapSwizzle` + Bank swizzling pattern inside shared memory + l2Promotion : :py:obj:`~.CUtensorMapL2promotion` + L2 promotion size + oobFill : :py:obj:`~.CUtensorMapFloatOOBfill` + Indicate whether zero or special NaN constant will be used to fill + out-of-bound elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to create + + See Also + -------- + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapReplaceAddress` + """ + cdef cydriver.cuuint32_t* cyelementStrides + cdef size_t elementStridesLen + cdef cydriver.cuuint32_t[5] elementStridesStatic + elementStridesLen = 0 if elementStrides is None else len(elementStrides) + if elementStridesLen == 0: + cyelementStrides = NULL + elif elementStridesLen == 1: + cyelementStrides = ( elementStrides[0])._pvt_ptr + elif elementStridesLen <= 5: + for idx in range(elementStridesLen): + elementStridesStatic[idx] = ( elementStrides[idx])._pvt_ptr[0] + cyelementStrides = elementStridesStatic + else: + raise ValueError("Argument 'elementStrides' too long, must be <= 5") + cdef cydriver.cuuint32_t cypixelsPerColumn + if pixelsPerColumn is None: + ppixelsPerColumn = 0 + elif isinstance(pixelsPerColumn, (cuuint32_t,)): + ppixelsPerColumn = int(pixelsPerColumn) + else: + ppixelsPerColumn = int(cuuint32_t(pixelsPerColumn)) + cypixelsPerColumn = ppixelsPerColumn + cdef cydriver.cuuint32_t cychannelsPerPixel + if channelsPerPixel is None: + pchannelsPerPixel = 0 + elif isinstance(channelsPerPixel, (cuuint32_t,)): + pchannelsPerPixel = int(channelsPerPixel) + else: + pchannelsPerPixel = int(cuuint32_t(channelsPerPixel)) + cychannelsPerPixel = pchannelsPerPixel + cdef cydriver.cuuint64_t* cyglobalStrides + cdef size_t globalStridesLen + cdef cydriver.cuuint64_t[5] globalStridesStatic + globalStridesLen = 0 if globalStrides is None else len(globalStrides) + if globalStridesLen == 0: + cyglobalStrides = NULL + elif globalStridesLen == 1: + cyglobalStrides = ( globalStrides[0])._pvt_ptr + elif globalStridesLen <= 5: + for idx in range(globalStridesLen): + globalStridesStatic[idx] = ( globalStrides[idx])._pvt_ptr[0] + cyglobalStrides = globalStridesStatic + else: + raise ValueError("Argument 'globalStrides' too long, must be <= 5") + cdef cydriver.cuuint64_t* cyglobalDim + cdef size_t globalDimLen + cdef cydriver.cuuint64_t[5] globalDimStatic + globalDimLen = 0 if globalDim is None else len(globalDim) + if globalDimLen == 0: + cyglobalDim = NULL + elif globalDimLen == 1: + cyglobalDim = ( globalDim[0])._pvt_ptr + elif globalDimLen <= 5: + for idx in range(globalDimLen): + globalDimStatic[idx] = ( globalDim[idx])._pvt_ptr[0] + cyglobalDim = globalDimStatic + else: + raise ValueError("Argument 'globalDim' too long, must be <= 5") + cdef cydriver.cuuint32_t cytensorRank + if tensorRank is None: + ptensorRank = 0 + elif isinstance(tensorRank, (cuuint32_t,)): + ptensorRank = int(tensorRank) + else: + ptensorRank = int(cuuint32_t(tensorRank)) + cytensorRank = ptensorRank + cdef CUtensorMap tensorMap = CUtensorMap() + cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) + cdef _HelperInputVoidPtrStruct cyglobalAddressHelper + cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) + cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) + cdef cydriver.CUtensorMapIm2ColWideMode cymode = int(mode) + cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) + cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) + cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) + with nogil: + err = cydriver.cuTensorMapEncodeIm2colWide(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cymode, cyswizzle, cyl2Promotion, cyoobFill) + _helper_input_void_ptr_free(&cyglobalAddressHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, tensorMap) + +@cython.embedsignature(True) +def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): + """ Modify an existing tensor map descriptor with an updated global address. + + Modifies the descriptor for Tensor Memory Access (TMA) object passed in + `tensorMap` with an updated `globalAddress`. + + Tensor map objects are only supported on devices of compute capability + 9.0 or higher. Additionally, a tensor map object is an opaque value, + and, as such, should only be accessed through CUDA API calls. + + Parameters + ---------- + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to modify + globalAddress : Any + Starting address of memory region described by tensor, must follow + previous alignment requirements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` + """ + 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),) + +@cython.embedsignature(True) +def cuDeviceCanAccessPeer(dev, peerDev): + """ Queries if a device may directly access a peer device's memory. + + Returns in `*canAccessPeer` a value of 1 if contexts on `dev` are + capable of directly accessing memory from contexts on `peerDev` and 0 + otherwise. If direct access of `peerDev` from `dev` is possible, then + access may be enabled on two specific contexts by calling + :py:obj:`~.cuCtxEnablePeerAccess()`. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device from which allocations on `peerDev` are to be directly + accessed. + peerDev : :py:obj:`~.CUdevice` + Device on which the allocations to be directly accessed by `dev` + reside. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + canAccessPeer : int + Returned access capability + + See Also + -------- + :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cuCtxDisablePeerAccess`, :py:obj:`~.cudaDeviceCanAccessPeer` + """ + cdef cydriver.CUdevice cypeerDev + if peerDev is None: + ppeerDev = 0 + elif isinstance(peerDev, (CUdevice,)): + ppeerDev = int(peerDev) + else: + ppeerDev = int(CUdevice(peerDev)) + cypeerDev = ppeerDev + 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 int canAccessPeer = 0 + with nogil: + err = cydriver.cuDeviceCanAccessPeer(&canAccessPeer, cydev, cypeerDev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, canAccessPeer) + +@cython.embedsignature(True) +def cuCtxEnablePeerAccess(peerContext, unsigned int Flags): + """ Enables direct access to memory allocations in a peer context. + + If both the current context and `peerContext` are on devices which + support unified addressing (as may be queried using + :py:obj:`~.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`) and same major + compute capability, then on success all allocations from `peerContext` + will immediately be accessible by the current context. See + :py:obj:`~.Unified Addressing` for additional details. + + Note that access granted by this call is unidirectional and that in + order to access memory from the current context in `peerContext`, a + separate symmetric call to :py:obj:`~.cuCtxEnablePeerAccess()` is + required. + + Note that there are both device-wide and system-wide limitations per + system configuration, as noted in the CUDA Programming Guide under the + section "Peer-to-Peer Memory Access". + + Returns :py:obj:`~.CUDA_ERROR_PEER_ACCESS_UNSUPPORTED` if + :py:obj:`~.cuDeviceCanAccessPeer()` indicates that the + :py:obj:`~.CUdevice` of the current context cannot directly access + memory from the :py:obj:`~.CUdevice` of `peerContext`. + + Returns :py:obj:`~.CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED` if direct + access of `peerContext` from the current context has already been + enabled. + + Returns :py:obj:`~.CUDA_ERROR_TOO_MANY_PEERS` if direct peer access is + not possible because hardware resources required for peer access have + been exhausted. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` if there is no current + context, `peerContext` is not a valid context, or if the current + context is `peerContext`. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if `Flags` is not 0. + + Parameters + ---------- + peerContext : :py:obj:`~.CUcontext` + Peer context to enable direct access to from the current context + Flags : unsigned int + Reserved for future use and must be set to 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`, :py:obj:`~.CUDA_ERROR_TOO_MANY_PEERS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + + See Also + -------- + :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cuCtxDisablePeerAccess`, :py:obj:`~.cudaDeviceEnablePeerAccess` + """ + cdef cydriver.CUcontext cypeerContext + if peerContext is None: + ppeerContext = 0 + elif isinstance(peerContext, (CUcontext,)): + ppeerContext = int(peerContext) + else: + ppeerContext = int(CUcontext(peerContext)) + cypeerContext = ppeerContext + with nogil: + err = cydriver.cuCtxEnablePeerAccess(cypeerContext, Flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxDisablePeerAccess(peerContext): + """ Disables direct access to memory allocations in a peer context and unregisters any registered allocations. + + Returns :py:obj:`~.CUDA_ERROR_PEER_ACCESS_NOT_ENABLED` if direct peer + access has not yet been enabled from `peerContext` to the current + context. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` if there is no current + context, or if `peerContext` is not a valid context. + + Parameters + ---------- + peerContext : :py:obj:`~.CUcontext` + Peer context to disable direct access to + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + + See Also + -------- + :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cudaDeviceDisablePeerAccess` + """ + cdef cydriver.CUcontext cypeerContext + if peerContext is None: + ppeerContext = 0 + elif isinstance(peerContext, (CUcontext,)): + ppeerContext = int(peerContext) + else: + ppeerContext = int(CUcontext(peerContext)) + cypeerContext = ppeerContext + with nogil: + err = cydriver.cuCtxDisablePeerAccess(cypeerContext) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, dstDevice): + """ Queries attributes of the link between two devices. + + Returns in `*value` the value of the requested attribute `attrib` of + the link between `srcDevice` and `dstDevice`. The supported attributes + are: + + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK`: A relative + value indicating the performance of the link between two devices. + + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED` P2P: 1 if P2P + Access is enable. + + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`: 1 if + Atomic operations over the link are supported. + + - :py:obj:`~.CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED`: 1 if + cudaArray can be accessed over the link. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if `srcDevice` or + `dstDevice` are not valid or if they represent the same device. + + Returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if `attrib` is not valid + or if `value` is a null pointer. + + Parameters + ---------- + attrib : :py:obj:`~.CUdevice_P2PAttribute` + The requested attribute of the link between `srcDevice` and + `dstDevice`. + srcDevice : :py:obj:`~.CUdevice` + The source device of the target link. + dstDevice : :py:obj:`~.CUdevice` + The destination device of the target link. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + value : int + Returned value of the requested attribute + + See Also + -------- + :py:obj:`~.cuCtxEnablePeerAccess`, :py:obj:`~.cuCtxDisablePeerAccess`, :py:obj:`~.cuDeviceCanAccessPeer`, :py:obj:`~.cudaDeviceGetP2PAttribute` + """ + cdef cydriver.CUdevice cydstDevice + if dstDevice is None: + pdstDevice = 0 + elif isinstance(dstDevice, (CUdevice,)): + pdstDevice = int(dstDevice) + else: + pdstDevice = int(CUdevice(dstDevice)) + cydstDevice = pdstDevice + cdef cydriver.CUdevice cysrcDevice + if srcDevice is None: + psrcDevice = 0 + elif isinstance(srcDevice, (CUdevice,)): + psrcDevice = int(srcDevice) + else: + psrcDevice = int(CUdevice(srcDevice)) + cysrcDevice = psrcDevice + cdef int value = 0 + cdef cydriver.CUdevice_P2PAttribute cyattrib = int(attrib) + with nogil: + err = cydriver.cuDeviceGetP2PAttribute(&value, cyattrib, cysrcDevice, cydstDevice) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, value) + +@cython.embedsignature(True) +def cuGraphicsUnregisterResource(resource): + """ Unregisters a graphics resource for access by CUDA. + + Unregisters the graphics resource `resource` so it is not accessible by + CUDA unless registered again. + + If `resource` is invalid then :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is + returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + Resource to unregister + + 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_UNKNOWN` + + See Also + -------- + :py:obj:`~.cuGraphicsD3D9RegisterResource`, :py:obj:`~.cuGraphicsD3D10RegisterResource`, :py:obj:`~.cuGraphicsD3D11RegisterResource`, :py:obj:`~.cuGraphicsGLRegisterBuffer`, :py:obj:`~.cuGraphicsGLRegisterImage`, :py:obj:`~.cudaGraphicsUnregisterResource` + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + with nogil: + err = cydriver.cuGraphicsUnregisterResource(cyresource) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, unsigned int mipLevel): + """ Get an array through which to access a subresource of a mapped graphics resource. + + Returns in `*pArray` an array through which the subresource of the + mapped graphics resource `resource` which corresponds to array index + `arrayIndex` and mipmap level `mipLevel` may be accessed. The value set + in `*pArray` may change every time that `resource` is mapped. + + If `resource` is not a texture then it cannot be accessed via an array + and :py:obj:`~.CUDA_ERROR_NOT_MAPPED_AS_ARRAY` is returned. If + `arrayIndex` is not a valid array index for `resource` then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. If `mipLevel` is not + a valid mipmap level for `resource` then + :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is returned. If `resource` is not + mapped then :py:obj:`~.CUDA_ERROR_NOT_MAPPED` is returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + Mapped resource to access + arrayIndex : unsigned int + Array index for array textures or cubemap face index as defined by + :py:obj:`~.CUarray_cubemap_face` for cubemap textures for the + subresource to access + mipLevel : unsigned int + Mipmap level for the subresource to access + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_MAPPED`, :py:obj:`~.CUDA_ERROR_NOT_MAPPED_AS_ARRAY` + pArray : :py:obj:`~.CUarray` + Returned array through which a subresource of `resource` may be + accessed + + See Also + -------- + :py:obj:`~.cuGraphicsResourceGetMappedPointer`, :py:obj:`~.cudaGraphicsSubResourceGetMappedArray` + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + cdef CUarray pArray = CUarray() + with nogil: + err = cydriver.cuGraphicsSubResourceGetMappedArray(pArray._pvt_ptr, cyresource, arrayIndex, mipLevel) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pArray) + +@cython.embedsignature(True) +def cuGraphicsResourceGetMappedMipmappedArray(resource): + """ Get a mipmapped array through which to access a mapped graphics resource. + + Returns in `*pMipmappedArray` a mipmapped array through which the + mapped graphics resource `resource`. The value set in + `*pMipmappedArray` may change every time that `resource` is mapped. + + If `resource` is not a texture then it cannot be accessed via a + mipmapped array and :py:obj:`~.CUDA_ERROR_NOT_MAPPED_AS_ARRAY` is + returned. If `resource` is not mapped then + :py:obj:`~.CUDA_ERROR_NOT_MAPPED` is returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + Mapped resource to access + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_MAPPED`, :py:obj:`~.CUDA_ERROR_NOT_MAPPED_AS_ARRAY` + pMipmappedArray : :py:obj:`~.CUmipmappedArray` + Returned mipmapped array through which `resource` may be accessed + + See Also + -------- + :py:obj:`~.cuGraphicsResourceGetMappedPointer`, :py:obj:`~.cudaGraphicsResourceGetMappedMipmappedArray` + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + cdef CUmipmappedArray pMipmappedArray = CUmipmappedArray() + with nogil: + err = cydriver.cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray._pvt_ptr, cyresource) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pMipmappedArray) + +@cython.embedsignature(True) +def cuGraphicsResourceGetMappedPointer(resource): + """ Get a device pointer through which to access a mapped graphics resource. + + Returns in `*pDevPtr` a pointer through which the mapped graphics + resource `resource` may be accessed. Returns in `pSize` the size of the + memory in bytes which may be accessed from that pointer. The value set + in `pPointer` may change every time that `resource` is mapped. + + If `resource` is not a buffer then it cannot be accessed via a pointer + and :py:obj:`~.CUDA_ERROR_NOT_MAPPED_AS_POINTER` is returned. If + `resource` is not mapped then :py:obj:`~.CUDA_ERROR_NOT_MAPPED` is + returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + None + + Returns + ------- + CUresult + + pDevPtr : :py:obj:`~.CUdeviceptr` + None + pSize : int + None + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + cdef CUdeviceptr pDevPtr = CUdeviceptr() + cdef size_t pSize = 0 + with nogil: + err = cydriver.cuGraphicsResourceGetMappedPointer(pDevPtr._pvt_ptr, &pSize, cyresource) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pDevPtr, pSize) + +@cython.embedsignature(True) +def cuGraphicsResourceSetMapFlags(resource, unsigned int flags): + """ Set usage flags for mapping a graphics resource. + + Set `flags` for mapping the graphics resource `resource`. + + Changes to `flags` will take effect the next time `resource` is mapped. + The `flags` argument may be any of the following: + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE`: Specifies no hints + about how this resource will be used. It is therefore assumed that + this resource will be read from and written to by CUDA kernels. This + is the default value. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READONLY`: Specifies that + CUDA kernels which access this resource will not write to this + resource. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITEDISCARD`: Specifies + that CUDA kernels which access this resource will not read from this + resource and will write over the entire contents of the resource, so + none of the data previously stored in the resource will be preserved. + + If `resource` is presently mapped for access by CUDA then + :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED` is returned. If `flags` is not + one of the above values then :py:obj:`~.CUDA_ERROR_INVALID_VALUE` is + returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + Registered resource to set flags for + flags : unsigned int + Parameters for resource mapping + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED` + + See Also + -------- + :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cudaGraphicsResourceSetMapFlags` + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + with nogil: + err = cydriver.cuGraphicsResourceSetMapFlags(cyresource, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphicsMapResources(unsigned int count, resources, hStream): + """ Map graphics resources for access by CUDA. + + Maps the `count` graphics resources in `resources` for access by CUDA. + + The resources in `resources` may be accessed by CUDA until they are + unmapped. The graphics API from which `resources` were registered + should not access any resources while they are mapped by CUDA. If an + application does so, the results are undefined. + + This function provides the synchronization guarantee that any graphics + calls issued before :py:obj:`~.cuGraphicsMapResources()` will complete + before any subsequent CUDA work issued in `stream` begins. + + If `resources` includes any duplicate entries then + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. If any of + `resources` are presently mapped for access by CUDA then + :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED` is returned. + + Parameters + ---------- + count : unsigned int + Number of resources to map + resources : :py:obj:`~.CUgraphicsResource` + Resources to map for CUDA usage + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream with which to synchronize + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + + See Also + -------- + :py:obj:`~.cuGraphicsResourceGetMappedPointer`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cudaGraphicsMapResources` + """ + 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.CUgraphicsResource *cyresources + if resources is None: + cyresources = NULL + elif isinstance(resources, (CUgraphicsResource,)): + presources = resources.getPtr() + cyresources = presources + elif isinstance(resources, (int)): + cyresources = resources + else: + raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) + with nogil: + err = cydriver.cuGraphicsMapResources(count, cyresources, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphicsUnmapResources(unsigned int count, resources, hStream): + """ Unmap graphics resources. + + Unmaps the `count` graphics resources in `resources`. + + Once unmapped, the resources in `resources` may not be accessed by CUDA + until they are mapped again. + + This function provides the synchronization guarantee that any CUDA work + issued in `stream` before :py:obj:`~.cuGraphicsUnmapResources()` will + complete before any subsequently issued graphics work begins. + + If `resources` includes any duplicate entries then + :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is returned. If any of + `resources` are not presently mapped for access by CUDA then + :py:obj:`~.CUDA_ERROR_NOT_MAPPED` is returned. + + Parameters + ---------- + count : unsigned int + Number of resources to unmap + resources : :py:obj:`~.CUgraphicsResource` + Resources to unmap + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream with which to synchronize + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_NOT_MAPPED`, :py:obj:`~.CUDA_ERROR_UNKNOWN` + + See Also + -------- + :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cudaGraphicsUnmapResources` + """ + 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.CUgraphicsResource *cyresources + if resources is None: + cyresources = NULL + elif isinstance(resources, (CUgraphicsResource,)): + presources = resources.getPtr() + cyresources = presources + elif isinstance(resources, (int)): + cyresources = resources + else: + raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) + with nogil: + err = cydriver.cuGraphicsUnmapResources(count, cyresources, cyhStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGetProcAddress(char* symbol, int cudaVersion, flags): + """ Returns the requested driver API function pointer. + + Returns in `**pfn` the address of the CUDA driver function for the + requested CUDA version and flags. + + The CUDA version is specified as (1000 * major + 10 * minor), so CUDA + 11.2 should be specified as 11020. For a requested driver symbol, if + the specified CUDA version is greater than or equal to the CUDA version + in which the driver symbol was introduced, this API will return the + function pointer to the corresponding versioned function. + + The pointer returned by the API should be cast to a function pointer + matching the requested driver function's definition in the API header + file. The function pointer typedef can be picked up from the + corresponding typedefs header file. For example, cudaTypedefs.h + consists of function pointer typedefs for driver APIs defined in + :py:obj:`~.cuda.h`. + + The API will return :py:obj:`~.CUDA_SUCCESS` and set the returned `pfn` + to NULL if the requested driver function is not supported on the + platform, no ABI compatible driver function exists for the specified + `cudaVersion` or if the driver symbol is invalid. + + It will also set the optional `symbolStatus` to one of the values in + :py:obj:`~.CUdriverProcAddressQueryResult` with the following meanings: + + - :py:obj:`~.CU_GET_PROC_ADDRESS_SUCCESS` - The requested symbol was + succesfully found based on input arguments and `pfn` is valid + + - :py:obj:`~.CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND` - The requested + symbol was not found + + - :py:obj:`~.CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT` - The + requested symbol was found but is not supported by cudaVersion + specified + + The requested flags can be: + + - :py:obj:`~.CU_GET_PROC_ADDRESS_DEFAULT`: This is the default mode. + This is equivalent to + :py:obj:`~.CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM` if the code + is compiled with --default-stream per-thread compilation flag or the + macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; + :py:obj:`~.CU_GET_PROC_ADDRESS_LEGACY_STREAM` otherwise. + + - :py:obj:`~.CU_GET_PROC_ADDRESS_LEGACY_STREAM`: This will enable the + search for all driver symbols that match the requested driver symbol + name except the corresponding per-thread versions. + + - :py:obj:`~.CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM`: This will + enable the search for all driver symbols that match the requested + driver symbol name including the per-thread versions. If a per-thread + version is not found, the API will return the legacy version of the + driver function. + + Parameters + ---------- + symbol : bytes + The base name of the driver API function to look for. As an + example, for the driver API :py:obj:`~.cuMemAlloc_v2`, `symbol` + would be cuMemAlloc and `cudaVersion` would be the ABI compatible + CUDA version for the _v2 variant. + cudaVersion : int + The CUDA version to look for the requested driver symbol + flags : Any + Flags to specify search options. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pfn : Any + Location to return the function pointer to the requested driver + function + symbolStatus : :py:obj:`~.CUdriverProcAddressQueryResult` + Optional location to store the status of the search for `symbol` + based on `cudaVersion`. See + :py:obj:`~.CUdriverProcAddressQueryResult` for possible values. + + See Also + -------- + :py:obj:`~.cudaGetDriverEntryPoint` + """ + cdef cydriver.cuuint64_t cyflags + if flags is None: + pflags = 0 + elif isinstance(flags, (cuuint64_t,)): + pflags = int(flags) + else: + pflags = int(cuuint64_t(flags)) + cyflags = pflags + cdef void_ptr pfn = 0 + cdef cydriver.CUdriverProcAddressQueryResult symbolStatus + with nogil: + err = cydriver.cuGetProcAddress(symbol, &pfn, cudaVersion, cyflags, &symbolStatus) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pfn, CUdriverProcAddressQueryResult(symbolStatus)) + +@cython.embedsignature(True) +def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): + """ Allows caller to fetch a coredump attribute value for the current context. + + Returns in `*value` the requested value specified by `attrib`. 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 `attrib` 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` + unless set to :py:obj:`~.true` globally or locally, or the + CU_CTX_USER_COREDUMP_ENABLE flag was set during context creation. + + - :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` + unless set to :py:obj:`~.true` globally or locally. 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` unless set to :py:obj:`~.true` + globally or locally. + + - :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. 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. + + 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`, :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` + value : Any + void* containing the requested data. + size : int + The size of the memory region `value` points to. + + See Also + -------- + :py:obj:`~.cuCoredumpGetAttributeGlobal`, :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.cuCoredumpGetAttribute(cyattrib, cyvalue_ptr, &size) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyvalue.pyObj()) + +@cython.embedsignature(True) +def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): + """ Allows caller to fetch a coredump attribute value for the entire application. + + Returns in `*value` the requested value specified by `attrib`. 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 `attrib` 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. 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. + + 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. + + 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),) + +@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. + + 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` + size : int + The size of the memory region `value` points to. + + See Also + -------- + :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute` + """ + 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.cuCoredumpSetAttributeGlobal(cyattrib, cyvalue_ptr, &size) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGetExportTable(pExportTableId : Optional[CUuuid]): + """ + + Parameters + ---------- + pExportTableId : :py:obj:`~.CUuuid` + None + + Returns + ------- + CUresult + + ppExportTable : Any + None + """ + cdef void_ptr ppExportTable = 0 + 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) + +@cython.embedsignature(True) +def cuGreenCtxCreate(desc, dev, unsigned int flags): + """ Creates a green context with a specified set of resources. + + This API creates a green context with the resources specified in the + descriptor `desc` and returns it in the handle represented by `phCtx`. + This API will retain the primary context on device `dev`, which will is + released when the green context is destroyed. It is advised to have the + primary context active before calling this API to avoid the heavy cost + of triggering primary context initialization and deinitialization + multiple times. + + 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 :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_DEFAULT_STREAM` : Creates a default stream to use + inside the green context. Required. + + Parameters + ---------- + desc : :py:obj:`~.CUdevResourceDesc` + Descriptor generated via :py:obj:`~.cuDevResourceGenerateDesc` + which contains the set of resources to be used + dev : :py:obj:`~.CUdevice` + 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 + ------- + 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_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phCtx : :py:obj:`~.CUgreenCtx` + Pointer for the output handle to the green context + + See Also + -------- + :py:obj:`~.cuGreenCtxDestroy`, :py:obj:`~.cuCtxFromGreenCtx`, :py:obj:`~.cuCtxSetCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuDevResourceGenerateDesc`, :py:obj:`~.cuDevicePrimaryCtxRetain`, :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxCreate_v3` + """ + 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.CUdevResourceDesc cydesc + if desc is None: + pdesc = 0 + elif isinstance(desc, (CUdevResourceDesc,)): + pdesc = int(desc) + else: + pdesc = int(CUdevResourceDesc(desc)) + cydesc = pdesc + cdef CUgreenCtx phCtx = CUgreenCtx() + with nogil: + err = cydriver.cuGreenCtxCreate(phCtx._pvt_ptr, cydesc, cydev, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phCtx) + +@cython.embedsignature(True) +def cuGreenCtxDestroy(hCtx): + """ Destroys a green context. + + Destroys the green context, releasing the primary context of the device + that this green context was created for. Any resources provisioned for + this green context (that were initially available via the resource + descriptor) are released as well. + + Parameters + ---------- + hCtx : :py:obj:`~.CUgreenCtx` + Green context to be destroyed + + 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_CONTEXT_IS_DESTROYED` + + See Also + -------- + :py:obj:`~.cuGreenCtxCreate`, :py:obj:`~.cuCtxDestroy` + """ + cdef cydriver.CUgreenCtx cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUgreenCtx,)): + phCtx = int(hCtx) + else: + phCtx = int(CUgreenCtx(hCtx)) + cyhCtx = phCtx + with nogil: + err = cydriver.cuGreenCtxDestroy(cyhCtx) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCtxFromGreenCtx(hCtx): + """ Converts a green context into the primary 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 :py:obj:`~.CUcontext` parameter. + + Users are expected to call this API before calling any CUDA APIs that + accept a :py:obj:`~.CUcontext`. Failing to do so will result in the + APIs returning :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. + + Parameters + ---------- + hCtx : :py:obj:`~.CUgreenCtx` + Green context to convert + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pContext : :py:obj:`~.CUcontext` + Returned primary context with green context resources + + See Also + -------- + :py:obj:`~.cuGreenCtxCreate` + """ + cdef cydriver.CUgreenCtx cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUgreenCtx,)): + phCtx = int(hCtx) + else: + phCtx = int(CUgreenCtx(hCtx)) + cyhCtx = phCtx + cdef CUcontext pContext = CUcontext() + with nogil: + err = cydriver.cuCtxFromGreenCtx(pContext._pvt_ptr, cyhCtx) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pContext) + +@cython.embedsignature(True) +def cuDeviceGetDevResource(device, typename not None : CUdevResourceType): + """ Get device resources. + + Get the `typename` resources available to the `device`. This may often + be the starting point for further partitioning or configuring of + resources. + + Note: The API is not supported on 32-bit platforms. + + Parameters + ---------- + device : :py:obj:`~.CUdevice` + Device to get resource for + typename : :py:obj:`~.CUdevResourceType` + Type of resource to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + resource : :py:obj:`~.CUdevResource` + Output pointer to a :py:obj:`~.CUdevResource` structure + + See Also + -------- + :py:obj:`~.cuDevResourceGenerateDesc` + """ + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef CUdevResource resource = CUdevResource() + cdef cydriver.CUdevResourceType cytypename = int(typename) + with nogil: + err = cydriver.cuDeviceGetDevResource(cydevice, resource._pvt_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, resource) + +@cython.embedsignature(True) +def cuCtxGetDevResource(hCtx, typename not None : CUdevResourceType): + """ Get context resources. + + Get the `typename` resources available to the context represented by + `hCtx` Note: The API is not supported on 32-bit platforms. + + Parameters + ---------- + hCtx : :py:obj:`~.CUcontext` + Context to get resource for + typename : :py:obj:`~.CUdevResourceType` + Type of resource to retrieve + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + resource : :py:obj:`~.CUdevResource` + Output pointer to a :py:obj:`~.CUdevResource` structure + + See Also + -------- + :py:obj:`~.cuDevResourceGenerateDesc` + """ + cdef cydriver.CUcontext cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUcontext,)): + phCtx = int(hCtx) + else: + phCtx = int(CUcontext(hCtx)) + cyhCtx = phCtx + cdef CUdevResource resource = CUdevResource() + cdef cydriver.CUdevResourceType cytypename = int(typename) + with nogil: + err = cydriver.cuCtxGetDevResource(cyhCtx, resource._pvt_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, resource) + +@cython.embedsignature(True) +def cuGreenCtxGetDevResource(hCtx, typename not None : CUdevResourceType): + """ Get green context resources. + + Get the `typename` resources available to the green context represented + by `hCtx` + + Parameters + ---------- + hCtx : :py:obj:`~.CUgreenCtx` + Green context to get resource for + typename : :py:obj:`~.CUdevResourceType` + Type of resource to retrieve + + 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_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + resource : :py:obj:`~.CUdevResource` + Output pointer to a :py:obj:`~.CUdevResource` structure + + See Also + -------- + :py:obj:`~.cuDevResourceGenerateDesc` + """ + cdef cydriver.CUgreenCtx cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUgreenCtx,)): + phCtx = int(hCtx) + else: + phCtx = int(CUgreenCtx(hCtx)) + cyhCtx = phCtx + cdef CUdevResource resource = CUdevResource() + cdef cydriver.CUdevResourceType cytypename = int(typename) + with nogil: + err = cydriver.cuGreenCtxGetDevResource(cyhCtx, resource._pvt_ptr, cytypename) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, resource) + +@cython.embedsignature(True) +def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevResource], unsigned int useFlags, unsigned int minCount): + """ Splits `CU_DEV_RESOURCE_TYPE_SM` resources. + + Splits `CU_DEV_RESOURCE_TYPE_SM` resources into `nbGroups`, adhering to + the minimum SM count specified in `minCount` and the usage flags in + `useFlags`. If `result` is NULL, the API simulates a split and provides + the amount of groups that would be created in `nbGroups`. Otherwise, + `nbGroups` must point to the amount of elements in `result` and on + return, the API will overwrite `nbGroups` with the amount actually + created. The groups are written to the array in `result`. `nbGroups` + can be less than the total amount if a smaller number of groups is + needed. + + This API is used to spatially partition the input resource. The input + resource needs to come from one of :py:obj:`~.cuDeviceGetDevResource`, + :py:obj:`~.cuCtxGetDevResource`, or + :py:obj:`~.cuGreenCtxGetDevResource`. A limitation of the API is that + the output results cannot be split again without first creating a + descriptor and a green context with that descriptor. + + When creating the groups, the API will take into account the + performance and functional characteristics of the input resource, and + guarantee a split that will create a disjoint set of symmetrical + partitions. This may lead to fewer groups created than purely dividing + the total SM count by the `minCount` due to cluster requirements or + alignment and granularity requirements for the minCount. + + The `remainder` set does not have the same functional or performance + guarantees as the groups in `result`. Its use should be carefully + planned and future partitions of the `remainder` set are discouraged. + + The following flags are supported: + + - `CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING` : Lower the minimum + SM count and alignment, and treat each SM independent of its + hierarchy. This allows more fine grained partitions but at the cost + of advanced features (such as large clusters on compute capability + 9.0+). + + - `CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE` : Compute + Capability 9.0+ only. Attempt to create groups that may allow for + maximally sized thread clusters. This can be queried post green + context creation using + :py:obj:`~.cuOccupancyMaxPotentialClusterSize`. + + A successful API call must either have: + + - A valid array of `result` pointers of size passed in `nbGroups`, with + `input` of type `CU_DEV_RESOURCE_TYPE_SM`. Value of `minCount` must + be between 0 and the SM count specified in `input`. `remaining` may + be NULL. + + - NULL passed in for `result`, with a valid integer pointer in + `nbGroups` and `input` of type `CU_DEV_RESOURCE_TYPE_SM`. Value of + `minCount` must be between 0 and the SM count specified in `input`. + `remaining` may be NULL. This queries the number of groups that would + be created by the API. + + Note: The API is not supported on 32-bit platforms. + + Parameters + ---------- + nbGroups : unsigned int + This is a pointer, specifying the number of groups that would be or + should be created as described below. + input : :py:obj:`~.CUdevResource` + Input SM resource to be split. Must be a valid + `CU_DEV_RESOURCE_TYPE_SM` resource. + useFlags : unsigned int + Flags specifying how these partitions are used or which constraints + to abide by when splitting the input. Zero is valid for default + behavior. + minCount : unsigned int + Minimum number of SMs required + + Returns + ------- + 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 `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. + remaining : :py:obj:`~.CUdevResource` + If the input resource cannot be cleanly split among `nbGroups`, the + remaining is placed in here. Can be ommitted (NULL) if the user + does not need the remaining set. + + See Also + -------- + :py:obj:`~.cuGreenCtxGetDevResource`, :py:obj:`~.cuCtxGetDevResource`, :py:obj:`~.cuDeviceGetDevResource` + """ + cdef cydriver.CUdevResource* cyresult = NULL + pyresult = [CUdevResource() for idx in range(nbGroups)] + if nbGroups != 0: + 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 unsigned int cynbGroups = nbGroups + cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL + cdef CUdevResource remaining = CUdevResource() + with nogil: + err = cydriver.cuDevSmResourceSplitByCount(cyresult, &cynbGroups, cyinput__ptr, remaining._pvt_ptr, useFlags, minCount) + if CUresult(err) == CUresult(0): + for idx in range(nbGroups): + string.memcpy((pyresult[idx])._pvt_ptr, &cyresult[idx], sizeof(cydriver.CUdevResource)) + if cyresult is not NULL: + free(cyresult) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None, None) + return (_CUresult_SUCCESS, pyresult, cynbGroups, remaining) + +@cython.embedsignature(True) +def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[CUdevResource]], unsigned int nbResources): + """ Generate a resource descriptor. + + Generates a single resource descriptor with the set of resources + specified in `resources`. The generated resource descriptor is + necessary for the creation of green contexts via the + :py:obj:`~.cuGreenCtxCreate` API. Resources of the same type can be + passed in, provided they meet the requirements as noted below. + + A successful API call must have: + + - A valid output pointer for the `phDesc` descriptor as well as a valid + array of `resources` pointers, with the array size passed in + `nbResources`. If multiple resources are provided in `resources`, the + device they came from must be the same, otherwise + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. If multiple + resources are provided in `resources` and they are of type + :py:obj:`~.CU_DEV_RESOURCE_TYPE_SM`, they must be outputs (whether + `result` or `remaining`) from the same split API instance, otherwise + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. + + Note: The API is not supported on 32-bit platforms. + + Parameters + ---------- + resources : list[:py:obj:`~.CUdevResource`] + Array of resources to be included in the descriptor + nbResources : unsigned int + Number of resources passed in `resources` + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION` + phDesc : :py:obj:`~.CUdevResourceDesc` + Output descriptor + + See Also + -------- + :py:obj:`~.cuDevSmResourceSplitByCount` + """ + resources = [] if resources is None else resources + if not all(isinstance(_x, (CUdevResource,)) for _x in resources): + raise TypeError("Argument 'resources' is not instance of type (expected tuple[cydriver.CUdevResource,] or list[cydriver.CUdevResource,]") + cdef CUdevResourceDesc phDesc = CUdevResourceDesc() + cdef cydriver.CUdevResource* cyresources = NULL + if len(resources) > 1: + cyresources = calloc(len(resources), sizeof(cydriver.CUdevResource)) + if cyresources is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(resources)) + 'x' + str(sizeof(cydriver.CUdevResource))) + for idx in range(len(resources)): + string.memcpy(&cyresources[idx], (resources[idx])._pvt_ptr, sizeof(cydriver.CUdevResource)) + elif len(resources) == 1: + cyresources = (resources[0])._pvt_ptr + if nbResources > len(resources): raise RuntimeError("List is too small: " + str(len(resources)) + " < " + str(nbResources)) + with nogil: + err = cydriver.cuDevResourceGenerateDesc(phDesc._pvt_ptr, cyresources, nbResources) + if len(resources) > 1 and cyresources is not NULL: + free(cyresources) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phDesc) + +@cython.embedsignature(True) +def cuGreenCtxRecordEvent(hCtx, hEvent): + """ Records an event. + + Captures in `hEvent` all the activities of the green context of `hCtx` + at the time of this call. `hEvent` and `hCtx` must be from the same + primary context otherwise :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` is + returned. Calls such as :py:obj:`~.cuEventQuery()` or + :py:obj:`~.cuGreenCtxWaitEvent()` will then examine or wait for + completion of the work that was captured. Uses of `hCtx` after this + call do not modify `hEvent`. + + Parameters + ---------- + hCtx : :py:obj:`~.CUgreenCtx` + Green context to record event for + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + + 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_STREAM_CAPTURE_UNSUPPORTED` + + See Also + -------- + :py:obj:`~.cuGreenCtxWaitEvent`, :py:obj:`~.cuEventRecord`, :py:obj:`~.cuCtxRecordEvent`, :py:obj:`~.cuCtxWaitEvent` + + Notes + ----- + The API will return :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` if the specified green context `hCtx` has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures. + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + cdef cydriver.CUgreenCtx cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUgreenCtx,)): + phCtx = int(hCtx) + else: + phCtx = int(CUgreenCtx(hCtx)) + cyhCtx = phCtx + with nogil: + err = cydriver.cuGreenCtxRecordEvent(cyhCtx, cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGreenCtxWaitEvent(hCtx, hEvent): + """ Make a green context wait on an event. + + Makes all future work submitted to green context `hCtx` wait for all + work captured in `hEvent`. The synchronization will be performed on the + device and will not block the calling CPU thread. See + :py:obj:`~.cuGreenCtxRecordEvent()` or :py:obj:`~.cuEventRecord()`, for + details on what is captured by an event. + + Parameters + ---------- + hCtx : :py:obj:`~.CUgreenCtx` + Green context to wait + hEvent : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait on + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` + + See Also + -------- + :py:obj:`~.cuGreenCtxRecordEvent`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuCtxRecordEvent`, :py:obj:`~.cuCtxWaitEvent` + + Notes + ----- + `hEvent` may be from a different context or device than `hCtx`. + + The API will return :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED` and invalidate the capture if the specified event `hEvent` is part of an ongoing capture sequence or if the specified green context `hCtx` has a stream in the capture mode. + """ + cdef cydriver.CUevent cyhEvent + if hEvent is None: + phEvent = 0 + elif isinstance(hEvent, (CUevent,)): + phEvent = int(hEvent) + else: + phEvent = int(CUevent(hEvent)) + cyhEvent = phEvent + cdef cydriver.CUgreenCtx cyhCtx + if hCtx is None: + phCtx = 0 + elif isinstance(hCtx, (CUgreenCtx,)): + phCtx = int(hCtx) + else: + phCtx = int(CUgreenCtx(hCtx)) + cyhCtx = phCtx + with nogil: + err = cydriver.cuGreenCtxWaitEvent(cyhCtx, cyhEvent) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuStreamGetGreenCtx(hStream): + """ Query the green context associated with a stream. + + Returns the CUDA green context that the stream is associated with, or + NULL if the stream is not associated with any green context. + + The stream handle `hStream` can refer to any of the following: + + - a stream created via any of the CUDA driver APIs such as + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority` + and :py:obj:`~.cuGreenCtxStreamCreate`, or their runtime API + equivalents such as :py:obj:`~.cudaStreamCreate`, + :py:obj:`~.cudaStreamCreateWithFlags` and + :py:obj:`~.cudaStreamCreateWithPriority`. If during stream creation + the context that was active in the calling thread was obtained with + cuCtxFromGreenCtx, that green context is returned in `phCtx`. + Otherwise, `*phCtx` is set to NULL instead. + + - special stream such as the NULL stream or + :py:obj:`~.CU_STREAM_LEGACY`. In that case if context that is active + in the calling thread was obtained with cuCtxFromGreenCtx, that green + context is returned. Otherwise, `*phCtx` is set to NULL instead. + + Passing an invalid handle will result in undefined behavior. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + 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`, + phCtx : :py:obj:`~.CUgreenCtx` + Returned green context associated with the stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamCreateWithPriority`, :py:obj:`~.cuStreamGetCtx_v2`, :py:obj:`~.cuGreenCtxStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` + """ + 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 CUgreenCtx phCtx = CUgreenCtx() + with nogil: + err = cydriver.cuStreamGetGreenCtx(cyhStream, phCtx._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phCtx) + +@cython.embedsignature(True) +def cuGreenCtxStreamCreate(greenCtx, unsigned int flags, int priority): + """ Create a stream for use in the green context. + + Creates a stream for use in the specified green context `greenCtx` and + returns a handle in `phStream`. The stream can be destroyed by calling + :py:obj:`~.cuStreamDestroy()`. Note that the API ignores the context + that is current to the calling thread and creates a stream in the + specified green context `greenCtx`. + + The supported values for `flags` are: + + - :py:obj:`~.CU_STREAM_NON_BLOCKING`: This must be specified. It + indicates that work running in the created stream may run + concurrently with work in the default stream, and that the created + stream should perform no implicit synchronization with the default + stream. + + Specifying `priority` affects the scheduling priority of work in the + stream. Priorities provide a hint to preferentially run work with + higher priority when possible, but do not preempt already-running work + or provide any other functional guarantee on execution order. + `priority` follows a convention where lower numbers represent higher + priorities. '0' represents default priority. The range of meaningful + numerical priorities can be queried using + :py:obj:`~.cuCtxGetStreamPriorityRange`. If the specified priority is + outside the numerical range returned by + :py:obj:`~.cuCtxGetStreamPriorityRange`, it will automatically be + clamped to the lowest or the highest number in the range. + + Parameters + ---------- + greenCtx : :py:obj:`~.CUgreenCtx` + Green context for which to create the stream for + flags : unsigned int + Flags for stream creation. `CU_STREAM_NON_BLOCKING` must be + specified. + priority : int + Stream priority. Lower numbers represent higher priorities. See + :py:obj:`~.cuCtxGetStreamPriorityRange` for more information about + meaningful stream priorities that can be passed. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phStream : :py:obj:`~.CUstream` + Returned newly created stream + + See Also + -------- + :py:obj:`~.cuStreamDestroy`, :py:obj:`~.cuGreenCtxCreate` :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamGetPriority`, :py:obj:`~.cuCtxGetStreamPriorityRange`, :py:obj:`~.cuStreamGetFlags`, :py:obj:`~.cuStreamGetDevice`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuStreamQuery`, :py:obj:`~.cuStreamSynchronize`, :py:obj:`~.cuStreamAddCallback`, :py:obj:`~.cudaStreamCreateWithPriority` + + Notes + ----- + In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream priorities have no effect on host-to-device and device-to-host memory operations. + """ + cdef cydriver.CUgreenCtx cygreenCtx + if greenCtx is None: + pgreenCtx = 0 + elif isinstance(greenCtx, (CUgreenCtx,)): + pgreenCtx = int(greenCtx) + else: + pgreenCtx = int(CUgreenCtx(greenCtx)) + cygreenCtx = pgreenCtx + cdef CUstream phStream = CUstream() + with nogil: + err = cydriver.cuGreenCtxStreamCreate(phStream._pvt_ptr, cygreenCtx, flags, priority) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phStream) + +ctypedef struct cuLogsCallbackData_st: + cydriver.CUlogsCallback callback + void *userData + +ctypedef cuLogsCallbackData_st cuLogsCallbackData + +@cython.show_performance_hints(False) +cdef void cuLogsCallbackWrapper(void *data, cydriver.CUlogLevel logLevel, char *message, size_t length) nogil: + cdef cuLogsCallbackData *cbData = data + with gil: + cbData.callback(cbData.userData, logLevel, message, length) + +@cython.embedsignature(True) +def cuLogsRegisterCallback(callbackFunc, userData): + """ Register a callback function to receive error log messages. + + Parameters + ---------- + callbackFunc : :py:obj:`~.CUlogsCallback` + The function to register as a callback + userData : Any + A generic pointer to user data. This is passed into the callback + function. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + callback_out : :py:obj:`~.CUlogsCallbackHandle` + Optional location to store the callback handle after it is + registered + """ + cdef cydriver.CUlogsCallback cycallbackFunc + if callbackFunc is None: + pcallbackFunc = 0 + elif isinstance(callbackFunc, (CUlogsCallback,)): + pcallbackFunc = int(callbackFunc) + else: + pcallbackFunc = int(CUlogsCallback(callbackFunc)) + cycallbackFunc = pcallbackFunc + cdef _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cuLogsCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (CUresult.CUDA_ERROR_OUT_OF_MEMORY, None) + cbData.callback = cycallbackFunc + cbData.userData = cyuserData + + cdef CUlogsCallbackHandle callback_out = CUlogsCallbackHandle() + with nogil: + err = cydriver.cuLogsRegisterCallback(cuLogsCallbackWrapper, cbData, callback_out._pvt_ptr) + if err != cydriver.CUDA_SUCCESS: + free(cbData) + else: + m_global._allocated[int(callback_out)] = cbData + _helper_input_void_ptr_free(&cyuserDataHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, callback_out) + +@cython.embedsignature(True) +def cuLogsUnregisterCallback(callback): + """ Unregister a log message callback. + + Parameters + ---------- + callback : :py:obj:`~.CUlogsCallbackHandle` + The callback instance to unregister from receiving log messages + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + """ + cdef cydriver.CUlogsCallbackHandle cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (CUlogsCallbackHandle,)): + pcallback = int(callback) + else: + pcallback = int(CUlogsCallbackHandle(callback)) + cycallback = pcallback + with nogil: + err = cydriver.cuLogsUnregisterCallback(cycallback) + if err == cydriver.CUDA_SUCCESS: + free(m_global._allocated[pcallback]) + m_global._allocated.erase(pcallback) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogsCurrent(unsigned int flags): + """ Sets log iterator to point to the end of log buffer, where the next message would be written. + + Parameters + ---------- + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + iterator_out : :py:obj:`~.CUlogIterator` + Location to store an iterator to the current tail of the logs + """ + cdef CUlogIterator iterator_out = CUlogIterator() + with nogil: + err = cydriver.cuLogsCurrent(iterator_out._pvt_ptr, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, iterator_out) + +@cython.embedsignature(True) +def cuLogsDumpToFile(iterator : Optional[CUlogIterator], char* pathToFile, unsigned int flags): + """ Dump accumulated driver logs into a file. + + Logs generated by the driver are stored in an internal buffer and can + be copied out using this API. This API dumps all driver logs starting + from `iterator` into `pathToFile` provided. + + Parameters + ---------- + iterator : :py:obj:`~.CUlogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + pathToFile : bytes + Path to output file for dumping logs + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + iterator : :py:obj:`~.CUlogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + + Notes + ----- + `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log. + + The driver reserves limited memory for storing logs. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. + """ + cdef cydriver.CUlogIterator* cyiterator = NULL + if iterator is not None: + cyiterator = iterator._pvt_ptr + with nogil: + err = cydriver.cuLogsDumpToFile(cyiterator, pathToFile, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, iterator) + +@cython.embedsignature(True) +def cuLogsDumpToMemory(iterator : Optional[CUlogIterator], char* buffer, size_t size, unsigned int flags): + """ Dump accumulated driver logs into a buffer. + + Logs generated by the driver are stored in an internal buffer and can + be copied out using this API. This API dumps driver logs from + `iterator` into `buffer` up to the size specified in `*size`. The + driver will always null terminate the buffer but there will not be a + null character between log entries, only a newline \n. The driver will + then return the actual number of bytes written in `*size`, excluding + the null terminator. If there are no messages to dump, `*size` will be + set to 0 and the function will return :py:obj:`~.CUDA_SUCCESS`. If the + provided `buffer` is not large enough to hold any messages, `*size` + will be set to 0 and the function will return + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + Parameters + ---------- + iterator : :py:obj:`~.CUlogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + buffer : bytes + Pointer to dump logs + size : int + See description + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + iterator : :py:obj:`~.CUlogIterator` + Optional auto-advancing iterator specifying the starting log to + read. NULL value dumps all logs. + size : int + See description + + Notes + ----- + `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log. + + The driver reserves limited memory for storing logs. The maximum size of the buffer is 25600 bytes. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. + + If the provided value in `*size` is not large enough to hold all buffered messages, a message will be added at the head of the buffer indicating this. The driver then computes the number of messages it is able to store in `buffer` and writes it out. The final message in `buffer` will always be the most recent log message as of when the API is called. + """ + cdef cydriver.CUlogIterator* cyiterator = NULL + if iterator is not None: + cyiterator = iterator._pvt_ptr + with nogil: + err = cydriver.cuLogsDumpToMemory(cyiterator, buffer, &size, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, iterator, size) + +@cython.embedsignature(True) +def cuCheckpointProcessGetRestoreThreadId(int pid): + """ Returns the restore thread ID for a CUDA process. + + Returns in `*tid` the thread ID of the CUDA restore thread for the + process specified by `pid`. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + tid : int + Returned restore thread ID + """ + cdef int tid = 0 + with nogil: + err = cydriver.cuCheckpointProcessGetRestoreThreadId(pid, &tid) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, tid) + +@cython.embedsignature(True) +def cuCheckpointProcessGetState(int pid): + """ Returns the process state of a CUDA process. + + Returns in `*state` the current state of the CUDA process specified by + `pid`. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + state : :py:obj:`~.CUprocessState` + Returned CUDA process state + """ + cdef cydriver.CUprocessState state + with nogil: + err = cydriver.cuCheckpointProcessGetState(pid, &state) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUprocessState(state)) + +@cython.embedsignature(True) +def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): + """ Lock a running CUDA process. + + Lock the CUDA process specified by `pid` which will block further CUDA + API calls. Process must be in the RUNNING state in order to lock. + + Upon successful return the process will be in the LOCKED state. + + If timeoutMs is specified and the timeout is reached the process will + be left in the RUNNING state upon return. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + args : :py:obj:`~.CUcheckpointLockArgs` + Optional lock operation arguments + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` :py:obj:`~.CUDA_ERROR_NOT_READY` + """ + 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),) + +@cython.embedsignature(True) +def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpointArgs]): + """ Checkpoint a CUDA process's GPU memory contents. + + Checkpoints a CUDA process specified by `pid` that is in the LOCKED + state. The GPU memory contents will be brought into host memory and all + underlying references will be released. Process must be in the LOCKED + state to checkpoint. + + Upon successful return the process will be in the CHECKPOINTED state. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + args : :py:obj:`~.CUcheckpointCheckpointArgs` + Optional checkpoint operation arguments + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + 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),) + +@cython.embedsignature(True) +def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs]): + """ Restore a CUDA process's GPU memory contents from its last checkpoint. + + Restores a CUDA process specified by `pid` from its last checkpoint. + Process must be in the CHECKPOINTED state to restore. + + Upon successful return the process will be in the LOCKED state. + + CUDA process restore requires persistence mode to be enabled or + :py:obj:`~.cuInit` to have been called before execution. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + args : :py:obj:`~.CUcheckpointRestoreArgs` + Optional restore operation arguments + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuInit` + """ + cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL + with nogil: + err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): + """ Unlock a CUDA process to allow CUDA API calls. + + Unlocks a process specified by `pid` allowing it to resume making CUDA + API calls. Process must be in the LOCKED state. + + Upon successful return the process will be in the RUNNING state. + + Parameters + ---------- + pid : int + The process ID of the CUDA process + args : :py:obj:`~.CUcheckpointUnlockArgs` + Optional unlock operation arguments + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + 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),) + +@cython.embedsignature(True) +def cuProfilerStart(): + """ Enable profiling. + + Enables profile collection by the active profiling tool for the current + context. If profiling is already enabled, then + :py:obj:`~.cuProfilerStart()` has no effect. + + cuProfilerStart and cuProfilerStop APIs are used to programmatically + control the profiling granularity by allowing profiling to be done only + on selective pieces of code. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuProfilerInitialize`, :py:obj:`~.cuProfilerStop`, :py:obj:`~.cudaProfilerStart` + """ + with nogil: + err = cydriver.cuProfilerStart() + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuProfilerStop(): + """ Disable profiling. + + Disables profile collection by the active profiling tool for the + current context. If profiling is already disabled, then + :py:obj:`~.cuProfilerStop()` has no effect. + + cuProfilerStart and cuProfilerStop APIs are used to programmatically + control the profiling granularity by allowing profiling to be done only + on selective pieces of code. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` + + See Also + -------- + :py:obj:`~.cuProfilerInitialize`, :py:obj:`~.cuProfilerStart`, :py:obj:`~.cudaProfilerStop` + """ + with nogil: + err = cydriver.cuProfilerStop() + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphicsEGLRegisterImage(image, unsigned int flags): + """ Registers an EGL image. + + 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 + access the objects have completed before passing control to CUDA. This + may be accomplished by issuing and waiting for glFinish command on all + GLcontexts (for OpenGL and likewise for other APIs). The application + will be also responsible for ensuring that any pending operation on the + registered CUDA resource has completed prior to executing subsequent + commands in other APIs accesing the same memory objects. This can be + accomplished by calling cuCtxSynchronize or cuEventSynchronize + (preferably). + + 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 + this resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY`: Specifies that + CUDA will not write to this resource. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD`: Specifies + that CUDA will not read from this resource and will write over the + entire contents of the resource, so none of the data previously + stored in the resource will be preserved. + + 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 :py:obj:`~.EGLImageKHR` image which can be used to create target + resource. + flags : unsigned int + Map flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + pCudaResource : :py:obj:`~.CUgraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cuGraphicsEGLRegisterImage`, :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsResourceSetMapFlags`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cudaGraphicsEGLRegisterImage` + """ + cdef cydriver.EGLImageKHR cyimage + if image is None: + pimage = 0 + elif isinstance(image, (EGLImageKHR,)): + pimage = int(image) + else: + pimage = int(EGLImageKHR(image)) + cyimage = pimage + cdef CUgraphicsResource pCudaResource = CUgraphicsResource() + with nogil: + err = cydriver.cuGraphicsEGLRegisterImage(pCudaResource._pvt_ptr, cyimage, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCudaResource) + +@cython.embedsignature(True) +def cuEGLStreamConsumerConnect(stream): + """ Connect CUDA to EGLStream as a consumer. + + Connect CUDA as a consumer to :py:obj:`~.EGLStreamKHR` specified by + `stream`. + + 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` + :py:obj:`~.EGLStreamKHR` handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + conn : :py:obj:`~.CUeglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cuEGLStreamConsumerConnect`, :py:obj:`~.cuEGLStreamConsumerDisconnect`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame`, :py:obj:`~.cudaEGLStreamConsumerConnect` + """ + cdef cydriver.EGLStreamKHR cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (EGLStreamKHR,)): + pstream = int(stream) + else: + pstream = int(EGLStreamKHR(stream)) + cystream = pstream + cdef CUeglStreamConnection conn = CUeglStreamConnection() + with nogil: + err = cydriver.cuEGLStreamConsumerConnect(conn._pvt_ptr, cystream) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, conn) + +@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 :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 + :py:obj:`~.CU_EGL_RESOURCE_LOCATION_VIDMEM`. + + Parameters + ---------- + stream : :py:obj:`~.EGLStreamKHR` + :py:obj:`~.EGLStreamKHR` handle + flags : unsigned int + Flags denote intended location - system or video. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + conn : :py:obj:`~.CUeglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cuEGLStreamConsumerConnect`, :py:obj:`~.cuEGLStreamConsumerDisconnect`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame`, :py:obj:`~.cudaEGLStreamConsumerConnectWithFlags` + """ + cdef cydriver.EGLStreamKHR cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (EGLStreamKHR,)): + pstream = int(stream) + else: + pstream = int(EGLStreamKHR(stream)) + cystream = pstream + cdef CUeglStreamConnection conn = CUeglStreamConnection() + with nogil: + err = cydriver.cuEGLStreamConsumerConnectWithFlags(conn._pvt_ptr, cystream, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, conn) + +@cython.embedsignature(True) +def cuEGLStreamConsumerDisconnect(conn): + """ Disconnect CUDA as a consumer to EGLStream . + + Disconnect CUDA as a consumer to :py:obj:`~.EGLStreamKHR`. + + Parameters + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Conection to disconnect. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + + See Also + -------- + :py:obj:`~.cuEGLStreamConsumerConnect`, :py:obj:`~.cuEGLStreamConsumerDisconnect`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame`, :py:obj:`~.cudaEGLStreamConsumerDisconnect` + """ + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cydriver.cuEGLStreamConsumerDisconnect(cyconn) + return (_CUresult(err),) + +@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 :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 + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Connection on which to acquire + pCudaResource : :py:obj:`~.CUgraphicsResource` + CUDA resource on which the stream frame will be mapped for use. + pStream : :py:obj:`~.CUstream` + CUDA stream for synchronization and any data migrations implied by + :py:obj:`~.CUeglResourceLocationFlags`. + timeout : unsigned int + Desired timeout in usec for a new frame to be acquired. If set as + :py:obj:`~.CUDA_EGL_INFINITE_TIMEOUT`, acquire waits infinitely. + After timeout occurs CUDA consumer tries to acquire an old frame if + available and EGL_SUPPORT_REUSE_NV flag is set. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_LAUNCH_TIMEOUT`, + + See Also + -------- + :py:obj:`~.cuEGLStreamConsumerConnect`, :py:obj:`~.cuEGLStreamConsumerDisconnect`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame`, :py:obj:`~.cudaEGLStreamConsumerAcquireFrame` + """ + cdef cydriver.CUstream *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (CUstream,)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cydriver.CUgraphicsResource *cypCudaResource + if pCudaResource is None: + cypCudaResource = NULL + elif isinstance(pCudaResource, (CUgraphicsResource,)): + ppCudaResource = pCudaResource.getPtr() + cypCudaResource = ppCudaResource + elif isinstance(pCudaResource, (int)): + cypCudaResource = pCudaResource + else: + raise TypeError("Argument 'pCudaResource' is not instance of type (expected , found " + str(type(pCudaResource))) + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cydriver.cuEGLStreamConsumerAcquireFrame(cyconn, cypCudaResource, cypStream, timeout) + return (_CUresult(err),) + +@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 + :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 + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Connection on which to release + pCudaResource : :py:obj:`~.CUgraphicsResource` + CUDA resource whose corresponding frame is to be released + pStream : :py:obj:`~.CUstream` + CUDA stream on which release will be done. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, + + See Also + -------- + :py:obj:`~.cuEGLStreamConsumerConnect`, :py:obj:`~.cuEGLStreamConsumerDisconnect`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame`, :py:obj:`~.cudaEGLStreamConsumerReleaseFrame` + """ + cdef cydriver.CUstream *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (CUstream,)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cydriver.CUgraphicsResource cypCudaResource + if pCudaResource is None: + ppCudaResource = 0 + elif isinstance(pCudaResource, (CUgraphicsResource,)): + ppCudaResource = int(pCudaResource) + else: + ppCudaResource = int(CUgraphicsResource(pCudaResource)) + cypCudaResource = ppCudaResource + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cydriver.cuEGLStreamConsumerReleaseFrame(cyconn, cypCudaResource, cypStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEGLStreamProducerConnect(stream, width, height): + """ Connect CUDA to EGLStream as a producer. + + Connect CUDA as a producer to :py:obj:`~.EGLStreamKHR` specified by + `stream`. + + 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` + :py:obj:`~.EGLStreamKHR` handle + width : :py:obj:`~.EGLint` + width of the image to be submitted to the stream + height : :py:obj:`~.EGLint` + height of the image to be submitted to the stream + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + conn : :py:obj:`~.CUeglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cuEGLStreamProducerConnect`, :py:obj:`~.cuEGLStreamProducerDisconnect`, :py:obj:`~.cuEGLStreamProducerPresentFrame`, :py:obj:`~.cudaEGLStreamProducerConnect` + """ + cdef cydriver.EGLint cyheight + if height is None: + pheight = 0 + elif isinstance(height, (EGLint,)): + pheight = int(height) + else: + pheight = int(EGLint(height)) + cyheight = pheight + cdef cydriver.EGLint cywidth + if width is None: + pwidth = 0 + elif isinstance(width, (EGLint,)): + pwidth = int(width) + else: + pwidth = int(EGLint(width)) + cywidth = pwidth + cdef cydriver.EGLStreamKHR cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (EGLStreamKHR,)): + pstream = int(stream) + else: + pstream = int(EGLStreamKHR(stream)) + cystream = pstream + cdef CUeglStreamConnection conn = CUeglStreamConnection() + with nogil: + err = cydriver.cuEGLStreamProducerConnect(conn._pvt_ptr, cystream, cywidth, cyheight) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, conn) + +@cython.embedsignature(True) +def cuEGLStreamProducerDisconnect(conn): + """ Disconnect CUDA as a producer to EGLStream . + + Disconnect CUDA as a producer to :py:obj:`~.EGLStreamKHR`. + + Parameters + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Conection to disconnect. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + + See Also + -------- + :py:obj:`~.cuEGLStreamProducerConnect`, :py:obj:`~.cuEGLStreamProducerDisconnect`, :py:obj:`~.cuEGLStreamProducerPresentFrame`, :py:obj:`~.cudaEGLStreamProducerDisconnect` + """ + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cydriver.cuEGLStreamProducerDisconnect(cyconn) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEGLStreamProducerPresentFrame(conn, eglframe not None : CUeglFrame, pStream): + """ Present a CUDA eglFrame to the EGLStream with CUDA as a producer. + + When a frame is presented by the producer, it gets associated with the + EGLStream and thus it is illegal to free the frame before the producer + is disconnected. If a frame is freed and reused it may lead to + undefined behavior. + + If producer and consumer are on different GPUs (iGPU and dGPU) then + frametype :py:obj:`~.CU_EGL_FRAME_TYPE_ARRAY` is not supported. + :py:obj:`~.CU_EGL_FRAME_TYPE_PITCH` can be used for such cross-device + applications. + + The :py:obj:`~.CUeglFrame` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + For :py:obj:`~.CUeglFrame` of type :py:obj:`~.CU_EGL_FRAME_TYPE_PITCH`, + the application may present sub-region of a memory allocation. In that + case, the pitched pointer will specify the start address of the sub- + region in the allocation and corresponding :py:obj:`~.CUeglFrame` + fields will specify the dimensions of the sub-region. + + Parameters + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Connection on which to present the CUDA array + eglframe : :py:obj:`~.CUeglFrame` + CUDA Eglstream Proucer Frame handle to be sent to the consumer over + EglStream. + pStream : :py:obj:`~.CUstream` + CUDA stream on which to present the frame. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, + + See Also + -------- + :py:obj:`~.cuEGLStreamProducerConnect`, :py:obj:`~.cuEGLStreamProducerDisconnect`, :py:obj:`~.cuEGLStreamProducerReturnFrame`, :py:obj:`~.cudaEGLStreamProducerPresentFrame` + """ + cdef cydriver.CUstream *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (CUstream,)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cydriver.cuEGLStreamProducerPresentFrame(cyconn, eglframe._pvt_ptr[0], cypStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuEGLStreamProducerReturnFrame(conn, eglframe : Optional[CUeglFrame], pStream): + """ Return the CUDA eglFrame to the EGLStream released by the consumer. + + This API can potentially return CUDA_ERROR_LAUNCH_TIMEOUT if the + consumer has not returned a frame to EGL stream. If timeout is returned + the application can retry. + + Parameters + ---------- + conn : :py:obj:`~.CUeglStreamConnection` + Connection on which to return + eglframe : :py:obj:`~.CUeglFrame` + CUDA Eglstream Proucer Frame handle returned from the consumer over + EglStream. + pStream : :py:obj:`~.CUstream` + CUDA stream on which to return the frame. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_LAUNCH_TIMEOUT` + + See Also + -------- + :py:obj:`~.cuEGLStreamProducerConnect`, :py:obj:`~.cuEGLStreamProducerDisconnect`, :py:obj:`~.cuEGLStreamProducerPresentFrame`, :py:obj:`~.cudaEGLStreamProducerReturnFrame` + """ + cdef cydriver.CUstream *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (CUstream,)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cydriver.CUeglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (CUeglStreamConnection,)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + 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 + with nogil: + err = cydriver.cuEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned int mipLevel): + """ Get an eglFrame through which to access a registered EGL graphics resource. + + Returns in `*eglFrame` an eglFrame pointer through which the registered + graphics resource `resource` may be accessed. This API can only be + called for registered EGL graphics resources. + + The :py:obj:`~.CUeglFrame` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If `resource` is not registered then :py:obj:`~.CUDA_ERROR_NOT_MAPPED` + is returned. + + Parameters + ---------- + resource : :py:obj:`~.CUgraphicsResource` + None + index : unsigned int + None + mipLevel : unsigned int + None + + Returns + ------- + CUresult + + eglFrame : :py:obj:`~.CUeglFrame` + None + """ + cdef cydriver.CUgraphicsResource cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (CUgraphicsResource,)): + presource = int(resource) + else: + presource = int(CUgraphicsResource(resource)) + cyresource = presource + cdef CUeglFrame eglFrame = CUeglFrame() + with nogil: + err = cydriver.cuGraphicsResourceGetMappedEglFrame(eglFrame._pvt_ptr, cyresource, index, mipLevel) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, eglFrame) + +@cython.embedsignature(True) +def cuEventCreateFromEGLSync(eglSync, unsigned int flags): + """ Creates an event from EGLSync object. + + 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. + + - :py:obj:`~.CU_EVENT_BLOCKING_SYNC`: Specifies that the created event + should use blocking synchronization. A CPU thread that uses + :py:obj:`~.cuEventSynchronize()` to wait on an event created with + this flag will block until the event has actually been completed. + + Once the `eglSync` gets destroyed, :py:obj:`~.cuEventDestroy` is the + only API that can be invoked on the event. + + :py:obj:`~.cuEventRecord` and TimingData are not supported for events + created from EGLSync. + + The :py:obj:`~.EGLSyncKHR` is an opaque handle to an EGL sync object. + typedef void* :py:obj:`~.EGLSyncKHR` + + Parameters + ---------- + eglSync : :py:obj:`~.EGLSyncKHR` + Opaque handle to EGLSync object + flags : unsigned int + Event creation flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + phEvent : :py:obj:`~.CUevent` + Returns newly created event + + See Also + -------- + :py:obj:`~.cuEventQuery`, :py:obj:`~.cuEventSynchronize`, :py:obj:`~.cuEventDestroy` + """ + cdef cydriver.EGLSyncKHR cyeglSync + if eglSync is None: + peglSync = 0 + elif isinstance(eglSync, (EGLSyncKHR,)): + peglSync = int(eglSync) + else: + peglSync = int(EGLSyncKHR(eglSync)) + cyeglSync = peglSync + cdef CUevent phEvent = CUevent() + with nogil: + err = cydriver.cuEventCreateFromEGLSync(phEvent._pvt_ptr, cyeglSync, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phEvent) + +@cython.embedsignature(True) +def cuGraphicsGLRegisterBuffer(buffer, unsigned int Flags): + """ Registers an OpenGL buffer object. + + Registers the buffer object specified by `buffer` for access by CUDA. A + handle to the registered object is returned as `pCudaResource`. The + register flags `Flags` specify the intended usage, as follows: + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_NONE`: Specifies no hints about + how this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY`: Specifies that CUDA + will not write to this resource. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD`: Specifies that + CUDA will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + Parameters + ---------- + buffer : :py:obj:`~.GLuint` + name of buffer object to be registered + Flags : unsigned int + Register flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_OPERATING_SYSTEM` + pCudaResource : :py:obj:`~.CUgraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsResourceGetMappedPointer`, :py:obj:`~.cudaGraphicsGLRegisterBuffer` + """ + cdef cydriver.GLuint cybuffer + if buffer is None: + pbuffer = 0 + elif isinstance(buffer, (GLuint,)): + pbuffer = int(buffer) + else: + pbuffer = int(GLuint(buffer)) + cybuffer = pbuffer + cdef CUgraphicsResource pCudaResource = CUgraphicsResource() + with nogil: + err = cydriver.cuGraphicsGLRegisterBuffer(pCudaResource._pvt_ptr, cybuffer, Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCudaResource) + +@cython.embedsignature(True) +def cuGraphicsGLRegisterImage(image, target, unsigned int Flags): + """ Register an OpenGL texture or renderbuffer object. + + Registers the texture or renderbuffer object specified by `image` for + access by CUDA. A handle to the registered object is returned as + `pCudaResource`. + + `target` must match the type of the object, and must be one of + :py:obj:`~.GL_TEXTURE_2D`, :py:obj:`~.GL_TEXTURE_RECTANGLE`, + :py:obj:`~.GL_TEXTURE_CUBE_MAP`, :py:obj:`~.GL_TEXTURE_3D`, + :py:obj:`~.GL_TEXTURE_2D_ARRAY`, or :py:obj:`~.GL_RENDERBUFFER`. + + The register flags `Flags` specify the intended usage, as follows: + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_NONE`: Specifies no hints about + how this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY`: Specifies that CUDA + will not write to this resource. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD`: Specifies that + CUDA will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST`: Specifies that + CUDA will bind this resource to a surface reference. + + - :py:obj:`~.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER`: Specifies that + CUDA will perform texture gather operations on this resource. + + The following image formats are supported. For brevity's sake, the list + is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would expand to the + following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16} : + + - GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, + GL_INTENSITY + + - {GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, + 32I} + + - {GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, + 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, + 32I_EXT} + + The following image classes are currently disallowed: + + - Textures with borders + + - Multisampled renderbuffers + + Parameters + ---------- + image : :py:obj:`~.GLuint` + name of texture or renderbuffer object to be registered + target : :py:obj:`~.GLenum` + Identifies the type of object specified by `image` + Flags : unsigned int + Register flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_OPERATING_SYSTEM` + pCudaResource : :py:obj:`~.CUgraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cudaGraphicsGLRegisterImage` + """ + cdef cydriver.GLenum cytarget + if target is None: + ptarget = 0 + elif isinstance(target, (GLenum,)): + ptarget = int(target) + else: + ptarget = int(GLenum(target)) + cytarget = ptarget + cdef cydriver.GLuint cyimage + if image is None: + pimage = 0 + elif isinstance(image, (GLuint,)): + pimage = int(image) + else: + pimage = int(GLuint(image)) + cyimage = pimage + cdef CUgraphicsResource pCudaResource = CUgraphicsResource() + with nogil: + err = cydriver.cuGraphicsGLRegisterImage(pCudaResource._pvt_ptr, cyimage, cytarget, Flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCudaResource) + +@cython.embedsignature(True) +def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDeviceList): + """ Gets the CUDA devices associated with the current OpenGL context. + + Returns in `*pCudaDeviceCount` the number of CUDA-compatible devices + corresponding to the current OpenGL context. Also returns in + `*pCudaDevices` at most cudaDeviceCount of the CUDA-compatible devices + corresponding to the current OpenGL context. If any of the GPUs being + used by the current OpenGL context are not CUDA capable then the call + will return CUDA_ERROR_NO_DEVICE. + + The `deviceList` argument may be any of the following: + CU_GL_DEVICE_LIST_ALL: Query all devices used by the current OpenGL + context. CU_GL_DEVICE_LIST_CURRENT_FRAME: Query the devices used by the + current OpenGL context to render the current frame (in SLI). + CU_GL_DEVICE_LIST_NEXT_FRAME: Query the devices used by the current + OpenGL context to render the next frame (in SLI). Note that this is a + prediction, it can't be guaranteed that this is correct in all cases. + + Parameters + ---------- + cudaDeviceCount : unsigned int + The size of the output device array pCudaDevices. + deviceList : CUGLDeviceList + The set of devices to return. + + Returns + ------- + CUresult + CUDA_SUCCESS + CUDA_ERROR_NO_DEVICE + CUDA_ERROR_INVALID_VALUE + CUDA_ERROR_INVALID_CONTEXT + CUDA_ERROR_INVALID_GRAPHICS_CONTEXT + pCudaDeviceCount : unsigned int + Returned number of CUDA devices. + pCudaDevices : list[CUdevice] + Returned CUDA devices. + + See Also + -------- + ~.cudaGLGetDevices + + Notes + ----- + This function is not supported on Mac OS X. + + """ + cdef unsigned int pCudaDeviceCount = 0 + cdef cydriver.CUdevice* cypCudaDevices = NULL + pypCudaDevices = [] + if cudaDeviceCount != 0: + cypCudaDevices = calloc(cudaDeviceCount, sizeof(cydriver.CUdevice)) + if cypCudaDevices is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(cudaDeviceCount) + 'x' + str(sizeof(cydriver.CUdevice))) + cdef cydriver.CUGLDeviceList cydeviceList = int(deviceList) + with nogil: + err = cydriver.cuGLGetDevices(&pCudaDeviceCount, cypCudaDevices, cudaDeviceCount, cydeviceList) + if CUresult(err) == CUresult(0): + pypCudaDevices = [CUdevice(init_value=cypCudaDevices[idx]) for idx in range(cudaDeviceCount)] + if cypCudaDevices is not NULL: + free(cypCudaDevices) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pCudaDeviceCount, pypCudaDevices) + +@cython.embedsignature(True) +def cuVDPAUGetDevice(vdpDevice, vdpGetProcAddress): + """ Gets the CUDA device associated with a VDPAU device. + + Returns in `*pDevice` the CUDA device associated with a `vdpDevice`, if + applicable. + + Parameters + ---------- + vdpDevice : :py:obj:`~.VdpDevice` + A :py:obj:`~.VdpDevice` handle + vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` + VDPAU's :py:obj:`~.VdpGetProcAddress` function pointer + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + pDevice : :py:obj:`~.CUdevice` + Device associated with vdpDevice + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuVDPAUCtxCreate`, :py:obj:`~.cuGraphicsVDPAURegisterVideoSurface`, :py:obj:`~.cuGraphicsVDPAURegisterOutputSurface`, :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsResourceSetMapFlags`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cudaVDPAUGetDevice` + """ + cdef cydriver.VdpGetProcAddress *cyvdpGetProcAddress + if vdpGetProcAddress is None: + cyvdpGetProcAddress = NULL + elif isinstance(vdpGetProcAddress, (VdpGetProcAddress,)): + pvdpGetProcAddress = vdpGetProcAddress.getPtr() + cyvdpGetProcAddress = pvdpGetProcAddress + elif isinstance(vdpGetProcAddress, (int)): + cyvdpGetProcAddress = vdpGetProcAddress + else: + raise TypeError("Argument 'vdpGetProcAddress' is not instance of type (expected , found " + str(type(vdpGetProcAddress))) + cdef cydriver.VdpDevice cyvdpDevice + if vdpDevice is None: + pvdpDevice = 0 + elif isinstance(vdpDevice, (VdpDevice,)): + pvdpDevice = int(vdpDevice) + else: + pvdpDevice = int(VdpDevice(vdpDevice)) + cyvdpDevice = pvdpDevice + cdef CUdevice pDevice = CUdevice() + with nogil: + err = cydriver.cuVDPAUGetDevice(pDevice._pvt_ptr, cyvdpDevice, cyvdpGetProcAddress) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pDevice) + +@cython.embedsignature(True) +def cuVDPAUCtxCreate(unsigned int flags, device, vdpDevice, vdpGetProcAddress): + """ Create a CUDA context for interoperability with VDPAU. + + Creates a new CUDA context, initializes VDPAU interoperability, and + associates the CUDA context with the calling thread. It must be called + before performing any other VDPAU interoperability operations. It may + fail if the needed VDPAU driver facilities are not available. For usage + of the `flags` parameter, see :py:obj:`~.cuCtxCreate()`. + + Parameters + ---------- + flags : unsigned int + Options for CUDA context creation + device : :py:obj:`~.CUdevice` + Device on which to create the context + vdpDevice : :py:obj:`~.VdpDevice` + The :py:obj:`~.VdpDevice` to interop with + vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` + VDPAU's :py:obj:`~.VdpGetProcAddress` function pointer + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + pCtx : :py:obj:`~.CUcontext` + Returned CUDA context + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuGraphicsVDPAURegisterVideoSurface`, :py:obj:`~.cuGraphicsVDPAURegisterOutputSurface`, :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsResourceSetMapFlags`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuVDPAUGetDevice` + """ + cdef cydriver.VdpGetProcAddress *cyvdpGetProcAddress + if vdpGetProcAddress is None: + cyvdpGetProcAddress = NULL + elif isinstance(vdpGetProcAddress, (VdpGetProcAddress,)): + pvdpGetProcAddress = vdpGetProcAddress.getPtr() + cyvdpGetProcAddress = pvdpGetProcAddress + elif isinstance(vdpGetProcAddress, (int)): + cyvdpGetProcAddress = vdpGetProcAddress + else: + raise TypeError("Argument 'vdpGetProcAddress' is not instance of type (expected , found " + str(type(vdpGetProcAddress))) + cdef cydriver.VdpDevice cyvdpDevice + if vdpDevice is None: + pvdpDevice = 0 + elif isinstance(vdpDevice, (VdpDevice,)): + pvdpDevice = int(vdpDevice) + else: + pvdpDevice = int(VdpDevice(vdpDevice)) + cyvdpDevice = pvdpDevice + cdef cydriver.CUdevice cydevice + if device is None: + pdevice = 0 + elif isinstance(device, (CUdevice,)): + pdevice = int(device) + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + cdef CUcontext pCtx = CUcontext() + with nogil: + err = cydriver.cuVDPAUCtxCreate(pCtx._pvt_ptr, flags, cydevice, cyvdpDevice, cyvdpGetProcAddress) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCtx) + +@cython.embedsignature(True) +def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): + """ Registers a VDPAU :py:obj:`~.VdpVideoSurface` object. + + 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 + this resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY`: Specifies that + CUDA will not write to this resource. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD`: Specifies + that CUDA will not read from this resource and will write over the + entire contents of the resource, so none of the data previously + stored in the resource will be preserved. + + 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. + + Parameters + ---------- + vdpSurface : :py:obj:`~.VdpVideoSurface` + The :py:obj:`~.VdpVideoSurface` to be registered + flags : unsigned int + Map flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + pCudaResource : :py:obj:`~.CUgraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuVDPAUCtxCreate`, :py:obj:`~.cuGraphicsVDPAURegisterOutputSurface`, :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsResourceSetMapFlags`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuVDPAUGetDevice`, :py:obj:`~.cudaGraphicsVDPAURegisterVideoSurface` + """ + cdef cydriver.VdpVideoSurface cyvdpSurface + if vdpSurface is None: + pvdpSurface = 0 + elif isinstance(vdpSurface, (VdpVideoSurface,)): + pvdpSurface = int(vdpSurface) + else: + pvdpSurface = int(VdpVideoSurface(vdpSurface)) + cyvdpSurface = pvdpSurface + cdef CUgraphicsResource pCudaResource = CUgraphicsResource() + with nogil: + err = cydriver.cuGraphicsVDPAURegisterVideoSurface(pCudaResource._pvt_ptr, cyvdpSurface, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCudaResource) + +@cython.embedsignature(True) +def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): + """ Registers a VDPAU :py:obj:`~.VdpOutputSurface` object. + + 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 + this resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY`: Specifies that + CUDA will not write to this resource. + + - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD`: Specifies + that CUDA will not read from this resource and will write over the + entire contents of the resource, so none of the data previously + stored in the resource will be preserved. + + 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. + + Parameters + ---------- + vdpSurface : :py:obj:`~.VdpOutputSurface` + The :py:obj:`~.VdpOutputSurface` to be registered + flags : unsigned int + Map flags + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, + pCudaResource : :py:obj:`~.CUgraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuVDPAUCtxCreate`, :py:obj:`~.cuGraphicsVDPAURegisterVideoSurface`, :py:obj:`~.cuGraphicsUnregisterResource`, :py:obj:`~.cuGraphicsResourceSetMapFlags`, :py:obj:`~.cuGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuVDPAUGetDevice`, :py:obj:`~.cudaGraphicsVDPAURegisterOutputSurface` + """ + cdef cydriver.VdpOutputSurface cyvdpSurface + if vdpSurface is None: + pvdpSurface = 0 + elif isinstance(vdpSurface, (VdpOutputSurface,)): + pvdpSurface = int(vdpSurface) + else: + pvdpSurface = int(VdpOutputSurface(vdpSurface)) + cyvdpSurface = pvdpSurface + cdef CUgraphicsResource pCudaResource = CUgraphicsResource() + with nogil: + err = cydriver.cuGraphicsVDPAURegisterOutputSurface(pCudaResource._pvt_ptr, cyvdpSurface, flags) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, pCudaResource) + +cdef class cudaBindingsDriverGlobal: + cdef map[void_ptr, void*] _allocated + + def __dealloc__(self): + for item in self._allocated: + free(item.second) + self._allocated.clear() + +cdef cudaBindingsDriverGlobal m_global = cudaBindingsDriverGlobal() + +@cython.embedsignature(True) +def sizeof(objType): + """ Returns the size of provided CUDA Python structure in bytes + + Parameters + ---------- + objType : Any + CUDA Python object + + Returns + ------- + lowered_name : int + The size of `objType` in bytes + """ + + if objType == cuuint32_t: + return sizeof(cydriver.cuuint32_t) + + if objType == cuuint64_t: + return sizeof(cydriver.cuuint64_t) + + if objType == CUdeviceptr_v2: + return sizeof(cydriver.CUdeviceptr_v2) + + if objType == CUdeviceptr: + return sizeof(cydriver.CUdeviceptr) + + if objType == CUdevice_v1: + return sizeof(cydriver.CUdevice_v1) + + if objType == CUdevice: + return sizeof(cydriver.CUdevice) + + if objType == CUcontext: + return sizeof(cydriver.CUcontext) + + if objType == CUmodule: + return sizeof(cydriver.CUmodule) + + if objType == CUfunction: + return sizeof(cydriver.CUfunction) + + if objType == CUlibrary: + return sizeof(cydriver.CUlibrary) + + if objType == CUkernel: + return sizeof(cydriver.CUkernel) + + if objType == CUarray: + return sizeof(cydriver.CUarray) + + if objType == CUmipmappedArray: + return sizeof(cydriver.CUmipmappedArray) + + if objType == CUtexref: + return sizeof(cydriver.CUtexref) + + if objType == CUsurfref: + return sizeof(cydriver.CUsurfref) + + if objType == CUevent: + return sizeof(cydriver.CUevent) + + if objType == CUstream: + return sizeof(cydriver.CUstream) + + if objType == CUgraphicsResource: + return sizeof(cydriver.CUgraphicsResource) + + if objType == CUtexObject_v1: + return sizeof(cydriver.CUtexObject_v1) + + if objType == CUtexObject: + return sizeof(cydriver.CUtexObject) + + if objType == CUsurfObject_v1: + return sizeof(cydriver.CUsurfObject_v1) + + if objType == CUsurfObject: + return sizeof(cydriver.CUsurfObject) + + if objType == CUexternalMemory: + return sizeof(cydriver.CUexternalMemory) + + if objType == CUexternalSemaphore: + return sizeof(cydriver.CUexternalSemaphore) + + if objType == CUgraph: + return sizeof(cydriver.CUgraph) + + if objType == CUgraphNode: + return sizeof(cydriver.CUgraphNode) + + if objType == CUgraphExec: + return sizeof(cydriver.CUgraphExec) + + if objType == CUmemoryPool: + return sizeof(cydriver.CUmemoryPool) + + if objType == CUuserObject: + return sizeof(cydriver.CUuserObject) + + if objType == CUgraphConditionalHandle: + return sizeof(cydriver.CUgraphConditionalHandle) + + if objType == CUgraphDeviceNode: + return sizeof(cydriver.CUgraphDeviceNode) + + if objType == CUasyncCallbackHandle: + return sizeof(cydriver.CUasyncCallbackHandle) + + if objType == CUgreenCtx: + return sizeof(cydriver.CUgreenCtx) + + if objType == CUuuid_st: + return sizeof(cydriver.CUuuid_st) + + if objType == CUuuid: + return sizeof(cydriver.CUuuid) + + if objType == CUmemFabricHandle_st: + return sizeof(cydriver.CUmemFabricHandle_st) + + if objType == CUmemFabricHandle_v1: + return sizeof(cydriver.CUmemFabricHandle_v1) + + if objType == CUmemFabricHandle: + return sizeof(cydriver.CUmemFabricHandle) + + if objType == CUipcEventHandle_st: + return sizeof(cydriver.CUipcEventHandle_st) + + if objType == CUipcEventHandle_v1: + return sizeof(cydriver.CUipcEventHandle_v1) + + if objType == CUipcEventHandle: + return sizeof(cydriver.CUipcEventHandle) + + if objType == CUipcMemHandle_st: + return sizeof(cydriver.CUipcMemHandle_st) + + if objType == CUipcMemHandle_v1: + return sizeof(cydriver.CUipcMemHandle_v1) + + if objType == CUipcMemHandle: + return sizeof(cydriver.CUipcMemHandle) + + if objType == CUstreamBatchMemOpParams_union: + return sizeof(cydriver.CUstreamBatchMemOpParams_union) + + if objType == CUstreamBatchMemOpParams_v1: + return sizeof(cydriver.CUstreamBatchMemOpParams_v1) + + if objType == CUstreamBatchMemOpParams: + 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) + + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v1: + 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) + + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + 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) + + if objType == CUasyncNotificationInfo_st: + return sizeof(cydriver.CUasyncNotificationInfo_st) + + if objType == CUasyncNotificationInfo: + return sizeof(cydriver.CUasyncNotificationInfo) + + if objType == CUasyncCallback: + return sizeof(cydriver.CUasyncCallback) + + if objType == CUdevprop_st: + return sizeof(cydriver.CUdevprop_st) + + if objType == CUdevprop_v1: + return sizeof(cydriver.CUdevprop_v1) + + if objType == CUdevprop: + return sizeof(cydriver.CUdevprop) + + if objType == CUlinkState: + return sizeof(cydriver.CUlinkState) + + if objType == CUhostFn: + return sizeof(cydriver.CUhostFn) + + if objType == CUaccessPolicyWindow_st: + return sizeof(cydriver.CUaccessPolicyWindow_st) + + if objType == CUaccessPolicyWindow_v1: + return sizeof(cydriver.CUaccessPolicyWindow_v1) + + if objType == CUaccessPolicyWindow: + return sizeof(cydriver.CUaccessPolicyWindow) + + if objType == CUDA_KERNEL_NODE_PARAMS_st: + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_st) + + if objType == CUDA_KERNEL_NODE_PARAMS_v1: + 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) + + if objType == CUDA_KERNEL_NODE_PARAMS_v2: + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v2) + + if objType == CUDA_KERNEL_NODE_PARAMS: + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS) + + if objType == CUDA_KERNEL_NODE_PARAMS_v3_st: + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st) + + if objType == CUDA_KERNEL_NODE_PARAMS_v3: + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3) + + if objType == CUDA_MEMSET_NODE_PARAMS_st: + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_st) + + if objType == CUDA_MEMSET_NODE_PARAMS_v1: + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v1) + + if objType == CUDA_MEMSET_NODE_PARAMS: + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS) + + if objType == CUDA_MEMSET_NODE_PARAMS_v2_st: + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st) + + if objType == CUDA_MEMSET_NODE_PARAMS_v2: + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2) + + if objType == CUDA_HOST_NODE_PARAMS_st: + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_st) + + if objType == CUDA_HOST_NODE_PARAMS_v1: + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v1) + + if objType == CUDA_HOST_NODE_PARAMS: + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS) + + if objType == CUDA_HOST_NODE_PARAMS_v2_st: + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2_st) + + if objType == CUDA_HOST_NODE_PARAMS_v2: + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2) + + if objType == CUDA_CONDITIONAL_NODE_PARAMS: + return sizeof(cydriver.CUDA_CONDITIONAL_NODE_PARAMS) + + if objType == CUgraphEdgeData_st: + return sizeof(cydriver.CUgraphEdgeData_st) + + if objType == CUgraphEdgeData: + return sizeof(cydriver.CUgraphEdgeData) + + if objType == CUDA_GRAPH_INSTANTIATE_PARAMS_st: + return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st) + + if objType == CUDA_GRAPH_INSTANTIATE_PARAMS: + return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS) + + if objType == CUlaunchMemSyncDomainMap_st: + return sizeof(cydriver.CUlaunchMemSyncDomainMap_st) + + if objType == CUlaunchMemSyncDomainMap: + return sizeof(cydriver.CUlaunchMemSyncDomainMap) + + if objType == CUlaunchAttributeValue_union: + return sizeof(cydriver.CUlaunchAttributeValue_union) + + if objType == CUlaunchAttributeValue: + return sizeof(cydriver.CUlaunchAttributeValue) + + if objType == CUlaunchAttribute_st: + return sizeof(cydriver.CUlaunchAttribute_st) + + if objType == CUlaunchAttribute: + return sizeof(cydriver.CUlaunchAttribute) + + if objType == CUlaunchConfig_st: + return sizeof(cydriver.CUlaunchConfig_st) + + if objType == CUlaunchConfig: + return sizeof(cydriver.CUlaunchConfig) + + if objType == CUkernelNodeAttrValue_v1: + return sizeof(cydriver.CUkernelNodeAttrValue_v1) + + if objType == CUkernelNodeAttrValue: + return sizeof(cydriver.CUkernelNodeAttrValue) + + if objType == CUstreamAttrValue_v1: + return sizeof(cydriver.CUstreamAttrValue_v1) + + if objType == CUstreamAttrValue: + return sizeof(cydriver.CUstreamAttrValue) + + if objType == CUexecAffinitySmCount_st: + return sizeof(cydriver.CUexecAffinitySmCount_st) + + if objType == CUexecAffinitySmCount_v1: + return sizeof(cydriver.CUexecAffinitySmCount_v1) + + if objType == CUexecAffinitySmCount: + return sizeof(cydriver.CUexecAffinitySmCount) + + if objType == CUexecAffinityParam_st: + return sizeof(cydriver.CUexecAffinityParam_st) + + if objType == CUexecAffinityParam_v1: + return sizeof(cydriver.CUexecAffinityParam_v1) + + if objType == CUexecAffinityParam: + return sizeof(cydriver.CUexecAffinityParam) + + if objType == CUctxCigParam_st: + return sizeof(cydriver.CUctxCigParam_st) + + if objType == CUctxCigParam: + return sizeof(cydriver.CUctxCigParam) + + if objType == CUctxCreateParams_st: + return sizeof(cydriver.CUctxCreateParams_st) + + if objType == CUctxCreateParams: + return sizeof(cydriver.CUctxCreateParams) + + if objType == CUlibraryHostUniversalFunctionAndDataTable_st: + return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable_st) + + if objType == CUlibraryHostUniversalFunctionAndDataTable: + return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable) + + if objType == CUstreamCallback: + return sizeof(cydriver.CUstreamCallback) + + if objType == CUoccupancyB2DSize: + return sizeof(cydriver.CUoccupancyB2DSize) + + if objType == CUDA_MEMCPY2D_st: + return sizeof(cydriver.CUDA_MEMCPY2D_st) + + if objType == CUDA_MEMCPY2D_v2: + return sizeof(cydriver.CUDA_MEMCPY2D_v2) + + if objType == CUDA_MEMCPY2D: + return sizeof(cydriver.CUDA_MEMCPY2D) + + if objType == CUDA_MEMCPY3D_st: + return sizeof(cydriver.CUDA_MEMCPY3D_st) + + if objType == CUDA_MEMCPY3D_v2: + return sizeof(cydriver.CUDA_MEMCPY3D_v2) + + if objType == CUDA_MEMCPY3D: + return sizeof(cydriver.CUDA_MEMCPY3D) + + if objType == CUDA_MEMCPY3D_PEER_st: + return sizeof(cydriver.CUDA_MEMCPY3D_PEER_st) + + if objType == CUDA_MEMCPY3D_PEER_v1: + return sizeof(cydriver.CUDA_MEMCPY3D_PEER_v1) + + if objType == CUDA_MEMCPY3D_PEER: + return sizeof(cydriver.CUDA_MEMCPY3D_PEER) + + if objType == CUDA_MEMCPY_NODE_PARAMS_st: + return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS_st) + + if objType == CUDA_MEMCPY_NODE_PARAMS: + return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS) + + if objType == CUDA_ARRAY_DESCRIPTOR_st: + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_st) + + if objType == CUDA_ARRAY_DESCRIPTOR_v2: + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_v2) + + if objType == CUDA_ARRAY_DESCRIPTOR: + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR) + + if objType == CUDA_ARRAY3D_DESCRIPTOR_st: + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_st) + + if objType == CUDA_ARRAY3D_DESCRIPTOR_v2: + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2) + + if objType == CUDA_ARRAY3D_DESCRIPTOR: + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR) + + if objType == CUDA_ARRAY_SPARSE_PROPERTIES_st: + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st) + + if objType == CUDA_ARRAY_SPARSE_PROPERTIES_v1: + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_v1) + + if objType == CUDA_ARRAY_SPARSE_PROPERTIES: + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES) + + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st) + + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS_v1: + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_v1) + + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS: + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS) + + if objType == CUDA_RESOURCE_DESC_st: + return sizeof(cydriver.CUDA_RESOURCE_DESC_st) + + if objType == CUDA_RESOURCE_DESC_v1: + return sizeof(cydriver.CUDA_RESOURCE_DESC_v1) + + if objType == CUDA_RESOURCE_DESC: + return sizeof(cydriver.CUDA_RESOURCE_DESC) + + if objType == CUDA_TEXTURE_DESC_st: + return sizeof(cydriver.CUDA_TEXTURE_DESC_st) + + if objType == CUDA_TEXTURE_DESC_v1: + return sizeof(cydriver.CUDA_TEXTURE_DESC_v1) + + if objType == CUDA_TEXTURE_DESC: + return sizeof(cydriver.CUDA_TEXTURE_DESC) + + if objType == CUDA_RESOURCE_VIEW_DESC_st: + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_st) + + if objType == CUDA_RESOURCE_VIEW_DESC_v1: + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_v1) + + if objType == CUDA_RESOURCE_VIEW_DESC: + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC) + + if objType == CUtensorMap_st: + return sizeof(cydriver.CUtensorMap_st) + + if objType == CUtensorMap: + return sizeof(cydriver.CUtensorMap) + + if objType == CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + 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) + + if objType == CUDA_POINTER_ATTRIBUTE_P2P_TOKENS: + return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS) + + if objType == CUDA_LAUNCH_PARAMS_st: + return sizeof(cydriver.CUDA_LAUNCH_PARAMS_st) + + if objType == CUDA_LAUNCH_PARAMS_v1: + return sizeof(cydriver.CUDA_LAUNCH_PARAMS_v1) + + if objType == CUDA_LAUNCH_PARAMS: + return sizeof(cydriver.CUDA_LAUNCH_PARAMS) + + if objType == CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + 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) + + if objType == CUDA_EXTERNAL_MEMORY_HANDLE_DESC: + 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) + + if objType == CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1: + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) + + if objType == CUDA_EXTERNAL_MEMORY_BUFFER_DESC: + 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) + + if objType == CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1: + 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) + + if objType == CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + 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) + + if objType == CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC: + 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) + + if objType == CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1: + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1) + + if objType == CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS: + 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) + + if objType == CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1: + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1) + + if objType == CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS: + 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) + + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1: + 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) + + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + 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) + + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + 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) + + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS: + 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) + + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2: + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2) + + if objType == CUmemGenericAllocationHandle_v1: + return sizeof(cydriver.CUmemGenericAllocationHandle_v1) + + if objType == CUmemGenericAllocationHandle: + return sizeof(cydriver.CUmemGenericAllocationHandle) + + if objType == CUarrayMapInfo_st: + return sizeof(cydriver.CUarrayMapInfo_st) + + if objType == CUarrayMapInfo_v1: + return sizeof(cydriver.CUarrayMapInfo_v1) + + if objType == CUarrayMapInfo: + return sizeof(cydriver.CUarrayMapInfo) + + if objType == CUmemLocation_st: + return sizeof(cydriver.CUmemLocation_st) + + if objType == CUmemLocation_v1: + return sizeof(cydriver.CUmemLocation_v1) + + if objType == CUmemLocation: + return sizeof(cydriver.CUmemLocation) + + if objType == CUmemAllocationProp_st: + return sizeof(cydriver.CUmemAllocationProp_st) + + if objType == CUmemAllocationProp_v1: + return sizeof(cydriver.CUmemAllocationProp_v1) + + if objType == CUmemAllocationProp: + return sizeof(cydriver.CUmemAllocationProp) + + if objType == CUmulticastObjectProp_st: + return sizeof(cydriver.CUmulticastObjectProp_st) + + if objType == CUmulticastObjectProp_v1: + return sizeof(cydriver.CUmulticastObjectProp_v1) + + if objType == CUmulticastObjectProp: + return sizeof(cydriver.CUmulticastObjectProp) + + if objType == CUmemAccessDesc_st: + return sizeof(cydriver.CUmemAccessDesc_st) + + if objType == CUmemAccessDesc_v1: + return sizeof(cydriver.CUmemAccessDesc_v1) + + if objType == CUmemAccessDesc: + return sizeof(cydriver.CUmemAccessDesc) + + if objType == CUgraphExecUpdateResultInfo_st: + return sizeof(cydriver.CUgraphExecUpdateResultInfo_st) + + if objType == CUgraphExecUpdateResultInfo_v1: + return sizeof(cydriver.CUgraphExecUpdateResultInfo_v1) + + if objType == CUgraphExecUpdateResultInfo: + return sizeof(cydriver.CUgraphExecUpdateResultInfo) + + if objType == CUmemPoolProps_st: + return sizeof(cydriver.CUmemPoolProps_st) + + if objType == CUmemPoolProps_v1: + return sizeof(cydriver.CUmemPoolProps_v1) + + if objType == CUmemPoolProps: + return sizeof(cydriver.CUmemPoolProps) + + if objType == CUmemPoolPtrExportData_st: + return sizeof(cydriver.CUmemPoolPtrExportData_st) + + if objType == CUmemPoolPtrExportData_v1: + return sizeof(cydriver.CUmemPoolPtrExportData_v1) + + if objType == CUmemPoolPtrExportData: + return sizeof(cydriver.CUmemPoolPtrExportData) + + if objType == CUmemcpyAttributes_st: + return sizeof(cydriver.CUmemcpyAttributes_st) + + if objType == CUmemcpyAttributes_v1: + return sizeof(cydriver.CUmemcpyAttributes_v1) + + if objType == CUmemcpyAttributes: + return sizeof(cydriver.CUmemcpyAttributes) + + if objType == CUoffset3D_st: + return sizeof(cydriver.CUoffset3D_st) + + if objType == CUoffset3D_v1: + return sizeof(cydriver.CUoffset3D_v1) + + if objType == CUoffset3D: + return sizeof(cydriver.CUoffset3D) + + if objType == CUextent3D_st: + return sizeof(cydriver.CUextent3D_st) + + if objType == CUextent3D_v1: + return sizeof(cydriver.CUextent3D_v1) + + if objType == CUextent3D: + return sizeof(cydriver.CUextent3D) + + if objType == CUmemcpy3DOperand_st: + return sizeof(cydriver.CUmemcpy3DOperand_st) + + if objType == CUmemcpy3DOperand_v1: + return sizeof(cydriver.CUmemcpy3DOperand_v1) + + if objType == CUmemcpy3DOperand: + return sizeof(cydriver.CUmemcpy3DOperand) + + if objType == CUDA_MEMCPY3D_BATCH_OP_st: + return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_st) + + if objType == CUDA_MEMCPY3D_BATCH_OP_v1: + return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_v1) + + if objType == CUDA_MEMCPY3D_BATCH_OP: + 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) + + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v1: + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1) + + if objType == CUDA_MEM_ALLOC_NODE_PARAMS: + 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) + + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v2: + 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) + + if objType == CUDA_MEM_FREE_NODE_PARAMS: + 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) + + if objType == CUDA_CHILD_GRAPH_NODE_PARAMS: + 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) + + if objType == CUDA_EVENT_RECORD_NODE_PARAMS: + 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) + + if objType == CUDA_EVENT_WAIT_NODE_PARAMS: + return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS) + + if objType == CUgraphNodeParams_st: + return sizeof(cydriver.CUgraphNodeParams_st) + + if objType == CUgraphNodeParams: + return sizeof(cydriver.CUgraphNodeParams) + + if objType == CUcheckpointLockArgs_st: + return sizeof(cydriver.CUcheckpointLockArgs_st) + + if objType == CUcheckpointLockArgs: + return sizeof(cydriver.CUcheckpointLockArgs) + + if objType == CUcheckpointCheckpointArgs_st: + return sizeof(cydriver.CUcheckpointCheckpointArgs_st) + + if objType == CUcheckpointCheckpointArgs: + return sizeof(cydriver.CUcheckpointCheckpointArgs) + + if objType == CUcheckpointRestoreArgs_st: + return sizeof(cydriver.CUcheckpointRestoreArgs_st) + + if objType == CUcheckpointRestoreArgs: + return sizeof(cydriver.CUcheckpointRestoreArgs) + + if objType == CUcheckpointUnlockArgs_st: + return sizeof(cydriver.CUcheckpointUnlockArgs_st) + + if objType == CUcheckpointUnlockArgs: + return sizeof(cydriver.CUcheckpointUnlockArgs) + + if objType == CUmemDecompressParams_st: + return sizeof(cydriver.CUmemDecompressParams_st) + + if objType == CUmemDecompressParams: + return sizeof(cydriver.CUmemDecompressParams) + + if objType == CUdevResourceDesc: + return sizeof(cydriver.CUdevResourceDesc) + + if objType == CUdevSmResource_st: + return sizeof(cydriver.CUdevSmResource_st) + + if objType == CUdevSmResource: + return sizeof(cydriver.CUdevSmResource) + + if objType == CUdevResource_st: + return sizeof(cydriver.CUdevResource_st) + + if objType == CUdevResource_v1: + return sizeof(cydriver.CUdevResource_v1) + + if objType == CUdevResource: + return sizeof(cydriver.CUdevResource) + + if objType == CUlogsCallbackHandle: + return sizeof(cydriver.CUlogsCallbackHandle) + + if objType == CUlogsCallback: + return sizeof(cydriver.CUlogsCallback) + + if objType == CUlogIterator: + return sizeof(cydriver.CUlogIterator) + + if objType == CUeglFrame_st: + return sizeof(cydriver.CUeglFrame_st) + + if objType == CUeglFrame_v1: + return sizeof(cydriver.CUeglFrame_v1) + + if objType == CUeglFrame: + return sizeof(cydriver.CUeglFrame) + + if objType == CUeglStreamConnection: + return sizeof(cydriver.CUeglStreamConnection) + + if objType == GLenum: + return sizeof(cydriver.GLenum) + + if objType == GLuint: + return sizeof(cydriver.GLuint) + + if objType == EGLImageKHR: + return sizeof(cydriver.EGLImageKHR) + + if objType == EGLStreamKHR: + return sizeof(cydriver.EGLStreamKHR) + + if objType == EGLint: + return sizeof(cydriver.EGLint) + + if objType == EGLSyncKHR: + return sizeof(cydriver.EGLSyncKHR) + + if objType == VdpDevice: + return sizeof(cydriver.VdpDevice) + + if objType == VdpGetProcAddress: + return sizeof(cydriver.VdpGetProcAddress) + + if objType == VdpVideoSurface: + return sizeof(cydriver.VdpVideoSurface) + + if objType == VdpOutputSurface: + 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 + + def CUcontext_getter(CUcontext x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUcontext, CUcontext_getter) + + + def CUmodule_getter(CUmodule x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmodule, CUmodule_getter) + + + def CUfunction_getter(CUfunction x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUfunction, CUfunction_getter) + + + def CUlibrary_getter(CUlibrary x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlibrary, CUlibrary_getter) + + + def CUkernel_getter(CUkernel x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUkernel, CUkernel_getter) + + + def CUarray_getter(CUarray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUarray, CUarray_getter) + + + def CUmipmappedArray_getter(CUmipmappedArray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmipmappedArray, CUmipmappedArray_getter) + + + def CUtexref_getter(CUtexref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUtexref, CUtexref_getter) + + + def CUsurfref_getter(CUsurfref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUsurfref, CUsurfref_getter) + + + def CUevent_getter(CUevent x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUevent, CUevent_getter) + + + def CUstream_getter(CUstream x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUstream, CUstream_getter) + + + def CUgraphicsResource_getter(CUgraphicsResource x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphicsResource, CUgraphicsResource_getter) + + + def CUexternalMemory_getter(CUexternalMemory x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalMemory, CUexternalMemory_getter) + + + def CUexternalSemaphore_getter(CUexternalSemaphore x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalSemaphore, CUexternalSemaphore_getter) + + + def CUgraph_getter(CUgraph x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraph, CUgraph_getter) + + + def CUgraphNode_getter(CUgraphNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphNode, CUgraphNode_getter) + + + def CUgraphExec_getter(CUgraphExec x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphExec, CUgraphExec_getter) + + + def CUmemoryPool_getter(CUmemoryPool x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmemoryPool, CUmemoryPool_getter) + + + def CUuserObject_getter(CUuserObject x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUuserObject, CUuserObject_getter) + + + def CUgraphDeviceNode_getter(CUgraphDeviceNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphDeviceNode, CUgraphDeviceNode_getter) + + + def CUasyncCallbackHandle_getter(CUasyncCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUasyncCallbackHandle, CUasyncCallbackHandle_getter) + + + def CUgreenCtx_getter(CUgreenCtx x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgreenCtx, CUgreenCtx_getter) + + + def CUlinkState_getter(CUlinkState x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlinkState, CUlinkState_getter) + + + def CUdevResourceDesc_getter(CUdevResourceDesc x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUdevResourceDesc, CUdevResourceDesc_getter) + + + def CUlogsCallbackHandle_getter(CUlogsCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlogsCallbackHandle, CUlogsCallbackHandle_getter) + + + def CUeglStreamConnection_getter(CUeglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUeglStreamConnection, CUeglStreamConnection_getter) + + + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + + + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + + + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + + return 0 +_add_native_handle_getters() diff --git a/cuda_bindings_12/cuda/bindings/nvfatbin.pxd b/cuda_bindings_12/cuda/bindings/nvfatbin.pxd new file mode 100644 index 00000000000..d27d4002320 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvfatbin.pxd @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=d9fd5ffb6adedf403c2fee0594d979c6ad2221c94f886cdaaa5efb01c1fa1421 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from .cynvfatbin cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvFatbinHandle Handle + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvFatbinResult _Result + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t create(options, size_t options_count) except -1 +cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line) +cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier) +cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line) +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_12/cuda/bindings/nvfatbin.pyx b/cuda_bindings_12/cuda/bindings/nvfatbin.pyx new file mode 100644 index 00000000000..0e485dd80dc --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvfatbin.pyx @@ -0,0 +1,374 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=464151e9be344b663eb001d24b780328f477470afca263a03384394a057b74bd + + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +from libc.stdint cimport intptr_t + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) except?-1: + cdef intptr_t ptr + cdef int flags = _cyb_cpython.PyBUF_ANY_CONTIGUOUS + if not readonly: + flags |= _cyb_cpython.PyBUF_WRITABLE + cdef int status = -1 + cdef _cyb_cpython.Py_buffer view + if isinstance(buf, int): + ptr = buf + else: + try: + status = _cyb_cpython.PyObject_GetBuffer(buf, &view, flags) + if size != -1: + assert view.len == size + assert view.ndim == 1 + except Exception as e: + adj = "writable " if not readonly else "" + raise ValueError( + "buf must be either a Python int representing the pointer " + f"address to a valid buffer, or a 1D contiguous {adj}" + f"buffer, of size {size}" + ) from e + else: + ptr = view.buf + finally: + if status == 0: + _cyb_cpython.PyBuffer_Release(&view) + return ptr + + +# <<<< END OF PREAMBLE CONTENT >>>> + +cimport cython # NOQA + +from ._internal.utils cimport (get_resource_ptr, get_nested_resource_ptr, nested_resource, nullable_unique_ptr, + get_resource_ptrs) + +from libcpp.vector cimport vector + + +############################################################################### +# Enum +############################################################################### + +class Result(_cyb_FastEnum): + """ + The enumerated type `nvFatbinResult` defines API call result codes. + nvFatbin APIs return `nvFatbinResult` codes to indicate the result. + + See `nvFatbinResult`. + """ + SUCCESS = NVFATBIN_SUCCESS + ERROR_INTERNAL = NVFATBIN_ERROR_INTERNAL + ERROR_ELF_ARCH_MISMATCH = NVFATBIN_ERROR_ELF_ARCH_MISMATCH + ERROR_ELF_SIZE_MISMATCH = NVFATBIN_ERROR_ELF_SIZE_MISMATCH + ERROR_MISSING_PTX_VERSION = NVFATBIN_ERROR_MISSING_PTX_VERSION + ERROR_NULL_POINTER = NVFATBIN_ERROR_NULL_POINTER + ERROR_COMPRESSION_FAILED = NVFATBIN_ERROR_COMPRESSION_FAILED + ERROR_COMPRESSED_SIZE_EXCEEDED = NVFATBIN_ERROR_COMPRESSED_SIZE_EXCEEDED + ERROR_UNRECOGNIZED_OPTION = NVFATBIN_ERROR_UNRECOGNIZED_OPTION + ERROR_INVALID_ARCH = NVFATBIN_ERROR_INVALID_ARCH + ERROR_INVALID_NVVM = NVFATBIN_ERROR_INVALID_NVVM + ERROR_EMPTY_INPUT = NVFATBIN_ERROR_EMPTY_INPUT + ERROR_MISSING_PTX_ARCH = NVFATBIN_ERROR_MISSING_PTX_ARCH + ERROR_PTX_ARCH_MISMATCH = NVFATBIN_ERROR_PTX_ARCH_MISMATCH + ERROR_MISSING_FATBIN = NVFATBIN_ERROR_MISSING_FATBIN + ERROR_INVALID_INDEX = NVFATBIN_ERROR_INVALID_INDEX + ERROR_IDENTIFIER_REUSE = NVFATBIN_ERROR_IDENTIFIER_REUSE + ERROR_INTERNAL_PTX_OPTION = NVFATBIN_ERROR_INTERNAL_PTX_OPTION + + +############################################################################### +# Error handling +############################################################################### + +class nvFatbinError(Exception): + + def __init__(self, status): + self.status = status + s = Result(status) + cdef str err = f"{s.name} ({s.value})" + super(nvFatbinError, self).__init__(err) + + def __reduce__(self): + return (type(self), (self.status,)) + + +@cython.profile(False) +cdef int check_status(int status) except 1 nogil: + if status != 0: + with gil: + raise nvFatbinError(status) + return status + + +############################################################################### +# Wrapper functions +############################################################################### + +cpdef destroy(intptr_t handle): + """nvFatbinDestroy frees the memory associated with the given handle. + + Args: + handle (intptr_t): nvFatbin handle. + + .. seealso:: `nvFatbinDestroy` + """ + cdef Handle h = handle + with nogil: + status = nvFatbinDestroy(&h) + check_status(status) + + +cpdef str get_error_string(int result): + """nvFatbinGetErrorString returns an error description string for each error code. + + Args: + result (Result): error code. + + .. seealso:: `nvFatbinGetErrorString` + """ + cdef const char* _output_ + cdef bytes _output_bytes_ + _output_ = nvFatbinGetErrorString(<_Result>result) + + if _output_ == NULL: + return "" + + _output_bytes_ = _output_ + return _output_bytes_.decode() + + +cpdef intptr_t create(options, size_t options_count) except -1: + """nvFatbinCreate creates a new handle. + + Args: + options (object): An array of strings, each containing a + single option. It can be: + + - an :class:`int` as the pointer address to the nested sequence, or + - a Python sequence of :class:`int`\s, each of which is a pointer address + to a valid sequence of 'char', or + - a nested Python sequence of ``str``. + + options_count (size_t): Number of options. + + Returns: + intptr_t: Address of nvFatbin handle. + + .. seealso:: `nvFatbinCreate` + """ + cdef nested_resource[ char ] _options_ + get_nested_resource_ptr[char](_options_, options, NULL) + cdef Handle handle_indirect + with nogil: + __status__ = nvFatbinCreate(&handle_indirect, (_options_.ptrs.data()), options_count) + check_status(__status__) + return handle_indirect + + +cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line): + """nvFatbinAddPTX adds PTX to the fatbinary. + + Args: + handle (intptr_t): nvFatbin handle. + code (bytes): The PTX code. + size (size_t): The size of the PTX code. + arch (str): The numerical architecture that this PTX is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the PTX, useful when extracting the + fatbin with tools like cuobjdump. + options_cmd_line (str): Options used during JIT compilation. + + .. seealso:: `nvFatbinAddPTX` + """ + cdef void* _code_ = _cyb_get_buffer_pointer(code, size, readonly=True) + if not isinstance(arch, str): + raise TypeError("arch must be a Python str") + cdef bytes _temp_arch_ = (arch).encode() + cdef char* _arch_ = _temp_arch_ + if not isinstance(identifier, str): + raise TypeError("identifier must be a Python str") + cdef bytes _temp_identifier_ = (identifier).encode() + cdef char* _identifier_ = _temp_identifier_ + if not isinstance(options_cmd_line, str): + raise TypeError("options_cmd_line must be a Python str") + cdef bytes _temp_options_cmd_line_ = (options_cmd_line).encode() + cdef char* _options_cmd_line_ = _temp_options_cmd_line_ + with nogil: + __status__ = nvFatbinAddPTX(handle, _code_, size, _arch_, _identifier_, _options_cmd_line_) + check_status(__status__) + + +cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier): + """nvFatbinAddCubin adds a CUDA binary to the fatbinary. + + Args: + handle (intptr_t): nvFatbin handle. + code (bytes): The cubin. + size (size_t): The size of the cubin. + arch (str): The numerical architecture that this cubin is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the cubin, useful when extracting + the fatbin with tools like cuobjdump. + + .. seealso:: `nvFatbinAddCubin` + """ + cdef void* _code_ = _cyb_get_buffer_pointer(code, size, readonly=True) + if not isinstance(arch, str): + raise TypeError("arch must be a Python str") + cdef bytes _temp_arch_ = (arch).encode() + cdef char* _arch_ = _temp_arch_ + 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__ = nvFatbinAddCubin(handle, _code_, size, _arch_, _identifier_) + check_status(__status__) + + +cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cmd_line): + """nvFatbinAddLTOIR adds LTOIR to the fatbinary. + + Args: + handle (intptr_t): nvFatbin handle. + code (bytes): The LTOIR code. + size (size_t): The size of the LTOIR code. + arch (str): The numerical architecture that this LTOIR is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the LTOIR, useful when extracting + the fatbin with tools like cuobjdump. + options_cmd_line (str): Options used during JIT compilation. + + .. seealso:: `nvFatbinAddLTOIR` + """ + cdef void* _code_ = _cyb_get_buffer_pointer(code, size, readonly=True) + if not isinstance(arch, str): + raise TypeError("arch must be a Python str") + cdef bytes _temp_arch_ = (arch).encode() + cdef char* _arch_ = _temp_arch_ + if not isinstance(identifier, str): + raise TypeError("identifier must be a Python str") + cdef bytes _temp_identifier_ = (identifier).encode() + cdef char* _identifier_ = _temp_identifier_ + if not isinstance(options_cmd_line, str): + raise TypeError("options_cmd_line must be a Python str") + cdef bytes _temp_options_cmd_line_ = (options_cmd_line).encode() + cdef char* _options_cmd_line_ = _temp_options_cmd_line_ + with nogil: + __status__ = nvFatbinAddLTOIR(handle, _code_, size, _arch_, _identifier_, _options_cmd_line_) + check_status(__status__) + + +cpdef size_t size(intptr_t handle) except? 0: + """nvFatbinSize returns the fatbinary's size. + + Args: + handle (intptr_t): nvFatbin handle. + + Returns: + size_t: The fatbinary's size. + + .. seealso:: `nvFatbinSize` + """ + cdef size_t size + with nogil: + __status__ = nvFatbinSize(handle, &size) + check_status(__status__) + return size + + +cpdef get(intptr_t handle, buffer): + """nvFatbinGet returns the completed fatbinary. + + Args: + handle (intptr_t): nvFatbin handle. + buffer (bytes): memory to store fatbinary. + + .. seealso:: `nvFatbinGet` + """ + cdef void* _buffer_ = _cyb_get_buffer_pointer(buffer, -1, readonly=False) + with nogil: + __status__ = nvFatbinGet(handle, _buffer_) + check_status(__status__) + + +cpdef tuple version(): + """nvFatbinVersion returns the current version of nvFatbin. + + Returns: + A 2-tuple containing: + + - unsigned int: The major version. + - unsigned int: The minor version. + + .. seealso:: `nvFatbinVersion` + """ + cdef unsigned int major + cdef unsigned int minor + with nogil: + __status__ = nvFatbinVersion(&major, &minor) + check_status(__status__) + return (major, minor) + + +cpdef add_index(intptr_t handle, code, size_t size, identifier): + cdef void* _code_ = _cyb_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. + + Args: + handle (intptr_t): nvFatbin handle. + code (bytes): The host object image. + size (size_t): The size of the host object image code. + + .. seealso:: `nvFatbinAddReloc` + """ + cdef void* _code_ = _cyb_get_buffer_pointer(code, size, readonly=True) + with nogil: + __status__ = nvFatbinAddReloc(handle, _code_, size) + check_status(__status__) + + +cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_line): + """nvFatbinAddTileIR adds Tile IR to the fatbinary. + + Args: + handle (intptr_t): nvFatbin handle. + code (bytes): The Tile IR. + size (size_t): The size of the Tile IR. + identifier (str): Name of the Tile IR, useful when extracting + the fatbin with tools like cuobjdump. + options_cmd_line (str): Options used during JIT compilation. + + .. seealso:: `nvFatbinAddTileIR` + """ + cdef void* _code_ = _cyb_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_ + if not isinstance(options_cmd_line, str): + raise TypeError("options_cmd_line must be a Python str") + cdef bytes _temp_options_cmd_line_ = (options_cmd_line).encode() + cdef char* _options_cmd_line_ = _temp_options_cmd_line_ + with nogil: + __status__ = nvFatbinAddTileIR(handle, _code_, size, _identifier_, _options_cmd_line_) + check_status(__status__) +del _cyb_FastEnum diff --git a/cuda_bindings_12/cuda/bindings/nvjitlink.pxd b/cuda_bindings_12/cuda/bindings/nvjitlink.pxd new file mode 100644 index 00000000000..714bbbc33ee --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvjitlink.pxd @@ -0,0 +1,56 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b3986e82e5ac57f70277f1ab470024ff95d353999f98723724c7eb62f6a409a1 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + intptr_t, + uint32_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from .cynvjitlink cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvJitLinkHandle Handle + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvJitLinkResult _Result +ctypedef nvJitLinkInputType _InputType + + +############################################################################### +# Functions +############################################################################### + +cpdef intptr_t create(uint32_t num_options, options) except -1 +cpdef add_data(intptr_t handle, int input_type, data, size_t size, name) +cpdef add_file(intptr_t handle, int input_type, file_name) +cpdef complete(intptr_t handle) +cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0 +cpdef get_linked_cubin(intptr_t handle, cubin) +cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0 +cpdef get_linked_ptx(intptr_t handle, ptx) +cpdef size_t get_error_log_size(intptr_t handle) except? 0 +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_12/cuda/bindings/nvjitlink.pyx b/cuda_bindings_12/cuda/bindings/nvjitlink.pyx new file mode 100644 index 00000000000..89076249cf9 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvjitlink.pyx @@ -0,0 +1,414 @@ +# 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 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4f142d6dd069dd459052ff17e4e585b764e7a8b4298051df3c6c0d39e1c67ded + + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +from libc.stdint cimport ( + intptr_t, + uint32_t, +) + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) except?-1: + cdef intptr_t ptr + cdef int flags = _cyb_cpython.PyBUF_ANY_CONTIGUOUS + if not readonly: + flags |= _cyb_cpython.PyBUF_WRITABLE + cdef int status = -1 + cdef _cyb_cpython.Py_buffer view + if isinstance(buf, int): + ptr = buf + else: + try: + status = _cyb_cpython.PyObject_GetBuffer(buf, &view, flags) + if size != -1: + assert view.len == size + assert view.ndim == 1 + except Exception as e: + adj = "writable " if not readonly else "" + raise ValueError( + "buf must be either a Python int representing the pointer " + f"address to a valid buffer, or a 1D contiguous {adj}" + f"buffer, of size {size}" + ) from e + else: + ptr = view.buf + finally: + if status == 0: + _cyb_cpython.PyBuffer_Release(&view) + return ptr + + +# <<<< END OF PREAMBLE CONTENT >>>> + +cimport cython # NOQA + +from ._internal.utils cimport (get_resource_ptr, get_nested_resource_ptr, nested_resource, nullable_unique_ptr, + get_resource_ptrs) + +from libcpp.vector cimport vector + + +############################################################################### +# Enum +############################################################################### + +class Result(_cyb_FastEnum): + """ + The enumerated type `nvJitLinkResult` defines API call result codes. + nvJitLink APIs return `nvJitLinkResult` codes to indicate the result. + + See `nvJitLinkResult`. + """ + SUCCESS = NVJITLINK_SUCCESS + ERROR_UNRECOGNIZED_OPTION = (NVJITLINK_ERROR_UNRECOGNIZED_OPTION, 'Unrecognized Option') + ERROR_MISSING_ARCH = (NVJITLINK_ERROR_MISSING_ARCH, 'Option `-arch=sm_NN` not specified') + ERROR_INVALID_INPUT = (NVJITLINK_ERROR_INVALID_INPUT, 'Invalid Input') + ERROR_PTX_COMPILE = (NVJITLINK_ERROR_PTX_COMPILE, 'Issue during PTX Compilation') + ERROR_NVVM_COMPILE = (NVJITLINK_ERROR_NVVM_COMPILE, 'Issue during NVVM Compilation') + ERROR_INTERNAL = (NVJITLINK_ERROR_INTERNAL, 'Internal Error') + ERROR_THREADPOOL = (NVJITLINK_ERROR_THREADPOOL, 'Issue with Thread Pool') + ERROR_UNRECOGNIZED_INPUT = (NVJITLINK_ERROR_UNRECOGNIZED_INPUT, 'Unrecognized Input') + ERROR_FINALIZE = (NVJITLINK_ERROR_FINALIZE, 'Finalizer Error') + ERROR_NULL_INPUT = (NVJITLINK_ERROR_NULL_INPUT, 'Null Input') + ERROR_INCOMPATIBLE_OPTIONS = (NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS, 'Incompatible Options') + ERROR_INCORRECT_INPUT_TYPE = (NVJITLINK_ERROR_INCORRECT_INPUT_TYPE, 'Incorrect Input Type') + ERROR_ARCH_MISMATCH = (NVJITLINK_ERROR_ARCH_MISMATCH, 'Arch Mismatch') + ERROR_OUTDATED_LIBRARY = (NVJITLINK_ERROR_OUTDATED_LIBRARY, 'Outdated Library') + ERROR_MISSING_FATBIN = (NVJITLINK_ERROR_MISSING_FATBIN, 'Missing Fatbin') + ERROR_UNRECOGNIZED_ARCH = (NVJITLINK_ERROR_UNRECOGNIZED_ARCH, 'Unrecognized -arch value') + ERROR_UNSUPPORTED_ARCH = (NVJITLINK_ERROR_UNSUPPORTED_ARCH, 'Unsupported -arch value') + ERROR_LTO_NOT_ENABLED = (NVJITLINK_ERROR_LTO_NOT_ENABLED, 'Requires -lto') + +class InputType(_cyb_FastEnum): + """ + The enumerated type `nvJitLinkInputType` defines the kind of inputs + that can be passed to nvJitLinkAdd* APIs. + + See `nvJitLinkInputType`. + """ + NONE = (NVJITLINK_INPUT_NONE, 'Error Type') + CUBIN = (NVJITLINK_INPUT_CUBIN, 'For CUDA Binaries') + PTX = (NVJITLINK_INPUT_PTX, 'For PTX') + LTOIR = (NVJITLINK_INPUT_LTOIR, 'For LTO-IR') + FATBIN = (NVJITLINK_INPUT_FATBIN, 'For Fatbin') + OBJECT = (NVJITLINK_INPUT_OBJECT, 'For Host Object') + LIBRARY = (NVJITLINK_INPUT_LIBRARY, 'For Host Library') + INDEX = (NVJITLINK_INPUT_INDEX, 'For Index File') + ANY = (NVJITLINK_INPUT_ANY, 'Dynamically chooses from the valid types') + + +############################################################################### +# Error handling +############################################################################### + +class nvJitLinkError(Exception): + + def __init__(self, status): + self.status = status + s = Result(status) + cdef str err = f"{s.name} ({s.value})" + super(nvJitLinkError, self).__init__(err) + + def __reduce__(self): + return (type(self), (self.status,)) + + +@cython.profile(False) +cdef int check_status(int status) except 1 nogil: + if status != 0: + with gil: + raise nvJitLinkError(status) + return status + + +############################################################################### +# Wrapper functions +############################################################################### + +cpdef destroy(intptr_t handle): + """nvJitLinkDestroy frees the memory associated with the given handle. + + Args: + handle (intptr_t): nvJitLink handle. + + .. seealso:: `nvJitLinkDestroy` + """ + cdef Handle h = handle + with nogil: + status = nvJitLinkDestroy(&h) + check_status(status) + + +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``. + + Args: + num_options (uint32_t): Number of options passed. + options (object): Array of size ``num_options`` of option + strings. It can be: + + - an :class:`int` as the pointer address to the nested sequence, or + - a Python sequence of :class:`int`\s, each of which is a pointer address + to a valid sequence of 'char', or + - a nested Python sequence of ``str``. + + + Returns: + intptr_t: Address of nvJitLink handle. + + .. seealso:: `nvJitLinkCreate` + """ + cdef nested_resource[ char ] _options_ + get_nested_resource_ptr[char](_options_, options, NULL) + cdef Handle handle + with nogil: + __status__ = nvJitLinkCreate(&handle, num_options, (_options_.ptrs.data())) + check_status(__status__) + return handle + + +cpdef add_data(intptr_t handle, int input_type, data, size_t size, name): + """nvJitLinkAddData adds data image to the link. + + Args: + handle (intptr_t): nvJitLink handle. + input_type (InputType): kind of input. + data (bytes): pointer to data image in memory. + size (size_t): size of the data. + name (str): name of input object. + + .. seealso:: `nvJitLinkAddData` + """ + cdef void* _data_ = _cyb_get_buffer_pointer(data, size, readonly=True) + if not isinstance(name, str): + raise TypeError("name must be a Python str") + cdef bytes _temp_name_ = (name).encode() + cdef char* _name_ = _temp_name_ + with nogil: + __status__ = nvJitLinkAddData(handle, <_InputType>input_type, _data_, size, _name_) + check_status(__status__) + + +cpdef add_file(intptr_t handle, int input_type, file_name): + """nvJitLinkAddFile reads data from file and links it in. + + Args: + handle (intptr_t): nvJitLink handle. + input_type (InputType): kind of input. + file_name (str): name of file. + + .. seealso:: `nvJitLinkAddFile` + """ + if not isinstance(file_name, str): + raise TypeError("file_name must be a Python str") + cdef bytes _temp_file_name_ = (file_name).encode() + cdef char* _file_name_ = _temp_file_name_ + with nogil: + __status__ = nvJitLinkAddFile(handle, <_InputType>input_type, _file_name_) + check_status(__status__) + + +cpdef complete(intptr_t handle): + """nvJitLinkComplete does the actual link. + + Args: + handle (intptr_t): nvJitLink handle. + + .. seealso:: `nvJitLinkComplete` + """ + with nogil: + __status__ = nvJitLinkComplete(handle) + check_status(__status__) + + +cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0: + """nvJitLinkGetLinkedCubinSize gets the size of the linked cubin. + + Args: + handle (intptr_t): nvJitLink handle. + + Returns: + size_t: Size of the linked cubin. + + .. seealso:: `nvJitLinkGetLinkedCubinSize` + """ + cdef size_t size + with nogil: + __status__ = nvJitLinkGetLinkedCubinSize(handle, &size) + check_status(__status__) + return size + + +cpdef get_linked_cubin(intptr_t handle, cubin): + """nvJitLinkGetLinkedCubin gets the linked cubin. + + Args: + handle (intptr_t): nvJitLink handle. + cubin (bytes): The linked cubin. + + .. seealso:: `nvJitLinkGetLinkedCubin` + """ + cdef void* _cubin_ = _cyb_get_buffer_pointer(cubin, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetLinkedCubin(handle, _cubin_) + check_status(__status__) + + +cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0: + """nvJitLinkGetLinkedPtxSize gets the size of the linked ptx. + + Args: + handle (intptr_t): nvJitLink handle. + + Returns: + size_t: Size of the linked PTX. + + .. seealso:: `nvJitLinkGetLinkedPtxSize` + """ + cdef size_t size + with nogil: + __status__ = nvJitLinkGetLinkedPtxSize(handle, &size) + check_status(__status__) + return size + + +cpdef get_linked_ptx(intptr_t handle, ptx): + """nvJitLinkGetLinkedPtx gets the linked ptx. + + Args: + handle (intptr_t): nvJitLink handle. + ptx (bytes): The linked PTX. + + .. seealso:: `nvJitLinkGetLinkedPtx` + """ + cdef void* _ptx_ = _cyb_get_buffer_pointer(ptx, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetLinkedPtx(handle, _ptx_) + check_status(__status__) + + +cpdef size_t get_error_log_size(intptr_t handle) except? 0: + """nvJitLinkGetErrorLogSize gets the size of the error log. + + Args: + handle (intptr_t): nvJitLink handle. + + Returns: + size_t: Size of the error log. + + .. seealso:: `nvJitLinkGetErrorLogSize` + """ + cdef size_t size + with nogil: + __status__ = nvJitLinkGetErrorLogSize(handle, &size) + check_status(__status__) + return size + + +cpdef get_error_log(intptr_t handle, log): + """nvJitLinkGetErrorLog puts any error messages in the log. + + Args: + handle (intptr_t): nvJitLink handle. + log (bytes): The error log. + + .. seealso:: `nvJitLinkGetErrorLog` + """ + cdef void* _log_ = _cyb_get_buffer_pointer(log, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetErrorLog(handle, _log_) + check_status(__status__) + + +cpdef size_t get_info_log_size(intptr_t handle) except? 0: + """nvJitLinkGetInfoLogSize gets the size of the info log. + + Args: + handle (intptr_t): nvJitLink handle. + + Returns: + size_t: Size of the info log. + + .. seealso:: `nvJitLinkGetInfoLogSize` + """ + cdef size_t size + with nogil: + __status__ = nvJitLinkGetInfoLogSize(handle, &size) + check_status(__status__) + return size + + +cpdef get_info_log(intptr_t handle, log): + """nvJitLinkGetInfoLog puts any info messages in the log. + + Args: + handle (intptr_t): nvJitLink handle. + log (bytes): The info log. + + .. seealso:: `nvJitLinkGetInfoLog` + """ + cdef void* _log_ = _cyb_get_buffer_pointer(log, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetInfoLog(handle, _log_) + check_status(__status__) + + +cpdef tuple version(): + """nvJitLinkVersion returns the current version of nvJitLink. + + Returns: + A 2-tuple containing: + + - unsigned int: The major version. + - unsigned int: The minor version. + + .. seealso:: `nvJitLinkVersion` + """ + cdef unsigned int major + cdef unsigned int minor + with nogil: + __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_ = _cyb_get_buffer_pointer(ltoir, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetLinkedLTOIR(handle, _ltoir_) + check_status(__status__) +del _cyb_FastEnum diff --git a/cuda_bindings_12/cuda/bindings/nvml.pxd b/cuda_bindings_12/cuda/bindings/nvml.pxd new file mode 100644 index 00000000000..ce3c1db4852 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvml.pxd @@ -0,0 +1,440 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=b6fe9a4efd0077f8c09ef4f826880ad0a54100455d4465953c4127d3de8c4d91 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from .cynvml cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvmlDramEncryptionInfo_v1_t DramEncryptionInfo_v1 +ctypedef nvmlMarginTemperature_v1_t MarginTemperature_v1 +ctypedef nvmlFanSpeedInfo_v1_t FanSpeedInfo_v1 +ctypedef nvmlDevicePerfModes_v1_t DevicePerfModes_v1 +ctypedef nvmlDeviceCurrentClockFreqs_v1_t DeviceCurrentClockFreqs_v1 +ctypedef nvmlVgpuHeterogeneousMode_v1_t VgpuHeterogeneousMode_v1 +ctypedef nvmlVgpuPlacementId_v1_t VgpuPlacementId_v1 +ctypedef nvmlVgpuRuntimeState_v1_t VgpuRuntimeState_v1 +ctypedef nvmlConfComputeSetKeyRotationThresholdInfo_v1_t ConfComputeSetKeyRotationThresholdInfo_v1 +ctypedef nvmlConfComputeGetKeyRotationThresholdInfo_v1_t ConfComputeGetKeyRotationThresholdInfo_v1 +ctypedef nvmlSystemDriverBranchInfo_v1_t SystemDriverBranchInfo_v1 +ctypedef nvmlTemperature_v1_t Temperature_v1 +ctypedef nvmlDeviceCapabilities_v1_t DeviceCapabilities_v1 +ctypedef nvmlPowerSmoothingProfile_v1_t PowerSmoothingProfile_v1 +ctypedef nvmlPowerSmoothingState_v1_t PowerSmoothingState_v1 +ctypedef nvmlPdi_v1_t Pdi_v1 +ctypedef nvmlDevice_t Device +ctypedef nvmlGpuInstance_t GpuInstance +ctypedef nvmlUnit_t Unit +ctypedef nvmlEventSet_t EventSet +ctypedef nvmlSystemEventSet_t SystemEventSet +ctypedef nvmlComputeInstance_t ComputeInstance +ctypedef nvmlGpmSample_t GpmSample +ctypedef nvmlEccErrorCounts_t EccErrorCounts +ctypedef nvmlProcessInfo_v1_t ProcessInfo_v1 +ctypedef nvmlProcessInfo_v2_t ProcessInfo_v2 +ctypedef nvmlNvLinkUtilizationControl_t NvLinkUtilizationControl +ctypedef nvmlViolationTime_t ViolationTime +ctypedef nvmlUUIDValue_t UUIDValue +ctypedef nvmlVgpuPlacementList_v1_t VgpuPlacementList_v1 +ctypedef nvmlNvLinkPowerThres_t NvLinkPowerThres +ctypedef nvmlGpuInstanceProfileInfo_t GpuInstanceProfileInfo +ctypedef nvmlGpuInstanceProfileInfo_v2_t GpuInstanceProfileInfo_v2 +ctypedef nvmlComputeInstanceProfileInfo_t ComputeInstanceProfileInfo +ctypedef nvmlGpmSupport_t GpmSupport +ctypedef nvmlMask255_t Mask255 +ctypedef nvmlHostname_v1_t Hostname_v1 +ctypedef nvmlUnrepairableMemoryStatus_v1_t UnrepairableMemoryStatus_v1 +ctypedef nvmlRusdSettings_v1_t RusdSettings_v1 +ctypedef nvmlPowerValue_v2_t PowerValue_v2 +ctypedef nvmlVgpuTypeMaxInstance_v1_t VgpuTypeMaxInstance_v1 +ctypedef nvmlVgpuProcessUtilizationSample_t VgpuProcessUtilizationSample +ctypedef nvmlGpuFabricInfo_t GpuFabricInfo +ctypedef nvmlSystemEventSetCreateRequest_v1_t SystemEventSetCreateRequest_v1 +ctypedef nvmlSystemEventSetFreeRequest_v1_t SystemEventSetFreeRequest_v1 +ctypedef nvmlSystemRegisterEventRequest_v1_t SystemRegisterEventRequest_v1 +ctypedef nvmlUUID_v1_t UUID_v1 +ctypedef nvmlSystemEventSetWaitRequest_v1_t SystemEventSetWaitRequest_v1 +ctypedef nvmlGpmMetric_t GpmMetric +ctypedef nvmlWorkloadPowerProfileInfo_v1_t WorkloadPowerProfileInfo_v1 +ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t WorkloadPowerProfileCurrentProfiles_v1 +ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t WorkloadPowerProfileRequestedProfiles_v1 +ctypedef nvmlWorkloadPowerProfileUpdateProfiles_v1_t WorkloadPowerProfileUpdateProfiles_v1 +ctypedef nvmlPRMTLV_v1_t PRMTLV_v1 +ctypedef nvmlVgpuSchedulerSetState_t VgpuSchedulerSetState +ctypedef nvmlGpmMetricsGet_t GpmMetricsGet +ctypedef nvmlPRMCounterList_v1_t PRMCounterList_v1 +ctypedef nvmlWorkloadPowerProfileProfilesInfo_v1_t WorkloadPowerProfileProfilesInfo_v1 + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvmlBridgeChipType_t _BridgeChipType +ctypedef nvmlNvLinkUtilizationCountUnits_t _NvLinkUtilizationCountUnits +ctypedef nvmlNvLinkUtilizationCountPktTypes_t _NvLinkUtilizationCountPktTypes +ctypedef nvmlNvLinkCapability_t _NvLinkCapability +ctypedef nvmlNvLinkErrorCounter_t _NvLinkErrorCounter +ctypedef nvmlIntNvLinkDeviceType_t _IntNvLinkDeviceType +ctypedef nvmlGpuTopologyLevel_t _GpuTopologyLevel +ctypedef nvmlGpuP2PStatus_t _GpuP2PStatus +ctypedef nvmlGpuP2PCapsIndex_t _GpuP2PCapsIndex +ctypedef nvmlSamplingType_t _SamplingType +ctypedef nvmlPcieUtilCounter_t _PcieUtilCounter +ctypedef nvmlValueType_t _ValueType +ctypedef nvmlPerfPolicyType_t _PerfPolicyType +ctypedef nvmlThermalTarget_t _ThermalTarget +ctypedef nvmlThermalController_t _ThermalController +ctypedef nvmlCoolerControl_t _CoolerControl +ctypedef nvmlCoolerTarget_t _CoolerTarget +ctypedef nvmlUUIDType_t _UUIDType +ctypedef nvmlEnableState_t _EnableState +ctypedef nvmlBrandType_t _BrandType +ctypedef nvmlTemperatureThresholds_t _TemperatureThresholds +ctypedef nvmlTemperatureSensors_t _TemperatureSensors +ctypedef nvmlComputeMode_t _ComputeMode +ctypedef nvmlMemoryErrorType_t _MemoryErrorType +ctypedef nvmlNvlinkVersion_t _NvlinkVersion +ctypedef nvmlEccCounterType_t _EccCounterType +ctypedef nvmlClockType_t _ClockType +ctypedef nvmlClockId_t _ClockId +ctypedef nvmlDriverModel_t _DriverModel +ctypedef nvmlPstates_t _Pstates +ctypedef nvmlGpuOperationMode_t _GpuOperationMode +ctypedef nvmlInforomObject_t _InforomObject +ctypedef nvmlReturn_t _Return +ctypedef nvmlMemoryLocation_t _MemoryLocation +ctypedef nvmlPageRetirementCause_t _PageRetirementCause +ctypedef nvmlRestrictedAPI_t _RestrictedAPI +ctypedef nvmlGpuUtilizationDomainId_t _GpuUtilizationDomainId +ctypedef nvmlGpuVirtualizationMode_t _GpuVirtualizationMode +ctypedef nvmlHostVgpuMode_t _HostVgpuMode +ctypedef nvmlVgpuVmIdType_t _VgpuVmIdType +ctypedef nvmlVgpuGuestInfoState_t _VgpuGuestInfoState +ctypedef nvmlGridLicenseFeatureCode_t _GridLicenseFeatureCode +ctypedef nvmlVgpuCapability_t _VgpuCapability +ctypedef nvmlVgpuDriverCapability_t _VgpuDriverCapability +ctypedef nvmlDeviceVgpuCapability_t _DeviceVgpuCapability +ctypedef nvmlDeviceGpuRecoveryAction_t _DeviceGpuRecoveryAction +ctypedef nvmlFanState_t _FanState +ctypedef nvmlLedColor_t _LedColor +ctypedef nvmlEncoderType_t _EncoderType +ctypedef nvmlFBCSessionType_t _FBCSessionType +ctypedef nvmlDetachGpuState_t _DetachGpuState +ctypedef nvmlPcieLinkState_t _PcieLinkState +ctypedef nvmlClockLimitId_t _ClockLimitId +ctypedef nvmlVgpuVmCompatibility_t _VgpuVmCompatibility +ctypedef nvmlVgpuPgpuCompatibilityLimitCode_t _VgpuPgpuCompatibilityLimitCode +ctypedef nvmlGpmMetricId_t _GpmMetricId +ctypedef nvmlPowerProfileType_t _PowerProfileType +ctypedef nvmlDeviceAddressingModeType_t _DeviceAddressingModeType +ctypedef nvmlPRMCounterId_t _PRMCounterId +ctypedef nvmlPowerProfileOperation_t _PowerProfileOperation +ctypedef nvmlProcessMode_t _ProcessMode +ctypedef nvmlCPERType_t _CPERType + + +############################################################################### +# Functions +############################################################################### + +cpdef init_v2() +cpdef init_with_flags(unsigned int flags) +cpdef shutdown() +cpdef str error_string(int result) +cpdef str system_get_driver_version() +cpdef str system_get_nvml_version() +cpdef int system_get_cuda_driver_version() except * +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 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) +cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except? 0 +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 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 +cpdef str device_get_name(intptr_t device) +cpdef int device_get_brand(intptr_t device) except? -1 +cpdef unsigned int device_get_index(intptr_t device) except? 0 +cpdef str device_get_serial(intptr_t device) +cpdef unsigned int device_get_module_id(intptr_t device) except? 0 +cpdef object device_get_c2c_mode_info_v(intptr_t device) +cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_size, unsigned int scope) +cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int cpu_set_size, unsigned int scope) +cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) +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_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) +cpdef str device_get_inforom_version(intptr_t device, int object) +cpdef str device_get_inforom_image_version(intptr_t device) +cpdef unsigned int device_get_inforom_configuration_checksum(intptr_t device) except? 0 +cpdef device_validate_inforom(intptr_t device) +cpdef tuple device_get_last_bbx_flush_time(intptr_t device) +cpdef int device_get_display_mode(intptr_t device) except? -1 +cpdef int device_get_display_active(intptr_t device) except? -1 +cpdef int device_get_persistence_mode(intptr_t device) except? -1 +cpdef object device_get_pci_info_ext(intptr_t device) +cpdef object device_get_pci_info_v3(intptr_t device) +cpdef unsigned int device_get_max_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_gpu_max_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_max_pcie_link_width(intptr_t device) except? 0 +cpdef unsigned int device_get_curr_pcie_link_generation(intptr_t device) except? 0 +cpdef unsigned int device_get_curr_pcie_link_width(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_throughput(intptr_t device, int counter) except? 0 +cpdef unsigned int device_get_pcie_replay_counter(intptr_t device) except? 0 +cpdef unsigned int device_get_clock_info(intptr_t device, int type) except? 0 +cpdef unsigned int device_get_max_clock_info(intptr_t device, int type) except? 0 +cpdef int device_get_gpc_clk_vf_offset(intptr_t device) except? 0 +cpdef unsigned int device_get_clock(intptr_t device, int clock_type, int clock_id) except? 0 +cpdef unsigned int device_get_max_customer_boost_clock(intptr_t device, int clock_type) except? 0 +cpdef object device_get_supported_memory_clocks(intptr_t device) +cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int memory_clock_m_hz) +cpdef tuple device_get_auto_boosted_clocks_enabled(intptr_t device) +cpdef unsigned int device_get_fan_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_fan_speed_v2(intptr_t device, unsigned int fan) except? 0 +cpdef unsigned int device_get_target_fan_speed(intptr_t device, unsigned int fan) except? 0 +cpdef tuple device_get_min_max_fan_speed(intptr_t device) +cpdef unsigned int device_get_fan_control_policy_v2(intptr_t device, unsigned int fan) except * +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_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 +cpdef int device_get_power_state(intptr_t device) except? -1 +cpdef object device_get_dynamic_pstates_info(intptr_t device) +cpdef int device_get_mem_clk_vf_offset(intptr_t device) except? 0 +cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int pstate) +cpdef tuple device_get_gpc_clk_min_max_vf_offset(intptr_t device) +cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device) +cpdef device_set_clock_offsets(intptr_t device, intptr_t info) +cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0 +cpdef tuple device_get_power_management_limit_constraints(intptr_t device) +cpdef unsigned int device_get_power_management_default_limit(intptr_t device) except? 0 +cpdef unsigned int device_get_power_usage(intptr_t device) except? 0 +cpdef unsigned long long device_get_total_energy_consumption(intptr_t device) except? 0 +cpdef unsigned int device_get_enforced_power_limit(intptr_t device) except? 0 +cpdef tuple device_get_gpu_operation_mode(intptr_t device) +cpdef object device_get_memory_info_v2(intptr_t device) +cpdef int device_get_compute_mode(intptr_t device) except? -1 +cpdef tuple device_get_cuda_compute_capability(intptr_t device) +cpdef tuple device_get_ecc_mode(intptr_t device) +cpdef int device_get_default_ecc_mode(intptr_t device) except? -1 +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 +cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_type, int counter_type) except? 0 +cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int error_type, int counter_type, int location_type) except? 0 +cpdef object device_get_utilization_rates(intptr_t device) +cpdef tuple device_get_encoder_utilization(intptr_t device) +cpdef unsigned int device_get_encoder_capacity(intptr_t device, int encoder_query_type) except? 0 +cpdef tuple device_get_encoder_stats(intptr_t device) +cpdef object device_get_encoder_sessions(intptr_t device) +cpdef tuple device_get_decoder_utilization(intptr_t device) +cpdef tuple device_get_jpg_utilization(intptr_t device) +cpdef tuple device_get_ofa_utilization(intptr_t device) +cpdef object device_get_fbc_stats(intptr_t device) +cpdef object device_get_fbc_sessions(intptr_t device) +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 +cpdef object device_get_bar1_memory_info(intptr_t device) +cpdef unsigned int device_get_irq_num(intptr_t device) except? 0 +cpdef unsigned int device_get_num_gpu_cores(intptr_t device) except? 0 +cpdef unsigned int device_get_power_source(intptr_t device) except * +cpdef unsigned int device_get_memory_bus_width(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_link_max_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_pcie_speed(intptr_t device) except? 0 +cpdef unsigned int device_get_adaptive_clock_info_status(intptr_t device) except? 0 +cpdef unsigned int device_get_bus_type(intptr_t device) except? 0 +cpdef object system_get_conf_compute_capabilities() +cpdef object system_get_conf_compute_state() +cpdef object device_get_conf_compute_mem_size_info(intptr_t device) +cpdef unsigned int system_get_conf_compute_gpus_ready_state() except? 0 +cpdef object device_get_conf_compute_protected_memory_usage(intptr_t device) +cpdef object device_get_conf_compute_gpu_certificate(intptr_t device) +cpdef device_set_conf_compute_unprotected_mem_size(intptr_t device, unsigned long long size_ki_b) +cpdef system_set_conf_compute_gpus_ready_state(unsigned int is_accepting_work) +cpdef object system_get_conf_compute_settings() +cpdef char device_get_gsp_firmware_version(intptr_t device) except? 0 +cpdef tuple device_get_gsp_firmware_mode(intptr_t device) +cpdef object device_get_sram_ecc_error_status(intptr_t device) +cpdef int device_get_accounting_mode(intptr_t device) except? -1 +cpdef object device_get_accounting_stats(intptr_t device, unsigned int pid) +cpdef object device_get_accounting_pids(intptr_t device) +cpdef unsigned int device_get_accounting_buffer_size(intptr_t device) except? 0 +cpdef object device_get_retired_pages(intptr_t device, int cause) +cpdef int device_get_retired_pages_pending_status(intptr_t device) except? -1 +cpdef tuple device_get_remapped_rows(intptr_t device) +cpdef object device_get_row_remapper_histogram(intptr_t device) +cpdef unsigned int device_get_architecture(intptr_t device) except? 0 +cpdef object device_get_clk_mon_status(intptr_t device) +cpdef object device_get_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp) +cpdef unit_set_led_state(intptr_t unit, int color) +cpdef device_set_persistence_mode(intptr_t device, int mode) +cpdef device_set_compute_mode(intptr_t device, int mode) +cpdef device_set_ecc_mode(intptr_t device, int ecc) +cpdef device_clear_ecc_error_counts(intptr_t device, int counter_type) +cpdef device_set_driver_model(intptr_t device, int driver_model, unsigned int flags) +cpdef device_set_gpu_locked_clocks(intptr_t device, unsigned int min_gpu_clock_m_hz, unsigned int max_gpu_clock_m_hz) +cpdef device_reset_gpu_locked_clocks(intptr_t device) +cpdef device_set_memory_locked_clocks(intptr_t device, unsigned int min_mem_clock_m_hz, unsigned int max_mem_clock_m_hz) +cpdef device_reset_memory_locked_clocks(intptr_t device) +cpdef device_set_auto_boosted_clocks_enabled(intptr_t device, int enabled) +cpdef device_set_default_auto_boosted_clocks_enabled(intptr_t device, int enabled, unsigned int flags) +cpdef device_set_default_fan_speed_v2(intptr_t device, unsigned int fan) +cpdef device_set_fan_control_policy(intptr_t device, unsigned int fan, unsigned int policy) +cpdef device_set_gpu_operation_mode(intptr_t device, int mode) +cpdef device_set_api_restriction(intptr_t device, int api_type, int is_restricted) +cpdef device_set_fan_speed_v2(intptr_t device, unsigned int fan, unsigned int speed) +cpdef device_set_accounting_mode(intptr_t device, int mode) +cpdef device_clear_accounting_pids(intptr_t device) +cpdef int device_get_nvlink_state(intptr_t device, unsigned int link) except? -1 +cpdef unsigned int device_get_nvlink_version(intptr_t device, unsigned int link) except? 0 +cpdef unsigned int device_get_nvlink_capability(intptr_t device, unsigned int link, int capability) except? 0 +cpdef object device_get_nvlink_remote_pci_info_v2(intptr_t device, unsigned int link) +cpdef unsigned long long device_get_nvlink_error_counter(intptr_t device, unsigned int link, int counter) except? 0 +cpdef device_reset_nvlink_error_counters(intptr_t device, unsigned int link) +cpdef int device_get_nvlink_remote_device_type(intptr_t device, unsigned int link) except? -1 +cpdef system_set_nvlink_bw_mode(unsigned int nvlink_bw_mode) +cpdef unsigned int system_get_nvlink_bw_mode() except? 0 +cpdef object device_get_nvlink_supported_bw_modes(intptr_t device) +cpdef object device_get_nvlink_bw_mode(intptr_t device) +cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode) +cpdef intptr_t event_set_create() except? 0 +cpdef device_register_events(intptr_t device, unsigned long long event_types, intptr_t set) +cpdef unsigned long long device_get_supported_event_types(intptr_t device) except? 0 +cpdef object event_set_wait_v2(intptr_t set, unsigned int timeoutms) +cpdef event_set_free(intptr_t set) +cpdef device_modify_drain_state(intptr_t pci_info, int new_state) +cpdef int device_query_drain_state(intptr_t pci_info) except? -1 +cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state) +cpdef device_discover_gpus(intptr_t pci_info) +cpdef int device_get_virtualization_mode(intptr_t device) except? -1 +cpdef int device_get_host_vgpu_mode(intptr_t device) except? -1 +cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode) +cpdef unsigned long long vgpu_type_get_gsp_heap_size(unsigned int vgpu_type_id) except? 0 +cpdef unsigned long long vgpu_type_get_fb_reservation(unsigned int vgpu_type_id) except? 0 +cpdef device_set_vgpu_capabilities(intptr_t device, int capability, int state) +cpdef object device_get_grid_licensable_features_v4(intptr_t device) +cpdef unsigned int get_vgpu_driver_capabilities(int capability) except? 0 +cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) except? 0 +cpdef str vgpu_type_get_class(unsigned int vgpu_type_id) +cpdef unsigned int vgpu_type_get_gpu_instance_profile_id(unsigned int vgpu_type_id) except? 0 +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_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 +cpdef unsigned int vgpu_type_get_max_instances_per_vm(unsigned int vgpu_type_id) except? 0 +cpdef object vgpu_type_get_bar1_info(unsigned int vgpu_type_id) +cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance) +cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance) +cpdef unsigned long long vgpu_instance_get_fb_usage(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_license_status(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_type(unsigned int vgpu_instance) except? 0 +cpdef unsigned int vgpu_instance_get_frame_rate_limit(unsigned int vgpu_instance) except? 0 +cpdef int vgpu_instance_get_ecc_mode(unsigned int vgpu_instance) except? -1 +cpdef unsigned int vgpu_instance_get_encoder_capacity(unsigned int vgpu_instance) except? 0 +cpdef vgpu_instance_set_encoder_capacity(unsigned int vgpu_instance, unsigned int encoder_capacity) +cpdef tuple vgpu_instance_get_encoder_stats(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_fbc_stats(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_fbc_sessions(unsigned int vgpu_instance) +cpdef unsigned int vgpu_instance_get_gpu_instance_id(unsigned int vgpu_instance) except? 0 +cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance) +cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int capability) except? 0 +cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance) +cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler) +cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance) +cpdef object gpu_instance_get_vgpu_scheduler_log(intptr_t gpu_instance) +cpdef str device_get_pgpu_metadata_string(intptr_t device) +cpdef object device_get_vgpu_scheduler_log(intptr_t device) +cpdef object device_get_vgpu_scheduler_state(intptr_t device) +cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device) +cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_state) +cpdef set_vgpu_version(intptr_t vgpu_version) +cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp) +cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? -1 +cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance) +cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsigned int pid) +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 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) +cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, unsigned int profile_id) except? 0 +cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_id) except? 0 +cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, intptr_t placement) except? 0 +cpdef gpu_instance_destroy(intptr_t gpu_instance) +cpdef intptr_t device_get_gpu_instance_by_id(intptr_t device, unsigned int id) except? 0 +cpdef object gpu_instance_get_info(intptr_t gpu_instance) +cpdef object gpu_instance_get_compute_instance_profile_info_v(intptr_t gpu_instance, unsigned int profile, unsigned int eng_profile) +cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t gpu_instance, unsigned int profile_id) except? 0 +cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_instance, unsigned int profile_id) +cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsigned int profile_id) except? 0 +cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, intptr_t placement) except? 0 +cpdef compute_instance_destroy(intptr_t compute_instance) +cpdef intptr_t gpu_instance_get_compute_instance_by_id(intptr_t gpu_instance, unsigned int id) except? 0 +cpdef object compute_instance_get_info_v2(intptr_t compute_instance) +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 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) +cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state) +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) +cpdef object system_get_cper_v1() +cpdef object device_get_bbx_time_data_v1(intptr_t device) +cpdef object device_get_accounting_stats_v2(intptr_t device) +cpdef object device_get_remapped_rows_v2(intptr_t device) diff --git a/cuda_bindings_12/cuda/bindings/nvml.pyx b/cuda_bindings_12/cuda/bindings/nvml.pyx new file mode 100644 index 00000000000..4378e667d06 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvml.pyx @@ -0,0 +1,30007 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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=9167da2a3d3194c67c44a0fe8d4d34b3dbd3c0f43061c50b7d238d2044c75509 + + +# <<<< 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.stdint cimport intptr_t +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 _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 >>>> + +cimport cython # NOQA +from cython cimport view +cimport cpython +from libc.string cimport memcpy + +from ._internal.utils cimport (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: + return (size | (ver << 24)) + + +############################################################################### +# Enum +############################################################################### + +class BridgeChipType(_cyb_FastEnum): + """ + Enum to represent type of bridge chip + + See `nvmlBridgeChipType_t`. + """ + BRIDGE_CHIP_PLX = NVML_BRIDGE_CHIP_PLX + BRIDGE_CHIP_BRO4 = NVML_BRIDGE_CHIP_BRO4 + +class NvLinkUtilizationCountUnits(_cyb_FastEnum): + """ + Enum to represent the NvLink utilization counter packet units + + See `nvmlNvLinkUtilizationCountUnits_t`. + """ + NVLINK_COUNTER_UNIT_CYCLES = NVML_NVLINK_COUNTER_UNIT_CYCLES + NVLINK_COUNTER_UNIT_PACKETS = NVML_NVLINK_COUNTER_UNIT_PACKETS + NVLINK_COUNTER_UNIT_BYTES = NVML_NVLINK_COUNTER_UNIT_BYTES + NVLINK_COUNTER_UNIT_RESERVED = NVML_NVLINK_COUNTER_UNIT_RESERVED + NVLINK_COUNTER_UNIT_COUNT = NVML_NVLINK_COUNTER_UNIT_COUNT + +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 + descriptions are target GPU centric ** these can be "OR'd" together + + See `nvmlNvLinkUtilizationCountPktTypes_t`. + """ + NVLINK_COUNTER_PKTFILTER_NOP = NVML_NVLINK_COUNTER_PKTFILTER_NOP + NVLINK_COUNTER_PKTFILTER_READ = NVML_NVLINK_COUNTER_PKTFILTER_READ + NVLINK_COUNTER_PKTFILTER_WRITE = NVML_NVLINK_COUNTER_PKTFILTER_WRITE + NVLINK_COUNTER_PKTFILTER_RATOM = NVML_NVLINK_COUNTER_PKTFILTER_RATOM + NVLINK_COUNTER_PKTFILTER_NRATOM = NVML_NVLINK_COUNTER_PKTFILTER_NRATOM + NVLINK_COUNTER_PKTFILTER_FLUSH = NVML_NVLINK_COUNTER_PKTFILTER_FLUSH + NVLINK_COUNTER_PKTFILTER_RESPDATA = NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA + NVLINK_COUNTER_PKTFILTER_RESPNODATA = NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA + NVLINK_COUNTER_PKTFILTER_ALL = NVML_NVLINK_COUNTER_PKTFILTER_ALL + +class NvLinkCapability(_cyb_FastEnum): + """ + Enum to represent NvLink queryable capabilities + + See `nvmlNvLinkCapability_t`. + """ + NVLINK_CAP_P2P_SUPPORTED = NVML_NVLINK_CAP_P2P_SUPPORTED + NVLINK_CAP_SYSMEM_ACCESS = NVML_NVLINK_CAP_SYSMEM_ACCESS + NVLINK_CAP_P2P_ATOMICS = NVML_NVLINK_CAP_P2P_ATOMICS + NVLINK_CAP_SYSMEM_ATOMICS = NVML_NVLINK_CAP_SYSMEM_ATOMICS + NVLINK_CAP_SLI_BRIDGE = NVML_NVLINK_CAP_SLI_BRIDGE + NVLINK_CAP_VALID = NVML_NVLINK_CAP_VALID + NVLINK_CAP_COUNT = NVML_NVLINK_CAP_COUNT + +class NvLinkErrorCounter(_cyb_FastEnum): + """ + Enum to represent NvLink queryable error counters + + See `nvmlNvLinkErrorCounter_t`. + """ + NVLINK_ERROR_DL_REPLAY = NVML_NVLINK_ERROR_DL_REPLAY + NVLINK_ERROR_DL_RECOVERY = NVML_NVLINK_ERROR_DL_RECOVERY + NVLINK_ERROR_DL_CRC_FLIT = NVML_NVLINK_ERROR_DL_CRC_FLIT + NVLINK_ERROR_DL_CRC_DATA = NVML_NVLINK_ERROR_DL_CRC_DATA + NVLINK_ERROR_DL_ECC_DATA = NVML_NVLINK_ERROR_DL_ECC_DATA + NVLINK_ERROR_COUNT = NVML_NVLINK_ERROR_COUNT + +class IntNvLinkDeviceType(_cyb_FastEnum): + """ + Enum to represent NvLink's remote device type + + See `nvmlIntNvLinkDeviceType_t`. + """ + NVLINK_DEVICE_TYPE_GPU = NVML_NVLINK_DEVICE_TYPE_GPU + NVLINK_DEVICE_TYPE_IBMNPU = NVML_NVLINK_DEVICE_TYPE_IBMNPU + NVLINK_DEVICE_TYPE_SWITCH = NVML_NVLINK_DEVICE_TYPE_SWITCH + NVLINK_DEVICE_TYPE_UNKNOWN = NVML_NVLINK_DEVICE_TYPE_UNKNOWN + +class GpuTopologyLevel(_cyb_FastEnum): + """ + Represents level relationships within a system between two GPUs The + enums are spaced to allow for future relationships + + See `nvmlGpuTopologyLevel_t`. + """ + TOPOLOGY_INTERNAL = NVML_TOPOLOGY_INTERNAL + TOPOLOGY_SINGLE = NVML_TOPOLOGY_SINGLE + TOPOLOGY_MULTIPLE = NVML_TOPOLOGY_MULTIPLE + TOPOLOGY_HOSTBRIDGE = NVML_TOPOLOGY_HOSTBRIDGE + TOPOLOGY_NODE = NVML_TOPOLOGY_NODE + TOPOLOGY_SYSTEM = NVML_TOPOLOGY_SYSTEM + +class GpuP2PStatus(_cyb_FastEnum): + """ + See `nvmlGpuP2PStatus_t`. + """ + P2P_STATUS_OK = NVML_P2P_STATUS_OK + P2P_STATUS_CHIPSET_NOT_SUPPORED = NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED + P2P_STATUS_CHIPSET_NOT_SUPPORTED = NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED + P2P_STATUS_GPU_NOT_SUPPORTED = NVML_P2P_STATUS_GPU_NOT_SUPPORTED + P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED = NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED + P2P_STATUS_DISABLED_BY_REGKEY = NVML_P2P_STATUS_DISABLED_BY_REGKEY + P2P_STATUS_NOT_SUPPORTED = NVML_P2P_STATUS_NOT_SUPPORTED + P2P_STATUS_UNKNOWN = NVML_P2P_STATUS_UNKNOWN + +class GpuP2PCapsIndex(_cyb_FastEnum): + """ + See `nvmlGpuP2PCapsIndex_t`. + """ + P2P_CAPS_INDEX_READ = NVML_P2P_CAPS_INDEX_READ + P2P_CAPS_INDEX_WRITE = NVML_P2P_CAPS_INDEX_WRITE + P2P_CAPS_INDEX_NVLINK = NVML_P2P_CAPS_INDEX_NVLINK + P2P_CAPS_INDEX_ATOMICS = NVML_P2P_CAPS_INDEX_ATOMICS + P2P_CAPS_INDEX_PCI = NVML_P2P_CAPS_INDEX_PCI + P2P_CAPS_INDEX_PROP = NVML_P2P_CAPS_INDEX_PROP + P2P_CAPS_INDEX_UNKNOWN = NVML_P2P_CAPS_INDEX_UNKNOWN + +class SamplingType(_cyb_FastEnum): + """ + Represents Type of Sampling Event + + See `nvmlSamplingType_t`. + """ + TOTAL_POWER_SAMPLES = (NVML_TOTAL_POWER_SAMPLES, 'To represent total power drawn by GPU.') + GPU_UTILIZATION_SAMPLES = (NVML_GPU_UTILIZATION_SAMPLES, 'To represent percent of time during which one or more kernels was executing on the GPU.') + MEMORY_UTILIZATION_SAMPLES = (NVML_MEMORY_UTILIZATION_SAMPLES, 'To represent percent of time during which global (device) memory was being read or written.') + ENC_UTILIZATION_SAMPLES = (NVML_ENC_UTILIZATION_SAMPLES, 'To represent percent of time during which NVENC remains busy.') + DEC_UTILIZATION_SAMPLES = (NVML_DEC_UTILIZATION_SAMPLES, 'To represent percent of time during which NVDEC remains busy.') + PROCESSOR_CLK_SAMPLES = (NVML_PROCESSOR_CLK_SAMPLES, 'To represent processor clock samples.') + MEMORY_CLK_SAMPLES = (NVML_MEMORY_CLK_SAMPLES, 'To represent memory clock samples.') + MODULE_POWER_SAMPLES = (NVML_MODULE_POWER_SAMPLES, 'To represent module power samples for total module starting Grace Hopper.') + JPG_UTILIZATION_SAMPLES = (NVML_JPG_UTILIZATION_SAMPLES, 'To represent percent of time during which NVJPG remains busy.') + OFA_UTILIZATION_SAMPLES = (NVML_OFA_UTILIZATION_SAMPLES, 'To represent percent of time during which NVOFA remains busy.') + SAMPLINGTYPE_COUNT = NVML_SAMPLINGTYPE_COUNT + +class PcieUtilCounter(_cyb_FastEnum): + """ + Represents the queryable PCIe utilization counters + + See `nvmlPcieUtilCounter_t`. + """ + PCIE_UTIL_TX_BYTES = NVML_PCIE_UTIL_TX_BYTES + PCIE_UTIL_RX_BYTES = NVML_PCIE_UTIL_RX_BYTES + PCIE_UTIL_COUNT = NVML_PCIE_UTIL_COUNT + +class ValueType(_cyb_FastEnum): + """ + Represents the type for sample value returned + + See `nvmlValueType_t`. + """ + DOUBLE = NVML_VALUE_TYPE_DOUBLE + UNSIGNED_INT = NVML_VALUE_TYPE_UNSIGNED_INT + UNSIGNED_LONG = NVML_VALUE_TYPE_UNSIGNED_LONG + UNSIGNED_LONG_LONG = NVML_VALUE_TYPE_UNSIGNED_LONG_LONG + SIGNED_LONG_LONG = NVML_VALUE_TYPE_SIGNED_LONG_LONG + SIGNED_INT = NVML_VALUE_TYPE_SIGNED_INT + UNSIGNED_SHORT = NVML_VALUE_TYPE_UNSIGNED_SHORT + COUNT = NVML_VALUE_TYPE_COUNT + +class PerfPolicyType(_cyb_FastEnum): + """ + Represents type of perf policy for which violation times can be queried + + See `nvmlPerfPolicyType_t`. + """ + PERF_POLICY_POWER = (NVML_PERF_POLICY_POWER, 'How long did power violations cause the GPU to be below application clocks.') + PERF_POLICY_THERMAL = (NVML_PERF_POLICY_THERMAL, 'How long did thermal violations cause the GPU to be below application clocks.') + PERF_POLICY_SYNC_BOOST = (NVML_PERF_POLICY_SYNC_BOOST, 'How long did sync boost cause the GPU to be below application clocks.') + 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_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(_cyb_FastEnum): + """ + Represents the thermal sensor targets + + See `nvmlThermalTarget_t`. + """ + NONE = NVML_THERMAL_TARGET_NONE + GPU = (NVML_THERMAL_TARGET_GPU, 'GPU core temperature requires NvPhysicalGpuHandle.') + MEMORY = (NVML_THERMAL_TARGET_MEMORY, 'GPU memory temperature requires NvPhysicalGpuHandle.') + POWER_SUPPLY = (NVML_THERMAL_TARGET_POWER_SUPPLY, 'GPU power supply temperature requires NvPhysicalGpuHandle.') + BOARD = (NVML_THERMAL_TARGET_BOARD, 'GPU board ambient temperature requires NvPhysicalGpuHandle.') + VCD_BOARD = (NVML_THERMAL_TARGET_VCD_BOARD, 'Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle.') + VCD_INLET = (NVML_THERMAL_TARGET_VCD_INLET, 'Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle.') + VCD_OUTLET = (NVML_THERMAL_TARGET_VCD_OUTLET, 'Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle.') + ALL = NVML_THERMAL_TARGET_ALL + UNKNOWN = NVML_THERMAL_TARGET_UNKNOWN + +class ThermalController(_cyb_FastEnum): + """ + Represents the thermal sensor controllers + + See `nvmlThermalController_t`. + """ + NONE = NVML_THERMAL_CONTROLLER_NONE + GPU_INTERNAL = NVML_THERMAL_CONTROLLER_GPU_INTERNAL + ADM1032 = NVML_THERMAL_CONTROLLER_ADM1032 + ADT7461 = NVML_THERMAL_CONTROLLER_ADT7461 + MAX6649 = NVML_THERMAL_CONTROLLER_MAX6649 + MAX1617 = NVML_THERMAL_CONTROLLER_MAX1617 + LM99 = NVML_THERMAL_CONTROLLER_LM99 + LM89 = NVML_THERMAL_CONTROLLER_LM89 + LM64 = NVML_THERMAL_CONTROLLER_LM64 + G781 = NVML_THERMAL_CONTROLLER_G781 + ADT7473 = NVML_THERMAL_CONTROLLER_ADT7473 + SBMAX6649 = NVML_THERMAL_CONTROLLER_SBMAX6649 + VBIOSEVT = NVML_THERMAL_CONTROLLER_VBIOSEVT + OS = NVML_THERMAL_CONTROLLER_OS + NVSYSCON_CANOAS = NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS + NVSYSCON_E551 = NVML_THERMAL_CONTROLLER_NVSYSCON_E551 + MAX6649R = NVML_THERMAL_CONTROLLER_MAX6649R + ADT7473S = NVML_THERMAL_CONTROLLER_ADT7473S + UNKNOWN = NVML_THERMAL_CONTROLLER_UNKNOWN + +class CoolerControl(_cyb_FastEnum): + """ + Cooler control type + + See `nvmlCoolerControl_t`. + """ + THERMAL_COOLER_SIGNAL_NONE = (NVML_THERMAL_COOLER_SIGNAL_NONE, 'This cooler has no control signal.') + THERMAL_COOLER_SIGNAL_TOGGLE = (NVML_THERMAL_COOLER_SIGNAL_TOGGLE, 'This cooler can only be toggled either ON or OFF (eg a switch).') + 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(_cyb_FastEnum): + """ + Cooler's target + + See `nvmlCoolerTarget_t`. + """ + THERMAL_NONE = (NVML_THERMAL_COOLER_TARGET_NONE, 'This cooler cools nothing.') + THERMAL_GPU = (NVML_THERMAL_COOLER_TARGET_GPU, 'This cooler can cool the GPU.') + THERMAL_MEMORY = (NVML_THERMAL_COOLER_TARGET_MEMORY, 'This cooler can cool the memory.') + 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(_cyb_FastEnum): + """ + Enum to represent different UUID types + + See `nvmlUUIDType_t`. + """ + NONE = (NVML_UUID_TYPE_NONE, 'Undefined type.') + ASCII = (NVML_UUID_TYPE_ASCII, 'ASCII format type.') + BINARY = (NVML_UUID_TYPE_BINARY, 'Binary format type.') + +class EnableState(_cyb_FastEnum): + """ + Generic enable/disable enum. + + See `nvmlEnableState_t`. + """ + FEATURE_DISABLED = (NVML_FEATURE_DISABLED, 'Feature disabled.') + FEATURE_ENABLED = (NVML_FEATURE_ENABLED, 'Feature enabled.') + +class BrandType(_cyb_FastEnum): + """ + - The Brand of the GPU + + See `nvmlBrandType_t`. + """ + BRAND_UNKNOWN = NVML_BRAND_UNKNOWN + BRAND_QUADRO = NVML_BRAND_QUADRO + BRAND_TESLA = NVML_BRAND_TESLA + BRAND_NVS = NVML_BRAND_NVS + BRAND_GRID = NVML_BRAND_GRID + BRAND_GEFORCE = NVML_BRAND_GEFORCE + BRAND_TITAN = NVML_BRAND_TITAN + BRAND_NVIDIA_VAPPS = NVML_BRAND_NVIDIA_VAPPS + BRAND_NVIDIA_VPC = NVML_BRAND_NVIDIA_VPC + BRAND_NVIDIA_VCS = NVML_BRAND_NVIDIA_VCS + BRAND_NVIDIA_VWS = NVML_BRAND_NVIDIA_VWS + BRAND_NVIDIA_CLOUD_GAMING = NVML_BRAND_NVIDIA_CLOUD_GAMING + BRAND_NVIDIA_VGAMING = NVML_BRAND_NVIDIA_VGAMING + BRAND_QUADRO_RTX = NVML_BRAND_QUADRO_RTX + BRAND_NVIDIA_RTX = NVML_BRAND_NVIDIA_RTX + BRAND_NVIDIA = NVML_BRAND_NVIDIA + BRAND_GEFORCE_RTX = NVML_BRAND_GEFORCE_RTX + BRAND_TITAN_RTX = NVML_BRAND_TITAN_RTX + BRAND_COUNT = NVML_BRAND_COUNT + +class TemperatureThresholds(_cyb_FastEnum): + """ + Temperature thresholds. + + See `nvmlTemperatureThresholds_t`. + """ + TEMPERATURE_THRESHOLD_SHUTDOWN = NVML_TEMPERATURE_THRESHOLD_SHUTDOWN + TEMPERATURE_THRESHOLD_SLOWDOWN = NVML_TEMPERATURE_THRESHOLD_SLOWDOWN + TEMPERATURE_THRESHOLD_MEM_MAX = NVML_TEMPERATURE_THRESHOLD_MEM_MAX + TEMPERATURE_THRESHOLD_GPU_MAX = NVML_TEMPERATURE_THRESHOLD_GPU_MAX + TEMPERATURE_THRESHOLD_ACOUSTIC_MIN = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN + TEMPERATURE_THRESHOLD_ACOUSTIC_CURR = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR + TEMPERATURE_THRESHOLD_ACOUSTIC_MAX = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX + TEMPERATURE_THRESHOLD_GPS_CURR = NVML_TEMPERATURE_THRESHOLD_GPS_CURR + TEMPERATURE_THRESHOLD_COUNT = NVML_TEMPERATURE_THRESHOLD_COUNT + +class TemperatureSensors(_cyb_FastEnum): + """ + Temperature sensors. + + See `nvmlTemperatureSensors_t`. + """ + TEMPERATURE_GPU = (NVML_TEMPERATURE_GPU, 'Temperature sensor for the GPU die.') + TEMPERATURE_COUNT = NVML_TEMPERATURE_COUNT + +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 + equivalent to NVML_COMPUTEMODE_EXCLUSIVE_THREAD in CUDA 4.0 and beyond. + + See `nvmlComputeMode_t`. + """ + COMPUTEMODE_DEFAULT = (NVML_COMPUTEMODE_DEFAULT, 'Default compute mode -- multiple contexts per device.') + COMPUTEMODE_EXCLUSIVE_THREAD = (NVML_COMPUTEMODE_EXCLUSIVE_THREAD, 'Support Removed.') + COMPUTEMODE_PROHIBITED = (NVML_COMPUTEMODE_PROHIBITED, 'Compute-prohibited mode -- no contexts per device.') + 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(_cyb_FastEnum): + """ + Memory error types + + See `nvmlMemoryErrorType_t`. + """ + CORRECTED = (NVML_MEMORY_ERROR_TYPE_CORRECTED, 'A memory error that was corrected For ECC errors, these are single bit errors For Texture memory, these are errors fixed by resend') + 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(_cyb_FastEnum): + """ + Represents Nvlink Version + + See `nvmlNvlinkVersion_t`. + """ + VERSION_INVALID = (NVML_NVLINK_VERSION_INVALID, 'NVLink version is invalid.') + VERSION_1_0 = (NVML_NVLINK_VERSION_1_0, 'NVLink Version 1.0.') + VERSION_2_0 = (NVML_NVLINK_VERSION_2_0, 'NVLink Version 2.0.') + VERSION_2_2 = (NVML_NVLINK_VERSION_2_2, 'NVLink Version 2.2.') + VERSION_3_0 = (NVML_NVLINK_VERSION_3_0, 'NVLink Version 3.0.') + 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(_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 + more frequent. On Linux the driver unloads when no active clients + exist. If persistence mode is enabled or there is always a driver + client active (e.g. X11), then Linux also sees per-boot behavior. If + not, volatile counts are reset each time a compute app is run. + + 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).') + COUNT = (NVML_ECC_COUNTER_TYPE_COUNT, 'Count of memory counter types.') + +class ClockType(_cyb_FastEnum): + """ + Clock types. All speeds are in Mhz. + + See `nvmlClockType_t`. + """ + CLOCK_GRAPHICS = (NVML_CLOCK_GRAPHICS, 'Graphics clock domain.') + CLOCK_SM = (NVML_CLOCK_SM, 'SM clock domain.') + CLOCK_MEM = (NVML_CLOCK_MEM, 'Memory clock domain.') + CLOCK_VIDEO = (NVML_CLOCK_VIDEO, 'Video encoder/decoder clock domain.') + CLOCK_COUNT = (NVML_CLOCK_COUNT, 'Count of clock types.') + +class ClockId(_cyb_FastEnum): + """ + Clock Ids. These are used in combination with `nvmlClockType_t` to + specify a single clock value. + + See `nvmlClockId_t`. + """ + CURRENT = (NVML_CLOCK_ID_CURRENT, 'Current actual clock value.') + APP_CLOCK_TARGET = (NVML_CLOCK_ID_APP_CLOCK_TARGET, 'Target application clock. Deprecated, do not use.') + APP_CLOCK_DEFAULT = (NVML_CLOCK_ID_APP_CLOCK_DEFAULT, 'Default application clock target Deprecated, do not use.') + 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(_cyb_FastEnum): + """ + Driver models. Windows only. + + See `nvmlDriverModel_t`. + """ + DRIVER_WDDM = (NVML_DRIVER_WDDM, 'WDDM driver model -- GPU treated as a display device.') + 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(_cyb_FastEnum): + """ + Allowed PStates. + + See `nvmlPstates_t`. + """ + PSTATE_0 = (NVML_PSTATE_0, 'Performance state 0 -- Maximum Performance.') + PSTATE_1 = (NVML_PSTATE_1, 'Performance state 1.') + PSTATE_2 = (NVML_PSTATE_2, 'Performance state 2.') + PSTATE_3 = (NVML_PSTATE_3, 'Performance state 3.') + PSTATE_4 = (NVML_PSTATE_4, 'Performance state 4.') + PSTATE_5 = (NVML_PSTATE_5, 'Performance state 5.') + PSTATE_6 = (NVML_PSTATE_6, 'Performance state 6.') + PSTATE_7 = (NVML_PSTATE_7, 'Performance state 7.') + PSTATE_8 = (NVML_PSTATE_8, 'Performance state 8.') + PSTATE_9 = (NVML_PSTATE_9, 'Performance state 9.') + PSTATE_10 = (NVML_PSTATE_10, 'Performance state 10.') + PSTATE_11 = (NVML_PSTATE_11, 'Performance state 11.') + PSTATE_12 = (NVML_PSTATE_12, 'Performance state 12.') + PSTATE_13 = (NVML_PSTATE_13, 'Performance state 13.') + PSTATE_14 = (NVML_PSTATE_14, 'Performance state 14.') + PSTATE_15 = (NVML_PSTATE_15, 'Performance state 15 -- Minimum Performance.') + PSTATE_UNKNOWN = (NVML_PSTATE_UNKNOWN, 'Unknown performance state.') + +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 + specific user needs. + + See `nvmlGpuOperationMode_t`. + """ + GOM_ALL_ON = (NVML_GOM_ALL_ON, 'Everything is enabled and running at full speed.') + 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(_cyb_FastEnum): + """ + Available infoROM objects. + + See `nvmlInforomObject_t`. + """ + INFOROM_OEM = (NVML_INFOROM_OEM, 'An object defined by OEM.') + INFOROM_ECC = (NVML_INFOROM_ECC, 'The ECC object determining the level of ECC support.') + INFOROM_POWER = (NVML_INFOROM_POWER, 'The power management object.') + 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(_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_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.') + ERROR_ALREADY_INITIALIZED = (NVML_ERROR_ALREADY_INITIALIZED, 'Deprecated: Multiple initializations are now allowed through ref counting.') + ERROR_NOT_FOUND = (NVML_ERROR_NOT_FOUND, 'A query to find an object was unsuccessful.') + ERROR_INSUFFICIENT_SIZE = (NVML_ERROR_INSUFFICIENT_SIZE, 'An input argument is not large enough.') + ERROR_INSUFFICIENT_POWER = (NVML_ERROR_INSUFFICIENT_POWER, "A device's external power cables are not properly attached.") + ERROR_DRIVER_NOT_LOADED = (NVML_ERROR_DRIVER_NOT_LOADED, 'NVIDIA driver is not loaded.') + ERROR_TIMEOUT = (NVML_ERROR_TIMEOUT, 'User provided timeout passed.') + ERROR_IRQ_ISSUE = (NVML_ERROR_IRQ_ISSUE, 'NVIDIA Kernel detected an interrupt issue with a GPU.') + ERROR_LIBRARY_NOT_FOUND = (NVML_ERROR_LIBRARY_NOT_FOUND, "NVML Shared Library couldn't be found or loaded.") + ERROR_FUNCTION_NOT_FOUND = (NVML_ERROR_FUNCTION_NOT_FOUND, "Local version of NVML doesn't implement this function.") + ERROR_CORRUPTED_INFOROM = (NVML_ERROR_CORRUPTED_INFOROM, 'infoROM is corrupted') + ERROR_GPU_IS_LOST = (NVML_ERROR_GPU_IS_LOST, 'The GPU has fallen off the bus or has otherwise become inaccessible.') + ERROR_RESET_REQUIRED = (NVML_ERROR_RESET_REQUIRED, 'The GPU requires a reset before it can be used again.') + ERROR_OPERATING_SYSTEM = (NVML_ERROR_OPERATING_SYSTEM, 'The GPU control device has been blocked by the operating system/cgroups.') + ERROR_LIB_RM_VERSION_MISMATCH = (NVML_ERROR_LIB_RM_VERSION_MISMATCH, 'RM detects a driver/library version mismatch.') + ERROR_IN_USE = (NVML_ERROR_IN_USE, 'An operation cannot be performed because the GPU is currently in use.') + ERROR_MEMORY = (NVML_ERROR_MEMORY, 'Insufficient memory.') + ERROR_NO_DATA = (NVML_ERROR_NO_DATA, 'No data.') + ERROR_VGPU_ECC_NOT_SUPPORTED = (NVML_ERROR_VGPU_ECC_NOT_SUPPORTED, 'The requested vgpu operation is not available on target device, becasue ECC is enabled.') + ERROR_INSUFFICIENT_RESOURCES = (NVML_ERROR_INSUFFICIENT_RESOURCES, 'Ran out of critical resources, other than memory.') + ERROR_FREQ_NOT_SUPPORTED = (NVML_ERROR_FREQ_NOT_SUPPORTED, 'Ran out of critical resources, other than memory.') + ERROR_ARGUMENT_VERSION_MISMATCH = (NVML_ERROR_ARGUMENT_VERSION_MISMATCH, 'The provided version is invalid/unsupported.') + ERROR_DEPRECATED = (NVML_ERROR_DEPRECATED, 'The requested functionality has been deprecated.') + ERROR_NOT_READY = (NVML_ERROR_NOT_READY, 'The system is not ready for the request.') + ERROR_GPU_NOT_FOUND = (NVML_ERROR_GPU_NOT_FOUND, 'No GPUs were found.') + ERROR_INVALID_STATE = (NVML_ERROR_INVALID_STATE, 'Resource not in correct state to perform requested operation.') + 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(_cyb_FastEnum): + """ + See `nvmlDeviceGetMemoryErrorCounter` + + See `nvmlMemoryLocation_t`. + """ + L1_CACHE = (NVML_MEMORY_LOCATION_L1_CACHE, 'GPU L1 Cache.') + L2_CACHE = (NVML_MEMORY_LOCATION_L2_CACHE, 'GPU L2 Cache.') + DRAM = (NVML_MEMORY_LOCATION_DRAM, 'Turing+ DRAM.') + DEVICE_MEMORY = (NVML_MEMORY_LOCATION_DEVICE_MEMORY, 'GPU Device Memory.') + REGISTER_FILE = (NVML_MEMORY_LOCATION_REGISTER_FILE, 'GPU Register File.') + TEXTURE_MEMORY = (NVML_MEMORY_LOCATION_TEXTURE_MEMORY, 'GPU Texture Memory.') + TEXTURE_SHM = (NVML_MEMORY_LOCATION_TEXTURE_SHM, 'Shared memory.') + CBU = (NVML_MEMORY_LOCATION_CBU, 'CBU.') + 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(_cyb_FastEnum): + """ + Causes for page retirement + + See `nvmlPageRetirementCause_t`. + """ + MULTIPLE_SINGLE_BIT_ECC_ERRORS = (NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS, 'Page was retired due to multiple single bit ECC error.') + 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(_cyb_FastEnum): + """ + API types that allow changes to default permission restrictions + + See `nvmlRestrictedAPI_t`. + """ + SET_APPLICATION_CLOCKS = (NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS, 'APIs that change application clocks, see nvmlDeviceSetApplicationsClocks and see nvmlDeviceResetApplicationsClocks. Deprecated, keeping definition for backward compatibility.') + 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(_cyb_FastEnum): + """ + Represents the GPU utilization domains + + See `nvmlGpuUtilizationDomainId_t`. + """ + GPU_UTILIZATION_DOMAIN_GPU = (NVML_GPU_UTILIZATION_DOMAIN_GPU, 'Graphics engine domain.') + GPU_UTILIZATION_DOMAIN_FB = (NVML_GPU_UTILIZATION_DOMAIN_FB, 'Frame buffer domain.') + 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(_cyb_FastEnum): + """ + GPU virtualization mode types. + + See `nvmlGpuVirtualizationMode_t`. + """ + NONE = (NVML_GPU_VIRTUALIZATION_MODE_NONE, 'Represents Bare Metal GPU.') + PASSTHROUGH = (NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH, 'Device is associated with GPU-Passthorugh.') + VGPU = (NVML_GPU_VIRTUALIZATION_MODE_VGPU, 'Device is associated with vGPU inside virtual machine.') + 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(_cyb_FastEnum): + """ + Host vGPU modes + + See `nvmlHostVgpuMode_t`. + """ + NON_SRIOV = (NVML_HOST_VGPU_MODE_NON_SRIOV, 'Non SR-IOV mode.') + SRIOV = (NVML_HOST_VGPU_MODE_SRIOV, 'SR-IOV mode.') + +class VgpuVmIdType(_cyb_FastEnum): + """ + Types of VM identifiers + + See `nvmlVgpuVmIdType_t`. + """ + 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(_cyb_FastEnum): + """ + vGPU GUEST info state + + See `nvmlVgpuGuestInfoState_t`. + """ + 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(_cyb_FastEnum): + """ + vGPU software licensable features + + See `nvmlGridLicenseFeatureCode_t`. + """ + UNKNOWN = (NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN, 'Unknown.') + VGPU = (NVML_GRID_LICENSE_FEATURE_CODE_VGPU, 'Virtual GPU.') + NVIDIA_RTX = (NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX, 'Nvidia RTX.') + VWORKSTATION = (NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION, 'Deprecated, do not use.') + GAMING = (NVML_GRID_LICENSE_FEATURE_CODE_GAMING, 'Gaming.') + COMPUTE = (NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE, 'Compute.') + +class VgpuCapability(_cyb_FastEnum): + """ + vGPU queryable capabilities + + See `nvmlVgpuCapability_t`. + """ + VGPU_CAP_NVLINK_P2P = (NVML_VGPU_CAP_NVLINK_P2P, 'P2P over NVLink is supported.') + VGPU_CAP_GPUDIRECT = (NVML_VGPU_CAP_GPUDIRECT, 'GPUDirect capability is supported.') + VGPU_CAP_MULTI_VGPU_EXCLUSIVE = (NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE, 'vGPU profile cannot be mixed with other vGPU profiles in same VM') + VGPU_CAP_EXCLUSIVE_TYPE = (NVML_VGPU_CAP_EXCLUSIVE_TYPE, 'vGPU profile cannot run on a GPU alongside other profiles of different type') + 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(_cyb_FastEnum): + """ + vGPU driver queryable capabilities + + See `nvmlVgpuDriverCapability_t`. + """ + VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU = (NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU, 'Supports mixing of different vGPU profiles within one guest VM.') + 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(_cyb_FastEnum): + """ + Device vGPU queryable capabilities + + See `nvmlDeviceVgpuCapability_t`. + """ + DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU = (NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU, 'Query whether the fractional vGPU profiles on this GPU can be used in multi-vGPU configurations.') + DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES = (NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES, 'Query whether the GPU support concurrent execution of timesliced vGPU profiles of differing types.') + DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES = (NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES, 'Query whether the GPU support concurrent execution of timesliced vGPU profiles of differing framebuffer sizes.') + DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW = (NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW, "Query the GPU's read_device_buffer expected bandwidth capacity in megabytes per second.") + DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW = (NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW, "Query the GPU's write_device_buffer expected bandwidth capacity in megabytes per second.") + DEVICE_VGPU_CAP_DEVICE_STREAMING = (NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING, 'Query whether the vGPU profiles on the GPU supports migration data streaming.') + DEVICE_VGPU_CAP_MINI_QUARTER_GPU = (NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU, 'Set/Get support for mini-quarter vGPU profiles.') + DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU = (NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU, 'Set/Get support for compute media engine vGPU profiles.') + DEVICE_VGPU_CAP_WARM_UPDATE = (NVML_DEVICE_VGPU_CAP_WARM_UPDATE, 'Query whether the GPU supports FSR and warm update.') + DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS = (NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS, 'Query whether the GPU supports reporting of placements of timesliced vGPU profiles with identical framebuffer sizes.') + DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED = (NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED, 'Query whether the GPU supports timesliced vGPU on MIG.') + 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(_cyb_FastEnum): + """ + Enum describing the GPU Recovery Action + + See `nvmlDeviceGpuRecoveryAction_t`. + """ + GPU_RECOVERY_ACTION_NONE = (NVML_GPU_RECOVERY_ACTION_NONE, 'No action needed.') + GPU_RECOVERY_ACTION_GPU_RESET = (NVML_GPU_RECOVERY_ACTION_GPU_RESET, 'Reset Gpu.') + 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(_cyb_FastEnum): + """ + Fan state enum. + + See `nvmlFanState_t`. + """ + FAN_NORMAL = (NVML_FAN_NORMAL, 'Fan is working properly.') + FAN_FAILED = (NVML_FAN_FAILED, 'Fan has failed.') + +class LedColor(_cyb_FastEnum): + """ + Led color enum. + + See `nvmlLedColor_t`. + """ + GREEN = (NVML_LED_COLOR_GREEN, 'GREEN, indicates good health.') + AMBER = (NVML_LED_COLOR_AMBER, 'AMBER, indicates problem.') + +class EncoderType(_cyb_FastEnum): + """ + Represents type of encoder for capacity can be queried + + See `nvmlEncoderType_t`. + """ + ENCODER_QUERY_H264 = (NVML_ENCODER_QUERY_H264, 'H264 encoder.') + ENCODER_QUERY_HEVC = (NVML_ENCODER_QUERY_HEVC, 'HEVC encoder.') + ENCODER_QUERY_AV1 = (NVML_ENCODER_QUERY_AV1, 'AV1 encoder.') + ENCODER_QUERY_UNKNOWN = (NVML_ENCODER_QUERY_UNKNOWN, 'Unknown encoder.') + +class FBCSessionType(_cyb_FastEnum): + """ + Represents frame buffer capture session type + + See `nvmlFBCSessionType_t`. + """ + UNKNOWN = (NVML_FBC_SESSION_TYPE_UNKNOWN, 'Unknown.') + TOSYS = (NVML_FBC_SESSION_TYPE_TOSYS, 'ToSys.') + CUDA = (NVML_FBC_SESSION_TYPE_CUDA, 'Cuda.') + VID = (NVML_FBC_SESSION_TYPE_VID, 'Vid.') + HWENC = (NVML_FBC_SESSION_TYPE_HWENC, 'HEnc.') + +class DetachGpuState(_cyb_FastEnum): + """ + Is the GPU device to be removed from the kernel by + `nvmlDeviceRemoveGpu()` + + See `nvmlDetachGpuState_t`. + """ + DETACH_GPU_KEEP = NVML_DETACH_GPU_KEEP + DETACH_GPU_REMOVE = NVML_DETACH_GPU_REMOVE + +class PcieLinkState(_cyb_FastEnum): + """ + 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(_cyb_FastEnum): + """ + See `nvmlClockLimitId_t`. + """ + RANGE_START = NVML_CLOCK_LIMIT_ID_RANGE_START + TDP = NVML_CLOCK_LIMIT_ID_TDP + UNLIMITED = NVML_CLOCK_LIMIT_ID_UNLIMITED + +class VgpuVmCompatibility(_cyb_FastEnum): + """ + vGPU VM compatibility codes + + See `nvmlVgpuVmCompatibility_t`. + """ + NONE = (NVML_VGPU_VM_COMPATIBILITY_NONE, 'vGPU is not runnable') + COLD = (NVML_VGPU_VM_COMPATIBILITY_COLD, 'vGPU is runnable from a cold / powered-off state (ACPI S5)') + HIBERNATE = (NVML_VGPU_VM_COMPATIBILITY_HIBERNATE, 'vGPU is runnable from a hibernated state (ACPI S4)') + 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(_cyb_FastEnum): + """ + vGPU-pGPU compatibility limit codes + + See `nvmlVgpuPgpuCompatibilityLimitCode_t`. + """ + VGPU_COMPATIBILITY_LIMIT_NONE = (NVML_VGPU_COMPATIBILITY_LIMIT_NONE, 'Compatibility is not limited.') + VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER = (NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER, 'ompatibility is limited by host driver version.') + VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER = (NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER, 'Compatibility is limited by guest driver version.') + 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(_cyb_FastEnum): + """ + GPM Metric Identifiers + + See `nvmlGpmMetricId_t`. + """ + GPM_METRIC_GRAPHICS_UTIL = (NVML_GPM_METRIC_GRAPHICS_UTIL, 'Percentage of time any compute/graphics app was active on the GPU. 0.0 - 100.0.') + GPM_METRIC_SM_UTIL = (NVML_GPM_METRIC_SM_UTIL, 'Percentage of SMs that were busy. 0.0 - 100.0.') + GPM_METRIC_SM_OCCUPANCY = (NVML_GPM_METRIC_SM_OCCUPANCY, 'Percentage of warps that were active vs theoretical maximum. 0.0 - 100.0.') + GPM_METRIC_INTEGER_UTIL = (NVML_GPM_METRIC_INTEGER_UTIL, "Percentage of time the GPU's SMs were doing integer operations. 0.0 - 100.0.") + GPM_METRIC_ANY_TENSOR_UTIL = (NVML_GPM_METRIC_ANY_TENSOR_UTIL, "Percentage of time the GPU's SMs were doing ANY tensor operations. 0.0 - 100.0.") + GPM_METRIC_DFMA_TENSOR_UTIL = (NVML_GPM_METRIC_DFMA_TENSOR_UTIL, "Percentage of time the GPU's SMs were doing DFMA tensor operations. 0.0 - 100.0.") + GPM_METRIC_HMMA_TENSOR_UTIL = (NVML_GPM_METRIC_HMMA_TENSOR_UTIL, "Percentage of time the GPU's SMs were doing HMMA tensor operations. 0.0 - 100.0.") + GPM_METRIC_DMMA_TENSOR_UTIL = (NVML_GPM_METRIC_DMMA_TENSOR_UTIL, "Percentage of time the GPU's SMs were doing DMMA tensor operations. 0.0 - 100.0.") + GPM_METRIC_IMMA_TENSOR_UTIL = (NVML_GPM_METRIC_IMMA_TENSOR_UTIL, "Percentage of time the GPU's SMs were doing IMMA tensor operations. 0.0 - 100.0.") + GPM_METRIC_DRAM_BW_UTIL = (NVML_GPM_METRIC_DRAM_BW_UTIL, 'Percentage of DRAM bw used vs theoretical maximum. `0.0 - 100.0 */`.') + GPM_METRIC_FP64_UTIL = (NVML_GPM_METRIC_FP64_UTIL, "Percentage of time the GPU's SMs were doing non-tensor FP64 math. 0.0 - 100.0.") + GPM_METRIC_FP32_UTIL = (NVML_GPM_METRIC_FP32_UTIL, "Percentage of time the GPU's SMs were doing non-tensor FP32 math. 0.0 - 100.0.") + GPM_METRIC_FP16_UTIL = (NVML_GPM_METRIC_FP16_UTIL, "Percentage of time the GPU's SMs were doing non-tensor FP16 math. 0.0 - 100.0.") + GPM_METRIC_PCIE_TX_PER_SEC = (NVML_GPM_METRIC_PCIE_TX_PER_SEC, 'PCIe traffic from this GPU in MiB/sec.') + GPM_METRIC_PCIE_RX_PER_SEC = (NVML_GPM_METRIC_PCIE_RX_PER_SEC, 'PCIe traffic to this GPU in MiB/sec.') + GPM_METRIC_NVDEC_0_UTIL = (NVML_GPM_METRIC_NVDEC_0_UTIL, 'Percent utilization of NVDEC 0. 0.0 - 100.0.') + GPM_METRIC_NVDEC_1_UTIL = (NVML_GPM_METRIC_NVDEC_1_UTIL, 'Percent utilization of NVDEC 1. 0.0 - 100.0.') + GPM_METRIC_NVDEC_2_UTIL = (NVML_GPM_METRIC_NVDEC_2_UTIL, 'Percent utilization of NVDEC 2. 0.0 - 100.0.') + GPM_METRIC_NVDEC_3_UTIL = (NVML_GPM_METRIC_NVDEC_3_UTIL, 'Percent utilization of NVDEC 3. 0.0 - 100.0.') + GPM_METRIC_NVDEC_4_UTIL = (NVML_GPM_METRIC_NVDEC_4_UTIL, 'Percent utilization of NVDEC 4. 0.0 - 100.0.') + GPM_METRIC_NVDEC_5_UTIL = (NVML_GPM_METRIC_NVDEC_5_UTIL, 'Percent utilization of NVDEC 5. 0.0 - 100.0.') + GPM_METRIC_NVDEC_6_UTIL = (NVML_GPM_METRIC_NVDEC_6_UTIL, 'Percent utilization of NVDEC 6. 0.0 - 100.0.') + GPM_METRIC_NVDEC_7_UTIL = (NVML_GPM_METRIC_NVDEC_7_UTIL, 'Percent utilization of NVDEC 7. 0.0 - 100.0.') + GPM_METRIC_NVJPG_0_UTIL = (NVML_GPM_METRIC_NVJPG_0_UTIL, 'Percent utilization of NVJPG 0. 0.0 - 100.0.') + GPM_METRIC_NVJPG_1_UTIL = (NVML_GPM_METRIC_NVJPG_1_UTIL, 'Percent utilization of NVJPG 1. 0.0 - 100.0.') + GPM_METRIC_NVJPG_2_UTIL = (NVML_GPM_METRIC_NVJPG_2_UTIL, 'Percent utilization of NVJPG 2. 0.0 - 100.0.') + GPM_METRIC_NVJPG_3_UTIL = (NVML_GPM_METRIC_NVJPG_3_UTIL, 'Percent utilization of NVJPG 3. 0.0 - 100.0.') + GPM_METRIC_NVJPG_4_UTIL = (NVML_GPM_METRIC_NVJPG_4_UTIL, 'Percent utilization of NVJPG 4. 0.0 - 100.0.') + GPM_METRIC_NVJPG_5_UTIL = (NVML_GPM_METRIC_NVJPG_5_UTIL, 'Percent utilization of NVJPG 5. 0.0 - 100.0.') + GPM_METRIC_NVJPG_6_UTIL = (NVML_GPM_METRIC_NVJPG_6_UTIL, 'Percent utilization of NVJPG 6. 0.0 - 100.0.') + GPM_METRIC_NVJPG_7_UTIL = (NVML_GPM_METRIC_NVJPG_7_UTIL, 'Percent utilization of NVJPG 7. 0.0 - 100.0.') + GPM_METRIC_NVOFA_0_UTIL = (NVML_GPM_METRIC_NVOFA_0_UTIL, 'Percent utilization of NVOFA 0. 0.0 - 100.0.') + GPM_METRIC_NVOFA_1_UTIL = (NVML_GPM_METRIC_NVOFA_1_UTIL, 'Percent utilization of NVOFA 1. 0.0 - 100.0.') + GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC, 'NvLink read bandwidth for all links in MiB/sec.') + GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC, 'NvLink write bandwidth for all links in MiB/sec.') + GPM_METRIC_NVLINK_L0_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC, 'NvLink read bandwidth for link 0 in MiB/sec.') + GPM_METRIC_NVLINK_L0_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC, 'NvLink write bandwidth for link 0 in MiB/sec.') + GPM_METRIC_NVLINK_L1_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC, 'NvLink read bandwidth for link 1 in MiB/sec.') + GPM_METRIC_NVLINK_L1_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC, 'NvLink write bandwidth for link 1 in MiB/sec.') + GPM_METRIC_NVLINK_L2_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC, 'NvLink read bandwidth for link 2 in MiB/sec.') + GPM_METRIC_NVLINK_L2_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC, 'NvLink write bandwidth for link 2 in MiB/sec.') + GPM_METRIC_NVLINK_L3_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC, 'NvLink read bandwidth for link 3 in MiB/sec.') + GPM_METRIC_NVLINK_L3_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC, 'NvLink write bandwidth for link 3 in MiB/sec.') + GPM_METRIC_NVLINK_L4_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC, 'NvLink read bandwidth for link 4 in MiB/sec.') + GPM_METRIC_NVLINK_L4_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC, 'NvLink write bandwidth for link 4 in MiB/sec.') + GPM_METRIC_NVLINK_L5_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC, 'NvLink read bandwidth for link 5 in MiB/sec.') + GPM_METRIC_NVLINK_L5_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC, 'NvLink write bandwidth for link 5 in MiB/sec.') + GPM_METRIC_NVLINK_L6_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC, 'NvLink read bandwidth for link 6 in MiB/sec.') + GPM_METRIC_NVLINK_L6_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC, 'NvLink write bandwidth for link 6 in MiB/sec.') + GPM_METRIC_NVLINK_L7_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC, 'NvLink read bandwidth for link 7 in MiB/sec.') + GPM_METRIC_NVLINK_L7_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC, 'NvLink write bandwidth for link 7 in MiB/sec.') + GPM_METRIC_NVLINK_L8_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC, 'NvLink read bandwidth for link 8 in MiB/sec.') + GPM_METRIC_NVLINK_L8_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC, 'NvLink write bandwidth for link 8 in MiB/sec.') + GPM_METRIC_NVLINK_L9_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC, 'NvLink read bandwidth for link 9 in MiB/sec.') + GPM_METRIC_NVLINK_L9_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC, 'NvLink write bandwidth for link 9 in MiB/sec.') + GPM_METRIC_NVLINK_L10_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC, 'NvLink read bandwidth for link 10 in MiB/sec.') + GPM_METRIC_NVLINK_L10_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC, 'NvLink write bandwidth for link 10 in MiB/sec.') + GPM_METRIC_NVLINK_L11_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC, 'NvLink read bandwidth for link 11 in MiB/sec.') + GPM_METRIC_NVLINK_L11_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC, 'NvLink write bandwidth for link 11 in MiB/sec.') + GPM_METRIC_NVLINK_L12_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC, 'NvLink read bandwidth for link 12 in MiB/sec.') + GPM_METRIC_NVLINK_L12_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC, 'NvLink write bandwidth for link 12 in MiB/sec.') + GPM_METRIC_NVLINK_L13_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC, 'NvLink read bandwidth for link 13 in MiB/sec.') + GPM_METRIC_NVLINK_L13_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC, 'NvLink write bandwidth for link 13 in MiB/sec.') + GPM_METRIC_NVLINK_L14_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC, 'NvLink read bandwidth for link 14 in MiB/sec.') + GPM_METRIC_NVLINK_L14_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC, 'NvLink write bandwidth for link 14 in MiB/sec.') + GPM_METRIC_NVLINK_L15_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC, 'NvLink read bandwidth for link 15 in MiB/sec.') + GPM_METRIC_NVLINK_L15_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC, 'NvLink write bandwidth for link 15 in MiB/sec.') + GPM_METRIC_NVLINK_L16_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC, 'NvLink read bandwidth for link 16 in MiB/sec.') + GPM_METRIC_NVLINK_L16_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC, 'NvLink write bandwidth for link 16 in MiB/sec.') + GPM_METRIC_NVLINK_L17_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC, 'NvLink read bandwidth for link 17 in MiB/sec.') + GPM_METRIC_NVLINK_L17_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC, 'NvLink write bandwidth for link 17 in MiB/sec.') + GPM_METRIC_C2C_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC + GPM_METRIC_C2C_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC + GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC + GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC + GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC + GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC + GPM_METRIC_HOSTMEM_CACHE_HIT = NVML_GPM_METRIC_HOSTMEM_CACHE_HIT + GPM_METRIC_HOSTMEM_CACHE_MISS = NVML_GPM_METRIC_HOSTMEM_CACHE_MISS + GPM_METRIC_PEERMEM_CACHE_HIT = NVML_GPM_METRIC_PEERMEM_CACHE_HIT + GPM_METRIC_PEERMEM_CACHE_MISS = NVML_GPM_METRIC_PEERMEM_CACHE_MISS + GPM_METRIC_DRAM_CACHE_HIT = NVML_GPM_METRIC_DRAM_CACHE_HIT + GPM_METRIC_DRAM_CACHE_MISS = NVML_GPM_METRIC_DRAM_CACHE_MISS + GPM_METRIC_NVENC_0_UTIL = NVML_GPM_METRIC_NVENC_0_UTIL + GPM_METRIC_NVENC_1_UTIL = NVML_GPM_METRIC_NVENC_1_UTIL + GPM_METRIC_NVENC_2_UTIL = NVML_GPM_METRIC_NVENC_2_UTIL + GPM_METRIC_NVENC_3_UTIL = NVML_GPM_METRIC_NVENC_3_UTIL + GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR0_CTXSW_REQUESTS = NVML_GPM_METRIC_GR0_CTXSW_REQUESTS + GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR0_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT + GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR1_CTXSW_REQUESTS = NVML_GPM_METRIC_GR1_CTXSW_REQUESTS + GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR1_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT + GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR2_CTXSW_REQUESTS = NVML_GPM_METRIC_GR2_CTXSW_REQUESTS + GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR2_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT + GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR3_CTXSW_REQUESTS = NVML_GPM_METRIC_GR3_CTXSW_REQUESTS + GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR3_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT + GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR4_CTXSW_REQUESTS = NVML_GPM_METRIC_GR4_CTXSW_REQUESTS + GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR4_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT + GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR5_CTXSW_REQUESTS = NVML_GPM_METRIC_GR5_CTXSW_REQUESTS + GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR5_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT + GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE + GPM_METRIC_GR6_CTXSW_REQUESTS = NVML_GPM_METRIC_GR6_CTXSW_REQUESTS + GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ + GPM_METRIC_GR6_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT + GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED + GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE + 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.") + GPM_METRIC_DMMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_DMMA_CYCLES_ACTIVE, "The GPU's SM DMMA tensor activity since reboot.") + GPM_METRIC_HMMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_HMMA_CYCLES_ACTIVE, "The GPU's SM HMMA tensor activity since reboot.") + GPM_METRIC_IMMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_IMMA_CYCLES_ACTIVE, "The GPU's SM IMMA tensor activity since reboot.") + GPM_METRIC_DFMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_DFMA_CYCLES_ACTIVE, "The GPU's SM DFMA tensor activity since reboot.") + GPM_METRIC_PCIE_TX = (NVML_GPM_METRIC_PCIE_TX, 'The PCIe TX traffic since reboot.') + GPM_METRIC_PCIE_RX = (NVML_GPM_METRIC_PCIE_RX, 'The PCIe RX traffic since reboot.') + GPM_METRIC_INTEGER_CYCLES_ACTIVE = (NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE, "The GPU's SM integer activity since reboot.") + GPM_METRIC_FP64_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP64_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") + GPM_METRIC_FP32_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP32_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") + GPM_METRIC_FP16_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP16_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") + GPM_METRIC_NVLINK_L0_RX = (NVML_GPM_METRIC_NVLINK_L0_RX, 'NvLink read for link 0 in bytes since reboot.') + GPM_METRIC_NVLINK_L0_TX = (NVML_GPM_METRIC_NVLINK_L0_TX, 'NvLink write for link 0 in bytes since reboot.') + GPM_METRIC_NVLINK_L1_RX = (NVML_GPM_METRIC_NVLINK_L1_RX, 'NvLink read for link 1 in bytes since reboot.') + GPM_METRIC_NVLINK_L1_TX = (NVML_GPM_METRIC_NVLINK_L1_TX, 'NvLink write for link 1 in bytes since reboot.') + GPM_METRIC_NVLINK_L2_RX = (NVML_GPM_METRIC_NVLINK_L2_RX, 'NvLink read for link 2 in bytes since reboot.') + GPM_METRIC_NVLINK_L2_TX = (NVML_GPM_METRIC_NVLINK_L2_TX, 'NvLink write for link 2 in bytes since reboot.') + GPM_METRIC_NVLINK_L3_RX = (NVML_GPM_METRIC_NVLINK_L3_RX, 'NvLink read for link 3 in bytes since reboot.') + GPM_METRIC_NVLINK_L3_TX = (NVML_GPM_METRIC_NVLINK_L3_TX, 'NvLink write for link 3 in bytes since reboot.') + GPM_METRIC_NVLINK_L4_RX = (NVML_GPM_METRIC_NVLINK_L4_RX, 'NvLink read for link 4 in bytes since reboot.') + GPM_METRIC_NVLINK_L4_TX = (NVML_GPM_METRIC_NVLINK_L4_TX, 'NvLink write for link 4 in bytes since reboot.') + GPM_METRIC_NVLINK_L5_RX = (NVML_GPM_METRIC_NVLINK_L5_RX, 'NvLink read for link 5 in bytes since reboot.') + GPM_METRIC_NVLINK_L5_TX = (NVML_GPM_METRIC_NVLINK_L5_TX, 'NvLink write for link 5 in bytes since reboot.') + GPM_METRIC_NVLINK_L6_RX = (NVML_GPM_METRIC_NVLINK_L6_RX, 'NvLink read for link 6 in bytes since reboot.') + GPM_METRIC_NVLINK_L6_TX = (NVML_GPM_METRIC_NVLINK_L6_TX, 'NvLink write for link 6 in bytes since reboot.') + GPM_METRIC_NVLINK_L7_RX = (NVML_GPM_METRIC_NVLINK_L7_RX, 'NvLink read for link 7 in bytes since reboot.') + GPM_METRIC_NVLINK_L7_TX = (NVML_GPM_METRIC_NVLINK_L7_TX, 'NvLink write for link 7 in bytes since reboot.') + GPM_METRIC_NVLINK_L8_RX = (NVML_GPM_METRIC_NVLINK_L8_RX, 'NvLink read for link 8 in bytes since reboot.') + GPM_METRIC_NVLINK_L8_TX = (NVML_GPM_METRIC_NVLINK_L8_TX, 'NvLink write for link 8 in bytes since reboot.') + GPM_METRIC_NVLINK_L9_RX = (NVML_GPM_METRIC_NVLINK_L9_RX, 'NvLink read for link 9 in bytes since reboot.') + GPM_METRIC_NVLINK_L9_TX = (NVML_GPM_METRIC_NVLINK_L9_TX, 'NvLink write for link 9 in bytes since reboot.') + GPM_METRIC_NVLINK_L10_RX = (NVML_GPM_METRIC_NVLINK_L10_RX, 'NvLink read for link 10 in bytes since reboot.') + GPM_METRIC_NVLINK_L10_TX = (NVML_GPM_METRIC_NVLINK_L10_TX, 'NvLink write for link 10 in bytes since reboot.') + GPM_METRIC_NVLINK_L11_RX = (NVML_GPM_METRIC_NVLINK_L11_RX, 'NvLink read for link 11 in bytes since reboot.') + GPM_METRIC_NVLINK_L11_TX = (NVML_GPM_METRIC_NVLINK_L11_TX, 'NvLink write for link 11 in bytes since reboot.') + GPM_METRIC_NVLINK_L12_RX = (NVML_GPM_METRIC_NVLINK_L12_RX, 'NvLink read for link 12 in bytes since reboot.') + GPM_METRIC_NVLINK_L12_TX = (NVML_GPM_METRIC_NVLINK_L12_TX, 'NvLink write for link 12 in bytes since reboot.') + GPM_METRIC_NVLINK_L13_RX = (NVML_GPM_METRIC_NVLINK_L13_RX, 'NvLink read for link 13 in bytes since reboot.') + GPM_METRIC_NVLINK_L13_TX = (NVML_GPM_METRIC_NVLINK_L13_TX, 'NvLink write for link 13 in bytes since reboot.') + GPM_METRIC_NVLINK_L14_RX = (NVML_GPM_METRIC_NVLINK_L14_RX, 'NvLink read for link 14 in bytes since reboot.') + GPM_METRIC_NVLINK_L14_TX = (NVML_GPM_METRIC_NVLINK_L14_TX, 'NvLink write for link 14 in bytes since reboot.') + GPM_METRIC_NVLINK_L15_RX = (NVML_GPM_METRIC_NVLINK_L15_RX, 'NvLink read for link 15 in bytes since reboot.') + GPM_METRIC_NVLINK_L15_TX = (NVML_GPM_METRIC_NVLINK_L15_TX, 'NvLink write for link 15 in bytes since reboot.') + GPM_METRIC_NVLINK_L16_RX = (NVML_GPM_METRIC_NVLINK_L16_RX, 'NvLink read for link 16 in bytes since reboot.') + 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(_cyb_FastEnum): + """ + See `nvmlPowerProfileType_t`. + """ + POWER_PROFILE_MAX_P = NVML_POWER_PROFILE_MAX_P + POWER_PROFILE_MAX_Q = NVML_POWER_PROFILE_MAX_Q + POWER_PROFILE_COMPUTE = NVML_POWER_PROFILE_COMPUTE + POWER_PROFILE_MEMORY_BOUND = NVML_POWER_PROFILE_MEMORY_BOUND + POWER_PROFILE_NETWORK = NVML_POWER_PROFILE_NETWORK + POWER_PROFILE_BALANCED = NVML_POWER_PROFILE_BALANCED + POWER_PROFILE_LLM_INFERENCE = NVML_POWER_PROFILE_LLM_INFERENCE + POWER_PROFILE_LLM_TRAINING = NVML_POWER_PROFILE_LLM_TRAINING + POWER_PROFILE_RBM = NVML_POWER_PROFILE_RBM + POWER_PROFILE_DCPCIE = NVML_POWER_PROFILE_DCPCIE + POWER_PROFILE_HMMA_SPARSE = NVML_POWER_PROFILE_HMMA_SPARSE + POWER_PROFILE_HMMA_DENSE = NVML_POWER_PROFILE_HMMA_DENSE + POWER_PROFILE_SYNC_BALANCED = NVML_POWER_PROFILE_SYNC_BALANCED + POWER_PROFILE_HPC = NVML_POWER_PROFILE_HPC + POWER_PROFILE_MIG = NVML_POWER_PROFILE_MIG + POWER_PROFILE_MAX = NVML_POWER_PROFILE_MAX + +class DeviceAddressingModeType(_cyb_FastEnum): + """ + Enum to represent device addressing mode values + + See `nvmlDeviceAddressingModeType_t`. + """ + DEVICE_ADDRESSING_MODE_NONE = (NVML_DEVICE_ADDRESSING_MODE_NONE, 'No active mode.') + 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(_cyb_FastEnum): + """ + PRM Counter IDs + + See `nvmlPRMCounterId_t`. + """ + NONE = NVML_PRM_COUNTER_ID_NONE + PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS + PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS + PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS + PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY + PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES + PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT = NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT + PPCNT_PLR_RCV_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES + PPCNT_PLR_RCV_CODE_ERR = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR + PPCNT_PLR_RCV_UNCORRECTABLE_CODE = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE + PPCNT_PLR_XMIT_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES + PPCNT_PLR_XMIT_RETRY_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES + PPCNT_PLR_XMIT_RETRY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS + PPCNT_PLR_SYNC_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS + PPRM_OPER_RECOVERY = NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY + +class PowerProfileOperation(_cyb_FastEnum): + """ + Enum for operation to perform on the requested profiles + + See `nvmlPowerProfileOperation_t`. + """ + CLEAR = (NVML_POWER_PROFILE_OPERATION_CLEAR, 'Remove the requested profiles from the existing list of requested profiles.') + SET = (NVML_POWER_PROFILE_OPERATION_SET, 'Add the requested profiles to the existing list of requested profiles.') + 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") + SOCKET = (1, "Scope of processor socket for affinity queries") + + +class FieldId(_FastEnum): + DEV_ECC_CURRENT = (1, "Current ECC mode. 1=Active. 0=Inactive") + DEV_ECC_PENDING = (2, "Pending ECC mode. 1=Active. 0=Inactive") + # ECC Count Totals + DEV_ECC_SBE_VOL_TOTAL = (3, "Total single bit volatile ECC errors") + DEV_ECC_DBE_VOL_TOTAL = (4, "Total double bit volatile ECC errors") + DEV_ECC_SBE_AGG_TOTAL = (5, "Total single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_TOTAL = (6, "Total double bit aggregate (persistent) ECC errors") + # Individual ECC locations + DEV_ECC_SBE_VOL_L1 = (7, "L1 cache single bit volatile ECC errors") + DEV_ECC_DBE_VOL_L1 = (8, "L1 cache double bit volatile ECC errors") + DEV_ECC_SBE_VOL_L2 = (9, "L2 cache single bit volatile ECC errors") + DEV_ECC_DBE_VOL_L2 = (10, "L2 cache double bit volatile ECC errors") + DEV_ECC_SBE_VOL_DEV = (11, "Device memory single bit volatile ECC errors") + DEV_ECC_DBE_VOL_DEV = (12, "Device memory double bit volatile ECC errors") + DEV_ECC_SBE_VOL_REG = (13, "Register file single bit volatile ECC errors") + DEV_ECC_DBE_VOL_REG = (14, "Register file double bit volatile ECC errors") + DEV_ECC_SBE_VOL_TEX = (15, "Texture memory single bit volatile ECC errors") + DEV_ECC_DBE_VOL_TEX = (16, "Texture memory double bit volatile ECC errors") + DEV_ECC_DBE_VOL_CBU = (17, "CBU double bit volatile ECC errors") + DEV_ECC_SBE_AGG_L1 = (18, "L1 cache single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_L1 = (19, "L1 cache double bit aggregate (persistent) ECC errors") + DEV_ECC_SBE_AGG_L2 = (20, "L2 cache single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_L2 = (21, "L2 cache double bit aggregate (persistent) ECC errors") + DEV_ECC_SBE_AGG_DEV = (22, "Device memory single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_DEV = (23, "Device memory double bit aggregate (persistent) ECC errors") + DEV_ECC_SBE_AGG_REG = (24, "Register File single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_REG = (25, "Register File double bit aggregate (persistent) ECC errors") + DEV_ECC_SBE_AGG_TEX = (26, "Texture memory single bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_TEX = (27, "Texture memory double bit aggregate (persistent) ECC errors") + DEV_ECC_DBE_AGG_CBU = (28, "CBU double bit aggregate ECC errors") + + # Page Retirement + DEV_RETIRED_SBE = (29, "Number of retired pages because of single bit errors") + DEV_RETIRED_DBE = (30, "Number of retired pages because of double bit errors") + DEV_RETIRED_PENDING = (31, "If any pages are pending retirement. 1=yes. 0=no.") + + # NVLink Flit Error Counters + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L0 = (32, "NVLink flow control CRC Error Counter for Lane 0") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L1 = (33, "NVLink flow control CRC Error Counter for Lane 1") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L2 = (34, "NVLink flow control CRC Error Counter for Lane 2") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L3 = (35, "NVLink flow control CRC Error Counter for Lane 3") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L4 = (36, "NVLink flow control CRC Error Counter for Lane 4") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L5 = (37, "NVLink flow control CRC Error Counter for Lane 5") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_TOTAL = (38, "NVLink flow control CRC Error Counter total for all Lanes") + + # NVLink CRC Data Error Counters + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L0 = (39, "NVLink data CRC Error Counter for Lane 0") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L1 = (40, "NVLink data CRC Error Counter for Lane 1") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L2 = (41, "NVLink data CRC Error Counter for Lane 2") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L3 = (42, "NVLink data CRC Error Counter for Lane 3") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L4 = (43, "NVLink data CRC Error Counter for Lane 4") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L5 = (44, "NVLink data CRC Error Counter for Lane 5") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_TOTAL = (45, "NvLink data CRC Error Counter total for all Lanes") + + # NVLink Replay Error Counters + DEV_NVLINK_REPLAY_ERROR_COUNT_L0 = (46, "NVLink Replay Error Counter for Lane 0") + DEV_NVLINK_REPLAY_ERROR_COUNT_L1 = (47, "NVLink Replay Error Counter for Lane 1") + DEV_NVLINK_REPLAY_ERROR_COUNT_L2 = (48, "NVLink Replay Error Counter for Lane 2") + DEV_NVLINK_REPLAY_ERROR_COUNT_L3 = (49, "NVLink Replay Error Counter for Lane 3") + DEV_NVLINK_REPLAY_ERROR_COUNT_L4 = (50, "NVLink Replay Error Counter for Lane 4") + DEV_NVLINK_REPLAY_ERROR_COUNT_L5 = (51, "NVLink Replay Error Counter for Lane 5") + DEV_NVLINK_REPLAY_ERROR_COUNT_TOTAL = (52, "NVLink Replay Error Counter total for all Lanes") + + # NVLink Recovery Error Counters + DEV_NVLINK_RECOVERY_ERROR_COUNT_L0 = (53, "NVLink Recovery Error Counter for Lane 0") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L1 = (54, "NVLink Recovery Error Counter for Lane 1") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L2 = (55, "NVLink Recovery Error Counter for Lane 2") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L3 = (56, "NVLink Recovery Error Counter for Lane 3") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L4 = (57, "NVLink Recovery Error Counter for Lane 4") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L5 = (58, "NVLink Recovery Error Counter for Lane 5") + DEV_NVLINK_RECOVERY_ERROR_COUNT_TOTAL = (59, "NVLink Recovery Error Counter total for all Lanes") + + # NvLink Bandwidth Counters + DEV_NVLINK_BANDWIDTH_C0_L0 = (60, "NVLink Bandwidth Counter for Counter Set 0, Lane 0") + DEV_NVLINK_BANDWIDTH_C0_L1 = (61, "NVLink Bandwidth Counter for Counter Set 0, Lane 1") + DEV_NVLINK_BANDWIDTH_C0_L2 = (62, "NVLink Bandwidth Counter for Counter Set 0, Lane 2") + DEV_NVLINK_BANDWIDTH_C0_L3 = (63, "NVLink Bandwidth Counter for Counter Set 0, Lane 3") + DEV_NVLINK_BANDWIDTH_C0_L4 = (64, "NVLink Bandwidth Counter for Counter Set 0, Lane 4") + DEV_NVLINK_BANDWIDTH_C0_L5 = (65, "NVLink Bandwidth Counter for Counter Set 0, Lane 5") + DEV_NVLINK_BANDWIDTH_C0_TOTAL = (66, "NVLink Bandwidth Counter Total for Counter Set 0, All Lanes") + + # NvLink Bandwidth Counters + DEV_NVLINK_BANDWIDTH_C1_L0 = (67, "NVLink Bandwidth Counter for Counter Set 1, Lane 0") + DEV_NVLINK_BANDWIDTH_C1_L1 = (68, "NVLink Bandwidth Counter for Counter Set 1, Lane 1") + DEV_NVLINK_BANDWIDTH_C1_L2 = (69, "NVLink Bandwidth Counter for Counter Set 1, Lane 2") + DEV_NVLINK_BANDWIDTH_C1_L3 = (70, "NVLink Bandwidth Counter for Counter Set 1, Lane 3") + DEV_NVLINK_BANDWIDTH_C1_L4 = (71, "NVLink Bandwidth Counter for Counter Set 1, Lane 4") + DEV_NVLINK_BANDWIDTH_C1_L5 = (72, "NVLink Bandwidth Counter for Counter Set 1, Lane 5") + DEV_NVLINK_BANDWIDTH_C1_TOTAL = (73, "NVLink Bandwidth Counter Total for Counter Set 1, All Lanes") + + # NVML Perf Policy Counters + DEV_PERF_POLICY_POWER = (74, "Perf Policy Counter for Power Policy") + DEV_PERF_POLICY_THERMAL = (75, "Perf Policy Counter for Thermal Policy") + DEV_PERF_POLICY_SYNC_BOOST = (76, "Perf Policy Counter for Sync boost Policy") + DEV_PERF_POLICY_BOARD_LIMIT = (77, "Perf Policy Counter for Board Limit") + DEV_PERF_POLICY_LOW_UTILIZATION = (78, "Perf Policy Counter for Low GPU Utilization Policy") + DEV_PERF_POLICY_RELIABILITY = (79, "Perf Policy Counter for Reliability Policy") + DEV_PERF_POLICY_TOTAL_APP_CLOCKS = (80, "Perf Policy Counter for Total App Clock Policy") + DEV_PERF_POLICY_TOTAL_BASE_CLOCKS = (81, "Perf Policy Counter for Total Base Clocks Policy") + + # Memory temperatures + DEV_MEMORY_TEMP = (82, "Memory temperature for the device") + + # Energy Counter + DEV_TOTAL_ENERGY_CONSUMPTION = (83, "Total energy consumption for the GPU in mJ since the driver was last reloaded") + + # NVLink Speed + DEV_NVLINK_SPEED_MBPS_L0 = (84, "NVLink Speed in MBps for Link 0") + DEV_NVLINK_SPEED_MBPS_L1 = (85, "NVLink Speed in MBps for Link 1") + DEV_NVLINK_SPEED_MBPS_L2 = (86, "NVLink Speed in MBps for Link 2") + DEV_NVLINK_SPEED_MBPS_L3 = (87, "NVLink Speed in MBps for Link 3") + DEV_NVLINK_SPEED_MBPS_L4 = (88, "NVLink Speed in MBps for Link 4") + DEV_NVLINK_SPEED_MBPS_L5 = (89, "NVLink Speed in MBps for Link 5") + DEV_NVLINK_SPEED_MBPS_COMMON = (90, "Common NVLink Speed in MBps for active links") + + DEV_NVLINK_LINK_COUNT = (91, "Number of NVLinks present on the device") + + DEV_RETIRED_PENDING_SBE = (92, "If any pages are pending retirement due to SBE. 1=yes. 0=no.") + DEV_RETIRED_PENDING_DBE = (93, "If any pages are pending retirement due to DBE. 1=yes. 0=no.") + + DEV_PCIE_REPLAY_COUNTER = (94, "PCIe replay counter") + DEV_PCIE_REPLAY_ROLLOVER_COUNTER = (95, "PCIe replay rollover counter") + + # NVLink Flit Error Counters + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L6 = (96, "NVLink flow control CRC Error Counter for Lane 6") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L7 = (97, "NVLink flow control CRC Error Counter for Lane 7") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L8 = (98, "NVLink flow control CRC Error Counter for Lane 8") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L9 = (99, "NVLink flow control CRC Error Counter for Lane 9") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L10 = (100, "NVLink flow control CRC Error Counter for Lane 10") + DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L11 = (101, "NVLink flow control CRC Error Counter for Lane 11") + + # NVLink CRC Data Error Counters + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L6 = (102, "NVLink data CRC Error Counter for Lane 6") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L7 = (103, "NVLink data CRC Error Counter for Lane 7") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L8 = (104, "NVLink data CRC Error Counter for Lane 8") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L9 = (105, "NVLink data CRC Error Counter for Lane 9") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L10 = (106, "NVLink data CRC Error Counter for Lane 10") + DEV_NVLINK_CRC_DATA_ERROR_COUNT_L11 = (107, "NVLink data CRC Error Counter for Lane 11") + + # NVLink Replay Error Counters + DEV_NVLINK_REPLAY_ERROR_COUNT_L6 = (108, "NVLink Replay Error Counter for Lane 6") + DEV_NVLINK_REPLAY_ERROR_COUNT_L7 = (109, "NVLink Replay Error Counter for Lane 7") + DEV_NVLINK_REPLAY_ERROR_COUNT_L8 = (110, "NVLink Replay Error Counter for Lane 8") + DEV_NVLINK_REPLAY_ERROR_COUNT_L9 = (111, "NVLink Replay Error Counter for Lane 9") + DEV_NVLINK_REPLAY_ERROR_COUNT_L10 = (112, "NVLink Replay Error Counter for Lane 10") + DEV_NVLINK_REPLAY_ERROR_COUNT_L11 = (113, "NVLink Replay Error Counter for Lane 11") + + # NVLink Recovery Error Counters + DEV_NVLINK_RECOVERY_ERROR_COUNT_L6 = (114, "NVLink Recovery Error Counter for Lane 6") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L7 = (115, "NVLink Recovery Error Counter for Lane 7") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L8 = (116, "NVLink Recovery Error Counter for Lane 8") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L9 = (117, "NVLink Recovery Error Counter for Lane 9") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L10 = (118, "NVLink Recovery Error Counter for Lane 10") + DEV_NVLINK_RECOVERY_ERROR_COUNT_L11 = (119, "NVLink Recovery Error Counter for Lane 11") + + # NvLink Bandwidth Counters */ + DEV_NVLINK_BANDWIDTH_C0_L6 = (120, "NVLink Bandwidth Counter for Counter Set 0, Lane 6") + DEV_NVLINK_BANDWIDTH_C0_L7 = (121, "NVLink Bandwidth Counter for Counter Set 0, Lane 7") + DEV_NVLINK_BANDWIDTH_C0_L8 = (122, "NVLink Bandwidth Counter for Counter Set 0, Lane 8") + DEV_NVLINK_BANDWIDTH_C0_L9 = (123, "NVLink Bandwidth Counter for Counter Set 0, Lane 9") + DEV_NVLINK_BANDWIDTH_C0_L10 = (124, "NVLink Bandwidth Counter for Counter Set 0, Lane 10") + DEV_NVLINK_BANDWIDTH_C0_L11 = (125, "NVLink Bandwidth Counter for Counter Set 0, Lane 11") + + # NvLink Bandwidth Counters + DEV_NVLINK_BANDWIDTH_C1_L6 = (126, "NVLink Bandwidth Counter for Counter Set 1, Lane 6") + DEV_NVLINK_BANDWIDTH_C1_L7 = (127, "NVLink Bandwidth Counter for Counter Set 1, Lane 7") + DEV_NVLINK_BANDWIDTH_C1_L8 = (128, "NVLink Bandwidth Counter for Counter Set 1, Lane 8") + DEV_NVLINK_BANDWIDTH_C1_L9 = (129, "NVLink Bandwidth Counter for Counter Set 1, Lane 9") + DEV_NVLINK_BANDWIDTH_C1_L10 = (130, "NVLink Bandwidth Counter for Counter Set 1, Lane 10") + DEV_NVLINK_BANDWIDTH_C1_L11 = (131, "NVLink Bandwidth Counter for Counter Set 1, Lane 11") + + # NVLink Speed + DEV_NVLINK_SPEED_MBPS_L6 = (132, "NVLink Speed in MBps for Link 6") + DEV_NVLINK_SPEED_MBPS_L7 = (133, "NVLink Speed in MBps for Link 7") + DEV_NVLINK_SPEED_MBPS_L8 = (134, "NVLink Speed in MBps for Link 8") + DEV_NVLINK_SPEED_MBPS_L9 = (135, "NVLink Speed in MBps for Link 9") + DEV_NVLINK_SPEED_MBPS_L10 = (136, "NVLink Speed in MBps for Link 10") + DEV_NVLINK_SPEED_MBPS_L11 = (137, "NVLink Speed in MBps for Link 11") + + # NVLink throughput counters field values + DEV_NVLINK_THROUGHPUT_DATA_TX = (138, "NVLink TX Data throughput in KiB") + DEV_NVLINK_THROUGHPUT_DATA_RX = (139, "NVLink RX Data throughput in KiB") + DEV_NVLINK_THROUGHPUT_RAW_TX = (140, "NVLink TX Data + protocol overhead in KiB") + DEV_NVLINK_THROUGHPUT_RAW_RX = (141, "NVLink RX Data + protocol overhead in KiB") + + # Row Remapper + DEV_REMAPPED_COR = (142, "Number of remapped rows due to correctable errors") + DEV_REMAPPED_UNC = (143, "Number of remapped rows due to uncorrectable errors") + DEV_REMAPPED_PENDING = (144, "If any rows are pending remapping. 1=yes 0=no") + DEV_REMAPPED_FAILURE = (145, "If any rows failed to be remapped 1=yes 0=no") + + # Remote device NVLink ID + DEV_NVLINK_REMOTE_NVLINK_ID = (146, "Remote device NVLink ID") + + # NVSwitch: connected NVLink count + DEV_NVSWITCH_CONNECTED_LINK_COUNT = (147, "Number of NVLinks connected to NVSwitch") + + # NvLink ECC Data Error Counters + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L0 = (148, "NVLink data ECC Error Counter for Link 0") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L1 = (149, "NVLink data ECC Error Counter for Link 1") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L2 = (150, "NVLink data ECC Error Counter for Link 2") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L3 = (151, "NVLink data ECC Error Counter for Link 3") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L4 = (152, "NVLink data ECC Error Counter for Link 4") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L5 = (153, "NVLink data ECC Error Counter for Link 5") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L6 = (154, "NVLink data ECC Error Counter for Link 6") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L7 = (155, "NVLink data ECC Error Counter for Link 7") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L8 = (156, "NVLink data ECC Error Counter for Link 8") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L9 = (157, "NVLink data ECC Error Counter for Link 9") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L10 = (158, "NVLink data ECC Error Counter for Link 10") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_L11 = (159, "NVLink data ECC Error Counter for Link 11") + DEV_NVLINK_ECC_DATA_ERROR_COUNT_TOTAL = (160, "NVLink data ECC Error Counter total for all Links") + + # NVLink Error Replay + DEV_NVLINK_ERROR_DL_REPLAY = (161, "NVLink Replay Error Counter") + + # NVLink Recovery Error Counter + DEV_NVLINK_ERROR_DL_RECOVERY = (162, "NVLink Recovery Error Counter") + + # NVLink Recovery Error CRC Counter + DEV_NVLINK_ERROR_DL_CRC = (163, "NVLink CRC Error Counter") + + + # NVLink Speed, State and Version field id 164, 165, and 166 + DEV_NVLINK_GET_SPEED = (164, "NVLink Speed in MBps") + DEV_NVLINK_GET_STATE = (165, "NVLink State - Active,Inactive") + DEV_NVLINK_GET_VERSION = (166, "NVLink Version") + + DEV_NVLINK_GET_POWER_STATE = (167, "NVLink Power state. 0=HIGH_SPEED 1=LOW_SPEED") + DEV_NVLINK_GET_POWER_THRESHOLD = (168, "NVLink length of idle period (units can be found from DEV_NVLINK_GET_POWER_THRESHOLD_UNITS) before transitioning links to sleep state") + + DEV_PCIE_L0_TO_RECOVERY_COUNTER = (169, "Device PEX error recovery counter") + + DEV_C2C_LINK_COUNT = (170, "Number of C2C Links present on the device") + DEV_C2C_LINK_GET_STATUS = (171, "C2C Link Status 0=INACTIVE 1=ACTIVE") + DEV_C2C_LINK_GET_MAX_BW = (172, "C2C Link Speed in MBps for active links") + + DEV_PCIE_COUNT_CORRECTABLE_ERRORS = (173, "PCIe Correctable Errors Counter") + DEV_PCIE_COUNT_NAKS_RECEIVED = (174, "PCIe NAK Receive Counter") + DEV_PCIE_COUNT_RECEIVER_ERROR = (175, "PCIe Receiver Error Counter") + DEV_PCIE_COUNT_BAD_TLP = (176, "PCIe Bad TLP Counter") + DEV_PCIE_COUNT_NAKS_SENT = (177, "PCIe NAK Send Counter") + DEV_PCIE_COUNT_BAD_DLLP = (178, "PCIe Bad DLLP Counter") + DEV_PCIE_COUNT_NON_FATAL_ERROR = (179, "PCIe Non Fatal Error Counter") + DEV_PCIE_COUNT_FATAL_ERROR = (180, "PCIe Fatal Error Counter") + DEV_PCIE_COUNT_UNSUPPORTED_REQ = (181, "PCIe Unsupported Request Counter") + DEV_PCIE_COUNT_LCRC_ERROR = (182, "PCIe LCRC Error Counter") + DEV_PCIE_COUNT_LANE_ERROR = (183, "PCIe Per Lane Error Counter.") + + DEV_IS_RESETLESS_MIG_SUPPORTED = (184, "Device's Restless MIG Capability") + + DEV_POWER_AVERAGE = (185, "GPU power averaged over 1 sec interval, supported on Ampere (except GA100) or newer architectures.") + DEV_POWER_INSTANT = (186, "Current GPU power, supported on all architectures.") + DEV_POWER_MIN_LIMIT = (187, "Minimum power limit in milliwatts.") + DEV_POWER_MAX_LIMIT = (188, "Maximum power limit in milliwatts.") + DEV_POWER_DEFAULT_LIMIT = (189, "Default power limit in milliwatts (limit which device boots with).") + DEV_POWER_CURRENT_LIMIT = (190, "Limit currently enforced in milliwatts (This includes other limits set elsewhere. E.g. Out-of-band).") + DEV_ENERGY = (191, "Total energy consumption (in mJ) since the driver was last reloaded. Same as \ref DEV_TOTAL_ENERGY_CONSUMPTION for the GPU.") + DEV_POWER_REQUESTED_LIMIT = (192, "Power limit requested by NVML or any other userspace client.") + + # GPU T.Limit temperature thresholds in degree Celsius + DEV_TEMPERATURE_SHUTDOWN_TLIMIT = (193, "T.Limit temperature after which GPU may shut down for HW protection") + DEV_TEMPERATURE_SLOWDOWN_TLIMIT = (194, "T.Limit temperature after which GPU may begin HW slowdown") + DEV_TEMPERATURE_MEM_MAX_TLIMIT = (195, "T.Limit temperature after which GPU may begin SW slowdown due to memory temperature") + DEV_TEMPERATURE_GPU_MAX_TLIMIT = (196, "T.Limit temperature after which GPU may be throttled below base clock") + + DEV_PCIE_COUNT_TX_BYTES = (197, "PCIe transmit bytes. Value can be wrapped.") + DEV_PCIE_COUNT_RX_BYTES = (198, "PCIe receive bytes. Value can be wrapped.") + + DEV_IS_MIG_MODE_INDEPENDENT_MIG_QUERY_CAPABLE = (199, "MIG mode independent, MIG query capable device. 1=yes. 0=no.") + + DEV_NVLINK_GET_POWER_THRESHOLD_MAX = (200, "Max Nvlink Power Threshold. See DEV_NVLINK_GET_POWER_THRESHOLD") + + + # NVLink counter field id 201-225 + DEV_NVLINK_COUNT_XMIT_PACKETS = (201, "Total Tx packets on the link in NVLink5") + DEV_NVLINK_COUNT_XMIT_BYTES = (202, "Total Tx bytes on the link in NVLink5") + DEV_NVLINK_COUNT_RCV_PACKETS = (203, "Total Rx packets on the link in NVLink5") + DEV_NVLINK_COUNT_RCV_BYTES = (204, "Total Rx bytes on the link in NVLink5") + DEV_NVLINK_COUNT_VL15_DROPPED = (205, "Deprecated, do not use") + DEV_NVLINK_COUNT_MALFORMED_PACKET_ERRORS = (206, "Number of packets Rx on a link where packets are malformed") + DEV_NVLINK_COUNT_BUFFER_OVERRUN_ERRORS = (207, "Number of packets that were discarded on Rx due to buffer overrun") + DEV_NVLINK_COUNT_RCV_ERRORS = (208, "Total number of packets with errors Rx on a link") + DEV_NVLINK_COUNT_RCV_REMOTE_ERRORS = (209, "Total number of packets Rx - stomp/EBP marker") + DEV_NVLINK_COUNT_RCV_GENERAL_ERRORS = (210, "Total number of packets Rx with header mismatch") + DEV_NVLINK_COUNT_LOCAL_LINK_INTEGRITY_ERRORS = (211, "Total number of times that the count of local errors exceeded a threshold") + DEV_NVLINK_COUNT_XMIT_DISCARDS = (212, "Total number of tx error packets that were discarded") + + DEV_NVLINK_COUNT_LINK_RECOVERY_SUCCESSFUL_EVENTS =(213, "Number of times link went from Up to recovery, succeeded and link came back up") + DEV_NVLINK_COUNT_LINK_RECOVERY_FAILED_EVENTS = (214, "Number of times link went from Up to recovery, failed and link was declared down") + DEV_NVLINK_COUNT_LINK_RECOVERY_EVENTS = (215, "Number of times link went from Up to recovery, irrespective of the result") + + DEV_NVLINK_COUNT_RAW_BER_LANE0 = (216, "Deprecated, do not use") + DEV_NVLINK_COUNT_RAW_BER_LANE1 = (217, "Deprecated, do not use") + DEV_NVLINK_COUNT_RAW_BER = (218, "Deprecated, do not use") + DEV_NVLINK_COUNT_EFFECTIVE_ERRORS = (219, "Sum of the number of errors in each Nvlink packet") + + # NVLink Effective BER + DEV_NVLINK_COUNT_EFFECTIVE_BER = (220, "Effective BER for effective errors") + DEV_NVLINK_COUNT_SYMBOL_ERRORS = (221, "Number of errors in rx symbols") + + # NVLink Symbol BER + DEV_NVLINK_COUNT_SYMBOL_BER = (222, "BER for symbol errors") + + DEV_NVLINK_GET_POWER_THRESHOLD_MIN = (223, "Min Nvlink Power Threshold. See DEV_NVLINK_GET_POWER_THRESHOLD") + DEV_NVLINK_GET_POWER_THRESHOLD_UNITS = (224, "Values are in the form NVML_NVLINK_LOW_POWER_THRESHOLD_UNIT_*") + DEV_NVLINK_GET_POWER_THRESHOLD_SUPPORTED = (225, "Determine if Nvlink Power Threshold feature is supported") + + DEV_RESET_STATUS = (226, "Depracated, do not use (use DEV_GET_GPU_RECOVERY_ACTION instead)") + DEV_DRAIN_AND_RESET_STATUS = (227, "Deprecated, do not use (use DEV_GET_GPU_RECOVERY_ACTION instead)") + DEV_PCIE_OUTBOUND_ATOMICS_MASK = 228 + DEV_PCIE_INBOUND_ATOMICS_MASK = 229 + DEV_GET_GPU_RECOVERY_ACTION = (230, "GPU Recovery action - None/Reset/Reboot/Drain P2P/Drain and Reset") + DEV_C2C_LINK_ERROR_INTR = (231, "C2C Link CRC Error Counter") + DEV_C2C_LINK_ERROR_REPLAY = (232, "C2C Link Replay Error Counter") + DEV_C2C_LINK_ERROR_REPLAY_B2B = (233, "C2C Link Back to Back Replay Error Counter") + DEV_C2C_LINK_POWER_STATE = (234, "C2C Link Power state. See NVML_C2C_POWER_STATE_*") + + # NVLink counter field id 235-250 + DEV_NVLINK_COUNT_FEC_HISTORY_0 = (235, "Count of symbol errors that are corrected - bin 0") + DEV_NVLINK_COUNT_FEC_HISTORY_1 = (236, "Count of symbol errors that are corrected - bin 1") + DEV_NVLINK_COUNT_FEC_HISTORY_2 = (237, "Count of symbol errors that are corrected - bin 2") + DEV_NVLINK_COUNT_FEC_HISTORY_3 = (238, "Count of symbol errors that are corrected - bin 3") + DEV_NVLINK_COUNT_FEC_HISTORY_4 = (239, "Count of symbol errors that are corrected - bin 4") + DEV_NVLINK_COUNT_FEC_HISTORY_5 = (240, "Count of symbol errors that are corrected - bin 5") + DEV_NVLINK_COUNT_FEC_HISTORY_6 = (241, "Count of symbol errors that are corrected - bin 6") + DEV_NVLINK_COUNT_FEC_HISTORY_7 = (242, "Count of symbol errors that are corrected - bin 7") + DEV_NVLINK_COUNT_FEC_HISTORY_8 = (243, "Count of symbol errors that are corrected - bin 8") + DEV_NVLINK_COUNT_FEC_HISTORY_9 = (244, "Count of symbol errors that are corrected - bin 9") + DEV_NVLINK_COUNT_FEC_HISTORY_10 = (245, "Count of symbol errors that are corrected - bin 10") + DEV_NVLINK_COUNT_FEC_HISTORY_11 = (246, "Count of symbol errors that are corrected - bin 11") + DEV_NVLINK_COUNT_FEC_HISTORY_12 = (247, "Count of symbol errors that are corrected - bin 12") + DEV_NVLINK_COUNT_FEC_HISTORY_13 = (248, "Count of symbol errors that are corrected - bin 13") + DEV_NVLINK_COUNT_FEC_HISTORY_14 = (249, "Count of symbol errors that are corrected - bin 14") + DEV_NVLINK_COUNT_FEC_HISTORY_15 = (250, "Count of symbol errors that are corrected - bin 15") + + # Power Smoothing + PWR_SMOOTHING_ENABLED = (251, "Enablement (0/DISABLED or 1/ENABLED)") + PWR_SMOOTHING_PRIV_LVL = (252, "Current privilege level") + PWR_SMOOTHING_IMM_RAMP_DOWN_ENABLED = (253, "Immediate ramp down enablement (0/DISABLED or 1/ENABLED)") + PWR_SMOOTHING_APPLIED_TMP_CEIL = (254, "Applied TMP ceiling value in Watts") + PWR_SMOOTHING_APPLIED_TMP_FLOOR = (255, "Applied TMP floor value in Watts") + PWR_SMOOTHING_MAX_PERCENT_TMP_FLOOR_SETTING = (256, "Max % TMP Floor value") + PWR_SMOOTHING_MIN_PERCENT_TMP_FLOOR_SETTING = (257, "Min % TMP Floor value") + PWR_SMOOTHING_HW_CIRCUITRY_PERCENT_LIFETIME_REMAINING = (258, "HW Circuitry % lifetime remaining") + PWR_SMOOTHING_MAX_NUM_PRESET_PROFILES = (259, "Max number of preset profiles") + PWR_SMOOTHING_PROFILE_PERCENT_TMP_FLOOR = (260, "% TMP floor for a given profile") + PWR_SMOOTHING_PROFILE_RAMP_UP_RATE = (261, "Ramp up rate in mW/s for a given profile") + PWR_SMOOTHING_PROFILE_RAMP_DOWN_RATE = (262, "Ramp down rate in mW/s for a given profile") + PWR_SMOOTHING_PROFILE_RAMP_DOWN_HYST_VAL = (263, "Ramp down hysteresis value in ms for a given profile") + PWR_SMOOTHING_ACTIVE_PRESET_PROFILE = (264, "Active preset profile number") + PWR_SMOOTHING_ADMIN_OVERRIDE_PERCENT_TMP_FLOOR = (265, "% TMP floor for a given profile") + PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_UP_RATE = (266, "Ramp up rate in mW/s for a given profile") + PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_DOWN_RATE = (267, "Ramp down rate in mW/s for a given profile") + PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_DOWN_HYST_VAL = (268, "Ramp down hysteresis value in ms for a given profile") + + # Field values for Clock Throttle Reason Counters + DEV_CLOCKS_EVENT_REASON_SW_POWER_CAP = (74, "Throttling to not exceed currently set power limits in ns") + DEV_CLOCKS_EVENT_REASON_SYNC_BOOST = (76, "Throttling to match minimum possible clock across Sync Boost Group in ns") + DEV_CLOCKS_EVENT_REASON_SW_THERM_SLOWDOWN = (269, "Throttling to ensure ((GPU temp < GPU Max Operating Temp) && (Memory Temp < Memory Max Operating Temp)) in ns") + DEV_CLOCKS_EVENT_REASON_HW_THERM_SLOWDOWN = (270, "Throttling due to temperature being too high (reducing core clocks by a factor of 2 or more) in ns") + DEV_CLOCKS_EVENT_REASON_HW_POWER_BRAKE_SLOWDOWN = (271, "Throttling due to external power brake assertion trigger (reducing core clocks by a factor of 2 or more) in ns") + DEV_POWER_SYNC_BALANCING_FREQ = (272, "Accumulated frequency of the GPU to be used for averaging") + DEV_POWER_SYNC_BALANCING_AF = (273, "Accumulated activity factor of the GPU to be used for averaging") + DEV_EDPP_MULTIPLIER = (274, "EDPp multiplier expressed as a percentage") + + PWR_SMOOTHING_PRIMARY_POWER_FLOOR = (275, "Current primary power floor value in Watts") + PWR_SMOOTHING_SECONDARY_POWER_FLOOR = (276, "Current secondary power floor value in Watts") + PWR_SMOOTHING_MIN_PRIMARY_FLOOR_ACT_OFFSET = (277, "Minimum primary floor activation offset value in Watts") + PWR_SMOOTHING_MIN_PRIMARY_FLOOR_ACT_POINT = (278, "Minimum primary floor activation point value in Watts") + PWR_SMOOTHING_WINDOW_MULTIPLIER = (279, "Window Multiplier value in ms") + PWR_SMOOTHING_DELAYED_PWR_SMOOTHING_SUPPORTED = (280, "Support (0/Not Supported or 1/Supported) for delayed power smoothing") + PWR_SMOOTHING_PROFILE_SECONDARY_POWER_FLOOR = (281, "Current secondary power floor value in Watts for a given profile") + PWR_SMOOTHING_PROFILE_PRIMARY_FLOOR_ACT_WIN_MULT = (282, "Current primary floor activation window multiplier value for a given profile") + PWR_SMOOTHING_PROFILE_PRIMARY_FLOOR_TAR_WIN_MULT = (283, "Current primary floor target window multiplier value for a given profile") + PWR_SMOOTHING_PROFILE_PRIMARY_FLOOR_ACT_OFFSET = (284, "Current primary floor activation offset value in Watts for a given profile") + PWR_SMOOTHING_ADMIN_OVERRIDE_SECONDARY_POWER_FLOOR = (285, "Current secondary power floor value in Watts for admin override") + PWR_SMOOTHING_ADMIN_OVERRIDE_PRIMARY_FLOOR_ACT_WIN_MULT = (286, "Current primary floor activation window multiplier value for admin override") + PWR_SMOOTHING_ADMIN_OVERRIDE_PRIMARY_FLOOR_TAR_WIN_MULT = (287, "Current primary floor target window multiplier value for admin override") + PWR_SMOOTHING_ADMIN_OVERRIDE_PRIMARY_FLOOR_ACT_OFFSET = (288, "Current primary floor activation offset value in Watts for admin override") + + + +NVLINK_MAX_LINKS = 18 + + +class RUSD(_FastEnum): + POLL_NONE = (0x0, "Disable RUSD polling on all metric groups") + POLL_CLOCK = (0x1, "Enable RUSD polling on clock group") + POLL_PERF = (0x2, "Enable RUSD polling on performance group") + POLL_MEMORY = (0x4, "Enable RUSD polling on memory group") + POLL_POWER = (0x8, "Enable RUSD polling on power group") + POLL_THERMAL = (0x10, "Enable RUSD polling on thermal group") + POLL_PCI = (0x20, "Enable RUSD polling on pci group") + POLL_FAN = (0x40, "Enable RUSD polling on fan group") + POLL_PROC_UTIL = (0x80, "Enable RUSD polling on process utilization group") + POLL_ALL = (0xFFFFFFFFFFFFFFFF, "Enable RUSD polling on all groups") + + +class PowerMizerMode(_FastEnum): + ADAPTIVE = (0, "Adjust GPU clocks based on GPU utilization") + PREFER_MAXIMUM_PERFORMANCE = (1, "Raise GPU clocks to favor maximum performance, to the extent that thermal and other constraints allow") + AUTO = (2, "PowerMizer mode is driver controlled") + PREFER_CONSISTENT_PERFORMANCE = (3, "lock to GPU base clocks") + + +class DeviceArch(_FastEnum): + KEPLER = 2 + MAXWELL = 3 + PASCAL = 4 + VOLTA = 5 + TURING = 6 + AMPERE = 7 + ADA = 8 + HOPPER = 9 + BLACKWELL = 10 + UNKNOWN = 0xFFFFFFFF + + +class BusType(_FastEnum): + UNKNOWN = (0, "Unknown bus type") + PCI = (1, "PCI bus") + PCIE = (2, "PXI-Express bus") + FPCI = (3, "FPCI bus") + AGP = (4, "AGP bus") + + +class FanControlPolicy(_FastEnum): + TEMPERATURE_CONTINUOUS_SW = (0, "Temperature-controlled fan policy") + MANUAL = (1, "Manual fan control policy") + + +class PowerSource(_FastEnum): + AC = 0x00000000 + BATTERY = 0x00000001 + UNDERSIZED = 0x00000002 + + +class PcieLinkMaxSpeed(_FastEnum): + SPEED_INVALID = 0x00000000 + SPEED_2500MBPS = 0x00000001 + SPEED_5000MBPS = 0x00000002 + SPEED_8000MBPS = 0x00000003 + SPEED_16000MBPS = 0x00000004 + SPEED_32000MBPS = 0x00000005 + SPEED_64000MBPS = 0x00000006 + + +class AdaptiveClockingInfoStatus(_FastEnum): + DISABLED = 0x00000000 + ENABLED = 0x00000001 + + +MAX_GPU_UTILIZATIONS = 8 + + +class PcieAtomicsCap(_FastEnum): + FETCHADD32 = (0x01, "32-bit fetch and add") + FETCHADD64 = (0x02, "64-bit fetch and add") + SWAP32 = (0x04, "32-bit swap") + SWAP64 = (0x08, "64-bit swap") + CAS32 = (0x10, "32-bit compare and swap") + CAS64 = (0x20, "64-bit compare and swap") + CAS128 = (0x40, "128-bit compare and swap") + MAX = 7 + + +class PowerScope(_FastEnum): + GPU = (0, "Targets only GPU") + MODULE = (1, "Targets the whole module") + MEMORY = (2, "Targets the GPU memory") + + +# Need "Enum" suffix to disambiguate from nvmlGridLicenseExpiry_t +class GridLicenseExpiryEnum(_FastEnum): + NOT_AVAILABLE = (0, "Expiry information not available") + INVALID = (1, "Invalid expiry or error fetching expiry") + VALID = (2, "Valid expiry") + NOT_APPLICABLE = (3, "Expiry not applicable") + PERMANENT = (4, "Permanent expiry") + + +GRID_LICENSE_FEATURE_MAX_COUNT = 3 + + +class VgpuVirtualizationCapMigration(_FastEnum): + NO = 0x0 + YES = 0x1 + + +class VgpuPgpuVirtualizationCapMigration(_FastEnum): + NO = 0x0 + YES = 0x1 + + +class VgpuSchedulerPolicy(_FastEnum): + UNKNOWN = 0 + BEST_EFFORT = 1 + EQUAL_SHARE = 2 + FIXED_SHARE = 3 + + +class VgpuSchedulerArr(_FastEnum): + DEFAULT = 0 + DISABLE = 1 + ENABLE = 2 + + +class VgpuSchedulerEngineType(_FastEnum): + GRAPHICS = 1 + NVENC1 = 2 + + +class GridLicenseState(_FastEnum): + UNKNOWN = 0 + UNINITIALIZED = 1 + UNLICENSED_UNRESTRICTED = 2 + UNLICENSED_RESTRICTED = 3 + UNLICENSED = 4 + LICENSED = 5 + + +class NvlinkLowPowerThresholdUnit(_FastEnum): + UNIT_100US = 0x0 + UNIT_50US = 0x1 + + +class NvlinkPowerState(_FastEnum): + HIGH_SPEED = 0x0 + LOW_SPEED = 0x1 + + +class NvlinkLowPowerThreshold(_FastEnum): + MIN = 0x1 + MAX = 0x1FFF + RESET = 0xFFFFFFFF + DEFAULT = 0xFFFFFFFF + + +class C2CPowerState(_FastEnum): + FULL_POWER = 0 + LOW_POWER = 1 + + +class EventType(_FastEnum): + NONE = 0x0000000000000000 + SINGLE_BIT_ECC_ERROR = 0x0000000000000001 + DOUBLE_BIT_ECC_ERROR = 0x0000000000000002 + PSTATE = 0x0000000000000004 + XID_CRITICAL_ERROR = 0x0000000000000008 + CLOCK = 0x0000000000000010 + POWER_SOURCE_CHANGE = 0x0000000000000080 + MIG_CONFIG_CHANGE = 0x0000000000000100 + SINGLE_BIT_ECC_ERROR_STORM = 0x0000000000000200 + DRAM_RETIREMENT_EVENT = 0x0000000000000400 + DRAM_RETIREMENT_FAILURE = 0x0000000000000800 + NON_FATAL_POISON_ERROR = 0x0000000000001000 + FATAL_POISON_ERROR = 0x0000000000002000 + GPU_UNAVAILABLE_ERROR = 0x0000000000004000 + GPU_RECOVERY_ACTION = 0x0000000000008000 + + +class SystemEventType(_FastEnum): + GPU_DRIVER_UNBIND = 0x0000000000000001 + GPU_DRIVER_BIND = 0x0000000000000002 + + +class ClocksEventReasons(_FastEnum): + EVENT_REASON_GPU_IDLE = 0x0000000000000001 + EVENT_REASON_APPLICATIONS_CLOCKS_SETTING = 0x0000000000000002 + EVENT_REASON_SW_POWER_CAP = 0x0000000000000004 + THROTTLE_REASON_HW_SLOWDOWN = 0x0000000000000008 + EVENT_REASON_SYNC_BOOST = 0x0000000000000010 + EVENT_REASON_SW_THERMAL_SLOWDOWN = 0x0000000000000020 + THROTTLE_REASON_HW_THERMAL_SLOWDOWN = 0x0000000000000040 + THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN = 0x0000000000000080 + EVENT_REASON_DISPLAY_CLOCK_SETTING = 0x0000000000000100 + EVENT_REASON_NONE = 0x0000000000000000 + + +class EncoderQuery(_FastEnum): + H264 = 0x00 + HEVC = 0x01 + AV1 = 0x02 + UNKNOWN = 0xFF + + +class NvFBCSessionFlag(_FastEnum): + DIFFMAP_ENABLED = 0x00000001 + CLASSIFICATIONMAP_ENABLED = 0x00000002 + CAPTURE_WITH_WAIT_NO_WAIT = 0x00000004 + CAPTURE_WITH_WAIT_INFINITE = 0x00000008 + CAPTURE_WITH_WAIT_TIMEOUT = 0x00000010 + + +class CCSystemCpuCaps(_FastEnum): + NONE = 0 + AMD_SEV = 1 + INTEL_TDX = 2 + AMD_SEV_SNP = 3 + AMD_SNP_VTOM = 4 + + +class CCSystemGpus(_FastEnum): + CC_NOT_CAPABLE = 0 + CC_CAPABLE = 1 + + +class CCSystemDevtoolsMode(_FastEnum): + OFF = 0 + ON = 1 + + +class CCSystemEnvironment(_FastEnum): + UNAVAILABLE = 0 + SIM = 1 + PROD = 2 + + +class CCSystemFeature(_FastEnum): + DISABLED = 0 + ENABLED = 1 + + +class CCSystemMultiGpu(_FastEnum): + NONE = 0 + PROTECTED_PCIE = 1 + NVLE = 2 + + +class CCAcceptingClientRequests(_FastEnum): + FALSE = 0 + TRUE = 1 + + +class GpuFabricState(_FastEnum): + NOT_SUPPORTED = 0 + NOT_STARTED = 1 + IN_PROGRESS = 2 + COMPLETED = 3 + + +class GpuFabricHealthMaskDegradedBw(_FastEnum): + NOT_SUPPORTED = 0 + TRUE = 1 + FALSE = 2 + + +class GpuFabricHealthMaskRouteRecovery(_FastEnum): + NOT_SUPPORTED = 0 + TRUE = 1 + FALSE = 2 + + +class GpuFabricHealthMaskRouteUnhealthy(_FastEnum): + NOT_SUPPORTED = 0 + TRUE = 1 + FALSE = 2 + + +class GpuFabricHealthMaskAccessTimeout(_FastEnum): + NOT_SUPPORTED = 0 + TRUE = 1 + FALSE = 2 + + +class GpuFabricHealthMaskIncorrectConfiguration(_FastEnum): + NOT_SUPPORTED = 0 + NONE = 1 + INCORRECT_SYSGUID = 2 + INCORRECT_CHASSIS_SN = 3 + NO_PARTITION = 4 + INSUFFICIENT_NVLINKS = 5 + INCOMPATIBLE_GPU_FW = 6 + INVALID_LOCATION = 7 + + +class GpuFabricHealthSummary(_FastEnum): + NOT_SUPPORTED = 0 + HEALTHY = 1 + UNHEALTHY = 2 + LIMITED_CAPACITY = 3 + + +class InitFlag(_FastEnum): + NO_GPUS = 1 + NO_ATTACH = 2 + + +class NvlinkState(_FastEnum): + INACTIVE = 0x0 + ACTIVE = 0x1 + SLEEP = 0x2 + + +class NvlinkFirmwareUcodeType(_FastEnum): + MSE = 0x1 + NETIR = 0x2 + NETIR_UPHY = 0x3 + NETIR_CLN = 0x4 + NETIR_DLN = 0x5 + + +class DeviceMig(_FastEnum): + DISABLE = 0 + ENABLE = 1 + + +class GpuInstanceProfile(_FastEnum): + PROFILE_1_SLICE = 0x0 + PROFILE_2_SLICE = 0x1 + PROFILE_3_SLICE = 0x2 + PROFILE_4_SLICE = 0x3 + PROFILE_7_SLICE = 0x4 + PROFILE_8_SLICE = 0x5 + PROFILE_6_SLICE = 0x6 + PROFILE_1_SLICE_REV1 = 0x7 + PROFILE_2_SLICE_REV1 = 0x8 + PROFILE_1_SLICE_REV2 = 0x9 + PROFILE_1_SLICE_GFX = 0x0A + PROFILE_2_SLICE_GFX = 0x0B + PROFILE_4_SLICE_GFX = 0x0C + PROFILE_1_SLICE_NO_ME = 0x0D + PROFILE_2_SLICE_NO_ME = 0x0E + PROFILE_1_SLICE_ALL_ME = 0x0F + PROFILE_2_SLICE_ALL_ME = 0x10 + PROFILE_COUNT = 0x11 + + +class GpuInstanceProfileCaps(_FastEnum): + P2P = 0x1 + GFX = 0x2 + + +class ComputeInstanceProfileCaps(_FastEnum): + GFX = 0x1 + + +class ComputeInstanceProfile(_FastEnum): + PROFILE_1_SLICE = 0x0 + PROFILE_2_SLICE = 0x1 + PROFILE_3_SLICE = 0x2 + PROFILE_4_SLICE = 0x3 + PROFILE_7_SLICE = 0x4 + PROFILE_8_SLICE = 0x5 + PROFILE_6_SLICE = 0x6 + PROFILE_1_SLICE_REV1 = 0x7 + PROFILE_COUNT = 0x8 + + +class ComputeInstanceEngineProfile(_FastEnum): + SHARED = 0x0 + COUNT = 0x1 + + +class PowerSmoothingProfileParam(_FastEnum): + PERCENT_TMP_FLOOR = 0 + RAMP_UP_RATE = 1 + RAMP_DOWN_RATE = 2 + RAMP_DOWN_HYSTERESIS = 3 + SECONDARY_POWER_FLOOR = 4 + PRIMARY_FLOOR_ACT_WIN_MULT = 5 + PRIMARY_FLOOR_TAR_WIN_MULT = 6 + PRIMARY_FLOOR_ACT_OFFSET = 7 + + +class VgpuPgpu(_FastEnum): + HETEROGENEOUS_MODE = 0 # Heterogeneous vGPU mode. + HOMOGENEOUS_MODE = 1 # Homogeneous vGPU mode. + + +############################################################################### +# Error handling +############################################################################### + + +class NvmlError(Exception): + def __init__(self, status): + self.status = status + s = error_string(status) + super(NvmlError, self).__init__(s) + + def __reduce__(self): + return (type(self), (self.status,)) + + +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: + return UninitializedError(pystatus) + elif status == 2: + return InvalidArgumentError(pystatus) + elif status == 3: + return NotSupportedError(pystatus) + elif status == 4: + return NoPermissionError(pystatus) + elif status == 5: + return AlreadyInitializedError(pystatus) + elif status == 6: + return NotFoundError(pystatus) + elif status == 7: + return InsufficientSizeError(pystatus) + elif status == 8: + return InsufficientPowerError(pystatus) + elif status == 9: + return DriverNotLoadedError(pystatus) + elif status == 10: + return TimeoutError(pystatus) + elif status == 11: + return IrqIssueError(pystatus) + elif status == 12: + return LibraryNotFoundError(pystatus) + elif status == 13: + return FunctionNotFoundError(pystatus) + elif status == 14: + return CorruptedInforomError(pystatus) + elif status == 15: + return GpuIsLostError(pystatus) + elif status == 16: + return ResetRequiredError(pystatus) + elif status == 17: + return OperatingSystemError(pystatus) + elif status == 18: + return LibRmVersionMismatchError(pystatus) + elif status == 19: + return InUseError(pystatus) + elif status == 20: + return MemoryError(pystatus) + elif status == 21: + return NoDataError(pystatus) + elif status == 22: + return VgpuEccNotSupportedError(pystatus) + elif status == 23: + return InsufficientResourcesError(pystatus) + elif status == 24: + return FreqNotSupportedError(pystatus) + elif status == 25: + return ArgumentVersionMismatchError(pystatus) + elif status == 26: + return DeprecatedError(pystatus) + elif status == 27: + return NotReadyError(pystatus) + elif status == 28: + return GpuNotFoundError(pystatus) + elif status == 29: + return InvalidStateError(pystatus) + elif status == 30: + return ResetTypeNotSupportedError(pystatus) + elif status == 999: + return UnknownError(pystatus) + return NvmlError(status) + + +@cython.profile(False) +cpdef int check_status(int status) except 1 nogil: + if status != 0: + with gil: + raise _nvml_error_factory(status) + return status != 0 + + +@cython.profile(False) +cpdef int check_status_size(int status) except 1 nogil: + if status == nvmlReturn_t.NVML_ERROR_INSUFFICIENT_SIZE: + return 0 + return check_status(status) + + +############################################################################### +# Wrapper functions +############################################################################### + + +cdef _get_pci_info_ext_v1_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.domain)) - (&pod), + (&(pod.bus)) - (&pod), + (&(pod.device)) - (&pod), + (&(pod.pciDeviceId)) - (&pod), + (&(pod.pciSubSystemId)) - (&pod), + (&(pod.baseClass)) - (&pod), + (&(pod.subClass)) - (&pod), + (&(pod.busId)) - (&pod), + ], + 'itemsize': sizeof(nvmlPciInfoExt_v1_t), + }) + +pci_info_ext_v1_dtype = _get_pci_info_ext_v1_dtype_offsets() + +cdef class PciInfoExt_v1: + """Empty-initialize an instance of `nvmlPciInfoExt_v1_t`. + + + .. seealso:: `nvmlPciInfoExt_v1_t` + """ + cdef: + nvmlPciInfoExt_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPciInfoExt_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PciInfoExt_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPciInfoExt_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PciInfoExt_v1 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 PciInfoExt_v1 other_ + if not isinstance(other, PciInfoExt_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfoExt_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPciInfoExt_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PciInfoExt_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfoExt_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].version = val + + @property + def domain(self): + """int: The PCI domain on which the device's bus resides, 0 to 0xffffffff.""" + return self._ptr[0].domain + + @domain.setter + def domain(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].domain = val + + @property + def bus(self): + """int: The bus on which the device resides, 0 to 0xff.""" + return self._ptr[0].bus + + @bus.setter + def bus(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].bus = val + + @property + def device_(self): + """int: The device's id on the bus, 0 to 31.""" + return self._ptr[0].device + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].device = val + + @property + def pci_device_id(self): + """int: The combined 16-bit device id and 16-bit vendor id.""" + return self._ptr[0].pciDeviceId + + @pci_device_id.setter + def pci_device_id(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].pciDeviceId = val + + @property + def pci_sub_system_id(self): + """int: The 32-bit Sub System Device ID.""" + return self._ptr[0].pciSubSystemId + + @pci_sub_system_id.setter + def pci_sub_system_id(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].pciSubSystemId = val + + @property + def base_class(self): + """int: The 8-bit PCI base class code.""" + return self._ptr[0].baseClass + + @base_class.setter + def base_class(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].baseClass = val + + @property + def sub_class(self): + """int: The 8-bit PCI sub class code.""" + return self._ptr[0].subClass + + @sub_class.setter + def sub_class(self, val): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + self._ptr[0].subClass = val + + @property + def bus_id(self): + """~_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): + if self._readonly: + raise ValueError("This PciInfoExt_v1 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 32: + raise ValueError("String too long for field bus_id, max length is 31") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlPciInfoExt_v1_t), PciInfoExt_v1) + + @staticmethod + def from_data(data): + """Create an PciInfoExt_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `pci_info_ext_v1_dtype` holding the data. + """ + 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): + """Create an PciInfoExt_v1 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 PciInfoExt_v1 obj = PciInfoExt_v1.__new__(PciInfoExt_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPciInfoExt_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PciInfoExt_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPciInfoExt_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_pci_info_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.busIdLegacy)) - (&pod), + (&(pod.domain)) - (&pod), + (&(pod.bus)) - (&pod), + (&(pod.device)) - (&pod), + (&(pod.pciDeviceId)) - (&pod), + (&(pod.pciSubSystemId)) - (&pod), + (&(pod.busId)) - (&pod), + ], + 'itemsize': sizeof(nvmlPciInfo_t), + }) + +pci_info_dtype = _get_pci_info_dtype_offsets() + +cdef class PciInfo: + """Empty-initialize an instance of `nvmlPciInfo_t`. + + + .. seealso:: `nvmlPciInfo_t` + """ + cdef: + nvmlPciInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPciInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PciInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPciInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PciInfo 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 PciInfo other_ + if not isinstance(other, PciInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPciInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PciInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def bus_id_legacy(self): + """~_numpy.int8: (array of length 16).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].busIdLegacy) + + @bus_id_legacy.setter + def bus_id_legacy(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 16: + raise ValueError("String too long for field bus_id_legacy, max length is 15") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].busIdLegacy), ptr, 16) + + @property + def domain(self): + """int: """ + return self._ptr[0].domain + + @domain.setter + def domain(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + self._ptr[0].domain = val + + @property + def bus(self): + """int: """ + return self._ptr[0].bus + + @bus.setter + def bus(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + self._ptr[0].bus = val + + @property + def device_(self): + """int: """ + return self._ptr[0].device + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + self._ptr[0].device = val + + @property + def pci_device_id(self): + """int: """ + return self._ptr[0].pciDeviceId + + @pci_device_id.setter + def pci_device_id(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + self._ptr[0].pciDeviceId = val + + @property + def pci_sub_system_id(self): + """int: """ + return self._ptr[0].pciSubSystemId + + @pci_sub_system_id.setter + def pci_sub_system_id(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + self._ptr[0].pciSubSystemId = val + + @property + def bus_id(self): + """~_numpy.int8: (array of length 32).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].busId) + + @bus_id.setter + def bus_id(self, val): + if self._readonly: + raise ValueError("This PciInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 32: + raise ValueError("String too long for field bus_id, max length is 31") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlPciInfo_t), PciInfo) + + @staticmethod + def from_data(data): + """Create an PciInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `pci_info_dtype` holding the data. + """ + 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): + """Create an PciInfo 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 PciInfo obj = PciInfo.__new__(PciInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPciInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PciInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPciInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_utilization_dtype_offsets(): + cdef nvmlUtilization_t pod + return _numpy.dtype({ + 'names': ['gpu', 'memory'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.gpu)) - (&pod), + (&(pod.memory)) - (&pod), + ], + 'itemsize': sizeof(nvmlUtilization_t), + }) + +utilization_dtype = _get_utilization_dtype_offsets() + +cdef class Utilization: + """Empty-initialize an instance of `nvmlUtilization_t`. + + + .. seealso:: `nvmlUtilization_t` + """ + cdef: + nvmlUtilization_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlUtilization_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Utilization") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlUtilization_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.Utilization 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 Utilization other_ + if not isinstance(other, Utilization): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUtilization_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlUtilization_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Utilization") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUtilization_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def gpu(self): + """int: """ + return self._ptr[0].gpu + + @gpu.setter + def gpu(self, val): + if self._readonly: + raise ValueError("This Utilization instance is read-only") + self._ptr[0].gpu = val + + @property + def memory(self): + """int: """ + return self._ptr[0].memory + + @memory.setter + def memory(self, val): + if self._readonly: + raise ValueError("This Utilization instance is read-only") + self._ptr[0].memory = val + + @staticmethod + def from_buffer(buffer): + """Create an Utilization instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlUtilization_t), Utilization) + + @staticmethod + def from_data(data): + """Create an Utilization instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `utilization_dtype` holding the data. + """ + return _cyb_from_data(data, "utilization_dtype", utilization_dtype, Utilization) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an Utilization 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 Utilization obj = Utilization.__new__(Utilization) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlUtilization_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Utilization") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUtilization_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_memory_dtype_offsets(): + cdef nvmlMemory_t pod + return _numpy.dtype({ + 'names': ['total', 'free', 'used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.total)) - (&pod), + (&(pod.free)) - (&pod), + (&(pod.used)) - (&pod), + ], + 'itemsize': sizeof(nvmlMemory_t), + }) + +memory_dtype = _get_memory_dtype_offsets() + +cdef class Memory: + """Empty-initialize an instance of `nvmlMemory_t`. + + + .. seealso:: `nvmlMemory_t` + """ + cdef: + nvmlMemory_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlMemory_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Memory") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlMemory_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.Memory 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 Memory other_ + if not isinstance(other, Memory): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlMemory_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Memory") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def total(self): + """int: """ + return self._ptr[0].total + + @total.setter + def total(self, val): + if self._readonly: + raise ValueError("This Memory instance is read-only") + self._ptr[0].total = val + + @property + def free(self): + """int: """ + return self._ptr[0].free + + @free.setter + def free(self, val): + if self._readonly: + raise ValueError("This Memory instance is read-only") + self._ptr[0].free = val + + @property + def used(self): + """int: """ + return self._ptr[0].used + + @used.setter + def used(self, val): + if self._readonly: + raise ValueError("This Memory instance is read-only") + self._ptr[0].used = val + + @staticmethod + def from_buffer(buffer): + """Create an Memory instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlMemory_t), Memory) + + @staticmethod + def from_data(data): + """Create an Memory instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `memory_dtype` holding the data. + """ + return _cyb_from_data(data, "memory_dtype", memory_dtype, Memory) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an Memory 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 Memory obj = Memory.__new__(Memory) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlMemory_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Memory") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlMemory_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_memory_v2_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.total)) - (&pod), + (&(pod.reserved)) - (&pod), + (&(pod.free)) - (&pod), + (&(pod.used)) - (&pod), + ], + 'itemsize': sizeof(nvmlMemory_v2_t), + }) + +memory_v2_dtype = _get_memory_v2_dtype_offsets() + +cdef class Memory_v2: + """Empty-initialize an instance of `nvmlMemory_v2_t`. + + + .. seealso:: `nvmlMemory_v2_t` + """ + cdef: + nvmlMemory_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlMemory_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Memory_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlMemory_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__}.Memory_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 Memory_v2 other_ + if not isinstance(other, Memory_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlMemory_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Memory_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This Memory_v2 instance is read-only") + self._ptr[0].version = val + + @property + def total(self): + """int: """ + return self._ptr[0].total + + @total.setter + def total(self, val): + if self._readonly: + raise ValueError("This Memory_v2 instance is read-only") + self._ptr[0].total = val + + @property + def reserved(self): + """int: """ + return self._ptr[0].reserved + + @reserved.setter + def reserved(self, val): + if self._readonly: + raise ValueError("This Memory_v2 instance is read-only") + self._ptr[0].reserved = val + + @property + def free(self): + """int: """ + return self._ptr[0].free + + @free.setter + def free(self, val): + if self._readonly: + raise ValueError("This Memory_v2 instance is read-only") + self._ptr[0].free = val + + @property + def used(self): + """int: """ + return self._ptr[0].used + + @used.setter + def used(self, val): + if self._readonly: + raise ValueError("This Memory_v2 instance is read-only") + self._ptr[0].used = val + + @staticmethod + def from_buffer(buffer): + """Create an Memory_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlMemory_v2_t), Memory_v2) + + @staticmethod + def from_data(data): + """Create an Memory_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `memory_v2_dtype` holding the data. + """ + 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): + """Create an Memory_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 Memory_v2 obj = Memory_v2.__new__(Memory_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlMemory_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Memory_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlMemory_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_ba_r1memory_dtype_offsets(): + cdef nvmlBAR1Memory_t pod + return _numpy.dtype({ + 'names': ['bar1_total', 'bar1_free', 'bar1_used'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.bar1Total)) - (&pod), + (&(pod.bar1Free)) - (&pod), + (&(pod.bar1Used)) - (&pod), + ], + 'itemsize': sizeof(nvmlBAR1Memory_t), + }) + +ba_r1memory_dtype = _get_ba_r1memory_dtype_offsets() + +cdef class BAR1Memory: + """Empty-initialize an instance of `nvmlBAR1Memory_t`. + + + .. seealso:: `nvmlBAR1Memory_t` + """ + cdef: + nvmlBAR1Memory_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlBAR1Memory_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BAR1Memory") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlBAR1Memory_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.BAR1Memory 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 BAR1Memory other_ + if not isinstance(other, BAR1Memory): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBAR1Memory_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlBAR1Memory_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BAR1Memory") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBAR1Memory_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def bar1_total(self): + """int: """ + return self._ptr[0].bar1Total + + @bar1_total.setter + def bar1_total(self, val): + if self._readonly: + raise ValueError("This BAR1Memory instance is read-only") + self._ptr[0].bar1Total = val + + @property + def bar1_free(self): + """int: """ + return self._ptr[0].bar1Free + + @bar1_free.setter + def bar1_free(self, val): + if self._readonly: + raise ValueError("This BAR1Memory instance is read-only") + self._ptr[0].bar1Free = val + + @property + def bar1_used(self): + """int: """ + return self._ptr[0].bar1Used + + @bar1_used.setter + def bar1_used(self, val): + if self._readonly: + raise ValueError("This BAR1Memory instance is read-only") + self._ptr[0].bar1Used = val + + @staticmethod + def from_buffer(buffer): + """Create an BAR1Memory instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlBAR1Memory_t), BAR1Memory) + + @staticmethod + def from_data(data): + """Create an BAR1Memory instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `ba_r1memory_dtype` holding the data. + """ + 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): + """Create an BAR1Memory 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 BAR1Memory obj = BAR1Memory.__new__(BAR1Memory) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlBAR1Memory_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating BAR1Memory") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBAR1Memory_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_process_info_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.pid)) - (&pod), + (&(pod.usedGpuMemory)) - (&pod), + (&(pod.gpuInstanceId)) - (&pod), + (&(pod.computeInstanceId)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=process_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlProcessInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlProcessInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ProcessInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ProcessInfo 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, ProcessInfo)) 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 pid(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def used_gpu_memory(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.used_gpu_memory[0]) + return self._data.used_gpu_memory + + @used_gpu_memory.setter + def used_gpu_memory(self, val): + self._data.used_gpu_memory = val + + @property + def gpu_instance_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.gpu_instance_id[0]) + return self._data.gpu_instance_id + + @gpu_instance_id.setter + def gpu_instance_id(self, val): + self._data.gpu_instance_id = val + + @property + def compute_instance_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.compute_instance_id[0]) + return self._data.compute_instance_id + + @compute_instance_id.setter + def compute_instance_id(self, val): + self._data.compute_instance_id = 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 ProcessInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == process_info_dtype: + return ProcessInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ProcessInfo instance with the memory from the given buffer.""" + return ProcessInfo.from_data(_numpy.frombuffer(buffer, dtype=process_info_dtype)) + + @staticmethod + def from_data(data): + """Create an ProcessInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `process_info_dtype` holding the data. + """ + cdef ProcessInfo obj = ProcessInfo.__new__(ProcessInfo) + 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 != process_info_dtype: + raise ValueError("data array must be of dtype process_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ProcessInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ProcessInfo obj = ProcessInfo.__new__(ProcessInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_process_detail_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.pid)) - (&pod), + (&(pod.usedGpuMemory)) - (&pod), + (&(pod.gpuInstanceId)) - (&pod), + (&(pod.computeInstanceId)) - (&pod), + (&(pod.usedGpuCcProtectedMemory)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessDetail_v1_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=process_detail_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlProcessDetail_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlProcessDetail_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ProcessDetail_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ProcessDetail_v1 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, ProcessDetail_v1)) 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 pid(self): + """Union[~_numpy.uint32, int]: Process ID.""" + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def used_gpu_memory(self): + """Union[~_numpy.uint64, int]: Amount of used GPU memory in bytes. Under WDDM, NVML_VALUE_NOT_AVAILABLE is always reported because Windows KMD manages all the memory and not the NVIDIA driver""" + if self._data.size == 1: + return int(self._data.used_gpu_memory[0]) + return self._data.used_gpu_memory + + @used_gpu_memory.setter + def used_gpu_memory(self, val): + self._data.used_gpu_memory = val + + @property + def gpu_instance_id(self): + """Union[~_numpy.uint32, int]: If MIG is enabled, stores a valid GPU instance ID. gpuInstanceId is.""" + if self._data.size == 1: + return int(self._data.gpu_instance_id[0]) + return self._data.gpu_instance_id + + @gpu_instance_id.setter + def gpu_instance_id(self, val): + self._data.gpu_instance_id = val + + @property + def compute_instance_id(self): + """Union[~_numpy.uint32, int]: If MIG is enabled, stores a valid compute instance ID. computeInstanceId.""" + if self._data.size == 1: + return int(self._data.compute_instance_id[0]) + return self._data.compute_instance_id + + @compute_instance_id.setter + def compute_instance_id(self, val): + self._data.compute_instance_id = val + + @property + def used_gpu_cc_protected_memory(self): + """Union[~_numpy.uint64, int]: Amount of used GPU conf compute protected memory in bytes.""" + if self._data.size == 1: + return int(self._data.used_gpu_cc_protected_memory[0]) + return self._data.used_gpu_cc_protected_memory + + @used_gpu_cc_protected_memory.setter + def used_gpu_cc_protected_memory(self, val): + self._data.used_gpu_cc_protected_memory = 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 ProcessDetail_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == process_detail_v1_dtype: + return ProcessDetail_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ProcessDetail_v1 instance with the memory from the given buffer.""" + return ProcessDetail_v1.from_data(_numpy.frombuffer(buffer, dtype=process_detail_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an ProcessDetail_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `process_detail_v1_dtype` holding the data. + """ + cdef ProcessDetail_v1 obj = ProcessDetail_v1.__new__(ProcessDetail_v1) + 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 != process_detail_v1_dtype: + raise ValueError("data array must be of dtype process_detail_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ProcessDetail_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ProcessDetail_v1 obj = ProcessDetail_v1.__new__(ProcessDetail_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_device_attributes_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.multiprocessorCount)) - (&pod), + (&(pod.sharedCopyEngineCount)) - (&pod), + (&(pod.sharedDecoderCount)) - (&pod), + (&(pod.sharedEncoderCount)) - (&pod), + (&(pod.sharedJpegCount)) - (&pod), + (&(pod.sharedOfaCount)) - (&pod), + (&(pod.gpuInstanceSliceCount)) - (&pod), + (&(pod.computeInstanceSliceCount)) - (&pod), + (&(pod.memorySizeMB)) - (&pod), + ], + 'itemsize': sizeof(nvmlDeviceAttributes_t), + }) + +device_attributes_dtype = _get_device_attributes_dtype_offsets() + +cdef class DeviceAttributes: + """Empty-initialize an instance of `nvmlDeviceAttributes_t`. + + + .. seealso:: `nvmlDeviceAttributes_t` + """ + cdef: + nvmlDeviceAttributes_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlDeviceAttributes_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DeviceAttributes") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlDeviceAttributes_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.DeviceAttributes 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 DeviceAttributes other_ + if not isinstance(other, DeviceAttributes): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAttributes_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlDeviceAttributes_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DeviceAttributes") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAttributes_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def multiprocessor_count(self): + """int: """ + return self._ptr[0].multiprocessorCount + + @multiprocessor_count.setter + def multiprocessor_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].multiprocessorCount = val + + @property + def shared_copy_engine_count(self): + """int: """ + return self._ptr[0].sharedCopyEngineCount + + @shared_copy_engine_count.setter + def shared_copy_engine_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].sharedCopyEngineCount = val + + @property + def shared_decoder_count(self): + """int: """ + return self._ptr[0].sharedDecoderCount + + @shared_decoder_count.setter + def shared_decoder_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].sharedDecoderCount = val + + @property + def shared_encoder_count(self): + """int: """ + return self._ptr[0].sharedEncoderCount + + @shared_encoder_count.setter + def shared_encoder_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].sharedEncoderCount = val + + @property + def shared_jpeg_count(self): + """int: """ + return self._ptr[0].sharedJpegCount + + @shared_jpeg_count.setter + def shared_jpeg_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].sharedJpegCount = val + + @property + def shared_ofa_count(self): + """int: """ + return self._ptr[0].sharedOfaCount + + @shared_ofa_count.setter + def shared_ofa_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].sharedOfaCount = val + + @property + def gpu_instance_slice_count(self): + """int: """ + return self._ptr[0].gpuInstanceSliceCount + + @gpu_instance_slice_count.setter + def gpu_instance_slice_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].gpuInstanceSliceCount = val + + @property + def compute_instance_slice_count(self): + """int: """ + return self._ptr[0].computeInstanceSliceCount + + @compute_instance_slice_count.setter + def compute_instance_slice_count(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].computeInstanceSliceCount = val + + @property + def memory_size_mb(self): + """int: """ + return self._ptr[0].memorySizeMB + + @memory_size_mb.setter + def memory_size_mb(self, val): + if self._readonly: + raise ValueError("This DeviceAttributes instance is read-only") + self._ptr[0].memorySizeMB = val + + @staticmethod + def from_buffer(buffer): + """Create an DeviceAttributes instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlDeviceAttributes_t), DeviceAttributes) + + @staticmethod + def from_data(data): + """Create an DeviceAttributes instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `device_attributes_dtype` holding the data. + """ + 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): + """Create an DeviceAttributes 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 DeviceAttributes obj = DeviceAttributes.__new__(DeviceAttributes) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlDeviceAttributes_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating DeviceAttributes") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAttributes_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_c2c_mode_info_v1_dtype_offsets(): + cdef nvmlC2cModeInfo_v1_t pod + return _numpy.dtype({ + 'names': ['is_c2c_enabled'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.isC2cEnabled)) - (&pod), + ], + 'itemsize': sizeof(nvmlC2cModeInfo_v1_t), + }) + +c2c_mode_info_v1_dtype = _get_c2c_mode_info_v1_dtype_offsets() + +cdef class C2cModeInfo_v1: + """Empty-initialize an instance of `nvmlC2cModeInfo_v1_t`. + + + .. seealso:: `nvmlC2cModeInfo_v1_t` + """ + cdef: + nvmlC2cModeInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlC2cModeInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating C2cModeInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlC2cModeInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.C2cModeInfo_v1 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 C2cModeInfo_v1 other_ + if not isinstance(other, C2cModeInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlC2cModeInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlC2cModeInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating C2cModeInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlC2cModeInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def is_c2c_enabled(self): + """int: """ + return self._ptr[0].isC2cEnabled + + @is_c2c_enabled.setter + def is_c2c_enabled(self, val): + if self._readonly: + raise ValueError("This C2cModeInfo_v1 instance is read-only") + self._ptr[0].isC2cEnabled = val + + @staticmethod + def from_buffer(buffer): + """Create an C2cModeInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlC2cModeInfo_v1_t), C2cModeInfo_v1) + + @staticmethod + def from_data(data): + """Create an C2cModeInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `c2c_mode_info_v1_dtype` holding the data. + """ + 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): + """Create an C2cModeInfo_v1 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 C2cModeInfo_v1 obj = C2cModeInfo_v1.__new__(C2cModeInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlC2cModeInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating C2cModeInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlC2cModeInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_row_remapper_histogram_values_dtype_offsets(): + cdef nvmlRowRemapperHistogramValues_t pod + return _numpy.dtype({ + 'names': ['max_', 'high', 'partial', 'low', 'none'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.max)) - (&pod), + (&(pod.high)) - (&pod), + (&(pod.partial)) - (&pod), + (&(pod.low)) - (&pod), + (&(pod.none)) - (&pod), + ], + 'itemsize': sizeof(nvmlRowRemapperHistogramValues_t), + }) + +row_remapper_histogram_values_dtype = _get_row_remapper_histogram_values_dtype_offsets() + +cdef class RowRemapperHistogramValues: + """Empty-initialize an instance of `nvmlRowRemapperHistogramValues_t`. + + + .. seealso:: `nvmlRowRemapperHistogramValues_t` + """ + cdef: + nvmlRowRemapperHistogramValues_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlRowRemapperHistogramValues_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RowRemapperHistogramValues") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlRowRemapperHistogramValues_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.RowRemapperHistogramValues 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 RowRemapperHistogramValues other_ + if not isinstance(other, RowRemapperHistogramValues): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRowRemapperHistogramValues_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlRowRemapperHistogramValues_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RowRemapperHistogramValues") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRowRemapperHistogramValues_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def max_(self): + """int: """ + return self._ptr[0].max + + @max_.setter + def max_(self, val): + if self._readonly: + raise ValueError("This RowRemapperHistogramValues instance is read-only") + self._ptr[0].max = val + + @property + def high(self): + """int: """ + return self._ptr[0].high + + @high.setter + def high(self, val): + if self._readonly: + raise ValueError("This RowRemapperHistogramValues instance is read-only") + self._ptr[0].high = val + + @property + def partial(self): + """int: """ + return self._ptr[0].partial + + @partial.setter + def partial(self, val): + if self._readonly: + raise ValueError("This RowRemapperHistogramValues instance is read-only") + self._ptr[0].partial = val + + @property + def low(self): + """int: """ + return self._ptr[0].low + + @low.setter + def low(self, val): + if self._readonly: + raise ValueError("This RowRemapperHistogramValues instance is read-only") + self._ptr[0].low = val + + @property + def none(self): + """int: """ + return self._ptr[0].none + + @none.setter + def none(self, val): + if self._readonly: + raise ValueError("This RowRemapperHistogramValues instance is read-only") + self._ptr[0].none = val + + @staticmethod + def from_buffer(buffer): + """Create an RowRemapperHistogramValues instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlRowRemapperHistogramValues_t), RowRemapperHistogramValues) + + @staticmethod + def from_data(data): + """Create an RowRemapperHistogramValues instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `row_remapper_histogram_values_dtype` holding the data. + """ + 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): + """Create an RowRemapperHistogramValues 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 RowRemapperHistogramValues obj = RowRemapperHistogramValues.__new__(RowRemapperHistogramValues) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlRowRemapperHistogramValues_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating RowRemapperHistogramValues") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRowRemapperHistogramValues_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_bridge_chip_info_dtype_offsets(): + cdef nvmlBridgeChipInfo_t pod + return _numpy.dtype({ + 'names': ['type', 'fw_version'], + 'formats': [_numpy.int32, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (&pod), + (&(pod.fwVersion)) - (&pod), + ], + 'itemsize': sizeof(nvmlBridgeChipInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=bridge_chip_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlBridgeChipInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlBridgeChipInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.BridgeChipInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.BridgeChipInfo 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, BridgeChipInfo)) 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 type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.type[0]) + return self._data.type + + @type.setter + def type(self, val): + self._data.type = val + + @property + def fw_version(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.fw_version[0]) + return self._data.fw_version + + @fw_version.setter + def fw_version(self, val): + self._data.fw_version = 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 BridgeChipInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == bridge_chip_info_dtype: + return BridgeChipInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an BridgeChipInfo instance with the memory from the given buffer.""" + return BridgeChipInfo.from_data(_numpy.frombuffer(buffer, dtype=bridge_chip_info_dtype)) + + @staticmethod + def from_data(data): + """Create an BridgeChipInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `bridge_chip_info_dtype` holding the data. + """ + cdef BridgeChipInfo obj = BridgeChipInfo.__new__(BridgeChipInfo) + 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 != bridge_chip_info_dtype: + raise ValueError("data array must be of dtype bridge_chip_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an BridgeChipInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef BridgeChipInfo obj = BridgeChipInfo.__new__(BridgeChipInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_value_dtype_offsets(): + cdef nvmlValue_t pod + return _numpy.dtype({ + 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], + 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], + 'offsets': [ + (&(pod.dVal)) - (&pod), + (&(pod.siVal)) - (&pod), + (&(pod.uiVal)) - (&pod), + (&(pod.ulVal)) - (&pod), + (&(pod.ullVal)) - (&pod), + (&(pod.sllVal)) - (&pod), + (&(pod.usVal)) - (&pod), + ], + 'itemsize': sizeof(nvmlValue_t), + }) + +value_dtype = _get_value_dtype_offsets() + +cdef class Value: + """Empty-initialize an instance of `nvmlValue_t`. + + + .. seealso:: `nvmlValue_t` + """ + cdef: + nvmlValue_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlValue_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Value") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlValue_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.Value 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 Value other_ + if not isinstance(other, Value): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlValue_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlValue_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating Value") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlValue_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def d_val(self): + """float: """ + return self._ptr[0].dVal + + @d_val.setter + def d_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].dVal = val + + @property + def si_val(self): + """int: """ + return self._ptr[0].siVal + + @si_val.setter + def si_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].siVal = val + + @property + def ui_val(self): + """int: """ + return self._ptr[0].uiVal + + @ui_val.setter + def ui_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].uiVal = val + + @property + def ul_val(self): + """int: """ + return self._ptr[0].ulVal + + @ul_val.setter + def ul_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].ulVal = val + + @property + def ull_val(self): + """int: """ + return self._ptr[0].ullVal + + @ull_val.setter + def ull_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].ullVal = val + + @property + def sll_val(self): + """int: """ + return self._ptr[0].sllVal + + @sll_val.setter + def sll_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].sllVal = val + + @property + def us_val(self): + """int: """ + return self._ptr[0].usVal + + @us_val.setter + def us_val(self, val): + if self._readonly: + raise ValueError("This Value instance is read-only") + self._ptr[0].usVal = val + + @staticmethod + def from_buffer(buffer): + """Create an Value instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlValue_t), Value) + + @staticmethod + def from_data(data): + """Create an Value instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `value_dtype` holding the data. + """ + return _cyb_from_data(data, "value_dtype", value_dtype, Value) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an Value 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 Value obj = Value.__new__(Value) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlValue_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Value") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlValue_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get__py_anon_pod0_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.controller)) - (&pod), + (&(pod.defaultMinTemp)) - (&pod), + (&(pod.defaultMaxTemp)) - (&pod), + (&(pod.currentTemp)) - (&pod), + (&(pod.target)) - (&pod), + ], + '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 array of `cuda_bindings_nvml__anon_pod0`. + The resulting object is of length `size` and of dtype `_py_anon_pod0_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `cuda_bindings_nvml__anon_pod0` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=_py_anon_pod0_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(cuda_bindings_nvml__anon_pod0), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(cuda_bindings_nvml__anon_pod0) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}._py_anon_pod0_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}._py_anon_pod0 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, _py_anon_pod0)) 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 controller(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.controller[0]) + return self._data.controller + + @controller.setter + def controller(self, val): + self._data.controller = val + + @property + def default_min_temp(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.default_min_temp[0]) + return self._data.default_min_temp + + @default_min_temp.setter + def default_min_temp(self, val): + self._data.default_min_temp = val + + @property + def default_max_temp(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.default_max_temp[0]) + return self._data.default_max_temp + + @default_max_temp.setter + def default_max_temp(self, val): + self._data.default_max_temp = val + + @property + def current_temp(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.current_temp[0]) + return self._data.current_temp + + @current_temp.setter + def current_temp(self, val): + self._data.current_temp = val + + @property + def target(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.target[0]) + return self._data.target + + @target.setter + def target(self, val): + self._data.target = 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 _py_anon_pod0.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == _py_anon_pod0_dtype: + return _py_anon_pod0.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod0 instance with the memory from the given buffer.""" + return _py_anon_pod0.from_data(_numpy.frombuffer(buffer, dtype=_py_anon_pod0_dtype)) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod0 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `_py_anon_pod0_dtype` holding the data. + """ + cdef _py_anon_pod0 obj = _py_anon_pod0.__new__(_py_anon_pod0) + 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 != _py_anon_pod0_dtype: + raise ValueError("data array must be of dtype _py_anon_pod0_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an _py_anon_pod0 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef _py_anon_pod0 obj = _py_anon_pod0.__new__(_py_anon_pod0) + 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(cuda_bindings_nvml__anon_pod0) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=_py_anon_pod0_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_cooler_info_v1_dtype_offsets(): + cdef nvmlCoolerInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'index', 'signal_type', 'target'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.index)) - (&pod), + (&(pod.signalType)) - (&pod), + (&(pod.target)) - (&pod), + ], + 'itemsize': sizeof(nvmlCoolerInfo_v1_t), + }) + +cooler_info_v1_dtype = _get_cooler_info_v1_dtype_offsets() + +cdef class CoolerInfo_v1: + """Empty-initialize an instance of `nvmlCoolerInfo_v1_t`. + + + .. seealso:: `nvmlCoolerInfo_v1_t` + """ + cdef: + nvmlCoolerInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlCoolerInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CoolerInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlCoolerInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.CoolerInfo_v1 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 CoolerInfo_v1 other_ + if not isinstance(other, CoolerInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlCoolerInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlCoolerInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CoolerInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlCoolerInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This CoolerInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def index(self): + """int: the cooler index""" + return self._ptr[0].index + + @index.setter + def index(self, val): + if self._readonly: + raise ValueError("This CoolerInfo_v1 instance is read-only") + self._ptr[0].index = val + + @property + def signal_type(self): + """int: OUT: the cooler's control signal characteristics.""" + return (self._ptr[0].signalType) + + @signal_type.setter + def signal_type(self, val): + if self._readonly: + raise ValueError("This CoolerInfo_v1 instance is read-only") + self._ptr[0].signalType = val + + @property + def target(self): + """int: OUT: the target that cooler cools.""" + return (self._ptr[0].target) + + @target.setter + def target(self, val): + if self._readonly: + raise ValueError("This CoolerInfo_v1 instance is read-only") + self._ptr[0].target = val + + @staticmethod + def from_buffer(buffer): + """Create an CoolerInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlCoolerInfo_v1_t), CoolerInfo_v1) + + @staticmethod + def from_data(data): + """Create an CoolerInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `cooler_info_v1_dtype` holding the data. + """ + 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): + """Create an CoolerInfo_v1 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 CoolerInfo_v1 obj = CoolerInfo_v1.__new__(CoolerInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlCoolerInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating CoolerInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlCoolerInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_clk_mon_fault_info_dtype_offsets(): + cdef nvmlClkMonFaultInfo_t pod + return _numpy.dtype({ + 'names': ['clk_api_domain', 'clk_domain_fault_mask'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.clkApiDomain)) - (&pod), + (&(pod.clkDomainFaultMask)) - (&pod), + ], + 'itemsize': sizeof(nvmlClkMonFaultInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=clk_mon_fault_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlClkMonFaultInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlClkMonFaultInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ClkMonFaultInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ClkMonFaultInfo 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, ClkMonFaultInfo)) 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 clk_api_domain(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.clk_api_domain[0]) + return self._data.clk_api_domain + + @clk_api_domain.setter + def clk_api_domain(self, val): + self._data.clk_api_domain = val + + @property + def clk_domain_fault_mask(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.clk_domain_fault_mask[0]) + return self._data.clk_domain_fault_mask + + @clk_domain_fault_mask.setter + def clk_domain_fault_mask(self, val): + self._data.clk_domain_fault_mask = 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 ClkMonFaultInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == clk_mon_fault_info_dtype: + return ClkMonFaultInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ClkMonFaultInfo instance with the memory from the given buffer.""" + return ClkMonFaultInfo.from_data(_numpy.frombuffer(buffer, dtype=clk_mon_fault_info_dtype)) + + @staticmethod + def from_data(data): + """Create an ClkMonFaultInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `clk_mon_fault_info_dtype` holding the data. + """ + cdef ClkMonFaultInfo obj = ClkMonFaultInfo.__new__(ClkMonFaultInfo) + 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 != clk_mon_fault_info_dtype: + raise ValueError("data array must be of dtype clk_mon_fault_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ClkMonFaultInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ClkMonFaultInfo obj = ClkMonFaultInfo.__new__(ClkMonFaultInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_clock_offset_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.type)) - (&pod), + (&(pod.pstate)) - (&pod), + (&(pod.clockOffsetMHz)) - (&pod), + (&(pod.minClockOffsetMHz)) - (&pod), + (&(pod.maxClockOffsetMHz)) - (&pod), + ], + 'itemsize': sizeof(nvmlClockOffset_v1_t), + }) + +clock_offset_v1_dtype = _get_clock_offset_v1_dtype_offsets() + +cdef class ClockOffset_v1: + """Empty-initialize an instance of `nvmlClockOffset_v1_t`. + + + .. seealso:: `nvmlClockOffset_v1_t` + """ + cdef: + nvmlClockOffset_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlClockOffset_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClockOffset_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlClockOffset_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ClockOffset_v1 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 ClockOffset_v1 other_ + if not isinstance(other, ClockOffset_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClockOffset_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlClockOffset_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClockOffset_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClockOffset_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].version = val + + @property + def type(self): + """int: """ + return (self._ptr[0].type) + + @type.setter + def type(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].type = val + + @property + def pstate(self): + """int: """ + return (self._ptr[0].pstate) + + @pstate.setter + def pstate(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].pstate = val + + @property + def clock_offset_m_hz(self): + """int: """ + return self._ptr[0].clockOffsetMHz + + @clock_offset_m_hz.setter + def clock_offset_m_hz(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].clockOffsetMHz = val + + @property + def min_clock_offset_m_hz(self): + """int: """ + return self._ptr[0].minClockOffsetMHz + + @min_clock_offset_m_hz.setter + def min_clock_offset_m_hz(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].minClockOffsetMHz = val + + @property + def max_clock_offset_m_hz(self): + """int: """ + return self._ptr[0].maxClockOffsetMHz + + @max_clock_offset_m_hz.setter + def max_clock_offset_m_hz(self, val): + if self._readonly: + raise ValueError("This ClockOffset_v1 instance is read-only") + self._ptr[0].maxClockOffsetMHz = val + + @staticmethod + def from_buffer(buffer): + """Create an ClockOffset_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlClockOffset_v1_t), ClockOffset_v1) + + @staticmethod + def from_data(data): + """Create an ClockOffset_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `clock_offset_v1_dtype` holding the data. + """ + 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): + """Create an ClockOffset_v1 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 ClockOffset_v1 obj = ClockOffset_v1.__new__(ClockOffset_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlClockOffset_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ClockOffset_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClockOffset_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_process_utilization_sample_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.pid)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationSample_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=process_utilization_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlProcessUtilizationSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlProcessUtilizationSample_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ProcessUtilizationSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ProcessUtilizationSample 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, ProcessUtilizationSample)) 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 pid(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def time_stamp(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def sm_util(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.sm_util[0]) + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.mem_util[0]) + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.enc_util[0]) + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.dec_util[0]) + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = 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 ProcessUtilizationSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == process_utilization_sample_dtype: + return ProcessUtilizationSample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ProcessUtilizationSample instance with the memory from the given buffer.""" + return ProcessUtilizationSample.from_data(_numpy.frombuffer(buffer, dtype=process_utilization_sample_dtype)) + + @staticmethod + def from_data(data): + """Create an ProcessUtilizationSample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `process_utilization_sample_dtype` holding the data. + """ + cdef ProcessUtilizationSample obj = ProcessUtilizationSample.__new__(ProcessUtilizationSample) + 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 != process_utilization_sample_dtype: + raise ValueError("data array must be of dtype process_utilization_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ProcessUtilizationSample 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ProcessUtilizationSample obj = ProcessUtilizationSample.__new__(ProcessUtilizationSample) + 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) + obj._owner = owner + + return obj + + +cdef _get_process_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.timeStamp)) - (&pod), + (&(pod.pid)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + (&(pod.jpgUtil)) - (&pod), + (&(pod.ofaUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessUtilizationInfo_v1_t), + }) + +process_utilization_info_v1_dtype = _get_process_utilization_info_v1_dtype_offsets() + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=process_utilization_info_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlProcessUtilizationInfo_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlProcessUtilizationInfo_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ProcessUtilizationInfo_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ProcessUtilizationInfo_v1 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, ProcessUtilizationInfo_v1)) 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 time_stamp(self): + """Union[~_numpy.uint64, int]: CPU Timestamp in microseconds.""" + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def pid(self): + """Union[~_numpy.uint32, int]: PID of process.""" + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def sm_util(self): + """Union[~_numpy.uint32, int]: SM (3D/Compute) Util Value.""" + if self._data.size == 1: + return int(self._data.sm_util[0]) + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """Union[~_numpy.uint32, int]: Frame Buffer Memory Util Value.""" + if self._data.size == 1: + return int(self._data.mem_util[0]) + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """Union[~_numpy.uint32, int]: Encoder Util Value.""" + if self._data.size == 1: + return int(self._data.enc_util[0]) + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """Union[~_numpy.uint32, int]: Decoder Util Value.""" + if self._data.size == 1: + return int(self._data.dec_util[0]) + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = val + + @property + def jpg_util(self): + """Union[~_numpy.uint32, int]: Jpeg Util Value.""" + if self._data.size == 1: + return int(self._data.jpg_util[0]) + return self._data.jpg_util + + @jpg_util.setter + def jpg_util(self, val): + self._data.jpg_util = val + + @property + def ofa_util(self): + """Union[~_numpy.uint32, int]: Ofa Util Value.""" + if self._data.size == 1: + return int(self._data.ofa_util[0]) + return self._data.ofa_util + + @ofa_util.setter + def ofa_util(self, val): + self._data.ofa_util = 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 ProcessUtilizationInfo_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == process_utilization_info_v1_dtype: + return ProcessUtilizationInfo_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ProcessUtilizationInfo_v1 instance with the memory from the given buffer.""" + return ProcessUtilizationInfo_v1.from_data(_numpy.frombuffer(buffer, dtype=process_utilization_info_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an ProcessUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `process_utilization_info_v1_dtype` holding the data. + """ + cdef ProcessUtilizationInfo_v1 obj = ProcessUtilizationInfo_v1.__new__(ProcessUtilizationInfo_v1) + 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 != process_utilization_info_v1_dtype: + raise ValueError("data array must be of dtype process_utilization_info_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ProcessUtilizationInfo_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ProcessUtilizationInfo_v1 obj = ProcessUtilizationInfo_v1.__new__(ProcessUtilizationInfo_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_ecc_sram_error_status_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.aggregateUncParity)) - (&pod), + (&(pod.aggregateUncSecDed)) - (&pod), + (&(pod.aggregateCor)) - (&pod), + (&(pod.volatileUncParity)) - (&pod), + (&(pod.volatileUncSecDed)) - (&pod), + (&(pod.volatileCor)) - (&pod), + (&(pod.aggregateUncBucketL2)) - (&pod), + (&(pod.aggregateUncBucketSm)) - (&pod), + (&(pod.aggregateUncBucketPcie)) - (&pod), + (&(pod.aggregateUncBucketMcu)) - (&pod), + (&(pod.aggregateUncBucketOther)) - (&pod), + (&(pod.bThresholdExceeded)) - (&pod), + ], + 'itemsize': sizeof(nvmlEccSramErrorStatus_v1_t), + }) + +ecc_sram_error_status_v1_dtype = _get_ecc_sram_error_status_v1_dtype_offsets() + +cdef class EccSramErrorStatus_v1: + """Empty-initialize an instance of `nvmlEccSramErrorStatus_v1_t`. + + + .. seealso:: `nvmlEccSramErrorStatus_v1_t` + """ + cdef: + nvmlEccSramErrorStatus_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramErrorStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramErrorStatus_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlEccSramErrorStatus_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.EccSramErrorStatus_v1 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 EccSramErrorStatus_v1 other_ + if not isinstance(other, EccSramErrorStatus_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramErrorStatus_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramErrorStatus_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramErrorStatus_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].version = val + + @property + def aggregate_unc_parity(self): + """int: aggregate uncorrectable parity error count""" + return self._ptr[0].aggregateUncParity + + @aggregate_unc_parity.setter + def aggregate_unc_parity(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncParity = val + + @property + def aggregate_unc_sec_ded(self): + """int: aggregate uncorrectable SEC-DED error count""" + return self._ptr[0].aggregateUncSecDed + + @aggregate_unc_sec_ded.setter + def aggregate_unc_sec_ded(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncSecDed = val + + @property + def aggregate_cor(self): + """int: aggregate correctable error count""" + return self._ptr[0].aggregateCor + + @aggregate_cor.setter + def aggregate_cor(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateCor = val + + @property + def volatile_unc_parity(self): + """int: volatile uncorrectable parity error count""" + return self._ptr[0].volatileUncParity + + @volatile_unc_parity.setter + def volatile_unc_parity(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].volatileUncParity = val + + @property + def volatile_unc_sec_ded(self): + """int: volatile uncorrectable SEC-DED error count""" + return self._ptr[0].volatileUncSecDed + + @volatile_unc_sec_ded.setter + def volatile_unc_sec_ded(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].volatileUncSecDed = val + + @property + def volatile_cor(self): + """int: volatile correctable error count""" + return self._ptr[0].volatileCor + + @volatile_cor.setter + def volatile_cor(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].volatileCor = val + + @property + def aggregate_unc_bucket_l2(self): + """int: aggregate uncorrectable error count for L2 cache bucket""" + return self._ptr[0].aggregateUncBucketL2 + + @aggregate_unc_bucket_l2.setter + def aggregate_unc_bucket_l2(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncBucketL2 = val + + @property + def aggregate_unc_bucket_sm(self): + """int: aggregate uncorrectable error count for SM bucket""" + return self._ptr[0].aggregateUncBucketSm + + @aggregate_unc_bucket_sm.setter + def aggregate_unc_bucket_sm(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncBucketSm = val + + @property + def aggregate_unc_bucket_pcie(self): + """int: aggregate uncorrectable error count for PCIE bucket""" + return self._ptr[0].aggregateUncBucketPcie + + @aggregate_unc_bucket_pcie.setter + def aggregate_unc_bucket_pcie(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncBucketPcie = val + + @property + def aggregate_unc_bucket_mcu(self): + """int: aggregate uncorrectable error count for Microcontroller bucket""" + return self._ptr[0].aggregateUncBucketMcu + + @aggregate_unc_bucket_mcu.setter + def aggregate_unc_bucket_mcu(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncBucketMcu = val + + @property + def aggregate_unc_bucket_other(self): + """int: aggregate uncorrectable error count for Other bucket""" + return self._ptr[0].aggregateUncBucketOther + + @aggregate_unc_bucket_other.setter + def aggregate_unc_bucket_other(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].aggregateUncBucketOther = val + + @property + def b_threshold_exceeded(self): + """int: if the error threshold of field diag is exceeded""" + return self._ptr[0].bThresholdExceeded + + @b_threshold_exceeded.setter + def b_threshold_exceeded(self, val): + if self._readonly: + raise ValueError("This EccSramErrorStatus_v1 instance is read-only") + self._ptr[0].bThresholdExceeded = val + + @staticmethod + def from_buffer(buffer): + """Create an EccSramErrorStatus_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEccSramErrorStatus_v1_t), EccSramErrorStatus_v1) + + @staticmethod + def from_data(data): + """Create an EccSramErrorStatus_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `ecc_sram_error_status_v1_dtype` holding the data. + """ + 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): + """Create an EccSramErrorStatus_v1 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 EccSramErrorStatus_v1 obj = EccSramErrorStatus_v1.__new__(EccSramErrorStatus_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EccSramErrorStatus_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramErrorStatus_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_platform_info_v1_dtype_offsets(): + cdef nvmlPlatformInfo_v1_t pod + return _numpy.dtype({ + '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), + (&(pod.ibGuid)) - (&pod), + (&(pod.rackGuid)) - (&pod), + (&(pod.chassisPhysicalSlotNumber)) - (&pod), + (&(pod.computeSlotIndex)) - (&pod), + (&(pod.nodeIndex)) - (&pod), + (&(pod.peerType)) - (&pod), + (&(pod.moduleId)) - (&pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v1_t), + }) + +platform_info_v1_dtype = _get_platform_info_v1_dtype_offsets() + +cdef class PlatformInfo_v1: + """Empty-initialize an instance of `nvmlPlatformInfo_v1_t`. + + + .. seealso:: `nvmlPlatformInfo_v1_t` + """ + cdef: + nvmlPlatformInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPlatformInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PlatformInfo_v1 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 PlatformInfo_v1 other_ + if not isinstance(other, PlatformInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPlatformInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v1 instance is read-only") + self._ptr[0].version = val + + @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 _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) + + @ib_guid.setter + def ib_guid(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _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 _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) + + @rack_guid.setter + def rack_guid(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _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).""" + return self._ptr[0].chassisPhysicalSlotNumber + + @chassis_physical_slot_number.setter + def chassis_physical_slot_number(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v1 instance is read-only") + self._ptr[0].chassisPhysicalSlotNumber = val + + @property + 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_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_index(self): + """int: Index of the node within the slot containing this GPU.""" + return self._ptr[0].nodeIndex + + @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).""" + return self._ptr[0].peerType + + @peer_type.setter + def peer_type(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v1 instance is read-only") + self._ptr[0].peerType = val + + @property + def module_id(self): + """int: ID of this GPU within the node.""" + return self._ptr[0].moduleId + + @module_id.setter + def module_id(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v1 instance is read-only") + self._ptr[0].moduleId = val + + @staticmethod + def from_buffer(buffer): + """Create an PlatformInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPlatformInfo_v1_t), PlatformInfo_v1) + + @staticmethod + def from_data(data): + """Create an PlatformInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `platform_info_v1_dtype` holding the data. + """ + 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): + """Create an PlatformInfo_v1 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 PlatformInfo_v1 obj = PlatformInfo_v1.__new__(PlatformInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_platform_info_v2_dtype_offsets(): + cdef nvmlPlatformInfo_v2_t pod + return _numpy.dtype({ + '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), + (&(pod.ibGuid)) - (&pod), + (&(pod.chassisSerialNumber)) - (&pod), + (&(pod.slotNumber)) - (&pod), + (&(pod.trayIndex)) - (&pod), + (&(pod.hostId)) - (&pod), + (&(pod.peerType)) - (&pod), + (&(pod.moduleId)) - (&pod), + ], + 'itemsize': sizeof(nvmlPlatformInfo_v2_t), + }) + +platform_info_v2_dtype = _get_platform_info_v2_dtype_offsets() + +cdef class PlatformInfo_v2: + """Empty-initialize an instance of `nvmlPlatformInfo_v2_t`. + + + .. seealso:: `nvmlPlatformInfo_v2_t` + """ + cdef: + nvmlPlatformInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPlatformInfo_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__}.PlatformInfo_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 PlatformInfo_v2 other_ + if not isinstance(other, PlatformInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPlatformInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].version = val + + @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 _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) + + @ib_guid.setter + def ib_guid(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _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 _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) + + @chassis_serial_number.setter + def chassis_serial_number(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _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).""" + return self._ptr[0].slotNumber + + @slot_number.setter + def slot_number(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].slotNumber = val + + @property + 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_index.setter + def tray_index(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].trayIndex = val + + @property + def host_id(self): + """int: Index of the node within the slot containing this GPU.""" + return self._ptr[0].hostId + + @host_id.setter + def host_id(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].hostId = val + + @property + def peer_type(self): + """int: Platform indicated NVLink-peer type (e.g. switch present or not).""" + return self._ptr[0].peerType + + @peer_type.setter + def peer_type(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].peerType = val + + @property + def module_id(self): + """int: ID of this GPU within the node.""" + return self._ptr[0].moduleId + + @module_id.setter + def module_id(self, val): + if self._readonly: + raise ValueError("This PlatformInfo_v2 instance is read-only") + self._ptr[0].moduleId = val + + @staticmethod + def from_buffer(buffer): + """Create an PlatformInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPlatformInfo_v2_t), PlatformInfo_v2) + + @staticmethod + def from_data(data): + """Create an PlatformInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `platform_info_v2_dtype` holding the data. + """ + 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): + """Create an PlatformInfo_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 PlatformInfo_v2 obj = PlatformInfo_v2.__new__(PlatformInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PlatformInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_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__py_anon_pod1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.bIsPresent)) - (&pod), + (&(pod.percentage)) - (&pod), + (&(pod.incThreshold)) - (&pod), + (&(pod.decThreshold)) - (&pod), + ], + '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 array of `cuda_bindings_nvml__anon_pod1`. + The resulting object is of length `size` and of dtype `_py_anon_pod1_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `cuda_bindings_nvml__anon_pod1` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=_py_anon_pod1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(cuda_bindings_nvml__anon_pod1), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(cuda_bindings_nvml__anon_pod1) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}._py_anon_pod1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}._py_anon_pod1 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, _py_anon_pod1)) 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 b_is_present(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.b_is_present[0]) + return self._data.b_is_present + + @b_is_present.setter + def b_is_present(self, val): + self._data.b_is_present = val + + @property + def percentage(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.percentage[0]) + return self._data.percentage + + @percentage.setter + def percentage(self, val): + self._data.percentage = val + + @property + def inc_threshold(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.inc_threshold[0]) + return self._data.inc_threshold + + @inc_threshold.setter + def inc_threshold(self, val): + self._data.inc_threshold = val + + @property + def dec_threshold(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.dec_threshold[0]) + return self._data.dec_threshold + + @dec_threshold.setter + def dec_threshold(self, val): + self._data.dec_threshold = 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 _py_anon_pod1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == _py_anon_pod1_dtype: + return _py_anon_pod1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod1 instance with the memory from the given buffer.""" + return _py_anon_pod1.from_data(_numpy.frombuffer(buffer, dtype=_py_anon_pod1_dtype)) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `_py_anon_pod1_dtype` holding the data. + """ + cdef _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) + 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 != _py_anon_pod1_dtype: + raise ValueError("data array must be of dtype _py_anon_pod1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an _py_anon_pod1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) + 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(cuda_bindings_nvml__anon_pod1) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=_py_anon_pod1_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_vgpu_placement_list_v2_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.placementSize)) - (&pod), + (&(pod.count)) - (&pod), + (&(pod.placementIds)) - (&pod), + (&(pod.mode)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuPlacementList_v2_t), + }) + +vgpu_placement_list_v2_dtype = _get_vgpu_placement_list_v2_dtype_offsets() + +cdef class VgpuPlacementList_v2: + """Empty-initialize an instance of `nvmlVgpuPlacementList_v2_t`. + + + .. seealso:: `nvmlVgpuPlacementList_v2_t` + """ + cdef: + nvmlVgpuPlacementList_v2_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPlacementList_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPlacementList_v2") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuPlacementList_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__}.VgpuPlacementList_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 VgpuPlacementList_v2 other_ + if not isinstance(other, VgpuPlacementList_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPlacementList_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuPlacementList_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPlacementList_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPlacementList_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuPlacementList_v2 instance is read-only") + self._ptr[0].version = val + + @property + def placement_size(self): + """int: OUT: The number of slots occupied by the vGPU type.""" + return self._ptr[0].placementSize + + @placement_size.setter + def placement_size(self, val): + if self._readonly: + raise ValueError("This VgpuPlacementList_v2 instance is read-only") + self._ptr[0].placementSize = val + + @property + def placement_ids(self): + """int: IN/OUT: Placement IDs for the vGPU type.""" + if self._ptr[0].placementIds == NULL: + return [] + 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) + + @placement_ids.setter + def placement_ids(self, val): + if self._readonly: + raise ValueError("This VgpuPlacementList_v2 instance is read-only") + 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) + self._refs["placement_ids"] = arr + + @property + def mode(self): + """int: IN: The vGPU mode. Either NVML_VGPU_PGPU_HETEROGENEOUS_MODE or NVML_VGPU_PGPU_HOMOGENEOUS_MODE.""" + return self._ptr[0].mode + + @mode.setter + def mode(self, val): + if self._readonly: + raise ValueError("This VgpuPlacementList_v2 instance is read-only") + self._ptr[0].mode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuPlacementList_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPlacementList_v2_t), VgpuPlacementList_v2) + + @staticmethod + def from_data(data): + """Create an VgpuPlacementList_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_placement_list_v2_dtype` holding the data. + """ + 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): + """Create an VgpuPlacementList_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 VgpuPlacementList_v2 obj = VgpuPlacementList_v2.__new__(VgpuPlacementList_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPlacementList_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuPlacementList_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPlacementList_v2_t)) + 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_vgpu_type_bar1info_v1_dtype_offsets(): + cdef nvmlVgpuTypeBar1Info_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'bar1size'], + 'formats': [_numpy.uint32, _numpy.uint64], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.bar1Size)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeBar1Info_v1_t), + }) + +vgpu_type_bar1info_v1_dtype = _get_vgpu_type_bar1info_v1_dtype_offsets() + +cdef class VgpuTypeBar1Info_v1: + """Empty-initialize an instance of `nvmlVgpuTypeBar1Info_v1_t`. + + + .. seealso:: `nvmlVgpuTypeBar1Info_v1_t` + """ + cdef: + nvmlVgpuTypeBar1Info_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuTypeBar1Info_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuTypeBar1Info_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuTypeBar1Info_v1 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 VgpuTypeBar1Info_v1 other_ + if not isinstance(other, VgpuTypeBar1Info_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeBar1Info_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuTypeBar1Info_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuTypeBar1Info_v1 instance is read-only") + self._ptr[0].version = val + + @property + def bar1size(self): + """int: BAR1 size in megabytes.""" + return self._ptr[0].bar1Size + + @bar1size.setter + def bar1size(self, val): + if self._readonly: + raise ValueError("This VgpuTypeBar1Info_v1 instance is read-only") + self._ptr[0].bar1Size = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuTypeBar1Info_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuTypeBar1Info_v1_t), VgpuTypeBar1Info_v1) + + @staticmethod + def from_data(data): + """Create an VgpuTypeBar1Info_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_type_bar1info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuTypeBar1Info_v1 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 VgpuTypeBar1Info_v1 obj = VgpuTypeBar1Info_v1.__new__(VgpuTypeBar1Info_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuTypeBar1Info_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeBar1Info_v1_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_process_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.processName)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.pid)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + (&(pod.jpgUtil)) - (&pod), + (&(pod.ofaUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), + }) + +vgpu_process_utilization_info_v1_dtype = _get_vgpu_process_utilization_info_v1_dtype_offsets() + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_process_utilization_info_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuProcessUtilizationInfo_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuProcessUtilizationInfo_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuProcessUtilizationInfo_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuProcessUtilizationInfo_v1 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, VgpuProcessUtilizationInfo_v1)) 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 process_name(self): + """~_numpy.int8: (array of length 64).Name of process running within the vGPU VM.""" + return self._data.process_name + + @process_name.setter + def process_name(self, val): + self._data.process_name = val + + @property + def time_stamp(self): + """Union[~_numpy.uint64, int]: CPU Timestamp in microseconds.""" + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: vGPU Instance""" + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def pid(self): + """Union[~_numpy.uint32, int]: PID of process running within the vGPU VM.""" + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def sm_util(self): + """Union[~_numpy.uint32, int]: SM (3D/Compute) Util Value.""" + if self._data.size == 1: + return int(self._data.sm_util[0]) + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """Union[~_numpy.uint32, int]: Frame Buffer Memory Util Value.""" + if self._data.size == 1: + return int(self._data.mem_util[0]) + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """Union[~_numpy.uint32, int]: Encoder Util Value.""" + if self._data.size == 1: + return int(self._data.enc_util[0]) + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """Union[~_numpy.uint32, int]: Decoder Util Value.""" + if self._data.size == 1: + return int(self._data.dec_util[0]) + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = val + + @property + def jpg_util(self): + """Union[~_numpy.uint32, int]: Jpeg Util Value.""" + if self._data.size == 1: + return int(self._data.jpg_util[0]) + return self._data.jpg_util + + @jpg_util.setter + def jpg_util(self, val): + self._data.jpg_util = val + + @property + def ofa_util(self): + """Union[~_numpy.uint32, int]: Ofa Util Value.""" + if self._data.size == 1: + return int(self._data.ofa_util[0]) + return self._data.ofa_util + + @ofa_util.setter + def ofa_util(self, val): + self._data.ofa_util = 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 VgpuProcessUtilizationInfo_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_process_utilization_info_v1_dtype: + return VgpuProcessUtilizationInfo_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuProcessUtilizationInfo_v1 instance with the memory from the given buffer.""" + return VgpuProcessUtilizationInfo_v1.from_data(_numpy.frombuffer(buffer, dtype=vgpu_process_utilization_info_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuProcessUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_process_utilization_info_v1_dtype` holding the data. + """ + cdef VgpuProcessUtilizationInfo_v1 obj = VgpuProcessUtilizationInfo_v1.__new__(VgpuProcessUtilizationInfo_v1) + 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_process_utilization_info_v1_dtype: + raise ValueError("data array must be of dtype vgpu_process_utilization_info_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuProcessUtilizationInfo_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuProcessUtilizationInfo_v1 obj = VgpuProcessUtilizationInfo_v1.__new__(VgpuProcessUtilizationInfo_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get__py_anon_pod2_dtype_offsets(): + cdef cuda_bindings_nvml__anon_pod2 pod + return _numpy.dtype({ + 'names': ['avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), + ], + '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 `cuda_bindings_nvml__anon_pod2`. + + + .. seealso:: `cuda_bindings_nvml__anon_pod2` + """ + cdef: + cuda_bindings_nvml__anon_pod2 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + 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 + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_nvml__anon_pod2 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod2 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 _py_anon_pod2 other_ + if not isinstance(other, _py_anon_pod2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod2)) == 0) + + 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 = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod2)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_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 + else: + setattr(self, key, val) + + @property + def avg_factor(self): + """int: """ + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def timeslice(self): + """int: """ + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod2 instance is read-only") + self._ptr[0].timeslice = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod2), _py_anon_pod2) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod2 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 _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod2)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod2") + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod2)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get__py_anon_pod3_dtype_offsets(): + cdef cuda_bindings_nvml__anon_pod3 pod + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (&pod), + ], + '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 `cuda_bindings_nvml__anon_pod3`. + + + .. seealso:: `cuda_bindings_nvml__anon_pod3` + """ + cdef: + cuda_bindings_nvml__anon_pod3 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + 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 + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_nvml__anon_pod3 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod3 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 _py_anon_pod3 other_ + if not isinstance(other, _py_anon_pod3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod3)) == 0) + + 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 = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod3)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_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 + else: + setattr(self, key, val) + + @property + def timeslice(self): + """int: """ + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod3 instance is read-only") + self._ptr[0].timeslice = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod3), _py_anon_pod3) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod3_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod3 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 _py_anon_pod3 obj = _py_anon_pod3.__new__(_py_anon_pod3) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod3)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod3") + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod3)) + 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_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.timestamp)) - (&pod), + (&(pod.timeRunTotal)) - (&pod), + (&(pod.timeRun)) - (&pod), + (&(pod.swRunlistId)) - (&pod), + (&(pod.targetTimeSlice)) - (&pod), + (&(pod.cumulativePreemptionTime)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuSchedulerLogEntry_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuSchedulerLogEntry_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuSchedulerLogEntry_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuSchedulerLogEntry 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)) 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]: """ + 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]: """ + 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]: """ + 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]: """ + 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]: """ + 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]: """ + 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 + + 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.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_scheduler_log_entry_dtype: + return VgpuSchedulerLogEntry.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLogEntry instance with the memory from the given buffer.""" + return VgpuSchedulerLogEntry.from_data(_numpy.frombuffer(buffer, dtype=vgpu_scheduler_log_entry_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLogEntry instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_scheduler_log_entry_dtype` holding the data. + """ + cdef VgpuSchedulerLogEntry obj = VgpuSchedulerLogEntry.__new__(VgpuSchedulerLogEntry) + 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_dtype: + raise ValueError("data array must be of dtype vgpu_scheduler_log_entry_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuSchedulerLogEntry 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerLogEntry obj = VgpuSchedulerLogEntry.__new__(VgpuSchedulerLogEntry) + 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) + obj._owner = owner + + return obj + + +cdef _get__py_anon_pod4_dtype_offsets(): + cdef cuda_bindings_nvml__anon_pod4 pod + return _numpy.dtype({ + 'names': ['avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.avgFactor)) - (&pod), + (&(pod.frequency)) - (&pod), + ], + '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 `cuda_bindings_nvml__anon_pod4`. + + + .. seealso:: `cuda_bindings_nvml__anon_pod4` + """ + cdef: + cuda_bindings_nvml__anon_pod4 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + 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 + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_nvml__anon_pod4 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod4 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 _py_anon_pod4 other_ + if not isinstance(other, _py_anon_pod4): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod4)) == 0) + + 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 = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod4)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_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 + else: + setattr(self, key, val) + + @property + def avg_factor(self): + """int: """ + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod4 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def frequency(self): + """int: """ + return self._ptr[0].frequency + + @frequency.setter + def frequency(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod4 instance is read-only") + self._ptr[0].frequency = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod4 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod4), _py_anon_pod4) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod4 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod4_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod4 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 _py_anon_pod4 obj = _py_anon_pod4.__new__(_py_anon_pod4) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod4)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod4") + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod4)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get__py_anon_pod5_dtype_offsets(): + cdef cuda_bindings_nvml__anon_pod5 pod + return _numpy.dtype({ + 'names': ['timeslice'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeslice)) - (&pod), + ], + '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 `cuda_bindings_nvml__anon_pod5`. + + + .. seealso:: `cuda_bindings_nvml__anon_pod5` + """ + cdef: + cuda_bindings_nvml__anon_pod5 *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + 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 + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cuda_bindings_nvml__anon_pod5 *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}._py_anon_pod5 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 _py_anon_pod5 other_ + if not isinstance(other, _py_anon_pod5): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod5)) == 0) + + 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 = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod5)) + if self._ptr == NULL: + raise MemoryError("Error allocating _py_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 + else: + setattr(self, key, val) + + @property + def timeslice(self): + """int: """ + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This _py_anon_pod5 instance is read-only") + self._ptr[0].timeslice = val + + @staticmethod + def from_buffer(buffer): + """Create an _py_anon_pod5 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod5), _py_anon_pod5) + + @staticmethod + def from_data(data): + """Create an _py_anon_pod5 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod5_dtype` holding the data. + """ + 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): + """Create an _py_anon_pod5 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 _py_anon_pod5 obj = _py_anon_pod5.__new__(_py_anon_pod5) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod5)) + if obj._ptr == NULL: + raise MemoryError("Error allocating _py_anon_pod5") + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod5)) + 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_capabilities_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.supportedSchedulers)) - (&pod), + (&(pod.maxTimeslice)) - (&pod), + (&(pod.minTimeslice)) - (&pod), + (&(pod.isArrModeSupported)) - (&pod), + (&(pod.maxFrequencyForARR)) - (&pod), + (&(pod.minFrequencyForARR)) - (&pod), + (&(pod.maxAvgFactorForARR)) - (&pod), + (&(pod.minAvgFactorForARR)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerCapabilities_t), + }) + +vgpu_scheduler_capabilities_dtype = _get_vgpu_scheduler_capabilities_dtype_offsets() + +cdef class VgpuSchedulerCapabilities: + """Empty-initialize an instance of `nvmlVgpuSchedulerCapabilities_t`. + + + .. seealso:: `nvmlVgpuSchedulerCapabilities_t` + """ + cdef: + nvmlVgpuSchedulerCapabilities_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerCapabilities_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerCapabilities") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerCapabilities_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerCapabilities 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 VgpuSchedulerCapabilities other_ + if not isinstance(other, VgpuSchedulerCapabilities): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerCapabilities_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerCapabilities") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerCapabilities_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def supported_schedulers(self): + """~_numpy.uint32: (array of length 3).""" + 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) + + @supported_schedulers.setter + def supported_schedulers(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(3,), itemsize=sizeof(unsigned int), format="I", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) + _cyb_memcpy((&(self._ptr[0].supportedSchedulers)), (arr.data), sizeof(unsigned int) * len(val)) + + @property + def max_timeslice(self): + """int: """ + return self._ptr[0].maxTimeslice + + @max_timeslice.setter + def max_timeslice(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].maxTimeslice = val + + @property + def min_timeslice(self): + """int: """ + return self._ptr[0].minTimeslice + + @min_timeslice.setter + def min_timeslice(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].minTimeslice = val + + @property + def is_arr_mode_supported(self): + """int: """ + return self._ptr[0].isArrModeSupported + + @is_arr_mode_supported.setter + def is_arr_mode_supported(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].isArrModeSupported = val + + @property + def max_frequency_for_arr(self): + """int: """ + return self._ptr[0].maxFrequencyForARR + + @max_frequency_for_arr.setter + def max_frequency_for_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].maxFrequencyForARR = val + + @property + def min_frequency_for_arr(self): + """int: """ + return self._ptr[0].minFrequencyForARR + + @min_frequency_for_arr.setter + def min_frequency_for_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].minFrequencyForARR = val + + @property + def max_avg_factor_for_arr(self): + """int: """ + return self._ptr[0].maxAvgFactorForARR + + @max_avg_factor_for_arr.setter + def max_avg_factor_for_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].maxAvgFactorForARR = val + + @property + def min_avg_factor_for_arr(self): + """int: """ + return self._ptr[0].minAvgFactorForARR + + @min_avg_factor_for_arr.setter + def min_avg_factor_for_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerCapabilities instance is read-only") + self._ptr[0].minAvgFactorForARR = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerCapabilities instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerCapabilities_t), VgpuSchedulerCapabilities) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerCapabilities instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_capabilities_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerCapabilities 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 VgpuSchedulerCapabilities obj = VgpuSchedulerCapabilities.__new__(VgpuSchedulerCapabilities) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerCapabilities") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerCapabilities_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_license_expiry_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.year)) - (&pod), + (&(pod.month)) - (&pod), + (&(pod.day)) - (&pod), + (&(pod.hour)) - (&pod), + (&(pod.min)) - (&pod), + (&(pod.sec)) - (&pod), + (&(pod.status)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseExpiry_t), + }) + +vgpu_license_expiry_dtype = _get_vgpu_license_expiry_dtype_offsets() + +cdef class VgpuLicenseExpiry: + """Empty-initialize an instance of `nvmlVgpuLicenseExpiry_t`. + + + .. seealso:: `nvmlVgpuLicenseExpiry_t` + """ + cdef: + nvmlVgpuLicenseExpiry_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseExpiry_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseExpiry") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuLicenseExpiry_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuLicenseExpiry 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 VgpuLicenseExpiry other_ + if not isinstance(other, VgpuLicenseExpiry): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseExpiry_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuLicenseExpiry_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseExpiry") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseExpiry_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def year(self): + """int: """ + return self._ptr[0].year + + @year.setter + def year(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].year = val + + @property + def month(self): + """int: """ + return self._ptr[0].month + + @month.setter + def month(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].month = val + + @property + def day(self): + """int: """ + return self._ptr[0].day + + @day.setter + def day(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].day = val + + @property + def hour(self): + """int: """ + return self._ptr[0].hour + + @hour.setter + def hour(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].hour = val + + @property + def min_(self): + """int: """ + return self._ptr[0].min + + @min_.setter + def min_(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].min = val + + @property + def sec(self): + """int: """ + return self._ptr[0].sec + + @sec.setter + def sec(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].sec = val + + @property + def status(self): + """int: """ + return self._ptr[0].status + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseExpiry instance is read-only") + self._ptr[0].status = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuLicenseExpiry instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseExpiry_t), VgpuLicenseExpiry) + + @staticmethod + def from_data(data): + """Create an VgpuLicenseExpiry instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_license_expiry_dtype` holding the data. + """ + 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): + """Create an VgpuLicenseExpiry 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 VgpuLicenseExpiry obj = VgpuLicenseExpiry.__new__(VgpuLicenseExpiry) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseExpiry_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseExpiry") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseExpiry_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_grid_license_expiry_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.year)) - (&pod), + (&(pod.month)) - (&pod), + (&(pod.day)) - (&pod), + (&(pod.hour)) - (&pod), + (&(pod.min)) - (&pod), + (&(pod.sec)) - (&pod), + (&(pod.status)) - (&pod), + ], + 'itemsize': sizeof(nvmlGridLicenseExpiry_t), + }) + +grid_license_expiry_dtype = _get_grid_license_expiry_dtype_offsets() + +cdef class GridLicenseExpiry: + """Empty-initialize an instance of `nvmlGridLicenseExpiry_t`. + + + .. seealso:: `nvmlGridLicenseExpiry_t` + """ + cdef: + nvmlGridLicenseExpiry_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicenseExpiry_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GridLicenseExpiry") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGridLicenseExpiry_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GridLicenseExpiry 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 GridLicenseExpiry other_ + if not isinstance(other, GridLicenseExpiry): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicenseExpiry_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGridLicenseExpiry_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GridLicenseExpiry") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicenseExpiry_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def year(self): + """int: """ + return self._ptr[0].year + + @year.setter + def year(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].year = val + + @property + def month(self): + """int: """ + return self._ptr[0].month + + @month.setter + def month(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].month = val + + @property + def day(self): + """int: """ + return self._ptr[0].day + + @day.setter + def day(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].day = val + + @property + def hour(self): + """int: """ + return self._ptr[0].hour + + @hour.setter + def hour(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].hour = val + + @property + def min_(self): + """int: """ + return self._ptr[0].min + + @min_.setter + def min_(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].min = val + + @property + def sec(self): + """int: """ + return self._ptr[0].sec + + @sec.setter + def sec(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].sec = val + + @property + def status(self): + """int: """ + return self._ptr[0].status + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This GridLicenseExpiry instance is read-only") + self._ptr[0].status = val + + @staticmethod + def from_buffer(buffer): + """Create an GridLicenseExpiry instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGridLicenseExpiry_t), GridLicenseExpiry) + + @staticmethod + def from_data(data): + """Create an GridLicenseExpiry instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `grid_license_expiry_dtype` holding the data. + """ + 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): + """Create an GridLicenseExpiry 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 GridLicenseExpiry obj = GridLicenseExpiry.__new__(GridLicenseExpiry) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGridLicenseExpiry_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GridLicenseExpiry") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicenseExpiry_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_type_id_info_v1_dtype_offsets(): + cdef nvmlVgpuTypeIdInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.vgpuCount)) - (&pod), + (&(pod.vgpuTypeIds)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuTypeIdInfo_v1_t), + }) + +vgpu_type_id_info_v1_dtype = _get_vgpu_type_id_info_v1_dtype_offsets() + +cdef class VgpuTypeIdInfo_v1: + """Empty-initialize an instance of `nvmlVgpuTypeIdInfo_v1_t`. + + + .. seealso:: `nvmlVgpuTypeIdInfo_v1_t` + """ + cdef: + nvmlVgpuTypeIdInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + 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 + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuTypeIdInfo_v1 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 VgpuTypeIdInfo_v1 other_ + if not isinstance(other, VgpuTypeIdInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeIdInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuTypeIdInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuTypeIdInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def vgpu_type_ids(self): + """int: OUT: List of vGPU type IDs.""" + if self._ptr[0].vgpuTypeIds == NULL: + return [] + 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) + + @vgpu_type_ids.setter + def vgpu_type_ids(self, val): + if self._readonly: + raise ValueError("This VgpuTypeIdInfo_v1 instance is read-only") + 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) + self._refs["vgpu_type_ids"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuTypeIdInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuTypeIdInfo_v1_t), VgpuTypeIdInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuTypeIdInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_type_id_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuTypeIdInfo_v1 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 VgpuTypeIdInfo_v1 obj = VgpuTypeIdInfo_v1.__new__(VgpuTypeIdInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuTypeIdInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + 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_active_vgpu_instance_info_v1_dtype_offsets(): + cdef nvmlActiveVgpuInstanceInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'vgpu_count', 'vgpu_instances'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.vgpuCount)) - (&pod), + (&(pod.vgpuInstances)) - (&pod), + ], + 'itemsize': sizeof(nvmlActiveVgpuInstanceInfo_v1_t), + }) + +active_vgpu_instance_info_v1_dtype = _get_active_vgpu_instance_info_v1_dtype_offsets() + +cdef class ActiveVgpuInstanceInfo_v1: + """Empty-initialize an instance of `nvmlActiveVgpuInstanceInfo_v1_t`. + + + .. seealso:: `nvmlActiveVgpuInstanceInfo_v1_t` + """ + cdef: + nvmlActiveVgpuInstanceInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + 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 + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ActiveVgpuInstanceInfo_v1 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 ActiveVgpuInstanceInfo_v1 other_ + if not isinstance(other, ActiveVgpuInstanceInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ActiveVgpuInstanceInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ActiveVgpuInstanceInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def vgpu_instances(self): + """int: IN/OUT: list of active vGPU instances.""" + if self._ptr[0].vgpuInstances == NULL: + return [] + 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) + + @vgpu_instances.setter + def vgpu_instances(self, val): + if self._readonly: + raise ValueError("This ActiveVgpuInstanceInfo_v1 instance is read-only") + 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) + self._refs["vgpu_instances"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an ActiveVgpuInstanceInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlActiveVgpuInstanceInfo_v1_t), ActiveVgpuInstanceInfo_v1) + + @staticmethod + def from_data(data): + """Create an ActiveVgpuInstanceInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `active_vgpu_instance_info_v1_dtype` holding the data. + """ + 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): + """Create an ActiveVgpuInstanceInfo_v1 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 ActiveVgpuInstanceInfo_v1 obj = ActiveVgpuInstanceInfo_v1.__new__(ActiveVgpuInstanceInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ActiveVgpuInstanceInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + 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_vgpu_creatable_placement_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.vgpuTypeId)) - (&pod), + (&(pod.count)) - (&pod), + (&(pod.placementIds)) - (&pod), + (&(pod.placementSize)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), + }) + +vgpu_creatable_placement_info_v1_dtype = _get_vgpu_creatable_placement_info_v1_dtype_offsets() + +cdef class VgpuCreatablePlacementInfo_v1: + """Empty-initialize an instance of `nvmlVgpuCreatablePlacementInfo_v1_t`. + + + .. seealso:: `nvmlVgpuCreatablePlacementInfo_v1_t` + """ + cdef: + nvmlVgpuCreatablePlacementInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuCreatablePlacementInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuCreatablePlacementInfo_v1 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 VgpuCreatablePlacementInfo_v1 other_ + if not isinstance(other, VgpuCreatablePlacementInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuCreatablePlacementInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def vgpu_type_id(self): + """int: IN: Handle to vGPU type.""" + return (self._ptr[0].vgpuTypeId) + + @vgpu_type_id.setter + def vgpu_type_id(self, val): + if self._readonly: + raise ValueError("This VgpuCreatablePlacementInfo_v1 instance is read-only") + self._ptr[0].vgpuTypeId = val + + @property + def count(self): + """int: IN/OUT: Count of the placement IDs.""" + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This VgpuCreatablePlacementInfo_v1 instance is read-only") + self._ptr[0].count = val + + @property + def placement_ids(self): + """int: IN/OUT: Placement IDs for the vGPU type.""" + if self._ptr[0].placementIds == NULL: + return [] + 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) + + @placement_ids.setter + def placement_ids(self, val): + if self._readonly: + raise ValueError("This VgpuCreatablePlacementInfo_v1 instance is read-only") + 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) + self._refs["placement_ids"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuCreatablePlacementInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), VgpuCreatablePlacementInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuCreatablePlacementInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_creatable_placement_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuCreatablePlacementInfo_v1 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 VgpuCreatablePlacementInfo_v1 obj = VgpuCreatablePlacementInfo_v1.__new__(VgpuCreatablePlacementInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + 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_hwbc_entry_dtype_offsets(): + cdef nvmlHwbcEntry_t pod + return _numpy.dtype({ + 'names': ['hwbc_id', 'firmware_version'], + 'formats': [_numpy.uint32, (_numpy.int8, 32)], + 'offsets': [ + (&(pod.hwbcId)) - (&pod), + (&(pod.firmwareVersion)) - (&pod), + ], + 'itemsize': sizeof(nvmlHwbcEntry_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=hwbc_entry_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlHwbcEntry_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlHwbcEntry_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.HwbcEntry_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.HwbcEntry 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, HwbcEntry)) 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 hwbc_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.hwbc_id[0]) + return self._data.hwbc_id + + @hwbc_id.setter + def hwbc_id(self, val): + self._data.hwbc_id = val + + @property + def firmware_version(self): + """~_numpy.int8: (array of length 32).""" + return self._data.firmware_version + + @firmware_version.setter + def firmware_version(self, val): + self._data.firmware_version = 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 HwbcEntry.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == hwbc_entry_dtype: + return HwbcEntry.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an HwbcEntry instance with the memory from the given buffer.""" + return HwbcEntry.from_data(_numpy.frombuffer(buffer, dtype=hwbc_entry_dtype)) + + @staticmethod + def from_data(data): + """Create an HwbcEntry instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `hwbc_entry_dtype` holding the data. + """ + cdef HwbcEntry obj = HwbcEntry.__new__(HwbcEntry) + 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 != hwbc_entry_dtype: + raise ValueError("data array must be of dtype hwbc_entry_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an HwbcEntry 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef HwbcEntry obj = HwbcEntry.__new__(HwbcEntry) + 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) + obj._owner = owner + + return obj + + +cdef _get_led_state_dtype_offsets(): + cdef nvmlLedState_t pod + return _numpy.dtype({ + 'names': ['cause', 'color'], + 'formats': [(_numpy.int8, 256), _numpy.int32], + 'offsets': [ + (&(pod.cause)) - (&pod), + (&(pod.color)) - (&pod), + ], + 'itemsize': sizeof(nvmlLedState_t), + }) + +led_state_dtype = _get_led_state_dtype_offsets() + +cdef class LedState: + """Empty-initialize an instance of `nvmlLedState_t`. + + + .. seealso:: `nvmlLedState_t` + """ + cdef: + nvmlLedState_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlLedState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating LedState") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlLedState_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.LedState 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 LedState other_ + if not isinstance(other, LedState): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlLedState_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlLedState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating LedState") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlLedState_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cause(self): + """~_numpy.int8: (array of length 256).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].cause) + + @cause.setter + def cause(self, val): + if self._readonly: + raise ValueError("This LedState instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 256: + raise ValueError("String too long for field cause, max length is 255") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].cause), ptr, 256) + + @property + def color(self): + """int: """ + return (self._ptr[0].color) + + @color.setter + def color(self, val): + if self._readonly: + raise ValueError("This LedState instance is read-only") + self._ptr[0].color = val + + @staticmethod + def from_buffer(buffer): + """Create an LedState instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlLedState_t), LedState) + + @staticmethod + def from_data(data): + """Create an LedState instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `led_state_dtype` holding the data. + """ + 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): + """Create an LedState 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 LedState obj = LedState.__new__(LedState) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlLedState_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating LedState") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlLedState_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_unit_info_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.name)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.serial)) - (&pod), + (&(pod.firmwareVersion)) - (&pod), + ], + 'itemsize': sizeof(nvmlUnitInfo_t), + }) + +unit_info_dtype = _get_unit_info_dtype_offsets() + +cdef class UnitInfo: + """Empty-initialize an instance of `nvmlUnitInfo_t`. + + + .. seealso:: `nvmlUnitInfo_t` + """ + cdef: + nvmlUnitInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlUnitInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlUnitInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.UnitInfo 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 UnitInfo other_ + if not isinstance(other, UnitInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlUnitInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitInfo_t)) + 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 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) + + @name.setter + def name(self, val): + if self._readonly: + raise ValueError("This UnitInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field name, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].name), ptr, 96) + + @property + def id(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].id) + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This UnitInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field id, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].id), ptr, 96) + + @property + def serial(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].serial) + + @serial.setter + def serial(self, val): + if self._readonly: + raise ValueError("This UnitInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field serial, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].serial), ptr, 96) + + @property + def firmware_version(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].firmwareVersion) + + @firmware_version.setter + def firmware_version(self, val): + if self._readonly: + raise ValueError("This UnitInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field firmware_version, max length is 95") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlUnitInfo_t), UnitInfo) + + @staticmethod + def from_data(data): + """Create an UnitInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `unit_info_dtype` holding the data. + """ + 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): + """Create an UnitInfo 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 UnitInfo obj = UnitInfo.__new__(UnitInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlUnitInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating UnitInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_psu_info_dtype_offsets(): + cdef nvmlPSUInfo_t pod + return _numpy.dtype({ + 'names': ['state', 'current', 'voltage', 'power'], + 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.state)) - (&pod), + (&(pod.current)) - (&pod), + (&(pod.voltage)) - (&pod), + (&(pod.power)) - (&pod), + ], + 'itemsize': sizeof(nvmlPSUInfo_t), + }) + +psu_info_dtype = _get_psu_info_dtype_offsets() + +cdef class PSUInfo: + """Empty-initialize an instance of `nvmlPSUInfo_t`. + + + .. seealso:: `nvmlPSUInfo_t` + """ + cdef: + nvmlPSUInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPSUInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PSUInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPSUInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PSUInfo 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 PSUInfo other_ + if not isinstance(other, PSUInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPSUInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPSUInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PSUInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPSUInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def state(self): + """~_numpy.int8: (array of length 256).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].state) + + @state.setter + def state(self, val): + if self._readonly: + raise ValueError("This PSUInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 256: + raise ValueError("String too long for field state, max length is 255") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].state), ptr, 256) + + @property + def current(self): + """int: """ + return self._ptr[0].current + + @current.setter + def current(self, val): + if self._readonly: + raise ValueError("This PSUInfo instance is read-only") + self._ptr[0].current = val + + @property + def voltage(self): + """int: """ + return self._ptr[0].voltage + + @voltage.setter + def voltage(self, val): + if self._readonly: + raise ValueError("This PSUInfo instance is read-only") + self._ptr[0].voltage = val + + @property + def power(self): + """int: """ + return self._ptr[0].power + + @power.setter + def power(self, val): + if self._readonly: + raise ValueError("This PSUInfo instance is read-only") + self._ptr[0].power = val + + @staticmethod + def from_buffer(buffer): + """Create an PSUInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPSUInfo_t), PSUInfo) + + @staticmethod + def from_data(data): + """Create an PSUInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `psu_info_dtype` holding the data. + """ + 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): + """Create an PSUInfo 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 PSUInfo obj = PSUInfo.__new__(PSUInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPSUInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PSUInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPSUInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_unit_fan_info_dtype_offsets(): + cdef nvmlUnitFanInfo_t pod + return _numpy.dtype({ + 'names': ['speed', 'state'], + 'formats': [_numpy.uint32, _numpy.int32], + 'offsets': [ + (&(pod.speed)) - (&pod), + (&(pod.state)) - (&pod), + ], + 'itemsize': sizeof(nvmlUnitFanInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=unit_fan_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlUnitFanInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlUnitFanInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.UnitFanInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.UnitFanInfo 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, UnitFanInfo)) 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 speed(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.speed[0]) + return self._data.speed + + @speed.setter + def speed(self, val): + self._data.speed = val + + @property + def state(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.state[0]) + return self._data.state + + @state.setter + def state(self, val): + self._data.state = 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 UnitFanInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == unit_fan_info_dtype: + return UnitFanInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an UnitFanInfo instance with the memory from the given buffer.""" + return UnitFanInfo.from_data(_numpy.frombuffer(buffer, dtype=unit_fan_info_dtype)) + + @staticmethod + def from_data(data): + """Create an UnitFanInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `unit_fan_info_dtype` holding the data. + """ + cdef UnitFanInfo obj = UnitFanInfo.__new__(UnitFanInfo) + 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 != unit_fan_info_dtype: + raise ValueError("data array must be of dtype unit_fan_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an UnitFanInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef UnitFanInfo obj = UnitFanInfo.__new__(UnitFanInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_event_data_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.device)) - (&pod), + (&(pod.eventType)) - (&pod), + (&(pod.eventData)) - (&pod), + (&(pod.gpuInstanceId)) - (&pod), + (&(pod.computeInstanceId)) - (&pod), + ], + 'itemsize': sizeof(nvmlEventData_t), + }) + +event_data_dtype = _get_event_data_dtype_offsets() + +cdef class EventData: + """Empty-initialize an instance of `nvmlEventData_t`. + + + .. seealso:: `nvmlEventData_t` + """ + cdef: + nvmlEventData_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEventData_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EventData") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlEventData_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.EventData 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 EventData other_ + if not isinstance(other, EventData): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventData_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlEventData_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EventData") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventData_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def device_(self): + """int: """ + return (self._ptr[0].device) + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This EventData instance is read-only") + self._ptr[0].device = val + + @property + def event_type(self): + """int: """ + return self._ptr[0].eventType + + @event_type.setter + def event_type(self, val): + if self._readonly: + raise ValueError("This EventData instance is read-only") + self._ptr[0].eventType = val + + @property + def event_data(self): + """int: """ + return self._ptr[0].eventData + + @event_data.setter + def event_data(self, val): + if self._readonly: + raise ValueError("This EventData instance is read-only") + self._ptr[0].eventData = val + + @property + def gpu_instance_id(self): + """int: """ + return self._ptr[0].gpuInstanceId + + @gpu_instance_id.setter + def gpu_instance_id(self, val): + if self._readonly: + raise ValueError("This EventData instance is read-only") + self._ptr[0].gpuInstanceId = val + + @property + def compute_instance_id(self): + """int: """ + return self._ptr[0].computeInstanceId + + @compute_instance_id.setter + def compute_instance_id(self, val): + if self._readonly: + raise ValueError("This EventData instance is read-only") + self._ptr[0].computeInstanceId = val + + @staticmethod + def from_buffer(buffer): + """Create an EventData instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventData_t), EventData) + + @staticmethod + def from_data(data): + """Create an EventData instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `event_data_dtype` holding the data. + """ + 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): + """Create an EventData 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 EventData obj = EventData.__new__(EventData) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEventData_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EventData") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventData_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_system_event_data_v1_dtype_offsets(): + cdef nvmlSystemEventData_v1_t pod + return _numpy.dtype({ + 'names': ['event_type', 'gpu_id'], + 'formats': [_numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.eventType)) - (&pod), + (&(pod.gpuId)) - (&pod), + ], + 'itemsize': sizeof(nvmlSystemEventData_v1_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=system_event_data_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlSystemEventData_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlSystemEventData_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.SystemEventData_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.SystemEventData_v1 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, SystemEventData_v1)) 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 event_type(self): + """Union[~_numpy.uint64, int]: Information about what specific system event occurred.""" + if self._data.size == 1: + return int(self._data.event_type[0]) + return self._data.event_type + + @event_type.setter + def event_type(self, val): + self._data.event_type = val + + @property + def gpu_id(self): + """Union[~_numpy.uint32, int]: gpuId in PCI format""" + if self._data.size == 1: + return int(self._data.gpu_id[0]) + return self._data.gpu_id + + @gpu_id.setter + def gpu_id(self, val): + self._data.gpu_id = 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 SystemEventData_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == system_event_data_v1_dtype: + return SystemEventData_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an SystemEventData_v1 instance with the memory from the given buffer.""" + return SystemEventData_v1.from_data(_numpy.frombuffer(buffer, dtype=system_event_data_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an SystemEventData_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `system_event_data_v1_dtype` holding the data. + """ + cdef SystemEventData_v1 obj = SystemEventData_v1.__new__(SystemEventData_v1) + 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 != system_event_data_v1_dtype: + raise ValueError("data array must be of dtype system_event_data_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an SystemEventData_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef SystemEventData_v1 obj = SystemEventData_v1.__new__(SystemEventData_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_accounting_stats_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.gpuUtilization)) - (&pod), + (&(pod.memoryUtilization)) - (&pod), + (&(pod.maxMemoryUsage)) - (&pod), + (&(pod.time)) - (&pod), + (&(pod.startTime)) - (&pod), + (&(pod.isRunning)) - (&pod), + (&(pod.reserved)) - (&pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_t), + }) + +accounting_stats_dtype = _get_accounting_stats_dtype_offsets() + +cdef class AccountingStats: + """Empty-initialize an instance of `nvmlAccountingStats_t`. + + + .. seealso:: `nvmlAccountingStats_t` + """ + cdef: + nvmlAccountingStats_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlAccountingStats_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating AccountingStats") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlAccountingStats_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.AccountingStats 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 AccountingStats other_ + if not isinstance(other, AccountingStats): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlAccountingStats_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlAccountingStats_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating AccountingStats") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAccountingStats_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def gpu_utilization(self): + """int: """ + return self._ptr[0].gpuUtilization + + @gpu_utilization.setter + def gpu_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].gpuUtilization = val + + @property + def memory_utilization(self): + """int: """ + return self._ptr[0].memoryUtilization + + @memory_utilization.setter + def memory_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].memoryUtilization = val + + @property + def max_memory_usage(self): + """int: """ + return self._ptr[0].maxMemoryUsage + + @max_memory_usage.setter + def max_memory_usage(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].maxMemoryUsage = val + + @property + def time(self): + """int: """ + return self._ptr[0].time + + @time.setter + def time(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].time = val + + @property + def start_time(self): + """int: """ + return self._ptr[0].startTime + + @start_time.setter + def start_time(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].startTime = val + + @property + def is_running(self): + """int: """ + return self._ptr[0].isRunning + + @is_running.setter + def is_running(self, val): + if self._readonly: + raise ValueError("This AccountingStats instance is read-only") + self._ptr[0].isRunning = val + + @staticmethod + def from_buffer(buffer): + """Create an AccountingStats instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlAccountingStats_t), AccountingStats) + + @staticmethod + def from_data(data): + """Create an AccountingStats instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `accounting_stats_dtype` holding the data. + """ + 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): + """Create an AccountingStats 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 AccountingStats obj = AccountingStats.__new__(AccountingStats) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating AccountingStats") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlAccountingStats_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_encoder_session_info_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.sessionId)) - (&pod), + (&(pod.pid)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.codecType)) - (&pod), + (&(pod.hResolution)) - (&pod), + (&(pod.vResolution)) - (&pod), + (&(pod.averageFps)) - (&pod), + (&(pod.averageLatency)) - (&pod), + ], + 'itemsize': sizeof(nvmlEncoderSessionInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=encoder_session_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlEncoderSessionInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlEncoderSessionInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.EncoderSessionInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.EncoderSessionInfo 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, EncoderSessionInfo)) 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 session_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.session_id[0]) + return self._data.session_id + + @session_id.setter + def session_id(self, val): + self._data.session_id = val + + @property + def pid(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def codec_type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.codec_type[0]) + return self._data.codec_type + + @codec_type.setter + def codec_type(self, val): + self._data.codec_type = val + + @property + def h_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.h_resolution[0]) + return self._data.h_resolution + + @h_resolution.setter + def h_resolution(self, val): + self._data.h_resolution = val + + @property + def v_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.v_resolution[0]) + return self._data.v_resolution + + @v_resolution.setter + def v_resolution(self, val): + self._data.v_resolution = val + + @property + def average_fps(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.average_fps[0]) + return self._data.average_fps + + @average_fps.setter + def average_fps(self, val): + self._data.average_fps = val + + @property + def average_latency(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.average_latency[0]) + return self._data.average_latency + + @average_latency.setter + def average_latency(self, val): + self._data.average_latency = 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 EncoderSessionInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == encoder_session_info_dtype: + return EncoderSessionInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an EncoderSessionInfo instance with the memory from the given buffer.""" + return EncoderSessionInfo.from_data(_numpy.frombuffer(buffer, dtype=encoder_session_info_dtype)) + + @staticmethod + def from_data(data): + """Create an EncoderSessionInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `encoder_session_info_dtype` holding the data. + """ + cdef EncoderSessionInfo obj = EncoderSessionInfo.__new__(EncoderSessionInfo) + 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 != encoder_session_info_dtype: + raise ValueError("data array must be of dtype encoder_session_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an EncoderSessionInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef EncoderSessionInfo obj = EncoderSessionInfo.__new__(EncoderSessionInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_fbc_stats_dtype_offsets(): + cdef nvmlFBCStats_t pod + return _numpy.dtype({ + 'names': ['sessions_count', 'average_fps', 'average_latency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.sessionsCount)) - (&pod), + (&(pod.averageFPS)) - (&pod), + (&(pod.averageLatency)) - (&pod), + ], + 'itemsize': sizeof(nvmlFBCStats_t), + }) + +fbc_stats_dtype = _get_fbc_stats_dtype_offsets() + +cdef class FBCStats: + """Empty-initialize an instance of `nvmlFBCStats_t`. + + + .. seealso:: `nvmlFBCStats_t` + """ + cdef: + nvmlFBCStats_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlFBCStats_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating FBCStats") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlFBCStats_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.FBCStats 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 FBCStats other_ + if not isinstance(other, FBCStats): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlFBCStats_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlFBCStats_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating FBCStats") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlFBCStats_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def sessions_count(self): + """int: """ + return self._ptr[0].sessionsCount + + @sessions_count.setter + def sessions_count(self, val): + if self._readonly: + raise ValueError("This FBCStats instance is read-only") + self._ptr[0].sessionsCount = val + + @property + def average_fps(self): + """int: """ + return self._ptr[0].averageFPS + + @average_fps.setter + def average_fps(self, val): + if self._readonly: + raise ValueError("This FBCStats instance is read-only") + self._ptr[0].averageFPS = val + + @property + def average_latency(self): + """int: """ + return self._ptr[0].averageLatency + + @average_latency.setter + def average_latency(self, val): + if self._readonly: + raise ValueError("This FBCStats instance is read-only") + self._ptr[0].averageLatency = val + + @staticmethod + def from_buffer(buffer): + """Create an FBCStats instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlFBCStats_t), FBCStats) + + @staticmethod + def from_data(data): + """Create an FBCStats instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `fbc_stats_dtype` holding the data. + """ + 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): + """Create an FBCStats 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 FBCStats obj = FBCStats.__new__(FBCStats) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlFBCStats_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating FBCStats") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlFBCStats_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_fbc_session_info_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.sessionId)) - (&pod), + (&(pod.pid)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.displayOrdinal)) - (&pod), + (&(pod.sessionType)) - (&pod), + (&(pod.sessionFlags)) - (&pod), + (&(pod.hMaxResolution)) - (&pod), + (&(pod.vMaxResolution)) - (&pod), + (&(pod.hResolution)) - (&pod), + (&(pod.vResolution)) - (&pod), + (&(pod.averageFPS)) - (&pod), + (&(pod.averageLatency)) - (&pod), + ], + 'itemsize': sizeof(nvmlFBCSessionInfo_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=fbc_session_info_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlFBCSessionInfo_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlFBCSessionInfo_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.FBCSessionInfo_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.FBCSessionInfo 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, FBCSessionInfo)) 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 session_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.session_id[0]) + return self._data.session_id + + @session_id.setter + def session_id(self, val): + self._data.session_id = val + + @property + def pid(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.pid[0]) + return self._data.pid + + @pid.setter + def pid(self, val): + self._data.pid = val + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def display_ordinal(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.display_ordinal[0]) + return self._data.display_ordinal + + @display_ordinal.setter + def display_ordinal(self, val): + self._data.display_ordinal = val + + @property + def session_type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.session_type[0]) + return self._data.session_type + + @session_type.setter + def session_type(self, val): + self._data.session_type = val + + @property + def session_flags(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.session_flags[0]) + return self._data.session_flags + + @session_flags.setter + def session_flags(self, val): + self._data.session_flags = val + + @property + def h_max_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.h_max_resolution[0]) + return self._data.h_max_resolution + + @h_max_resolution.setter + def h_max_resolution(self, val): + self._data.h_max_resolution = val + + @property + def v_max_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.v_max_resolution[0]) + return self._data.v_max_resolution + + @v_max_resolution.setter + def v_max_resolution(self, val): + self._data.v_max_resolution = val + + @property + def h_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.h_resolution[0]) + return self._data.h_resolution + + @h_resolution.setter + def h_resolution(self, val): + self._data.h_resolution = val + + @property + def v_resolution(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.v_resolution[0]) + return self._data.v_resolution + + @v_resolution.setter + def v_resolution(self, val): + self._data.v_resolution = val + + @property + def average_fps(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.average_fps[0]) + return self._data.average_fps + + @average_fps.setter + def average_fps(self, val): + self._data.average_fps = val + + @property + def average_latency(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.average_latency[0]) + return self._data.average_latency + + @average_latency.setter + def average_latency(self, val): + self._data.average_latency = 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 FBCSessionInfo.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == fbc_session_info_dtype: + return FBCSessionInfo.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an FBCSessionInfo instance with the memory from the given buffer.""" + return FBCSessionInfo.from_data(_numpy.frombuffer(buffer, dtype=fbc_session_info_dtype)) + + @staticmethod + def from_data(data): + """Create an FBCSessionInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `fbc_session_info_dtype` holding the data. + """ + cdef FBCSessionInfo obj = FBCSessionInfo.__new__(FBCSessionInfo) + 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 != fbc_session_info_dtype: + raise ValueError("data array must be of dtype fbc_session_info_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an FBCSessionInfo 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef FBCSessionInfo obj = FBCSessionInfo.__new__(FBCSessionInfo) + 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) + obj._owner = owner + + return obj + + +cdef _get_conf_compute_system_caps_dtype_offsets(): + cdef nvmlConfComputeSystemCaps_t pod + return _numpy.dtype({ + 'names': ['cpu_caps', 'gpus_caps'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.cpuCaps)) - (&pod), + (&(pod.gpusCaps)) - (&pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemCaps_t), + }) + +conf_compute_system_caps_dtype = _get_conf_compute_system_caps_dtype_offsets() + +cdef class ConfComputeSystemCaps: + """Empty-initialize an instance of `nvmlConfComputeSystemCaps_t`. + + + .. seealso:: `nvmlConfComputeSystemCaps_t` + """ + cdef: + nvmlConfComputeSystemCaps_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeSystemCaps_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemCaps") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlConfComputeSystemCaps_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ConfComputeSystemCaps 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 ConfComputeSystemCaps other_ + if not isinstance(other, ConfComputeSystemCaps): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemCaps_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlConfComputeSystemCaps_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemCaps") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemCaps_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cpu_caps(self): + """int: """ + return self._ptr[0].cpuCaps + + @cpu_caps.setter + def cpu_caps(self, val): + if self._readonly: + raise ValueError("This ConfComputeSystemCaps instance is read-only") + self._ptr[0].cpuCaps = val + + @property + def gpus_caps(self): + """int: """ + return self._ptr[0].gpusCaps + + @gpus_caps.setter + def gpus_caps(self, val): + if self._readonly: + raise ValueError("This ConfComputeSystemCaps instance is read-only") + self._ptr[0].gpusCaps = val + + @staticmethod + def from_buffer(buffer): + """Create an ConfComputeSystemCaps instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeSystemCaps_t), ConfComputeSystemCaps) + + @staticmethod + def from_data(data): + """Create an ConfComputeSystemCaps instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `conf_compute_system_caps_dtype` holding the data. + """ + 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): + """Create an ConfComputeSystemCaps 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 ConfComputeSystemCaps obj = ConfComputeSystemCaps.__new__(ConfComputeSystemCaps) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemCaps_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemCaps") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemCaps_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_conf_compute_system_state_dtype_offsets(): + cdef nvmlConfComputeSystemState_t pod + return _numpy.dtype({ + 'names': ['environment', 'cc_feature', 'dev_tools_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.environment)) - (&pod), + (&(pod.ccFeature)) - (&pod), + (&(pod.devToolsMode)) - (&pod), + ], + 'itemsize': sizeof(nvmlConfComputeSystemState_t), + }) + +conf_compute_system_state_dtype = _get_conf_compute_system_state_dtype_offsets() + +cdef class ConfComputeSystemState: + """Empty-initialize an instance of `nvmlConfComputeSystemState_t`. + + + .. seealso:: `nvmlConfComputeSystemState_t` + """ + cdef: + nvmlConfComputeSystemState_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeSystemState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemState") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlConfComputeSystemState_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ConfComputeSystemState 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 ConfComputeSystemState other_ + if not isinstance(other, ConfComputeSystemState): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemState_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlConfComputeSystemState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemState") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemState_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def environment(self): + """int: """ + return self._ptr[0].environment + + @environment.setter + def environment(self, val): + if self._readonly: + raise ValueError("This ConfComputeSystemState instance is read-only") + self._ptr[0].environment = val + + @property + def cc_feature(self): + """int: """ + return self._ptr[0].ccFeature + + @cc_feature.setter + def cc_feature(self, val): + if self._readonly: + raise ValueError("This ConfComputeSystemState instance is read-only") + self._ptr[0].ccFeature = val + + @property + def dev_tools_mode(self): + """int: """ + return self._ptr[0].devToolsMode + + @dev_tools_mode.setter + def dev_tools_mode(self, val): + if self._readonly: + raise ValueError("This ConfComputeSystemState instance is read-only") + self._ptr[0].devToolsMode = val + + @staticmethod + def from_buffer(buffer): + """Create an ConfComputeSystemState instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeSystemState_t), ConfComputeSystemState) + + @staticmethod + def from_data(data): + """Create an ConfComputeSystemState instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `conf_compute_system_state_dtype` holding the data. + """ + 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): + """Create an ConfComputeSystemState 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 ConfComputeSystemState obj = ConfComputeSystemState.__new__(ConfComputeSystemState) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemState_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ConfComputeSystemState") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemState_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_system_conf_compute_settings_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.environment)) - (&pod), + (&(pod.ccFeature)) - (&pod), + (&(pod.devToolsMode)) - (&pod), + (&(pod.multiGpuMode)) - (&pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v1_t), + }) + +system_conf_compute_settings_v1_dtype = _get_system_conf_compute_settings_v1_dtype_offsets() + +cdef class SystemConfComputeSettings_v1: + """Empty-initialize an instance of `nvmlSystemConfComputeSettings_v1_t`. + + + .. seealso:: `nvmlSystemConfComputeSettings_v1_t` + """ + cdef: + nvmlSystemConfComputeSettings_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating SystemConfComputeSettings_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlSystemConfComputeSettings_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.SystemConfComputeSettings_v1 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 SystemConfComputeSettings_v1 other_ + if not isinstance(other, SystemConfComputeSettings_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlSystemConfComputeSettings_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating SystemConfComputeSettings_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlSystemConfComputeSettings_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v1 instance is read-only") + self._ptr[0].version = val + + @property + def environment(self): + """int: """ + return self._ptr[0].environment + + @environment.setter + def environment(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v1 instance is read-only") + self._ptr[0].environment = val + + @property + def cc_feature(self): + """int: """ + return self._ptr[0].ccFeature + + @cc_feature.setter + def cc_feature(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v1 instance is read-only") + self._ptr[0].ccFeature = val + + @property + def dev_tools_mode(self): + """int: """ + return self._ptr[0].devToolsMode + + @dev_tools_mode.setter + def dev_tools_mode(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v1 instance is read-only") + self._ptr[0].devToolsMode = val + + @property + def multi_gpu_mode(self): + """int: """ + return self._ptr[0].multiGpuMode + + @multi_gpu_mode.setter + def multi_gpu_mode(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v1 instance is read-only") + self._ptr[0].multiGpuMode = val + + @staticmethod + def from_buffer(buffer): + """Create an SystemConfComputeSettings_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlSystemConfComputeSettings_v1_t), SystemConfComputeSettings_v1) + + @staticmethod + def from_data(data): + """Create an SystemConfComputeSettings_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `system_conf_compute_settings_v1_dtype` holding the data. + """ + 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): + """Create an SystemConfComputeSettings_v1 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 SystemConfComputeSettings_v1 obj = SystemConfComputeSettings_v1.__new__(SystemConfComputeSettings_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating SystemConfComputeSettings_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlSystemConfComputeSettings_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_conf_compute_mem_size_info_dtype_offsets(): + cdef nvmlConfComputeMemSizeInfo_t pod + return _numpy.dtype({ + 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], + 'formats': [_numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.protectedMemSizeKib)) - (&pod), + (&(pod.unprotectedMemSizeKib)) - (&pod), + ], + 'itemsize': sizeof(nvmlConfComputeMemSizeInfo_t), + }) + +conf_compute_mem_size_info_dtype = _get_conf_compute_mem_size_info_dtype_offsets() + +cdef class ConfComputeMemSizeInfo: + """Empty-initialize an instance of `nvmlConfComputeMemSizeInfo_t`. + + + .. seealso:: `nvmlConfComputeMemSizeInfo_t` + """ + cdef: + nvmlConfComputeMemSizeInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeMemSizeInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeMemSizeInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlConfComputeMemSizeInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ConfComputeMemSizeInfo 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 ConfComputeMemSizeInfo other_ + if not isinstance(other, ConfComputeMemSizeInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeMemSizeInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeMemSizeInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeMemSizeInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def protected_mem_size_kib(self): + """int: """ + return self._ptr[0].protectedMemSizeKib + + @protected_mem_size_kib.setter + def protected_mem_size_kib(self, val): + if self._readonly: + raise ValueError("This ConfComputeMemSizeInfo instance is read-only") + self._ptr[0].protectedMemSizeKib = val + + @property + def unprotected_mem_size_kib(self): + """int: """ + return self._ptr[0].unprotectedMemSizeKib + + @unprotected_mem_size_kib.setter + def unprotected_mem_size_kib(self, val): + if self._readonly: + raise ValueError("This ConfComputeMemSizeInfo instance is read-only") + self._ptr[0].unprotectedMemSizeKib = val + + @staticmethod + def from_buffer(buffer): + """Create an ConfComputeMemSizeInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeMemSizeInfo_t), ConfComputeMemSizeInfo) + + @staticmethod + def from_data(data): + """Create an ConfComputeMemSizeInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `conf_compute_mem_size_info_dtype` holding the data. + """ + 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): + """Create an ConfComputeMemSizeInfo 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 ConfComputeMemSizeInfo obj = ConfComputeMemSizeInfo.__new__(ConfComputeMemSizeInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ConfComputeMemSizeInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeMemSizeInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_conf_compute_gpu_certificate_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.certChainSize)) - (&pod), + (&(pod.attestationCertChainSize)) - (&pod), + (&(pod.certChain)) - (&pod), + (&(pod.attestationCertChain)) - (&pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuCertificate_t), + }) + +conf_compute_gpu_certificate_dtype = _get_conf_compute_gpu_certificate_dtype_offsets() + +cdef class ConfComputeGpuCertificate: + """Empty-initialize an instance of `nvmlConfComputeGpuCertificate_t`. + + + .. seealso:: `nvmlConfComputeGpuCertificate_t` + """ + cdef: + nvmlConfComputeGpuCertificate_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeGpuCertificate_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuCertificate") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlConfComputeGpuCertificate_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ConfComputeGpuCertificate 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 ConfComputeGpuCertificate other_ + if not isinstance(other, ConfComputeGpuCertificate): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuCertificate_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlConfComputeGpuCertificate_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuCertificate") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuCertificate_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cert_chain(self): + """~_numpy.uint8: (array of length 4096).""" + if self._ptr[0].certChainSize == 0: + return _numpy.array([]) + 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) + + @cert_chain.setter + def cert_chain(self, val): + if self._readonly: + raise ValueError("This ConfComputeGpuCertificate instance is read-only") + if len(val) > 4096: + raise ValueError(f"Too many elements for field cert_chain, max is 4096, got {len(val)}") + self._ptr[0].certChainSize = len(val) + if len(val) == 0: + return + 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) + _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 _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) + + @attestation_cert_chain.setter + def attestation_cert_chain(self, val): + if self._readonly: + raise ValueError("This ConfComputeGpuCertificate instance is read-only") + if len(val) > 5120: + raise ValueError(f"Too many elements for field attestation_cert_chain, max is 5120, got {len(val)}") + self._ptr[0].attestationCertChainSize = len(val) + if len(val) == 0: + return + 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) + _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 _cyb_from_buffer(buffer, sizeof(nvmlConfComputeGpuCertificate_t), ConfComputeGpuCertificate) + + @staticmethod + def from_data(data): + """Create an ConfComputeGpuCertificate instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `conf_compute_gpu_certificate_dtype` holding the data. + """ + 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): + """Create an ConfComputeGpuCertificate 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 ConfComputeGpuCertificate obj = ConfComputeGpuCertificate.__new__(ConfComputeGpuCertificate) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuCertificate_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuCertificate") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuCertificate_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_conf_compute_gpu_attestation_report_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.isCecAttestationReportPresent)) - (&pod), + (&(pod.attestationReportSize)) - (&pod), + (&(pod.cecAttestationReportSize)) - (&pod), + (&(pod.nonce)) - (&pod), + (&(pod.attestationReport)) - (&pod), + (&(pod.cecAttestationReport)) - (&pod), + ], + 'itemsize': sizeof(nvmlConfComputeGpuAttestationReport_t), + }) + +conf_compute_gpu_attestation_report_dtype = _get_conf_compute_gpu_attestation_report_dtype_offsets() + +cdef class ConfComputeGpuAttestationReport: + """Empty-initialize an instance of `nvmlConfComputeGpuAttestationReport_t`. + + + .. seealso:: `nvmlConfComputeGpuAttestationReport_t` + """ + cdef: + nvmlConfComputeGpuAttestationReport_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeGpuAttestationReport_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuAttestationReport") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlConfComputeGpuAttestationReport_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ConfComputeGpuAttestationReport 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 ConfComputeGpuAttestationReport other_ + if not isinstance(other, ConfComputeGpuAttestationReport): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuAttestationReport_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuAttestationReport") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuAttestationReport_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def is_cec_attestation_report_present(self): + """int: """ + return self._ptr[0].isCecAttestationReportPresent + + @is_cec_attestation_report_present.setter + def is_cec_attestation_report_present(self, val): + if self._readonly: + raise ValueError("This ConfComputeGpuAttestationReport instance is read-only") + self._ptr[0].isCecAttestationReportPresent = val + + @property + def nonce(self): + """~_numpy.uint8: (array of length 32).""" + 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) + + @nonce.setter + def nonce(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _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 _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) + + @attestation_report.setter + def attestation_report(self, val): + if self._readonly: + raise ValueError("This ConfComputeGpuAttestationReport instance is read-only") + if len(val) > 8192: + raise ValueError(f"Too many elements for field attestation_report, max is 8192, got {len(val)}") + self._ptr[0].attestationReportSize = len(val) + if len(val) == 0: + return + 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) + _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 _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) + + @cec_attestation_report.setter + def cec_attestation_report(self, val): + if self._readonly: + raise ValueError("This ConfComputeGpuAttestationReport instance is read-only") + if len(val) > 4096: + raise ValueError(f"Too many elements for field cec_attestation_report, max is 4096, got {len(val)}") + self._ptr[0].cecAttestationReportSize = len(val) + if len(val) == 0: + return + 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) + _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 _cyb_from_buffer(buffer, sizeof(nvmlConfComputeGpuAttestationReport_t), ConfComputeGpuAttestationReport) + + @staticmethod + def from_data(data): + """Create an ConfComputeGpuAttestationReport instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `conf_compute_gpu_attestation_report_dtype` holding the data. + """ + 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): + """Create an ConfComputeGpuAttestationReport 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 ConfComputeGpuAttestationReport obj = ConfComputeGpuAttestationReport.__new__(ConfComputeGpuAttestationReport) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ConfComputeGpuAttestationReport") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuAttestationReport_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_fabric_info_v2_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.clusterUuid)) - (&pod), + (&(pod.status)) - (&pod), + (&(pod.cliqueId)) - (&pod), + (&(pod.state)) - (&pod), + (&(pod.healthMask)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v2_t), + }) + +gpu_fabric_info_v2_dtype = _get_gpu_fabric_info_v2_dtype_offsets() + +cdef class GpuFabricInfo_v2: + """Empty-initialize an instance of `nvmlGpuFabricInfo_v2_t`. + + + .. seealso:: `nvmlGpuFabricInfo_v2_t` + """ + cdef: + nvmlGpuFabricInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuFabricInfo_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__}.GpuFabricInfo_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 GpuFabricInfo_v2 other_ + if not isinstance(other, GpuFabricInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: Structure version identifier (set to nvmlGpuFabricInfo_v2).""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v2 instance is read-only") + self._ptr[0].version = val + + @property + def cluster_uuid(self): + """~_numpy.uint8: (array of length 16).Uuid of the cluster to which this GPU belongs.""" + 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) + + @cluster_uuid.setter + def cluster_uuid(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _cyb_memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) + + @property + def status(self): + """int: Probe Error status, if any. Must be checked only if Probe state returns "complete".""" + return (self._ptr[0].status) + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v2 instance is read-only") + self._ptr[0].status = val + + @property + def clique_id(self): + """int: ID of the fabric clique to which this GPU belongs.""" + return self._ptr[0].cliqueId + + @clique_id.setter + def clique_id(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v2 instance is read-only") + self._ptr[0].cliqueId = val + + @property + def state(self): + """int: Current Probe State of GPU registration process. See NVML_GPU_FABRIC_STATE_*.""" + return (self._ptr[0].state) + + @state.setter + def state(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v2 instance is read-only") + self._ptr[0].state = val + + @property + def health_mask(self): + """int: GPU Fabric health Status Mask. See NVML_GPU_FABRIC_HEALTH_MASK_*.""" + return self._ptr[0].healthMask + + @health_mask.setter + def health_mask(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v2 instance is read-only") + self._ptr[0].healthMask = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuFabricInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v2_t), GpuFabricInfo_v2) + + @staticmethod + def from_data(data): + """Create an GpuFabricInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_info_v2_dtype` holding the data. + """ + 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): + """Create an GpuFabricInfo_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 GpuFabricInfo_v2 obj = GpuFabricInfo_v2.__new__(GpuFabricInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_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_nvlink_supported_bw_modes_v1_dtype_offsets(): + cdef nvmlNvlinkSupportedBwModes_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'bw_modes', 'total_bw_modes'], + 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.bwModes)) - (&pod), + (&(pod.totalBwModes)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkSupportedBwModes_v1_t), + }) + +nvlink_supported_bw_modes_v1_dtype = _get_nvlink_supported_bw_modes_v1_dtype_offsets() + +cdef class NvlinkSupportedBwModes_v1: + """Empty-initialize an instance of `nvmlNvlinkSupportedBwModes_v1_t`. + + + .. seealso:: `nvmlNvlinkSupportedBwModes_v1_t` + """ + cdef: + nvmlNvlinkSupportedBwModes_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkSupportedBwModes_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkSupportedBwModes_v1 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 NvlinkSupportedBwModes_v1 other_ + if not isinstance(other, NvlinkSupportedBwModes_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSupportedBwModes_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This NvlinkSupportedBwModes_v1 instance is read-only") + self._ptr[0].version = val + + @property + def bw_modes(self): + """~_numpy.uint8: (array of length 23).""" + if self._ptr[0].totalBwModes == 0: + return _numpy.array([]) + 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) + + @bw_modes.setter + def bw_modes(self, val): + if self._readonly: + raise ValueError("This NvlinkSupportedBwModes_v1 instance is read-only") + if len(val) > 23: + raise ValueError(f"Too many elements for field bw_modes, max is 23, got {len(val)}") + self._ptr[0].totalBwModes = len(val) + if len(val) == 0: + return + 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) + _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 _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSupportedBwModes_v1_t), NvlinkSupportedBwModes_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkSupportedBwModes_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_supported_bw_modes_v1_dtype` holding the data. + """ + 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): + """Create an NvlinkSupportedBwModes_v1 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 NvlinkSupportedBwModes_v1 obj = NvlinkSupportedBwModes_v1.__new__(NvlinkSupportedBwModes_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nvlink_get_bw_mode_v1_dtype_offsets(): + cdef nvmlNvlinkGetBwMode_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'b_is_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.bIsBest)) - (&pod), + (&(pod.bwMode)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetBwMode_v1_t), + }) + +nvlink_get_bw_mode_v1_dtype = _get_nvlink_get_bw_mode_v1_dtype_offsets() + +cdef class NvlinkGetBwMode_v1: + """Empty-initialize an instance of `nvmlNvlinkGetBwMode_v1_t`. + + + .. seealso:: `nvmlNvlinkGetBwMode_v1_t` + """ + cdef: + nvmlNvlinkGetBwMode_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkGetBwMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkGetBwMode_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkGetBwMode_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkGetBwMode_v1 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 NvlinkGetBwMode_v1 other_ + if not isinstance(other, NvlinkGetBwMode_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkGetBwMode_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkGetBwMode_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkGetBwMode_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This NvlinkGetBwMode_v1 instance is read-only") + self._ptr[0].version = val + + @property + def b_is_best(self): + """int: """ + return self._ptr[0].bIsBest + + @b_is_best.setter + def b_is_best(self, val): + if self._readonly: + raise ValueError("This NvlinkGetBwMode_v1 instance is read-only") + self._ptr[0].bIsBest = val + + @property + def bw_mode(self): + """int: """ + return self._ptr[0].bwMode + + @bw_mode.setter + def bw_mode(self, val): + if self._readonly: + raise ValueError("This NvlinkGetBwMode_v1 instance is read-only") + self._ptr[0].bwMode = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkGetBwMode_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkGetBwMode_v1_t), NvlinkGetBwMode_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkGetBwMode_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_get_bw_mode_v1_dtype` holding the data. + """ + 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): + """Create an NvlinkGetBwMode_v1 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 NvlinkGetBwMode_v1 obj = NvlinkGetBwMode_v1.__new__(NvlinkGetBwMode_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkGetBwMode_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkGetBwMode_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nvlink_set_bw_mode_v1_dtype_offsets(): + cdef nvmlNvlinkSetBwMode_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'b_set_best', 'bw_mode'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.bSetBest)) - (&pod), + (&(pod.bwMode)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetBwMode_v1_t), + }) + +nvlink_set_bw_mode_v1_dtype = _get_nvlink_set_bw_mode_v1_dtype_offsets() + +cdef class NvlinkSetBwMode_v1: + """Empty-initialize an instance of `nvmlNvlinkSetBwMode_v1_t`. + + + .. seealso:: `nvmlNvlinkSetBwMode_v1_t` + """ + cdef: + nvmlNvlinkSetBwMode_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkSetBwMode_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkSetBwMode_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkSetBwMode_v1 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 NvlinkSetBwMode_v1 other_ + if not isinstance(other, NvlinkSetBwMode_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetBwMode_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkSetBwMode_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSetBwMode_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This NvlinkSetBwMode_v1 instance is read-only") + self._ptr[0].version = val + + @property + def b_set_best(self): + """int: """ + return self._ptr[0].bSetBest + + @b_set_best.setter + def b_set_best(self, val): + if self._readonly: + raise ValueError("This NvlinkSetBwMode_v1 instance is read-only") + self._ptr[0].bSetBest = val + + @property + def bw_mode(self): + """int: """ + return self._ptr[0].bwMode + + @bw_mode.setter + def bw_mode(self, val): + if self._readonly: + raise ValueError("This NvlinkSetBwMode_v1 instance is read-only") + self._ptr[0].bwMode = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkSetBwMode_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSetBwMode_v1_t), NvlinkSetBwMode_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkSetBwMode_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_set_bw_mode_v1_dtype` holding the data. + """ + 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): + """Create an NvlinkSetBwMode_v1 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 NvlinkSetBwMode_v1 obj = NvlinkSetBwMode_v1.__new__(NvlinkSetBwMode_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkSetBwMode_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSetBwMode_v1_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_version_dtype_offsets(): + cdef nvmlVgpuVersion_t pod + return _numpy.dtype({ + 'names': ['min_version', 'max_version'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.minVersion)) - (&pod), + (&(pod.maxVersion)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuVersion_t), + }) + +vgpu_version_dtype = _get_vgpu_version_dtype_offsets() + +cdef class VgpuVersion: + """Empty-initialize an instance of `nvmlVgpuVersion_t`. + + + .. seealso:: `nvmlVgpuVersion_t` + """ + cdef: + nvmlVgpuVersion_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuVersion_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuVersion") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuVersion_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuVersion 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 VgpuVersion other_ + if not isinstance(other, VgpuVersion): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuVersion_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuVersion_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuVersion") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuVersion_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def min_version(self): + """int: """ + return self._ptr[0].minVersion + + @min_version.setter + def min_version(self, val): + if self._readonly: + raise ValueError("This VgpuVersion instance is read-only") + self._ptr[0].minVersion = val + + @property + def max_version(self): + """int: """ + return self._ptr[0].maxVersion + + @max_version.setter + def max_version(self, val): + if self._readonly: + raise ValueError("This VgpuVersion instance is read-only") + self._ptr[0].maxVersion = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuVersion instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuVersion_t), VgpuVersion) + + @staticmethod + def from_data(data): + """Create an VgpuVersion instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_version_dtype` holding the data. + """ + 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): + """Create an VgpuVersion 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 VgpuVersion obj = VgpuVersion.__new__(VgpuVersion) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuVersion_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuVersion") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuVersion_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_metadata_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.revision)) - (&pod), + (&(pod.guestInfoState)) - (&pod), + (&(pod.guestDriverVersion)) - (&pod), + (&(pod.hostDriverVersion)) - (&pod), + (&(pod.reserved)) - (&pod), + (&(pod.vgpuVirtualizationCaps)) - (&pod), + (&(pod.guestVgpuVersion)) - (&pod), + (&(pod.opaqueDataSize)) - (&pod), + (&(pod.opaqueData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuMetadata_t), + }) + +vgpu_metadata_dtype = _get_vgpu_metadata_dtype_offsets() + +cdef class VgpuMetadata: + """Empty-initialize an instance of `nvmlVgpuMetadata_t`. + + + .. seealso:: `nvmlVgpuMetadata_t` + """ + cdef: + nvmlVgpuMetadata_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuMetadata") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuMetadata_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuMetadata 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 VgpuMetadata other_ + if not isinstance(other, VgpuMetadata): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuMetadata_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuMetadata") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuMetadata_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].version = val + + @property + def revision(self): + """int: """ + return self._ptr[0].revision + + @revision.setter + def revision(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].revision = val + + @property + def guest_info_state(self): + """int: """ + return (self._ptr[0].guestInfoState) + + @guest_info_state.setter + def guest_info_state(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].guestInfoState = val + + @property + def guest_driver_version(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].guestDriverVersion) + + @guest_driver_version.setter + def guest_driver_version(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field guest_driver_version, max length is 79") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].guestDriverVersion), ptr, 80) + + @property + def host_driver_version(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + + @host_driver_version.setter + def host_driver_version(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field host_driver_version, max length is 79") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) + + @property + def vgpu_virtualization_caps(self): + """int: """ + return self._ptr[0].vgpuVirtualizationCaps + + @vgpu_virtualization_caps.setter + def vgpu_virtualization_caps(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].vgpuVirtualizationCaps = val + + @property + def guest_vgpu_version(self): + """int: """ + return self._ptr[0].guestVgpuVersion + + @guest_vgpu_version.setter + def guest_vgpu_version(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].guestVgpuVersion = val + + @property + def opaque_data_size(self): + """int: """ + return self._ptr[0].opaqueDataSize + + @opaque_data_size.setter + def opaque_data_size(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + self._ptr[0].opaqueDataSize = val + + @property + def opaque_data(self): + """~_numpy.int8: (array of length 4).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + + @opaque_data.setter + def opaque_data(self, val): + if self._readonly: + raise ValueError("This VgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 4: + raise ValueError("String too long for field opaque_data, max length is 3") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlVgpuMetadata_t), VgpuMetadata) + + @staticmethod + def from_data(data): + """Create an VgpuMetadata instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_metadata_dtype` holding the data. + """ + 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): + """Create an VgpuMetadata 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 VgpuMetadata obj = VgpuMetadata.__new__(VgpuMetadata) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuMetadata_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuMetadata") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuMetadata_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_pgpu_compatibility_dtype_offsets(): + cdef nvmlVgpuPgpuCompatibility_t pod + return _numpy.dtype({ + 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], + 'formats': [_numpy.int32, _numpy.int32], + 'offsets': [ + (&(pod.vgpuVmCompatibility)) - (&pod), + (&(pod.compatibilityLimitCode)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuCompatibility_t), + }) + +vgpu_pgpu_compatibility_dtype = _get_vgpu_pgpu_compatibility_dtype_offsets() + +cdef class VgpuPgpuCompatibility: + """Empty-initialize an instance of `nvmlVgpuPgpuCompatibility_t`. + + + .. seealso:: `nvmlVgpuPgpuCompatibility_t` + """ + cdef: + nvmlVgpuPgpuCompatibility_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuCompatibility_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuCompatibility") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuPgpuCompatibility_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuPgpuCompatibility 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 VgpuPgpuCompatibility other_ + if not isinstance(other, VgpuPgpuCompatibility): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuCompatibility_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuCompatibility") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuCompatibility_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def vgpu_vm_compatibility(self): + """int: """ + return (self._ptr[0].vgpuVmCompatibility) + + @vgpu_vm_compatibility.setter + def vgpu_vm_compatibility(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuCompatibility instance is read-only") + self._ptr[0].vgpuVmCompatibility = val + + @property + def compatibility_limit_code(self): + """int: """ + return (self._ptr[0].compatibilityLimitCode) + + @compatibility_limit_code.setter + def compatibility_limit_code(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuCompatibility instance is read-only") + self._ptr[0].compatibilityLimitCode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuPgpuCompatibility instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuCompatibility_t), VgpuPgpuCompatibility) + + @staticmethod + def from_data(data): + """Create an VgpuPgpuCompatibility instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_compatibility_dtype` holding the data. + """ + 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): + """Create an VgpuPgpuCompatibility 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 VgpuPgpuCompatibility obj = VgpuPgpuCompatibility.__new__(VgpuPgpuCompatibility) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuCompatibility") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuCompatibility_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_instance_placement_dtype_offsets(): + cdef nvmlGpuInstancePlacement_t pod + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (&pod), + (&(pod.size)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuInstancePlacement_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=gpu_instance_placement_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlGpuInstancePlacement_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlGpuInstancePlacement_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.GpuInstancePlacement_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.GpuInstancePlacement 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, GpuInstancePlacement)) 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 start(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.start[0]) + return self._data.start + + @start.setter + def start(self, val): + self._data.start = val + + @property + def size_(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.size_[0]) + return self._data.size_ + + @size_.setter + def size_(self, val): + self._data.size_ = 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 GpuInstancePlacement.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == gpu_instance_placement_dtype: + return GpuInstancePlacement.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuInstancePlacement instance with the memory from the given buffer.""" + return GpuInstancePlacement.from_data(_numpy.frombuffer(buffer, dtype=gpu_instance_placement_dtype)) + + @staticmethod + def from_data(data): + """Create an GpuInstancePlacement instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `gpu_instance_placement_dtype` holding the data. + """ + cdef GpuInstancePlacement obj = GpuInstancePlacement.__new__(GpuInstancePlacement) + 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 != gpu_instance_placement_dtype: + raise ValueError("data array must be of dtype gpu_instance_placement_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an GpuInstancePlacement 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef GpuInstancePlacement obj = GpuInstancePlacement.__new__(GpuInstancePlacement) + 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) + obj._owner = owner + + return obj + + +cdef _get_gpu_instance_profile_info_v3_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.sliceCount)) - (&pod), + (&(pod.instanceCount)) - (&pod), + (&(pod.multiprocessorCount)) - (&pod), + (&(pod.copyEngineCount)) - (&pod), + (&(pod.decoderCount)) - (&pod), + (&(pod.encoderCount)) - (&pod), + (&(pod.jpegCount)) - (&pod), + (&(pod.ofaCount)) - (&pod), + (&(pod.memorySizeMB)) - (&pod), + (&(pod.name)) - (&pod), + (&(pod.capabilities)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceProfileInfo_v3_t), + }) + +gpu_instance_profile_info_v3_dtype = _get_gpu_instance_profile_info_v3_dtype_offsets() + +cdef class GpuInstanceProfileInfo_v3: + """Empty-initialize an instance of `nvmlGpuInstanceProfileInfo_v3_t`. + + + .. seealso:: `nvmlGpuInstanceProfileInfo_v3_t` + """ + cdef: + nvmlGpuInstanceProfileInfo_v3_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuInstanceProfileInfo_v3_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuInstanceProfileInfo_v3 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 GpuInstanceProfileInfo_v3 other_ + if not isinstance(other, GpuInstanceProfileInfo_v3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceProfileInfo_v3_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].version = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].id = val + + @property + def slice_count(self): + """int: """ + return self._ptr[0].sliceCount + + @slice_count.setter + def slice_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sliceCount = val + + @property + def instance_count(self): + """int: """ + return self._ptr[0].instanceCount + + @instance_count.setter + def instance_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].instanceCount = val + + @property + def multiprocessor_count(self): + """int: """ + return self._ptr[0].multiprocessorCount + + @multiprocessor_count.setter + def multiprocessor_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].multiprocessorCount = val + + @property + def copy_engine_count(self): + """int: """ + return self._ptr[0].copyEngineCount + + @copy_engine_count.setter + def copy_engine_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].copyEngineCount = val + + @property + def decoder_count(self): + """int: """ + return self._ptr[0].decoderCount + + @decoder_count.setter + def decoder_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].decoderCount = val + + @property + def encoder_count(self): + """int: """ + return self._ptr[0].encoderCount + + @encoder_count.setter + def encoder_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].encoderCount = val + + @property + def jpeg_count(self): + """int: """ + return self._ptr[0].jpegCount + + @jpeg_count.setter + def jpeg_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].jpegCount = val + + @property + def ofa_count(self): + """int: """ + return self._ptr[0].ofaCount + + @ofa_count.setter + def ofa_count(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].ofaCount = val + + @property + def memory_size_mb(self): + """int: """ + return self._ptr[0].memorySizeMB + + @memory_size_mb.setter + def memory_size_mb(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].memorySizeMB = val + + @property + def name(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) + + @name.setter + def name(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field name, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].name), ptr, 96) + + @property + def capabilities(self): + """int: """ + return self._ptr[0].capabilities + + @capabilities.setter + def capabilities(self, val): + if self._readonly: + raise ValueError("This GpuInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].capabilities = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuInstanceProfileInfo_v3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceProfileInfo_v3_t), GpuInstanceProfileInfo_v3) + + @staticmethod + def from_data(data): + """Create an GpuInstanceProfileInfo_v3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_instance_profile_info_v3_dtype` holding the data. + """ + 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): + """Create an GpuInstanceProfileInfo_v3 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 GpuInstanceProfileInfo_v3 obj = GpuInstanceProfileInfo_v3.__new__(GpuInstanceProfileInfo_v3) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_compute_instance_placement_dtype_offsets(): + cdef nvmlComputeInstancePlacement_t pod + return _numpy.dtype({ + 'names': ['start', 'size_'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.start)) - (&pod), + (&(pod.size)) - (&pod), + ], + 'itemsize': sizeof(nvmlComputeInstancePlacement_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=compute_instance_placement_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlComputeInstancePlacement_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlComputeInstancePlacement_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.ComputeInstancePlacement_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ComputeInstancePlacement 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, ComputeInstancePlacement)) 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 start(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.start[0]) + return self._data.start + + @start.setter + def start(self, val): + self._data.start = val + + @property + def size_(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.size_[0]) + return self._data.size_ + + @size_.setter + def size_(self, val): + self._data.size_ = 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 ComputeInstancePlacement.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == compute_instance_placement_dtype: + return ComputeInstancePlacement.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an ComputeInstancePlacement instance with the memory from the given buffer.""" + return ComputeInstancePlacement.from_data(_numpy.frombuffer(buffer, dtype=compute_instance_placement_dtype)) + + @staticmethod + def from_data(data): + """Create an ComputeInstancePlacement instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `compute_instance_placement_dtype` holding the data. + """ + cdef ComputeInstancePlacement obj = ComputeInstancePlacement.__new__(ComputeInstancePlacement) + 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 != compute_instance_placement_dtype: + raise ValueError("data array must be of dtype compute_instance_placement_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ComputeInstancePlacement 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ComputeInstancePlacement obj = ComputeInstancePlacement.__new__(ComputeInstancePlacement) + 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) + obj._owner = owner + + return obj + + +cdef _get_compute_instance_profile_info_v2_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.sliceCount)) - (&pod), + (&(pod.instanceCount)) - (&pod), + (&(pod.multiprocessorCount)) - (&pod), + (&(pod.sharedCopyEngineCount)) - (&pod), + (&(pod.sharedDecoderCount)) - (&pod), + (&(pod.sharedEncoderCount)) - (&pod), + (&(pod.sharedJpegCount)) - (&pod), + (&(pod.sharedOfaCount)) - (&pod), + (&(pod.name)) - (&pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v2_t), + }) + +compute_instance_profile_info_v2_dtype = _get_compute_instance_profile_info_v2_dtype_offsets() + +cdef class ComputeInstanceProfileInfo_v2: + """Empty-initialize an instance of `nvmlComputeInstanceProfileInfo_v2_t`. + + + .. seealso:: `nvmlComputeInstanceProfileInfo_v2_t` + """ + cdef: + nvmlComputeInstanceProfileInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlComputeInstanceProfileInfo_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__}.ComputeInstanceProfileInfo_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 ComputeInstanceProfileInfo_v2 other_ + if not isinstance(other, ComputeInstanceProfileInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].version = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].id = val + + @property + def slice_count(self): + """int: """ + return self._ptr[0].sliceCount + + @slice_count.setter + def slice_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sliceCount = val + + @property + def instance_count(self): + """int: """ + return self._ptr[0].instanceCount + + @instance_count.setter + def instance_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].instanceCount = val + + @property + def multiprocessor_count(self): + """int: """ + return self._ptr[0].multiprocessorCount + + @multiprocessor_count.setter + def multiprocessor_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].multiprocessorCount = val + + @property + def shared_copy_engine_count(self): + """int: """ + return self._ptr[0].sharedCopyEngineCount + + @shared_copy_engine_count.setter + def shared_copy_engine_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sharedCopyEngineCount = val + + @property + def shared_decoder_count(self): + """int: """ + return self._ptr[0].sharedDecoderCount + + @shared_decoder_count.setter + def shared_decoder_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sharedDecoderCount = val + + @property + def shared_encoder_count(self): + """int: """ + return self._ptr[0].sharedEncoderCount + + @shared_encoder_count.setter + def shared_encoder_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sharedEncoderCount = val + + @property + def shared_jpeg_count(self): + """int: """ + return self._ptr[0].sharedJpegCount + + @shared_jpeg_count.setter + def shared_jpeg_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sharedJpegCount = val + + @property + def shared_ofa_count(self): + """int: """ + return self._ptr[0].sharedOfaCount + + @shared_ofa_count.setter + def shared_ofa_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + self._ptr[0].sharedOfaCount = val + + @property + def name(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) + + @name.setter + def name(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v2 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field name, max length is 95") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v2_t), ComputeInstanceProfileInfo_v2) + + @staticmethod + def from_data(data): + """Create an ComputeInstanceProfileInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `compute_instance_profile_info_v2_dtype` holding the data. + """ + 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): + """Create an ComputeInstanceProfileInfo_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 ComputeInstanceProfileInfo_v2 obj = ComputeInstanceProfileInfo_v2.__new__(ComputeInstanceProfileInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_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_compute_instance_profile_info_v3_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.sliceCount)) - (&pod), + (&(pod.instanceCount)) - (&pod), + (&(pod.multiprocessorCount)) - (&pod), + (&(pod.sharedCopyEngineCount)) - (&pod), + (&(pod.sharedDecoderCount)) - (&pod), + (&(pod.sharedEncoderCount)) - (&pod), + (&(pod.sharedJpegCount)) - (&pod), + (&(pod.sharedOfaCount)) - (&pod), + (&(pod.name)) - (&pod), + (&(pod.capabilities)) - (&pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceProfileInfo_v3_t), + }) + +compute_instance_profile_info_v3_dtype = _get_compute_instance_profile_info_v3_dtype_offsets() + +cdef class ComputeInstanceProfileInfo_v3: + """Empty-initialize an instance of `nvmlComputeInstanceProfileInfo_v3_t`. + + + .. seealso:: `nvmlComputeInstanceProfileInfo_v3_t` + """ + cdef: + nvmlComputeInstanceProfileInfo_v3_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlComputeInstanceProfileInfo_v3_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ComputeInstanceProfileInfo_v3 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 ComputeInstanceProfileInfo_v3 other_ + if not isinstance(other, ComputeInstanceProfileInfo_v3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v3_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].version = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].id = val + + @property + def slice_count(self): + """int: """ + return self._ptr[0].sliceCount + + @slice_count.setter + def slice_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sliceCount = val + + @property + def instance_count(self): + """int: """ + return self._ptr[0].instanceCount + + @instance_count.setter + def instance_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].instanceCount = val + + @property + def multiprocessor_count(self): + """int: """ + return self._ptr[0].multiprocessorCount + + @multiprocessor_count.setter + def multiprocessor_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].multiprocessorCount = val + + @property + def shared_copy_engine_count(self): + """int: """ + return self._ptr[0].sharedCopyEngineCount + + @shared_copy_engine_count.setter + def shared_copy_engine_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sharedCopyEngineCount = val + + @property + def shared_decoder_count(self): + """int: """ + return self._ptr[0].sharedDecoderCount + + @shared_decoder_count.setter + def shared_decoder_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sharedDecoderCount = val + + @property + def shared_encoder_count(self): + """int: """ + return self._ptr[0].sharedEncoderCount + + @shared_encoder_count.setter + def shared_encoder_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sharedEncoderCount = val + + @property + def shared_jpeg_count(self): + """int: """ + return self._ptr[0].sharedJpegCount + + @shared_jpeg_count.setter + def shared_jpeg_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sharedJpegCount = val + + @property + def shared_ofa_count(self): + """int: """ + return self._ptr[0].sharedOfaCount + + @shared_ofa_count.setter + def shared_ofa_count(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].sharedOfaCount = val + + @property + def name(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) + + @name.setter + def name(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field name, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].name), ptr, 96) + + @property + def capabilities(self): + """int: """ + return self._ptr[0].capabilities + + @capabilities.setter + def capabilities(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceProfileInfo_v3 instance is read-only") + self._ptr[0].capabilities = val + + @staticmethod + def from_buffer(buffer): + """Create an ComputeInstanceProfileInfo_v3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v3_t), ComputeInstanceProfileInfo_v3) + + @staticmethod + def from_data(data): + """Create an ComputeInstanceProfileInfo_v3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `compute_instance_profile_info_v3_dtype` holding the data. + """ + 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): + """Create an ComputeInstanceProfileInfo_v3 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 ComputeInstanceProfileInfo_v3 obj = ComputeInstanceProfileInfo_v3.__new__(ComputeInstanceProfileInfo_v3) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_device_addressing_mode_v1_dtype_offsets(): + cdef nvmlDeviceAddressingMode_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.value)) - (&pod), + ], + 'itemsize': sizeof(nvmlDeviceAddressingMode_v1_t), + }) + +device_addressing_mode_v1_dtype = _get_device_addressing_mode_v1_dtype_offsets() + +cdef class DeviceAddressingMode_v1: + """Empty-initialize an instance of `nvmlDeviceAddressingMode_v1_t`. + + + .. seealso:: `nvmlDeviceAddressingMode_v1_t` + """ + cdef: + nvmlDeviceAddressingMode_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlDeviceAddressingMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DeviceAddressingMode_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlDeviceAddressingMode_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.DeviceAddressingMode_v1 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 DeviceAddressingMode_v1 other_ + if not isinstance(other, DeviceAddressingMode_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAddressingMode_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DeviceAddressingMode_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAddressingMode_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: API version.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This DeviceAddressingMode_v1 instance is read-only") + self._ptr[0].version = val + + @property + def value(self): + """int: One of `nvmlDeviceAddressingModeType_t`.""" + return self._ptr[0].value + + @value.setter + def value(self, val): + if self._readonly: + raise ValueError("This DeviceAddressingMode_v1 instance is read-only") + self._ptr[0].value = val + + @staticmethod + def from_buffer(buffer): + """Create an DeviceAddressingMode_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlDeviceAddressingMode_v1_t), DeviceAddressingMode_v1) + + @staticmethod + def from_data(data): + """Create an DeviceAddressingMode_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `device_addressing_mode_v1_dtype` holding the data. + """ + 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): + """Create an DeviceAddressingMode_v1 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 DeviceAddressingMode_v1 obj = DeviceAddressingMode_v1.__new__(DeviceAddressingMode_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating DeviceAddressingMode_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAddressingMode_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_repair_status_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.bChannelRepairPending)) - (&pod), + (&(pod.bTpcRepairPending)) - (&pod), + ], + 'itemsize': sizeof(nvmlRepairStatus_v1_t), + }) + +repair_status_v1_dtype = _get_repair_status_v1_dtype_offsets() + +cdef class RepairStatus_v1: + """Empty-initialize an instance of `nvmlRepairStatus_v1_t`. + + + .. seealso:: `nvmlRepairStatus_v1_t` + """ + cdef: + nvmlRepairStatus_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlRepairStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RepairStatus_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlRepairStatus_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.RepairStatus_v1 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 RepairStatus_v1 other_ + if not isinstance(other, RepairStatus_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRepairStatus_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlRepairStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RepairStatus_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRepairStatus_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: API version number.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This RepairStatus_v1 instance is read-only") + self._ptr[0].version = val + + @property + def b_channel_repair_pending(self): + """int: Reference to `unsigned` int.""" + return self._ptr[0].bChannelRepairPending + + @b_channel_repair_pending.setter + def b_channel_repair_pending(self, val): + if self._readonly: + raise ValueError("This RepairStatus_v1 instance is read-only") + self._ptr[0].bChannelRepairPending = val + + @property + def b_tpc_repair_pending(self): + """int: Reference to `unsigned` int.""" + return self._ptr[0].bTpcRepairPending + + @b_tpc_repair_pending.setter + def b_tpc_repair_pending(self, val): + if self._readonly: + raise ValueError("This RepairStatus_v1 instance is read-only") + self._ptr[0].bTpcRepairPending = val + + @staticmethod + def from_buffer(buffer): + """Create an RepairStatus_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlRepairStatus_v1_t), RepairStatus_v1) + + @staticmethod + def from_data(data): + """Create an RepairStatus_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `repair_status_v1_dtype` holding the data. + """ + 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): + """Create an RepairStatus_v1 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 RepairStatus_v1 obj = RepairStatus_v1.__new__(RepairStatus_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlRepairStatus_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating RepairStatus_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRepairStatus_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_device_power_mizer_modes_v1_dtype_offsets(): + cdef nvmlDevicePowerMizerModes_v1_t pod + return _numpy.dtype({ + 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.currentMode)) - (&pod), + (&(pod.mode)) - (&pod), + (&(pod.supportedPowerMizerModes)) - (&pod), + ], + 'itemsize': sizeof(nvmlDevicePowerMizerModes_v1_t), + }) + +device_power_mizer_modes_v1_dtype = _get_device_power_mizer_modes_v1_dtype_offsets() + +cdef class DevicePowerMizerModes_v1: + """Empty-initialize an instance of `nvmlDevicePowerMizerModes_v1_t`. + + + .. seealso:: `nvmlDevicePowerMizerModes_v1_t` + """ + cdef: + nvmlDevicePowerMizerModes_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlDevicePowerMizerModes_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DevicePowerMizerModes_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlDevicePowerMizerModes_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.DevicePowerMizerModes_v1 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 DevicePowerMizerModes_v1 other_ + if not isinstance(other, DevicePowerMizerModes_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDevicePowerMizerModes_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating DevicePowerMizerModes_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDevicePowerMizerModes_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def current_mode(self): + """int: OUT: the current powermizer mode.""" + return self._ptr[0].currentMode + + @current_mode.setter + def current_mode(self, val): + if self._readonly: + raise ValueError("This DevicePowerMizerModes_v1 instance is read-only") + self._ptr[0].currentMode = val + + @property + def mode(self): + """int: IN: the powermizer mode to set.""" + return self._ptr[0].mode + + @mode.setter + def mode(self, val): + if self._readonly: + raise ValueError("This DevicePowerMizerModes_v1 instance is read-only") + self._ptr[0].mode = val + + @property + def supported_power_mizer_modes(self): + """int: OUT: Bitmask of supported powermizer modes. The bitmask of supported power mizer modes on this device. The supported modes can be combined using the bitwise OR operator '|'. For example, if a device supports all PowerMizer modes, the bitmask would be: supportedPowerMizerModes = ((1 << NVML_POWER_MIZER_MODE_ADAPTIVE) | (1 << NVML_POWER_MIZER_MODE_PREFER_MAXIMUM_PERFORMANCE) | (1 << NVML_POWER_MIZER_MODE_AUTO) | (1 << NVML_POWER_MIZER_MODE_PREFER_CONSISTENT_PERFORMANCE)); This bitmask can be used to check which power mizer modes are available on the device by performing a bitwise AND operation with the specific mode you want to check.""" + return self._ptr[0].supportedPowerMizerModes + + @supported_power_mizer_modes.setter + def supported_power_mizer_modes(self, val): + if self._readonly: + raise ValueError("This DevicePowerMizerModes_v1 instance is read-only") + self._ptr[0].supportedPowerMizerModes = val + + @staticmethod + def from_buffer(buffer): + """Create an DevicePowerMizerModes_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlDevicePowerMizerModes_v1_t), DevicePowerMizerModes_v1) + + @staticmethod + def from_data(data): + """Create an DevicePowerMizerModes_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `device_power_mizer_modes_v1_dtype` holding the data. + """ + 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): + """Create an DevicePowerMizerModes_v1 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 DevicePowerMizerModes_v1 obj = DevicePowerMizerModes_v1.__new__(DevicePowerMizerModes_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating DevicePowerMizerModes_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDevicePowerMizerModes_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.unit)) - (&pod), + (&(pod.location)) - (&pod), + (&(pod.sublocation)) - (&pod), + (&(pod.extlocation)) - (&pod), + (&(pod.address)) - (&pod), + (&(pod.isParity)) - (&pod), + (&(pod.count)) - (&pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), + }) + +ecc_sram_unique_uncorrected_error_entry_v1_dtype = _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets() + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.EccSramUniqueUncorrectedErrorEntry_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.EccSramUniqueUncorrectedErrorEntry_v1 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, EccSramUniqueUncorrectedErrorEntry_v1)) 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 unit(self): + """Union[~_numpy.uint32, int]: the SRAM unit index""" + if self._data.size == 1: + return int(self._data.unit[0]) + return self._data.unit + + @unit.setter + def unit(self, val): + self._data.unit = val + + @property + def location(self): + """Union[~_numpy.uint32, int]: the error location within the SRAM unit""" + if self._data.size == 1: + return int(self._data.location[0]) + return self._data.location + + @location.setter + def location(self, val): + self._data.location = val + + @property + def sublocation(self): + """Union[~_numpy.uint32, int]: the error sublocation within the SRAM unit""" + if self._data.size == 1: + return int(self._data.sublocation[0]) + return self._data.sublocation + + @sublocation.setter + def sublocation(self, val): + self._data.sublocation = val + + @property + def extlocation(self): + """Union[~_numpy.uint32, int]: the error extlocation within the SRAM unit""" + if self._data.size == 1: + return int(self._data.extlocation[0]) + return self._data.extlocation + + @extlocation.setter + def extlocation(self, val): + self._data.extlocation = val + + @property + def address(self): + """Union[~_numpy.uint32, int]: the error address within the SRAM unit""" + if self._data.size == 1: + return int(self._data.address[0]) + return self._data.address + + @address.setter + def address(self, val): + self._data.address = val + + @property + def is_parity(self): + """Union[~_numpy.uint32, int]: if the SRAM error is parity or not""" + if self._data.size == 1: + return int(self._data.is_parity[0]) + return self._data.is_parity + + @is_parity.setter + def is_parity(self, val): + self._data.is_parity = val + + @property + def count(self): + """Union[~_numpy.uint32, int]: the error count at the same SRAM address""" + if self._data.size == 1: + return int(self._data.count[0]) + return self._data.count + + @count.setter + def count(self, val): + self._data.count = 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 EccSramUniqueUncorrectedErrorEntry_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == ecc_sram_unique_uncorrected_error_entry_v1_dtype: + return EccSramUniqueUncorrectedErrorEntry_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an EccSramUniqueUncorrectedErrorEntry_v1 instance with the memory from the given buffer.""" + return EccSramUniqueUncorrectedErrorEntry_v1.from_data(_numpy.frombuffer(buffer, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an EccSramUniqueUncorrectedErrorEntry_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `ecc_sram_unique_uncorrected_error_entry_v1_dtype` holding the data. + """ + cdef EccSramUniqueUncorrectedErrorEntry_v1 obj = EccSramUniqueUncorrectedErrorEntry_v1.__new__(EccSramUniqueUncorrectedErrorEntry_v1) + 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 != ecc_sram_unique_uncorrected_error_entry_v1_dtype: + raise ValueError("data array must be of dtype ecc_sram_unique_uncorrected_error_entry_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an EccSramUniqueUncorrectedErrorEntry_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef EccSramUniqueUncorrectedErrorEntry_v1 obj = EccSramUniqueUncorrectedErrorEntry_v1.__new__(EccSramUniqueUncorrectedErrorEntry_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_gpu_fabric_info_v3_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.clusterUuid)) - (&pod), + (&(pod.status)) - (&pod), + (&(pod.cliqueId)) - (&pod), + (&(pod.state)) - (&pod), + (&(pod.healthMask)) - (&pod), + (&(pod.healthSummary)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v3_t), + }) + +gpu_fabric_info_v3_dtype = _get_gpu_fabric_info_v3_dtype_offsets() + +cdef class GpuFabricInfo_v3: + """Empty-initialize an instance of `nvmlGpuFabricInfo_v3_t`. + + + .. seealso:: `nvmlGpuFabricInfo_v3_t` + """ + cdef: + nvmlGpuFabricInfo_v3_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v3") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuFabricInfo_v3_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuFabricInfo_v3 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 GpuFabricInfo_v3 other_ + if not isinstance(other, GpuFabricInfo_v3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v3_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v3_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v3") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v3_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: Structure version identifier (set to nvmlGpuFabricInfo_v2).""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].version = val + + @property + def cluster_uuid(self): + """~_numpy.uint8: (array of length 16).Uuid of the cluster to which this GPU belongs.""" + 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) + + @cluster_uuid.setter + def cluster_uuid(self, val): + if self._readonly: + 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 _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _cyb_memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) + + @property + def status(self): + """int: Probe Error status, if any. Must be checked only if Probe state returns "complete".""" + return (self._ptr[0].status) + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].status = val + + @property + def clique_id(self): + """int: ID of the fabric clique to which this GPU belongs.""" + return self._ptr[0].cliqueId + + @clique_id.setter + def clique_id(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].cliqueId = val + + @property + def state(self): + """int: Current Probe State of GPU registration process. See NVML_GPU_FABRIC_STATE_*.""" + return (self._ptr[0].state) + + @state.setter + def state(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].state = val + + @property + def health_mask(self): + """int: GPU Fabric health Status Mask. See NVML_GPU_FABRIC_HEALTH_MASK_*.""" + return self._ptr[0].healthMask + + @health_mask.setter + def health_mask(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].healthMask = val + + @property + def health_summary(self): + """int: GPU Fabric health summary. See NVML_GPU_FABRIC_HEALTH_SUMMARY_*.""" + return self._ptr[0].healthSummary + + @health_summary.setter + def health_summary(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v3 instance is read-only") + self._ptr[0].healthSummary = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuFabricInfo_v3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v3_t), GpuFabricInfo_v3) + + @staticmethod + def from_data(data): + """Create an GpuFabricInfo_v3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_info_v3_dtype` holding the data. + """ + 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): + """Create an GpuFabricInfo_v3 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 GpuFabricInfo_v3 obj = GpuFabricInfo_v3.__new__(GpuFabricInfo_v3) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v3_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v3") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v3_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nv_link_info_v1_dtype_offsets(): + cdef nvmlNvLinkInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled'], + 'formats': [_numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.isNvleEnabled)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v1_t), + }) + +nv_link_info_v1_dtype = _get_nv_link_info_v1_dtype_offsets() + +cdef class NvLinkInfo_v1: + """Empty-initialize an instance of `nvmlNvLinkInfo_v1_t`. + + + .. seealso:: `nvmlNvLinkInfo_v1_t` + """ + cdef: + nvmlNvLinkInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvLinkInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvLinkInfo_v1 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 NvLinkInfo_v1 other_ + if not isinstance(other, NvLinkInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlNvLinkInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: IN - the API version number.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def is_nvle_enabled(self): + """int: OUT - NVLINK encryption enablement.""" + return self._ptr[0].isNvleEnabled + + @is_nvle_enabled.setter + def is_nvle_enabled(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v1 instance is read-only") + self._ptr[0].isNvleEnabled = val + + @staticmethod + def from_buffer(buffer): + """Create an NvLinkInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v1_t), NvLinkInfo_v1) + + @staticmethod + def from_data(data): + """Create an NvLinkInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v1_dtype` holding the data. + """ + 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): + """Create an NvLinkInfo_v1 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 NvLinkInfo_v1 obj = NvLinkInfo_v1.__new__(NvLinkInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nvlink_firmware_version_dtype_offsets(): + cdef nvmlNvlinkFirmwareVersion_t pod + return _numpy.dtype({ + 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], + 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.ucodeType)) - (&pod), + (&(pod.major)) - (&pod), + (&(pod.minor)) - (&pod), + (&(pod.subMinor)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareVersion_t), + }) + +nvlink_firmware_version_dtype = _get_nvlink_firmware_version_dtype_offsets() + +cdef class NvlinkFirmwareVersion: + """Empty-initialize an array of `nvmlNvlinkFirmwareVersion_t`. + The resulting object is of length `size` and of dtype `nvlink_firmware_version_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlNvlinkFirmwareVersion_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=nvlink_firmware_version_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlNvlinkFirmwareVersion_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlNvlinkFirmwareVersion_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.NvlinkFirmwareVersion_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.NvlinkFirmwareVersion 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, NvlinkFirmwareVersion)) 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 ucode_type(self): + """Union[~_numpy.uint8, int]: """ + if self._data.size == 1: + return int(self._data.ucode_type[0]) + return self._data.ucode_type + + @ucode_type.setter + def ucode_type(self, val): + self._data.ucode_type = val + + @property + def major(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.major[0]) + return self._data.major + + @major.setter + def major(self, val): + self._data.major = val + + @property + def minor(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.minor[0]) + return self._data.minor + + @minor.setter + def minor(self, val): + self._data.minor = val + + @property + def sub_minor(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.sub_minor[0]) + return self._data.sub_minor + + @sub_minor.setter + def sub_minor(self, val): + self._data.sub_minor = 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 NvlinkFirmwareVersion.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == nvlink_firmware_version_dtype: + return NvlinkFirmwareVersion.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkFirmwareVersion instance with the memory from the given buffer.""" + return NvlinkFirmwareVersion.from_data(_numpy.frombuffer(buffer, dtype=nvlink_firmware_version_dtype)) + + @staticmethod + def from_data(data): + """Create an NvlinkFirmwareVersion instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `nvlink_firmware_version_dtype` holding the data. + """ + cdef NvlinkFirmwareVersion obj = NvlinkFirmwareVersion.__new__(NvlinkFirmwareVersion) + 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 != nvlink_firmware_version_dtype: + raise ValueError("data array must be of dtype nvlink_firmware_version_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an NvlinkFirmwareVersion 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef NvlinkFirmwareVersion obj = NvlinkFirmwareVersion.__new__(NvlinkFirmwareVersion) + 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(nvmlNvlinkFirmwareVersion_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=nvlink_firmware_version_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_prm_counter_input_v1_dtype_offsets(): + cdef nvmlPRMCounterInput_v1_t pod + return _numpy.dtype({ + 'names': ['local_port'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.localPort)) - (&pod), + ], + 'itemsize': sizeof(nvmlPRMCounterInput_v1_t), + }) + +prm_counter_input_v1_dtype = _get_prm_counter_input_v1_dtype_offsets() + +cdef class PRMCounterInput_v1: + """Empty-initialize an instance of `nvmlPRMCounterInput_v1_t`. + + + .. seealso:: `nvmlPRMCounterInput_v1_t` + """ + cdef: + nvmlPRMCounterInput_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterInput_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterInput_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPRMCounterInput_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PRMCounterInput_v1 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 PRMCounterInput_v1 other_ + if not isinstance(other, PRMCounterInput_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterInput_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPRMCounterInput_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterInput_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterInput_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def local_port(self): + """int: Local port number.""" + return self._ptr[0].localPort + + @local_port.setter + def local_port(self, val): + if self._readonly: + raise ValueError("This PRMCounterInput_v1 instance is read-only") + self._ptr[0].localPort = val + + @staticmethod + def from_buffer(buffer): + """Create an PRMCounterInput_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterInput_v1_t), PRMCounterInput_v1) + + @staticmethod + def from_data(data): + """Create an PRMCounterInput_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `prm_counter_input_v1_dtype` holding the data. + """ + 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): + """Create an PRMCounterInput_v1 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 PRMCounterInput_v1 obj = PRMCounterInput_v1.__new__(PRMCounterInput_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterInput_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PRMCounterInput_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterInput_v1_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_state_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerStateInfo_v2_t pod + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), + }) + +vgpu_scheduler_state_info_v2_dtype = _get_vgpu_scheduler_state_info_v2_dtype_offsets() + +cdef class VgpuSchedulerStateInfo_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerStateInfo_v2_t` + """ + cdef: + nvmlVgpuSchedulerStateInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerStateInfo_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__}.VgpuSchedulerStateInfo_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 VgpuSchedulerStateInfo_v2 other_ + if not isinstance(other, VgpuSchedulerStateInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if self._ptr == NULL: + 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 + else: + setattr(self, key, val) + + @property + 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 + object _owner + + 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, object owner=None): + """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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + 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) + obj._owner = owner + + 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_bbx_time_data_v1_dtype_offsets(): + cdef nvmlBBXTimeData_v1_t pod + return _numpy.dtype({ + 'names': ['time_run'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.timeRun)) - (&pod), + ], + 'itemsize': sizeof(nvmlBBXTimeData_v1_t), + }) + +bbx_time_data_v1_dtype = _get_bbx_time_data_v1_dtype_offsets() + +cdef class BBXTimeData_v1: + """Empty-initialize an instance of `nvmlBBXTimeData_v1_t`. + + + .. seealso:: `nvmlBBXTimeData_v1_t` + """ + cdef: + nvmlBBXTimeData_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlBBXTimeData_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BBXTimeData_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlBBXTimeData_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.BBXTimeData_v1 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 BBXTimeData_v1 other_ + if not isinstance(other, BBXTimeData_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBBXTimeData_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBBXTimeData_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 = _cyb_malloc(sizeof(nvmlBBXTimeData_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BBXTimeData_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBBXTimeData_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def time_run(self): + """int: [out] Cumulative number of seconds the GPU has had the driver loaded""" + return self._ptr[0].timeRun + + @time_run.setter + def time_run(self, val): + if self._readonly: + raise ValueError("This BBXTimeData_v1 instance is read-only") + self._ptr[0].timeRun = val + + @staticmethod + def from_buffer(buffer): + """Create an BBXTimeData_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlBBXTimeData_v1_t), BBXTimeData_v1) + + @staticmethod + def from_data(data): + """Create an BBXTimeData_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `bbx_time_data_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "bbx_time_data_v1_dtype", bbx_time_data_v1_dtype, BBXTimeData_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an BBXTimeData_v1 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 BBXTimeData_v1 obj = BBXTimeData_v1.__new__(BBXTimeData_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlBBXTimeData_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating BBXTimeData_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBBXTimeData_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_remapped_rows_info_v2_dtype_offsets(): + cdef nvmlRemappedRowsInfo_v2_t pod + return _numpy.dtype({ + 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.corrActiveRemaps)) - (&pod), + (&(pod.corrInactiveRemaps)) - (&pod), + (&(pod.uncActiveRemaps)) - (&pod), + (&(pod.uncInactiveRemaps)) - (&pod), + (&(pod.bPending)) - (&pod), + (&(pod.bFailureOccurred)) - (&pod), + ], + 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), + }) + +remapped_rows_info_v2_dtype = _get_remapped_rows_info_v2_dtype_offsets() + +cdef class RemappedRowsInfo_v2: + """Empty-initialize an instance of `nvmlRemappedRowsInfo_v2_t`. + + + .. seealso:: `nvmlRemappedRowsInfo_v2_t` + """ + cdef: + nvmlRemappedRowsInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlRemappedRowsInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RemappedRowsInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlRemappedRowsInfo_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__}.RemappedRowsInfo_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 RemappedRowsInfo_v2 other_ + if not isinstance(other, RemappedRowsInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRemappedRowsInfo_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlRemappedRowsInfo_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(nvmlRemappedRowsInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating RemappedRowsInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRemappedRowsInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def corr_active_remaps(self): + """int: Number of active row remappings due to correctable errors.""" + return self._ptr[0].corrActiveRemaps + + @corr_active_remaps.setter + def corr_active_remaps(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].corrActiveRemaps = val + + @property + def corr_inactive_remaps(self): + """int: Number of inactive row remappings due to correctable errors.""" + return self._ptr[0].corrInactiveRemaps + + @corr_inactive_remaps.setter + def corr_inactive_remaps(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].corrInactiveRemaps = val + + @property + def unc_active_remaps(self): + """int: Number of active row remappings due to uncorrectable errors.""" + return self._ptr[0].uncActiveRemaps + + @unc_active_remaps.setter + def unc_active_remaps(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].uncActiveRemaps = val + + @property + def unc_inactive_remaps(self): + """int: Number of inactive row remappings due to uncorrectable errors.""" + return self._ptr[0].uncInactiveRemaps + + @unc_inactive_remaps.setter + def unc_inactive_remaps(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].uncInactiveRemaps = val + + @property + def b_pending(self): + """int: Whether or not there is any pending row remapping; 0 indicates not pending, 1 indicates pending.""" + return self._ptr[0].bPending + + @b_pending.setter + def b_pending(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].bPending = val + + @property + def b_failure_occurred(self): + """int: Whether or not there's any row remapping failure in the past; 0 indicates no failure, 1 indicates failure occurred.""" + return self._ptr[0].bFailureOccurred + + @b_failure_occurred.setter + def b_failure_occurred(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].bFailureOccurred = val + + @staticmethod + def from_buffer(buffer): + """Create an RemappedRowsInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlRemappedRowsInfo_v2_t), RemappedRowsInfo_v2) + + @staticmethod + def from_data(data): + """Create an RemappedRowsInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `remapped_rows_info_v2_dtype` holding the data. + """ + return _cyb_from_data(data, "remapped_rows_info_v2_dtype", remapped_rows_info_v2_dtype, RemappedRowsInfo_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an RemappedRowsInfo_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 RemappedRowsInfo_v2 obj = RemappedRowsInfo_v2.__new__(RemappedRowsInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlRemappedRowsInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating RemappedRowsInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRemappedRowsInfo_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_accounting_stats_v2_dtype_offsets(): + cdef nvmlAccountingStats_v2_t pod + return _numpy.dtype({ + 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'offsets': [ + (&(pod.pid)) - (&pod), + (&(pod.isRunning)) - (&pod), + (&(pod.gpuUtilization)) - (&pod), + (&(pod.memoryUtilization)) - (&pod), + (&(pod.maxMemoryUsage)) - (&pod), + (&(pod.sampleCount)) - (&pod), + (&(pod.sumGpuUtil)) - (&pod), + (&(pod.sumFbUtil)) - (&pod), + (&(pod.time)) - (&pod), + (&(pod.startTime)) - (&pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_v2_t), + }) + +accounting_stats_v2_dtype = _get_accounting_stats_v2_dtype_offsets() + +cdef class AccountingStats_v2: + """Empty-initialize an instance of `nvmlAccountingStats_v2_t`. + + + .. seealso:: `nvmlAccountingStats_v2_t` + """ + cdef: + nvmlAccountingStats_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlAccountingStats_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating AccountingStats_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlAccountingStats_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__}.AccountingStats_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 AccountingStats_v2 other_ + if not isinstance(other, AccountingStats_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlAccountingStats_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlAccountingStats_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(nvmlAccountingStats_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating AccountingStats_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAccountingStats_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def pid(self): + """int: Process Id of the target process to query stats for.""" + return self._ptr[0].pid + + @pid.setter + def pid(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].pid = val + + @property + def is_running(self): + """int: Flag to represent if the process is running (1 for running, 0 for terminated).""" + return self._ptr[0].isRunning + + @is_running.setter + def is_running(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].isRunning = val + + @property + def gpu_utilization(self): + """int: Percent of time over the process's lifetime during which one or more kernels was executing on the GPU. Utilization stats just like returned by nvmlDeviceGetUtilizationRates but for the life time of a process (not just the last sample period). Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported""" + return self._ptr[0].gpuUtilization + + @gpu_utilization.setter + def gpu_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].gpuUtilization = val + + @property + def memory_utilization(self): + """int: Percent of time over the process's lifetime during which global (device) memory was being read or written. Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported""" + return self._ptr[0].memoryUtilization + + @memory_utilization.setter + def memory_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].memoryUtilization = val + + @property + def max_memory_usage(self): + """int: Maximum total memory in bytes that was ever allocated by the process. Set to NVML_VALUE_NOT_AVAILABLE if nvmlProcessInfo_t->usedGpuMemory is not supported""" + return self._ptr[0].maxMemoryUsage + + @max_memory_usage.setter + def max_memory_usage(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].maxMemoryUsage = val + + @property + def sample_count(self): + """int: The sample counts since the process starts.""" + return self._ptr[0].sampleCount + + @sample_count.setter + def sample_count(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sampleCount = val + + @property + def sum_gpu_util(self): + """int: The sum of process's GR engine utilization in unit of pct * 100.""" + return self._ptr[0].sumGpuUtil + + @sum_gpu_util.setter + def sum_gpu_util(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sumGpuUtil = val + + @property + def sum_fb_util(self): + """int: The sum of process's FB bandwidth utilization in unit of pct * 100.""" + return self._ptr[0].sumFbUtil + + @sum_fb_util.setter + def sum_fb_util(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sumFbUtil = val + + @property + def time(self): + """int: Amount of time in ms during which the compute context was active. The time is reported as 0 if the process is not terminated""" + return self._ptr[0].time + + @time.setter + def time(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].time = val + + @property + def start_time(self): + """int: CPU Timestamp in usec representing start time for the process.""" + return self._ptr[0].startTime + + @start_time.setter + def start_time(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].startTime = val + + @staticmethod + def from_buffer(buffer): + """Create an AccountingStats_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlAccountingStats_v2_t), AccountingStats_v2) + + @staticmethod + def from_data(data): + """Create an AccountingStats_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `accounting_stats_v2_dtype` holding the data. + """ + return _cyb_from_data(data, "accounting_stats_v2_dtype", accounting_stats_v2_dtype, AccountingStats_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an AccountingStats_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 AccountingStats_v2 obj = AccountingStats_v2.__new__(AccountingStats_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating AccountingStats_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlAccountingStats_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_cper_cursor_v1_dtype_offsets(): + cdef nvmlCPERCursor_v1_t pod + return _numpy.dtype({ + 'names': ['cper_type_mask', 'uuid', 'handle'], + 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], + 'offsets': [ + (&(pod.cperTypeMask)) - (&pod), + (&(pod.uuid)) - (&pod), + (&(pod.handle)) - (&pod), + ], + 'itemsize': sizeof(nvmlCPERCursor_v1_t), + }) + +cper_cursor_v1_dtype = _get_cper_cursor_v1_dtype_offsets() + +cdef class CPERCursor_v1: + """Empty-initialize an instance of `nvmlCPERCursor_v1_t`. + + + .. seealso:: `nvmlCPERCursor_v1_t` + """ + cdef: + nvmlCPERCursor_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlCPERCursor_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlCPERCursor_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.CPERCursor_v1 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 CPERCursor_v1 other_ + if not isinstance(other, CPERCursor_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlCPERCursor_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlCPERCursor_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 = _cyb_malloc(sizeof(nvmlCPERCursor_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlCPERCursor_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cper_type_mask(self): + """int: [IN] Types of records to access. Bitmask of `nvmlCPERType_t` values. To change, reset `handle` to `NVML_CPER_CURSOR_HANDLE_INIT`.""" + return self._ptr[0].cperTypeMask + + @cper_type_mask.setter + def cper_type_mask(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 instance is read-only") + self._ptr[0].cperTypeMask = val + + @property + def uuid(self): + """~_numpy.int8: (array of length 80).[IN] UUID of target to filter records for. Required for `NVML_CPER_ACCESS_TYPE_GPU`. To change, reset `handle` to `NVML_CPER_CURSOR_HANDLE_INIT`.""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) + + @uuid.setter + def uuid(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field uuid, max length is 79") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].uuid), ptr, 80) + + @property + def handle(self): + """int: [IN/OUT] Opaque handle tracking read position. Initialize to `NVML_CPER_CURSOR_HANDLE_INIT` on first call; pass the same ``nvmlCPERCursor_v1_t`` on the next call to continue. Caller must not interpret or modify.""" + return (self._ptr[0].handle) + + @handle.setter + def handle(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 instance is read-only") + self._ptr[0].handle = val + + @staticmethod + def from_buffer(buffer): + """Create an CPERCursor_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlCPERCursor_v1_t), CPERCursor_v1) + + @staticmethod + def from_data(data): + """Create an CPERCursor_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `cper_cursor_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "cper_cursor_v1_dtype", cper_cursor_v1_dtype, CPERCursor_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an CPERCursor_v1 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 CPERCursor_v1 obj = CPERCursor_v1.__new__(CPERCursor_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlCPERCursor_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlCPERCursor_v1_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), + readonly=self._readonly, + owner=self, + ) + + @pci_info.setter + def pci_info(self, val): + if self._readonly: + raise ValueError("This ExcludedDeviceInfo instance is read-only") + cdef PciInfo val_ = val + _cyb_memcpy(&(self._ptr[0].pciInfo), (val_._get_ptr()), sizeof(nvmlPciInfo_t) * 1) + + @property + def uuid(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) + + @uuid.setter + def uuid(self, val): + if self._readonly: + raise ValueError("This ExcludedDeviceInfo instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field uuid, max length is 79") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlExcludedDeviceInfo_t), ExcludedDeviceInfo) + + @staticmethod + def from_data(data): + """Create an ExcludedDeviceInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `excluded_device_info_dtype` holding the data. + """ + 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): + """Create an ExcludedDeviceInfo 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 ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ExcludedDeviceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_process_detail_list_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.mode)) - (&pod), + (&(pod.numProcArrayEntries)) - (&pod), + (&(pod.procArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessDetailList_v1_t), + }) + +process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() + +cdef class ProcessDetailList_v1: + """Empty-initialize an instance of `nvmlProcessDetailList_v1_t`. + + + .. seealso:: `nvmlProcessDetailList_v1_t` + """ + cdef: + nvmlProcessDetailList_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessDetailList_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlProcessDetailList_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ProcessDetailList_v1 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 ProcessDetailList_v1 other_ + if not isinstance(other, ProcessDetailList_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessDetailList_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessDetailList_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: Struct version, MUST be nvmlProcessDetailList_v1.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ProcessDetailList_v1 instance is read-only") + self._ptr[0].version = val + + @property + def mode(self): + """int: Process mode, One of `nvmlProcessMode_t`.""" + return self._ptr[0].mode + + @mode.setter + def mode(self, val): + if self._readonly: + raise ValueError("This ProcessDetailList_v1 instance is read-only") + self._ptr[0].mode = val + + @property + def proc_array(self): + """int: Process array.""" + if self._ptr[0].procArray == NULL or self._ptr[0].numProcArrayEntries == 0: + return [] + return ProcessDetail_v1.from_ptr( + (self._ptr[0].procArray), + self._ptr[0].numProcArrayEntries, + owner=self, + readonly=self._readonly + ) + + @proc_array.setter + def proc_array(self, val): + if self._readonly: + raise ValueError("This ProcessDetailList_v1 instance is read-only") + cdef ProcessDetail_v1 arr = val + self._ptr[0].procArray = (arr._get_ptr()) + self._ptr[0].numProcArrayEntries = len(arr) + self._refs["proc_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an ProcessDetailList_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlProcessDetailList_v1_t), ProcessDetailList_v1) + + @staticmethod + def from_data(data): + """Create an ProcessDetailList_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `process_detail_list_v1_dtype` holding the data. + """ + 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): + """Create an ProcessDetailList_v1 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 ProcessDetailList_v1 obj = ProcessDetailList_v1.__new__(ProcessDetailList_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ProcessDetailList_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) + 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_bridge_chip_hierarchy_dtype_offsets(): + cdef nvmlBridgeChipHierarchy_t pod + return _numpy.dtype({ + 'names': ['bridge_count', 'bridge_chip_info'], + 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], + 'offsets': [ + (&(pod.bridgeCount)) - (&pod), + (&(pod.bridgeChipInfo)) - (&pod), + ], + 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), + }) + +bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() + +cdef class BridgeChipHierarchy: + """Empty-initialize an instance of `nvmlBridgeChipHierarchy_t`. + + + .. seealso:: `nvmlBridgeChipHierarchy_t` + """ + cdef: + nvmlBridgeChipHierarchy_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BridgeChipHierarchy") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlBridgeChipHierarchy_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.BridgeChipHierarchy 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 BridgeChipHierarchy other_ + if not isinstance(other, BridgeChipHierarchy): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating BridgeChipHierarchy") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def bridge_chip_info(self): + """BridgeChipInfo: """ + return BridgeChipInfo.from_ptr( + &(self._ptr[0].bridgeChipInfo), + self._ptr[0].bridgeCount, + readonly=self._readonly, + owner=self, + ) + + @bridge_chip_info.setter + def bridge_chip_info(self, val): + if self._readonly: + raise ValueError("This BridgeChipHierarchy instance is read-only") + cdef BridgeChipInfo val_ = val + if len(val) > 128: + raise ValueError(f"Expected length < 128 for field bridge_chip_info, got {len(val)}") + self._ptr[0].bridgeCount = len(val) + if len(val) == 0: + return + _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 _cyb_from_buffer(buffer, sizeof(nvmlBridgeChipHierarchy_t), BridgeChipHierarchy) + + @staticmethod + def from_data(data): + """Create an BridgeChipHierarchy instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `bridge_chip_hierarchy_dtype` holding the data. + """ + 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): + """Create an BridgeChipHierarchy 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 BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating BridgeChipHierarchy") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_sample_dtype_offsets(): + cdef nvmlSample_t pod + return _numpy.dtype({ + 'names': ['time_stamp', 'sample_value'], + 'formats': [_numpy.uint64, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (&pod), + (&(pod.sampleValue)) - (&pod), + ], + 'itemsize': sizeof(nvmlSample_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlSample_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.Sample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.Sample 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, Sample)) 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 time_stamp(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def sample_value(self): + """value_dtype: """ + return self._data.sample_value + + @sample_value.setter + def sample_value(self, val): + self._data.sample_value = 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 Sample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == sample_dtype: + return Sample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an Sample instance with the memory from the given buffer.""" + return Sample.from_data(_numpy.frombuffer(buffer, dtype=sample_dtype)) + + @staticmethod + def from_data(data): + """Create an Sample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `sample_dtype` holding the data. + """ + cdef Sample obj = Sample.__new__(Sample) + 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 != sample_dtype: + raise ValueError("data array must be of dtype sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an Sample 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef Sample obj = Sample.__new__(Sample) + 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) + obj._owner = owner + + return obj + + +cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.vgpuInstance)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + }) + +vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_instance_utilization_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationSample_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuInstanceUtilizationSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuInstanceUtilizationSample 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, VgpuInstanceUtilizationSample)) 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 vgpu_instance(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def time_stamp(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def sm_util(self): + """value_dtype: """ + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """value_dtype: """ + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """value_dtype: """ + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """value_dtype: """ + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = 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 VgpuInstanceUtilizationSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_sample_dtype: + return VgpuInstanceUtilizationSample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstanceUtilizationSample instance with the memory from the given buffer.""" + return VgpuInstanceUtilizationSample.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_sample_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuInstanceUtilizationSample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_sample_dtype` holding the data. + """ + cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + 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_instance_utilization_sample_dtype: + raise ValueError("data array must be of dtype vgpu_instance_utilization_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuInstanceUtilizationSample 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + 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) + obj._owner = owner + + return obj + + +cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.timeStamp)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + (&(pod.jpgUtil)) - (&pod), + (&(pod.ofaUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + }) + +vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_instance_utilization_info_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuInstanceUtilizationInfo_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuInstanceUtilizationInfo_v1 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, VgpuInstanceUtilizationInfo_v1)) 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 time_stamp(self): + """Union[~_numpy.uint64, int]: CPU Timestamp in microseconds.""" + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: vGPU Instance""" + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def sm_util(self): + """value_dtype: SM (3D/Compute) Util Value.""" + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """value_dtype: Frame Buffer Memory Util Value.""" + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """value_dtype: Encoder Util Value.""" + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """value_dtype: Decoder Util Value.""" + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = val + + @property + def jpg_util(self): + """value_dtype: Jpeg Util Value.""" + return self._data.jpg_util + + @jpg_util.setter + def jpg_util(self, val): + self._data.jpg_util = val + + @property + def ofa_util(self): + """value_dtype: Ofa Util Value.""" + return self._data.ofa_util + + @ofa_util.setter + def ofa_util(self, val): + self._data.ofa_util = 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 VgpuInstanceUtilizationInfo_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_info_v1_dtype: + return VgpuInstanceUtilizationInfo_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstanceUtilizationInfo_v1 instance with the memory from the given buffer.""" + return VgpuInstanceUtilizationInfo_v1.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_info_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuInstanceUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_info_v1_dtype` holding the data. + """ + cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + 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_instance_utilization_info_v1_dtype: + raise ValueError("data array must be of dtype vgpu_instance_utilization_info_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuInstanceUtilizationInfo_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_field_value_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.fieldId)) - (&pod), + (&(pod.scopeId)) - (&pod), + (&(pod.timestamp)) - (&pod), + (&(pod.latencyUsec)) - (&pod), + (&(pod.valueType)) - (&pod), + (&(pod.nvmlReturn)) - (&pod), + (&(pod.value)) - (&pod), + ], + 'itemsize': sizeof(nvmlFieldValue_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=field_value_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlFieldValue_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlFieldValue_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.FieldValue_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.FieldValue 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, FieldValue)) 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 field_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.field_id[0]) + return self._data.field_id + + @field_id.setter + def field_id(self, val): + self._data.field_id = val + + @property + def scope_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.scope_id[0]) + return self._data.scope_id + + @scope_id.setter + def scope_id(self, val): + self._data.scope_id = val + + @property + def timestamp(self): + """Union[~_numpy.int64, int]: """ + 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 latency_usec(self): + """Union[~_numpy.int64, int]: """ + if self._data.size == 1: + return int(self._data.latency_usec[0]) + return self._data.latency_usec + + @latency_usec.setter + def latency_usec(self, val): + self._data.latency_usec = val + + @property + def value_type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.value_type[0]) + return self._data.value_type + + @value_type.setter + def value_type(self, val): + self._data.value_type = val + + @property + def nvml_return(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.nvml_return[0]) + return self._data.nvml_return + + @nvml_return.setter + def nvml_return(self, val): + self._data.nvml_return = val + + @property + def value(self): + """value_dtype: """ + return self._data.value + + @value.setter + def value(self, val): + self._data.value = 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 FieldValue.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == field_value_dtype: + return FieldValue.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an FieldValue instance with the memory from the given buffer.""" + return FieldValue.from_data(_numpy.frombuffer(buffer, dtype=field_value_dtype)) + + @staticmethod + def from_data(data): + """Create an FieldValue instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `field_value_dtype` holding the data. + """ + cdef FieldValue obj = FieldValue.__new__(FieldValue) + 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 != field_value_dtype: + raise ValueError("data array must be of dtype field_value_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an FieldValue 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef FieldValue obj = FieldValue.__new__(FieldValue) + 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) + obj._owner = owner + + return obj + + +cdef _get_prm_counter_value_v1_dtype_offsets(): + cdef nvmlPRMCounterValue_v1_t pod + return _numpy.dtype({ + 'names': ['status', 'output_type', 'output_value'], + 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.status)) - (&pod), + (&(pod.outputType)) - (&pod), + (&(pod.outputValue)) - (&pod), + ], + 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + }) + +prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() + +cdef class PRMCounterValue_v1: + """Empty-initialize an instance of `nvmlPRMCounterValue_v1_t`. + + + .. seealso:: `nvmlPRMCounterValue_v1_t` + """ + cdef: + nvmlPRMCounterValue_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPRMCounterValue_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PRMCounterValue_v1 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 PRMCounterValue_v1 other_ + if not isinstance(other, PRMCounterValue_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterValue_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterValue_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def output_value(self): + """Value: Output value.""" + return Value.from_ptr( + &(self._ptr[0].outputValue), + readonly=self._readonly, + owner=self, + ) + + @output_value.setter + def output_value(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + cdef Value val_ = val + _cyb_memcpy(&(self._ptr[0].outputValue), (val_._get_ptr()), sizeof(nvmlValue_t) * 1) + + @property + def status(self): + """int: Status of the PRM counter read.""" + return (self._ptr[0].status) + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + self._ptr[0].status = val + + @property + def output_type(self): + """int: Output value type.""" + return (self._ptr[0].outputType) + + @output_type.setter + def output_type(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + self._ptr[0].outputType = val + + @staticmethod + def from_buffer(buffer): + """Create an PRMCounterValue_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterValue_v1_t), PRMCounterValue_v1) + + @staticmethod + def from_data(data): + """Create an PRMCounterValue_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `prm_counter_value_v1_dtype` holding the data. + """ + 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): + """Create an PRMCounterValue_v1 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 PRMCounterValue_v1 obj = PRMCounterValue_v1.__new__(PRMCounterValue_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterValue_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_thermal_settings_dtype_offsets(): + cdef nvmlGpuThermalSettings_t pod + return _numpy.dtype({ + 'names': ['count', 'sensor'], + 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'offsets': [ + (&(pod.count)) - (&pod), + (&(pod.sensor)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuThermalSettings_t), + }) + +gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() + +cdef class GpuThermalSettings: + """Empty-initialize an instance of `nvmlGpuThermalSettings_t`. + + + .. seealso:: `nvmlGpuThermalSettings_t` + """ + cdef: + nvmlGpuThermalSettings_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuThermalSettings_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuThermalSettings 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 GpuThermalSettings other_ + if not isinstance(other, GpuThermalSettings): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuThermalSettings_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuThermalSettings_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def sensor(self): + """_py_anon_pod0: """ + return _py_anon_pod0.from_ptr( + &(self._ptr[0].sensor), + 3, + readonly=self._readonly, + owner=self, + ) + + @sensor.setter + def sensor(self, val): + if self._readonly: + raise ValueError("This GpuThermalSettings instance is read-only") + cdef _py_anon_pod0 val_ = val + if len(val) != 3: + raise ValueError(f"Expected length { 3 } for field sensor, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].sensor), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod0) * 3) + + @property + def count(self): + """int: """ + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This GpuThermalSettings instance is read-only") + self._ptr[0].count = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuThermalSettings instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuThermalSettings_t), GpuThermalSettings) + + @staticmethod + def from_data(data): + """Create an GpuThermalSettings instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_thermal_settings_dtype` holding the data. + """ + 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): + """Create an GpuThermalSettings 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 GpuThermalSettings obj = GpuThermalSettings.__new__(GpuThermalSettings) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuThermalSettings_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_clk_mon_status_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.bGlobalStatus)) - (&pod), + (&(pod.clkMonListSize)) - (&pod), + (&(pod.clkMonList)) - (&pod), + ], + 'itemsize': sizeof(nvmlClkMonStatus_t), + }) + +clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() + +cdef class ClkMonStatus: + """Empty-initialize an instance of `nvmlClkMonStatus_t`. + + + .. seealso:: `nvmlClkMonStatus_t` + """ + cdef: + nvmlClkMonStatus_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlClkMonStatus_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ClkMonStatus 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 ClkMonStatus other_ + if not isinstance(other, ClkMonStatus): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClkMonStatus_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClkMonStatus_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def clk_mon_list(self): + """ClkMonFaultInfo: """ + return ClkMonFaultInfo.from_ptr( + &(self._ptr[0].clkMonList), + self._ptr[0].clkMonListSize, + readonly=self._readonly, + owner=self, + ) + + @clk_mon_list.setter + def clk_mon_list(self, val): + if self._readonly: + raise ValueError("This ClkMonStatus instance is read-only") + cdef ClkMonFaultInfo val_ = val + if len(val) > 32: + raise ValueError(f"Expected length < 32 for field clk_mon_list, got {len(val)}") + self._ptr[0].clkMonListSize = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].clkMonList), (val_._get_ptr()), sizeof(nvmlClkMonFaultInfo_t) * self._ptr[0].clkMonListSize) + + @property + def b_global_status(self): + """int: """ + return self._ptr[0].bGlobalStatus + + @b_global_status.setter + def b_global_status(self, val): + if self._readonly: + raise ValueError("This ClkMonStatus instance is read-only") + self._ptr[0].bGlobalStatus = val + + @staticmethod + def from_buffer(buffer): + """Create an ClkMonStatus instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlClkMonStatus_t), ClkMonStatus) + + @staticmethod + def from_data(data): + """Create an ClkMonStatus instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `clk_mon_status_dtype` holding the data. + """ + 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): + """Create an ClkMonStatus 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 ClkMonStatus obj = ClkMonStatus.__new__(ClkMonStatus) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClkMonStatus_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_processes_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.processSamplesCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.procUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + }) + +processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() + +cdef class ProcessesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlProcessesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlProcessesUtilizationInfo_v1_t` + """ + cdef: + nvmlProcessesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlProcessesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ProcessesUtilizationInfo_v1 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 ProcessesUtilizationInfo_v1 other_ + if not isinstance(other, ProcessesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessesUtilizationInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def proc_util_array(self): + """int: The array (allocated by caller) of the utilization of GPU SM, framebuffer, video encoder, video decoder, JPEG, and OFA.""" + if self._ptr[0].procUtilArray == NULL or self._ptr[0].processSamplesCount == 0: + return [] + return ProcessUtilizationInfo_v1.from_ptr( + (self._ptr[0].procUtilArray), + self._ptr[0].processSamplesCount, + owner=self, + readonly=self._readonly + ) + + @proc_util_array.setter + def proc_util_array(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + cdef ProcessUtilizationInfo_v1 arr = val + self._ptr[0].procUtilArray = (arr._get_ptr()) + self._ptr[0].processSamplesCount = len(arr) + self._refs["proc_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an ProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlProcessesUtilizationInfo_v1_t), ProcessesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an ProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `processes_utilization_info_v1_dtype` holding the data. + """ + 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): + """Create an ProcessesUtilizationInfo_v1 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 ProcessesUtilizationInfo_v1 obj = ProcessesUtilizationInfo_v1.__new__(ProcessesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + 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_gpu_dynamic_pstates_info_dtype_offsets(): + cdef nvmlGpuDynamicPstatesInfo_t pod + return _numpy.dtype({ + 'names': ['flags_', 'utilization'], + 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + 'offsets': [ + (&(pod.flags)) - (&pod), + (&(pod.utilization)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + }) + +gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() + +cdef class GpuDynamicPstatesInfo: + """Empty-initialize an instance of `nvmlGpuDynamicPstatesInfo_t`. + + + .. seealso:: `nvmlGpuDynamicPstatesInfo_t` + """ + cdef: + nvmlGpuDynamicPstatesInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuDynamicPstatesInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuDynamicPstatesInfo 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 GpuDynamicPstatesInfo other_ + if not isinstance(other, GpuDynamicPstatesInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def utilization(self): + """_py_anon_pod1: """ + return _py_anon_pod1.from_ptr( + &(self._ptr[0].utilization), + 8, + readonly=self._readonly, + owner=self, + ) + + @utilization.setter + def utilization(self, val): + if self._readonly: + raise ValueError("This GpuDynamicPstatesInfo instance is read-only") + cdef _py_anon_pod1 val_ = val + if len(val) != 8: + raise ValueError(f"Expected length { 8 } for field utilization, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].utilization), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod1) * 8) + + @property + def flags_(self): + """int: """ + return self._ptr[0].flags + + @flags_.setter + def flags_(self, val): + if self._readonly: + raise ValueError("This GpuDynamicPstatesInfo instance is read-only") + self._ptr[0].flags = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuDynamicPstatesInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) + + @staticmethod + def from_data(data): + """Create an GpuDynamicPstatesInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_dynamic_pstates_info_dtype` holding the data. + """ + 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): + """Create an GpuDynamicPstatesInfo 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 GpuDynamicPstatesInfo obj = GpuDynamicPstatesInfo.__new__(GpuDynamicPstatesInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_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_processes_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.vgpuProcessCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.vgpuProcUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + }) + +vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() + +cdef class VgpuProcessesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlVgpuProcessesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlVgpuProcessesUtilizationInfo_v1_t` + """ + cdef: + nvmlVgpuProcessesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuProcessesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuProcessesUtilizationInfo_v1 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 VgpuProcessesUtilizationInfo_v1 other_ + if not isinstance(other, VgpuProcessesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def vgpu_proc_util_array(self): + """int: The array (allocated by caller) in which utilization of processes running on vGPU instances are returned.""" + if self._ptr[0].vgpuProcUtilArray == NULL or self._ptr[0].vgpuProcessCount == 0: + return [] + return VgpuProcessUtilizationInfo_v1.from_ptr( + (self._ptr[0].vgpuProcUtilArray), + self._ptr[0].vgpuProcessCount, + owner=self, + readonly=self._readonly + ) + + @vgpu_proc_util_array.setter + def vgpu_proc_util_array(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + cdef VgpuProcessUtilizationInfo_v1 arr = val + self._ptr[0].vgpuProcUtilArray = (arr._get_ptr()) + self._ptr[0].vgpuProcessCount = len(arr) + self._refs["vgpu_proc_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), VgpuProcessesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_processes_utilization_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuProcessesUtilizationInfo_v1 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 VgpuProcessesUtilizationInfo_v1 obj = VgpuProcessesUtilizationInfo_v1.__new__(VgpuProcessesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + 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_vgpu_scheduler_params_dtype_offsets(): + cdef nvmlVgpuSchedulerParams_t pod + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (&pod), + (&(pod.vgpuSchedData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), + }) + +vgpu_scheduler_params_dtype = _get_vgpu_scheduler_params_dtype_offsets() + +cdef class VgpuSchedulerParams: + """Empty-initialize an instance of `nvmlVgpuSchedulerParams_t`. + + + .. seealso:: `nvmlVgpuSchedulerParams_t` + """ + cdef: + nvmlVgpuSchedulerParams_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerParams_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerParams 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 VgpuSchedulerParams other_ + if not isinstance(other, VgpuSchedulerParams): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def vgpu_sched_data_with_arr(self): + """_py_anon_pod2: """ + return _py_anon_pod2.from_ptr( + &(self._ptr[0].vgpuSchedDataWithARR), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data_with_arr.setter + def vgpu_sched_data_with_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerParams instance is read-only") + cdef _py_anon_pod2 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod2) * 1) + + @property + def vgpu_sched_data(self): + """_py_anon_pod3: """ + return _py_anon_pod3.from_ptr( + &(self._ptr[0].vgpuSchedData), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data.setter + def vgpu_sched_data(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerParams instance is read-only") + cdef _py_anon_pod3 val_ = val + _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 _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerParams_t), VgpuSchedulerParams) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerParams instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_params_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerParams 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 VgpuSchedulerParams obj = VgpuSchedulerParams.__new__(VgpuSchedulerParams) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_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_set_params_dtype_offsets(): + cdef nvmlVgpuSchedulerSetParams_t pod + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (&pod), + (&(pod.vgpuSchedData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), + }) + +vgpu_scheduler_set_params_dtype = _get_vgpu_scheduler_set_params_dtype_offsets() + +cdef class VgpuSchedulerSetParams: + """Empty-initialize an instance of `nvmlVgpuSchedulerSetParams_t`. + + + .. seealso:: `nvmlVgpuSchedulerSetParams_t` + """ + cdef: + nvmlVgpuSchedulerSetParams_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerSetParams_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerSetParams 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 VgpuSchedulerSetParams other_ + if not isinstance(other, VgpuSchedulerSetParams): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def vgpu_sched_data_with_arr(self): + """_py_anon_pod4: """ + return _py_anon_pod4.from_ptr( + &(self._ptr[0].vgpuSchedDataWithARR), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data_with_arr.setter + def vgpu_sched_data_with_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerSetParams instance is read-only") + cdef _py_anon_pod4 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod4) * 1) + + @property + def vgpu_sched_data(self): + """_py_anon_pod5: """ + return _py_anon_pod5.from_ptr( + &(self._ptr[0].vgpuSchedData), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data.setter + def vgpu_sched_data(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerSetParams instance is read-only") + cdef _py_anon_pod5 val_ = val + _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 _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerSetParams_t), VgpuSchedulerSetParams) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerSetParams instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_set_params_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerSetParams 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 VgpuSchedulerSetParams obj = VgpuSchedulerSetParams.__new__(VgpuSchedulerSetParams) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_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_license_info_dtype_offsets(): + cdef nvmlVgpuLicenseInfo_t pod + return _numpy.dtype({ + 'names': ['is_licensed', 'license_expiry', 'current_state'], + 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isLicensed)) - (&pod), + (&(pod.licenseExpiry)) - (&pod), + (&(pod.currentState)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + }) + +vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() + +cdef class VgpuLicenseInfo: + """Empty-initialize an instance of `nvmlVgpuLicenseInfo_t`. + + + .. seealso:: `nvmlVgpuLicenseInfo_t` + """ + cdef: + nvmlVgpuLicenseInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuLicenseInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuLicenseInfo 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 VgpuLicenseInfo other_ + if not isinstance(other, VgpuLicenseInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def license_expiry(self): + """VgpuLicenseExpiry: """ + return VgpuLicenseExpiry.from_ptr( + &(self._ptr[0].licenseExpiry), + readonly=self._readonly, + owner=self, + ) + + @license_expiry.setter + def license_expiry(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + cdef VgpuLicenseExpiry val_ = val + _cyb_memcpy(&(self._ptr[0].licenseExpiry), (val_._get_ptr()), sizeof(nvmlVgpuLicenseExpiry_t) * 1) + + @property + def is_licensed(self): + """int: """ + return self._ptr[0].isLicensed + + @is_licensed.setter + def is_licensed(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + self._ptr[0].isLicensed = val + + @property + def current_state(self): + """int: """ + return self._ptr[0].currentState + + @current_state.setter + def current_state(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + self._ptr[0].currentState = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuLicenseInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseInfo_t), VgpuLicenseInfo) + + @staticmethod + def from_data(data): + """Create an VgpuLicenseInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_license_info_dtype` holding the data. + """ + 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): + """Create an VgpuLicenseInfo 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 VgpuLicenseInfo obj = VgpuLicenseInfo.__new__(VgpuLicenseInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_grid_licensable_feature_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.featureCode)) - (&pod), + (&(pod.featureState)) - (&pod), + (&(pod.licenseInfo)) - (&pod), + (&(pod.productName)) - (&pod), + (&(pod.featureEnabled)) - (&pod), + (&(pod.licenseExpiry)) - (&pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeature_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=grid_licensable_feature_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlGridLicensableFeature_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlGridLicensableFeature_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.GridLicensableFeature_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.GridLicensableFeature 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, GridLicensableFeature)) 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 feature_code(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.feature_code[0]) + return self._data.feature_code + + @feature_code.setter + def feature_code(self, val): + self._data.feature_code = val + + @property + def feature_state(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.feature_state[0]) + return self._data.feature_state + + @feature_state.setter + def feature_state(self, val): + self._data.feature_state = val + + @property + def license_info(self): + """~_numpy.int8: (array of length 128).""" + return self._data.license_info + + @license_info.setter + def license_info(self, val): + self._data.license_info = val + + @property + def product_name(self): + """~_numpy.int8: (array of length 128).""" + return self._data.product_name + + @product_name.setter + def product_name(self, val): + self._data.product_name = val + + @property + def feature_enabled(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.feature_enabled[0]) + return self._data.feature_enabled + + @feature_enabled.setter + def feature_enabled(self, val): + self._data.feature_enabled = val + + @property + def license_expiry(self): + """grid_license_expiry_dtype: """ + return self._data.license_expiry + + @license_expiry.setter + def license_expiry(self, val): + self._data.license_expiry = 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 GridLicensableFeature.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == grid_licensable_feature_dtype: + return GridLicensableFeature.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an GridLicensableFeature instance with the memory from the given buffer.""" + return GridLicensableFeature.from_data(_numpy.frombuffer(buffer, dtype=grid_licensable_feature_dtype)) + + @staticmethod + def from_data(data): + """Create an GridLicensableFeature instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `grid_licensable_feature_dtype` holding the data. + """ + cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + 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 != grid_licensable_feature_dtype: + raise ValueError("data array must be of dtype grid_licensable_feature_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an GridLicensableFeature 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + 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) + obj._owner = owner + + return obj + + +cdef _get_unit_fan_speeds_dtype_offsets(): + cdef nvmlUnitFanSpeeds_t pod + return _numpy.dtype({ + 'names': ['fans', 'count'], + 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'offsets': [ + (&(pod.fans)) - (&pod), + (&(pod.count)) - (&pod), + ], + 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + }) + +unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() + +cdef class UnitFanSpeeds: + """Empty-initialize an instance of `nvmlUnitFanSpeeds_t`. + + + .. seealso:: `nvmlUnitFanSpeeds_t` + """ + cdef: + nvmlUnitFanSpeeds_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlUnitFanSpeeds_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.UnitFanSpeeds 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 UnitFanSpeeds other_ + if not isinstance(other, UnitFanSpeeds): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitFanSpeeds_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def fans(self): + """UnitFanInfo: """ + return UnitFanInfo.from_ptr( + &(self._ptr[0].fans), + 24, + readonly=self._readonly, + owner=self, + ) + + @fans.setter + def fans(self, val): + if self._readonly: + raise ValueError("This UnitFanSpeeds instance is read-only") + cdef UnitFanInfo val_ = val + if len(val) != 24: + raise ValueError(f"Expected length { 24 } for field fans, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].fans), (val_._get_ptr()), sizeof(nvmlUnitFanInfo_t) * 24) + + @property + def count(self): + """int: """ + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This UnitFanSpeeds instance is read-only") + self._ptr[0].count = val + + @staticmethod + def from_buffer(buffer): + """Create an UnitFanSpeeds instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlUnitFanSpeeds_t), UnitFanSpeeds) + + @staticmethod + def from_data(data): + """Create an UnitFanSpeeds instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `unit_fan_speeds_dtype` holding the data. + """ + 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): + """Create an UnitFanSpeeds 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 UnitFanSpeeds obj = UnitFanSpeeds.__new__(UnitFanSpeeds) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_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_pgpu_metadata_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.revision)) - (&pod), + (&(pod.hostDriverVersion)) - (&pod), + (&(pod.pgpuVirtualizationCaps)) - (&pod), + (&(pod.reserved)) - (&pod), + (&(pod.hostSupportedVgpuRange)) - (&pod), + (&(pod.opaqueDataSize)) - (&pod), + (&(pod.opaqueData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + }) + +vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() + +cdef class VgpuPgpuMetadata: + """Empty-initialize an instance of `nvmlVgpuPgpuMetadata_t`. + + + .. seealso:: `nvmlVgpuPgpuMetadata_t` + """ + cdef: + nvmlVgpuPgpuMetadata_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuPgpuMetadata_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuPgpuMetadata 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 VgpuPgpuMetadata other_ + if not isinstance(other, VgpuPgpuMetadata): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuMetadata_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuMetadata_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def host_supported_vgpu_range(self): + """VgpuVersion: """ + return VgpuVersion.from_ptr( + &(self._ptr[0].hostSupportedVgpuRange), + readonly=self._readonly, + owner=self, + ) + + @host_supported_vgpu_range.setter + def host_supported_vgpu_range(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef VgpuVersion val_ = val + _cyb_memcpy(&(self._ptr[0].hostSupportedVgpuRange), (val_._get_ptr()), sizeof(nvmlVgpuVersion_t) * 1) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].version = val + + @property + def revision(self): + """int: """ + return self._ptr[0].revision + + @revision.setter + def revision(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].revision = val + + @property + def host_driver_version(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + + @host_driver_version.setter + def host_driver_version(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field host_driver_version, max length is 79") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) + + @property + def pgpu_virtualization_caps(self): + """int: """ + return self._ptr[0].pgpuVirtualizationCaps + + @pgpu_virtualization_caps.setter + def pgpu_virtualization_caps(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].pgpuVirtualizationCaps = val + + @property + def opaque_data_size(self): + """int: """ + return self._ptr[0].opaqueDataSize + + @opaque_data_size.setter + def opaque_data_size(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].opaqueDataSize = val + + @property + def opaque_data(self): + """~_numpy.int8: (array of length 4).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + + @opaque_data.setter + def opaque_data(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 4: + raise ValueError("String too long for field opaque_data, max length is 3") + cdef char *ptr = buf + _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 _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuMetadata_t), VgpuPgpuMetadata) + + @staticmethod + def from_data(data): + """Create an VgpuPgpuMetadata instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_metadata_dtype` holding the data. + """ + 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): + """Create an VgpuPgpuMetadata 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 VgpuPgpuMetadata obj = VgpuPgpuMetadata.__new__(VgpuPgpuMetadata) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuMetadata_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_instance_info_dtype_offsets(): + cdef nvmlGpuInstanceInfo_t pod + return _numpy.dtype({ + 'names': ['device_', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.profileId)) - (&pod), + (&(pod.placement)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + }) + +gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() + +cdef class GpuInstanceInfo: + """Empty-initialize an instance of `nvmlGpuInstanceInfo_t`. + + + .. seealso:: `nvmlGpuInstanceInfo_t` + """ + cdef: + nvmlGpuInstanceInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuInstanceInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuInstanceInfo 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 GpuInstanceInfo other_ + if not isinstance(other, GpuInstanceInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def placement(self): + """GpuInstancePlacement: """ + return GpuInstancePlacement.from_ptr( + &(self._ptr[0].placement), + 1, + readonly=self._readonly, + owner=self, + ) + + @placement.setter + def placement(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + cdef GpuInstancePlacement val_ = val + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlGpuInstancePlacement_t) * 1) + + @property + def device_(self): + """int: """ + return (self._ptr[0].device) + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].device = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].id = val + + @property + def profile_id(self): + """int: """ + return self._ptr[0].profileId + + @profile_id.setter + def profile_id(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].profileId = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuInstanceInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceInfo_t), GpuInstanceInfo) + + @staticmethod + def from_data(data): + """Create an GpuInstanceInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_instance_info_dtype` holding the data. + """ + 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): + """Create an GpuInstanceInfo 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 GpuInstanceInfo obj = GpuInstanceInfo.__new__(GpuInstanceInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_compute_instance_info_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.device)) - (&pod), + (&(pod.gpuInstance)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.profileId)) - (&pod), + (&(pod.placement)) - (&pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + }) + +compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() + +cdef class ComputeInstanceInfo: + """Empty-initialize an instance of `nvmlComputeInstanceInfo_t`. + + + .. seealso:: `nvmlComputeInstanceInfo_t` + """ + cdef: + nvmlComputeInstanceInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlComputeInstanceInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ComputeInstanceInfo 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 ComputeInstanceInfo other_ + if not isinstance(other, ComputeInstanceInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def placement(self): + """ComputeInstancePlacement: """ + return ComputeInstancePlacement.from_ptr( + &(self._ptr[0].placement), + 1, + readonly=self._readonly, + owner=self, + ) + + @placement.setter + def placement(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + cdef ComputeInstancePlacement val_ = val + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlComputeInstancePlacement_t) * 1) + + @property + def device_(self): + """int: """ + return (self._ptr[0].device) + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].device = val + + @property + def gpu_instance(self): + """int: """ + return (self._ptr[0].gpuInstance) + + @gpu_instance.setter + def gpu_instance(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].gpuInstance = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].id = val + + @property + def profile_id(self): + """int: """ + return self._ptr[0].profileId + + @profile_id.setter + def profile_id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].profileId = val + + @staticmethod + def from_buffer(buffer): + """Create an ComputeInstanceInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceInfo_t), ComputeInstanceInfo) + + @staticmethod + def from_data(data): + """Create an ComputeInstanceInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `compute_instance_info_dtype` holding the data. + """ + 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): + """Create an ComputeInstanceInfo 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 ComputeInstanceInfo obj = ComputeInstanceInfo.__new__(ComputeInstanceInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'entry_count', 'entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.entryCount)) - (&pod), + (&(pod.entries)) - (&pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + }) + +ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() + +cdef class EccSramUniqueUncorrectedErrorCounts_v1: + """Empty-initialize an instance of `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t`. + + + .. seealso:: `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t` + """ + cdef: + nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.EccSramUniqueUncorrectedErrorCounts_v1 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 EccSramUniqueUncorrectedErrorCounts_v1 other_ + if not isinstance(other, EccSramUniqueUncorrectedErrorCounts_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") + self._ptr[0].version = val + + @property + def entries(self): + """int: pointer to caller-supplied buffer to return the SRAM unique uncorrected ECC error count entries""" + if self._ptr[0].entries == NULL or self._ptr[0].entryCount == 0: + return [] + return EccSramUniqueUncorrectedErrorEntry_v1.from_ptr( + (self._ptr[0].entries), + self._ptr[0].entryCount, + owner=self, + readonly=self._readonly + ) + + @entries.setter + def entries(self, val): + if self._readonly: + raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") + cdef EccSramUniqueUncorrectedErrorEntry_v1 arr = val + self._ptr[0].entries = (arr._get_ptr()) + self._ptr[0].entryCount = len(arr) + self._refs["entries"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) + + @staticmethod + def from_data(data): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `ecc_sram_unique_uncorrected_error_counts_v1_dtype` holding the data. + """ + 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): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 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 EccSramUniqueUncorrectedErrorCounts_v1 obj = EccSramUniqueUncorrectedErrorCounts_v1.__new__(EccSramUniqueUncorrectedErrorCounts_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + 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_nvlink_firmware_info_dtype_offsets(): + cdef nvmlNvlinkFirmwareInfo_t pod + return _numpy.dtype({ + 'names': ['firmware_version', 'num_valid_entries'], + 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'offsets': [ + (&(pod.firmwareVersion)) - (&pod), + (&(pod.numValidEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + }) + +nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() + +cdef class NvlinkFirmwareInfo: + """Empty-initialize an instance of `nvmlNvlinkFirmwareInfo_t`. + + + .. seealso:: `nvmlNvlinkFirmwareInfo_t` + """ + cdef: + nvmlNvlinkFirmwareInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkFirmwareInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkFirmwareInfo 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 NvlinkFirmwareInfo other_ + if not isinstance(other, NvlinkFirmwareInfo): + return False + other_ = other + 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, + readonly=self._readonly, + owner=self, + ) + + @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, + readonly=self._readonly, + owner=self, + ) + + @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 + + @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 VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].timeslice = val + + @property + def entries_count(self): + """int: OUT: Count of log entries fetched.""" + return self._ptr[0].entriesCount + + @entries_count.setter + def entries_count(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].entriesCount = val + + @staticmethod + def from_buffer(buffer): + """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 VgpuSchedulerLogInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v2_dtype` holding the data. + """ + 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 VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_v2 obj = VgpuSchedulerLogInfo_v2.__new__(VgpuSchedulerLogInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if obj._ptr == NULL: + 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._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_get_cper_v1_dtype_offsets(): + cdef nvmlGetCPER_v1_t pod + return _numpy.dtype({ + 'names': ['cursor', 'buffer', 'buffer_size'], + 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.cursor)) - (&pod), + (&(pod.buffer)) - (&pod), + (&(pod.bufferSize)) - (&pod), + ], + 'itemsize': sizeof(nvmlGetCPER_v1_t), + }) + +get_cper_v1_dtype = _get_get_cper_v1_dtype_offsets() + +cdef class GetCPER_v1: + """Empty-initialize an instance of `nvmlGetCPER_v1_t`. + + + .. seealso:: `nvmlGetCPER_v1_t` + """ + cdef: + nvmlGetCPER_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGetCPER_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGetCPER_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GetCPER_v1 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 GetCPER_v1 other_ + if not isinstance(other, GetCPER_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGetCPER_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGetCPER_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 = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGetCPER_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cursor(self): + """CPERCursor_v1: [IN/OUT] Query parameters and cursor. See `nvmlCPERCursor_v1_t`""" + return CPERCursor_v1.from_ptr( + &(self._ptr[0].cursor), + readonly=self._readonly, + owner=self, + ) + + @cursor.setter + def cursor(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + cdef CPERCursor_v1 val_ = val + _cyb_memcpy(&(self._ptr[0].cursor), (val_._get_ptr()), sizeof(nvmlCPERCursor_v1_t) * 1) + + @property + def buffer(self): + """str: [OUT] Buffer to be filled (allocated by client). May be NULL for size query.""" + return (self._ptr[0].buffer) + + @buffer.setter + def buffer(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + self._ptr[0].buffer = val + + @property + def buffer_size(self): + """int: [IN/OUT] Size of `buffer`. Set to 0 with `buffer` NULL to query required size. On return, set to required or used size; 0 means no (more) records.""" + return self._ptr[0].bufferSize + + @buffer_size.setter + def buffer_size(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + self._ptr[0].bufferSize = val + + @staticmethod + def from_buffer(buffer): + """Create an GetCPER_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGetCPER_v1_t), GetCPER_v1) + + @staticmethod + def from_data(data): + """Create an GetCPER_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `get_cper_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "get_cper_v1_dtype", get_cper_v1_dtype, GetCPER_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GetCPER_v1 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 GetCPER_v1 obj = GetCPER_v1.__new__(GetCPER_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGetCPER_v1_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_instances_utilization_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.sampleValType)) - (&pod), + (&(pod.vgpuInstanceCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.vgpuUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), + }) + +vgpu_instances_utilization_info_v1_dtype = _get_vgpu_instances_utilization_info_v1_dtype_offsets() + +cdef class VgpuInstancesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlVgpuInstancesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlVgpuInstancesUtilizationInfo_v1_t` + """ + cdef: + nvmlVgpuInstancesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuInstancesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuInstancesUtilizationInfo_v1 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 VgpuInstancesUtilizationInfo_v1 other_ + if not isinstance(other, VgpuInstancesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def sample_val_type(self): + """int: Hold the type of returned sample values.""" + return (self._ptr[0].sampleValType) + + @sample_val_type.setter + def sample_val_type(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].sampleValType = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def vgpu_util_array(self): + """int: The array (allocated by caller) in which vGPU utilization are returned.""" + if self._ptr[0].vgpuUtilArray == NULL or self._ptr[0].vgpuInstanceCount == 0: + return [] + return VgpuInstanceUtilizationInfo_v1.from_ptr( + (self._ptr[0].vgpuUtilArray), + self._ptr[0].vgpuInstanceCount, + owner=self, + readonly=self._readonly + ) + + @vgpu_util_array.setter + def vgpu_util_array(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + cdef VgpuInstanceUtilizationInfo_v1 arr = val + self._ptr[0].vgpuUtilArray = (arr._get_ptr()) + self._ptr[0].vgpuInstanceCount = len(arr) + self._refs["vgpu_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstancesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), VgpuInstancesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuInstancesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_instances_utilization_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuInstancesUtilizationInfo_v1 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 VgpuInstancesUtilizationInfo_v1 obj = VgpuInstancesUtilizationInfo_v1.__new__(VgpuInstancesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + 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_prm_counter_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.counterId)) - (&pod), + (&(pod.inData)) - (&pod), + (&(pod.counterValue)) - (&pod), + ], + 'itemsize': sizeof(nvmlPRMCounter_v1_t), + }) + +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 + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=prm_counter_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPRMCounter_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPRMCounter_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.PRMCounter_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PRMCounter_v1 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, PRMCounter_v1)) 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 counter_id(self): + """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 + + @counter_id.setter + def counter_id(self, val): + self._data.counter_id = val + + @property + def in_data(self): + """prm_counter_input_v1_dtype: PRM input values.""" + return self._data.in_data + + @in_data.setter + def in_data(self, val): + self._data.in_data = val + + @property + def counter_value(self): + """prm_counter_value_v1_dtype: Counter value.""" + return self._data.counter_value + + @counter_value.setter + def counter_value(self, val): + self._data.counter_value = 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 PRMCounter_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == prm_counter_v1_dtype: + return PRMCounter_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an PRMCounter_v1 instance with the memory from the given buffer.""" + return PRMCounter_v1.from_data(_numpy.frombuffer(buffer, dtype=prm_counter_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an PRMCounter_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `prm_counter_v1_dtype` holding the data. + """ + cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + 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 != prm_counter_v1_dtype: + raise ValueError("data array must be of dtype prm_counter_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PRMCounter_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + 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) + obj._owner = owner + + return obj + + +cdef _get_vgpu_scheduler_log_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + }) + +vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() + +cdef class VgpuSchedulerLog: + """Empty-initialize an instance of `nvmlVgpuSchedulerLog_t`. + + + .. seealso:: `nvmlVgpuSchedulerLog_t` + """ + cdef: + nvmlVgpuSchedulerLog_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerLog_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerLog 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 VgpuSchedulerLog other_ + if not isinstance(other, VgpuSchedulerLog): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLog_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLog_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: """ + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def log_entries(self): + """VgpuSchedulerLogEntry: """ + return VgpuSchedulerLogEntry.from_ptr( + &(self._ptr[0].logEntries), + 200, + readonly=self._readonly, + owner=self, + ) + + @log_entries.setter + def log_entries(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + cdef VgpuSchedulerLogEntry 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_t) * 200) + + @property + def engine_id(self): + """int: """ + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: """ + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: """ + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].arrMode = val + + @property + def entries_count(self): + """int: """ + return self._ptr[0].entriesCount + + @entries_count.setter + def entries_count(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].entriesCount = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLog instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLog_t), VgpuSchedulerLog) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLog instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerLog 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 VgpuSchedulerLog obj = VgpuSchedulerLog.__new__(VgpuSchedulerLog) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLog_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_get_state_dtype_offsets(): + cdef nvmlVgpuSchedulerGetState_t pod + return _numpy.dtype({ + 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), + }) + +vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() + +cdef class VgpuSchedulerGetState: + """Empty-initialize an instance of `nvmlVgpuSchedulerGetState_t`. + + + .. seealso:: `nvmlVgpuSchedulerGetState_t` + """ + cdef: + nvmlVgpuSchedulerGetState_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerGetState_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerGetState 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 VgpuSchedulerGetState other_ + if not isinstance(other, VgpuSchedulerGetState): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerGetState_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerGetState_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: """ + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def scheduler_policy(self): + """int: """ + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: """ + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + self._ptr[0].arrMode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerGetState instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerGetState instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_get_state_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerGetState 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 VgpuSchedulerGetState obj = VgpuSchedulerGetState.__new__(VgpuSchedulerGetState) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerGetState_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_state_info_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + }) + +vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() + +cdef class VgpuSchedulerStateInfo_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerStateInfo_v1_t` + """ + cdef: + nvmlVgpuSchedulerStateInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerStateInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerStateInfo_v1 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 VgpuSchedulerStateInfo_v1 other_ + if not isinstance(other, VgpuSchedulerStateInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + 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_v1 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_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + self._ptr[0].arrMode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerStateInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), VgpuSchedulerStateInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerStateInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerStateInfo_v1 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_v1 obj = VgpuSchedulerStateInfo_v1.__new__(VgpuSchedulerStateInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_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_v1_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + }) + +vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() + +cdef class VgpuSchedulerLogInfo_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerLogInfo_v1_t` + """ + cdef: + nvmlVgpuSchedulerLogInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerLogInfo_v1_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_v1 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_v1 other_ + if not isinstance(other, VgpuSchedulerLogInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def log_entries(self): + """VgpuSchedulerLogEntry: OUT: Structure to store the state and logs of a software runlist.""" + return VgpuSchedulerLogEntry.from_ptr( + &(self._ptr[0].logEntries), + 200, + readonly=self._readonly, + owner=self, + ) + + @log_entries.setter + def log_entries(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + cdef VgpuSchedulerLogEntry 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_t) * 200) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].version = val + + @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_v1 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 VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].arrMode = val + + @property + def entries_count(self): + """int: OUT: Count of log entries fetched.""" + return self._ptr[0].entriesCount + + @entries_count.setter + def entries_count(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].entriesCount = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLogInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLogInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v1_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerLogInfo_v1 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 VgpuSchedulerLogInfo_v1 obj = VgpuSchedulerLogInfo_v1.__new__(VgpuSchedulerLogInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_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_state_v1_dtype_offsets(): + 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.enableARRMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + }) + +vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() + +cdef class VgpuSchedulerState_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerState_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerState_v1_t` + """ + cdef: + nvmlVgpuSchedulerState_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerState_v1_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_v1 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_v1 other_ + if not isinstance(other, VgpuSchedulerState_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v1_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerSetParams: IN: vGPU Scheduler Parameters.""" + return VgpuSchedulerSetParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + cdef VgpuSchedulerSetParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerSetParams_t) * 1) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + self._ptr[0].version = 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_v1 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_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def enable_arr_mode(self): + """int: IN: Adaptive Round Robin scheduler.""" + return self._ptr[0].enableARRMode + + @enable_arr_mode.setter + def enable_arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + self._ptr[0].enableARRMode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerState_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v1_t), VgpuSchedulerState_v1) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerState_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v1_dtype` holding the data. + """ + 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): + """Create an VgpuSchedulerState_v1 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_v1 obj = VgpuSchedulerState_v1.__new__(VgpuSchedulerState_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_grid_licensable_features_dtype_offsets(): + 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)], + 'offsets': [ + (&(pod.isGridLicenseSupported)) - (&pod), + (&(pod.licensableFeaturesCount)) - (&pod), + (&(pod.gridLicensableFeatures)) - (&pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + }) + +grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() + +cdef class GridLicensableFeatures: + """Empty-initialize an instance of `nvmlGridLicensableFeatures_t`. + + + .. seealso:: `nvmlGridLicensableFeatures_t` + """ + cdef: + nvmlGridLicensableFeatures_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GridLicensableFeatures") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGridLicensableFeatures_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GridLicensableFeatures 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 GridLicensableFeatures other_ + if not isinstance(other, GridLicensableFeatures): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicensableFeatures_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GridLicensableFeatures") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicensableFeatures_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def grid_licensable_features(self): + """GridLicensableFeature: """ + return GridLicensableFeature.from_ptr( + &(self._ptr[0].gridLicensableFeatures), + self._ptr[0].licensableFeaturesCount, + readonly=self._readonly, + owner=self, + ) + + @grid_licensable_features.setter + def grid_licensable_features(self, val): + if self._readonly: + raise ValueError("This GridLicensableFeatures instance is read-only") + cdef GridLicensableFeature val_ = val + if len(val) > 3: + raise ValueError(f"Expected length < 3 for field grid_licensable_features, got {len(val)}") + self._ptr[0].licensableFeaturesCount = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].gridLicensableFeatures), (val_._get_ptr()), sizeof(nvmlGridLicensableFeature_t) * self._ptr[0].licensableFeaturesCount) + + @property + def is_grid_license_supported(self): + """int: """ + return self._ptr[0].isGridLicenseSupported + + @is_grid_license_supported.setter + def is_grid_license_supported(self, val): + if self._readonly: + raise ValueError("This GridLicensableFeatures instance is read-only") + self._ptr[0].isGridLicenseSupported = val + + @staticmethod + def from_buffer(buffer): + """Create an GridLicensableFeatures instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGridLicensableFeatures_t), GridLicensableFeatures) + + @staticmethod + def from_data(data): + """Create an GridLicensableFeatures instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `grid_licensable_features_dtype` holding the data. + """ + 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): + """Create an GridLicensableFeatures 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 GridLicensableFeatures obj = GridLicensableFeatures.__new__(GridLicensableFeatures) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GridLicensableFeatures") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicensableFeatures_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nv_link_info_v2_dtype_offsets(): + cdef nvmlNvLinkInfo_v2_t pod + return _numpy.dtype({ + 'names': ['version', 'is_nvle_enabled', 'firmware_info'], + 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.isNvleEnabled)) - (&pod), + (&(pod.firmwareInfo)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), + }) + +nv_link_info_v2_dtype = _get_nv_link_info_v2_dtype_offsets() + +cdef class NvLinkInfo_v2: + """Empty-initialize an instance of `nvmlNvLinkInfo_v2_t`. + + + .. seealso:: `nvmlNvLinkInfo_v2_t` + """ + cdef: + nvmlNvLinkInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvLinkInfo_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__}.NvLinkInfo_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 NvLinkInfo_v2 other_ + if not isinstance(other, NvLinkInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v2_t)) == 0) + + 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 = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def firmware_info(self): + """NvlinkFirmwareInfo: OUT - NVLINK Firmware info.""" + return NvlinkFirmwareInfo.from_ptr( + &(self._ptr[0].firmwareInfo), + readonly=self._readonly, + owner=self, + ) + + @firmware_info.setter + def firmware_info(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v2 instance is read-only") + cdef NvlinkFirmwareInfo val_ = val + _cyb_memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) + + @property + def version(self): + """int: IN - the API version number.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v2 instance is read-only") + self._ptr[0].version = val + + @property + def is_nvle_enabled(self): + """int: OUT - NVLINK encryption enablement.""" + return self._ptr[0].isNvleEnabled + + @is_nvle_enabled.setter + def is_nvle_enabled(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v2 instance is read-only") + self._ptr[0].isNvleEnabled = val + + @staticmethod + def from_buffer(buffer): + """Create an NvLinkInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v2_t), NvLinkInfo_v2) + + @staticmethod + def from_data(data): + """Create an NvLinkInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v2_dtype` holding the data. + """ + 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): + """Create an NvLinkInfo_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 NvLinkInfo_v2 obj = NvLinkInfo_v2.__new__(NvLinkInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvLinkInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cpdef init_v2(): + """Initialize NVML, but don't initialize any GPUs yet. + + .. seealso:: `nvmlInit_v2` + """ + with nogil: + __status__ = nvmlInit_v2() + check_status(__status__) + + +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``. + + Args: + flags (unsigned int): behaviour modifier flags. + + .. seealso:: `nvmlInitWithFlags` + """ + with nogil: + __status__ = nvmlInitWithFlags(flags) + check_status(__status__) + + +cpdef shutdown(): + """Shut down NVML by releasing all GPU resources previously allocated with :func:`init_v2`. + + .. seealso:: `nvmlShutdown` + """ + with nogil: + __status__ = nvmlShutdown() + check_status(__status__) + + +cpdef str error_string(int result): + """Helper method for converting NVML error codes into readable strings. + + Args: + result (Return): NVML error code to convert. + + .. seealso:: `nvmlErrorString` + """ + cdef const char *_output_cstr_ + cdef bytes _output_ + with nogil: + _output_cstr_ = nvmlErrorString(<_Return>result) + _output_ = _output_cstr_ + return _output_.decode() + + +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 + cdef char[80] version + with nogil: + __status__ = nvmlSystemGetDriverVersion(version, length) + check_status(__status__) + 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 + cdef char[80] version + with nogil: + __status__ = nvmlSystemGetNVMLVersion(version, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(version) + + +cpdef int system_get_cuda_driver_version() except *: + """Retrieves the version of the CUDA driver. + + Returns: + int: Reference in which to return the version identifier. + + .. seealso:: `nvmlSystemGetCudaDriverVersion` + """ + cdef int cuda_driver_version + with nogil: + __status__ = nvmlSystemGetCudaDriverVersion(&cuda_driver_version) + check_status(__status__) + return cuda_driver_version + + +cpdef int system_get_cuda_driver_version_v2() except 0: + """Retrieves the version of the CUDA driver from the shared library. + + Returns: + int: Reference in which to return the version identifier. + + .. seealso:: `nvmlSystemGetCudaDriverVersion_v2` + """ + cdef int cuda_driver_version + with nogil: + __status__ = nvmlSystemGetCudaDriverVersion_v2(&cuda_driver_version) + check_status(__status__) + return cuda_driver_version + + +cpdef str system_get_process_name(unsigned int pid): + """Gets name of the process with provided process id. + + 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 + cdef char[1024] name + with nogil: + __status__ = nvmlSystemGetProcessName(pid, name, length) + check_status(__status__) + 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] + with nogil: + __status__ = nvmlSystemGetHicVersion(hwbc_count, NULL) + check_status_size(__status__) + cdef HwbcEntry hwbc_entries = HwbcEntry(hwbc_count[0]) + cdef nvmlHwbcEntry_t *hwbc_entries_ptr = (hwbc_entries._get_ptr()) + if hwbc_count[0] == 0: + return hwbc_entries + with nogil: + __status__ = nvmlSystemGetHicVersion(hwbc_count, hwbc_entries_ptr) + check_status(__status__) + return hwbc_entries + + +cpdef unsigned int unit_get_count() except? 0: + """Retrieves the number of units in the system. + + Returns: + unsigned int: Reference in which to return the number of + units. + + .. seealso:: `nvmlUnitGetCount` + """ + cdef unsigned int unit_count + with nogil: + __status__ = nvmlUnitGetCount(&unit_count) + check_status(__status__) + return unit_count + + +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: + index (unsigned int): The index of the target unit, >= 0 and < + ``unitCount``. + + Returns: + intptr_t: Reference in which to return the unit handle. + + .. seealso:: `nvmlUnitGetHandleByIndex` + """ + cdef Unit unit + with nogil: + __status__ = nvmlUnitGetHandleByIndex(index, &unit) + check_status(__status__) + return unit + + +cpdef object unit_get_unit_info(intptr_t unit): + """Retrieves the static information associated with a unit. + + Args: + unit (intptr_t): The identifier of the target unit. + + Returns: + nvmlUnitInfo_t: Reference in which to return the unit + information. + + .. seealso:: `nvmlUnitGetUnitInfo` + """ + cdef UnitInfo info_py = UnitInfo() + cdef nvmlUnitInfo_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlUnitGetUnitInfo(unit, info) + check_status(__status__) + return info_py + + +cpdef object unit_get_led_state(intptr_t unit): + """Retrieves the LED state associated with this unit. + + Args: + unit (intptr_t): The identifier of the target unit. + + Returns: + nvmlLedState_t: Reference in which to return the current LED + state. + + .. seealso:: `nvmlUnitGetLedState` + """ + cdef LedState state_py = LedState() + cdef nvmlLedState_t *state = (state_py._get_ptr()) + with nogil: + __status__ = nvmlUnitGetLedState(unit, state) + check_status(__status__) + return state_py + + +cpdef object unit_get_psu_info(intptr_t unit): + """Retrieves the PSU stats for the unit. + + Args: + unit (intptr_t): The identifier of the target unit. + + Returns: + nvmlPSUInfo_t: Reference in which to return the PSU + information. + + .. seealso:: `nvmlUnitGetPsuInfo` + """ + cdef PSUInfo psu_py = PSUInfo() + cdef nvmlPSUInfo_t *psu = (psu_py._get_ptr()) + with nogil: + __status__ = nvmlUnitGetPsuInfo(unit, psu) + check_status(__status__) + return psu_py + + +cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except? 0: + """Retrieves the temperature readings for the unit, in degrees C. + + Args: + unit (intptr_t): The identifier of the target unit. + type (unsigned int): The type of reading to take. + + Returns: + unsigned int: Reference in which to return the intake + temperature. + + .. seealso:: `nvmlUnitGetTemperature` + """ + cdef unsigned int temp + with nogil: + __status__ = nvmlUnitGetTemperature(unit, type, &temp) + check_status(__status__) + return temp + + +cpdef object unit_get_fan_speed_info(intptr_t unit): + """Retrieves the fan speed readings for the unit. + + Args: + unit (intptr_t): The identifier of the target unit. + + Returns: + nvmlUnitFanSpeeds_t: Reference in which to return the fan + speed information. + + .. seealso:: `nvmlUnitGetFanSpeedInfo` + """ + cdef UnitFanSpeeds fan_speeds_py = UnitFanSpeeds() + cdef nvmlUnitFanSpeeds_t *fan_speeds = (fan_speeds_py._get_ptr()) + with nogil: + __status__ = nvmlUnitGetFanSpeedInfo(unit, fan_speeds) + check_status(__status__) + return fan_speeds_py + + +cpdef unsigned int device_get_count_v2() except? 0: + """Retrieves the number of compute devices in the system. A compute device is a single GPU. + + Returns: + unsigned int: Reference in which to return the number of + accessible devices. + + .. seealso:: `nvmlDeviceGetCount_v2` + """ + cdef unsigned int device_count + with nogil: + __status__ = nvmlDeviceGetCount_v2(&device_count) + check_status(__status__) + return device_count + + +cpdef object device_get_attributes_v2(intptr_t device): + """Get attributes (engine counts etc.) for the given NVML device handle. + + Args: + device (intptr_t): NVML device handle. + + Returns: + nvmlDeviceAttributes_t: Device attributes. + + .. seealso:: `nvmlDeviceGetAttributes_v2` + """ + cdef DeviceAttributes attributes_py = DeviceAttributes() + cdef nvmlDeviceAttributes_t *attributes = (attributes_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetAttributes_v2(device, attributes) + check_status(__status__) + return attributes_py + + +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: + index (unsigned int): The index of the target GPU, >= 0 and < + ``accessibleDevices``. + + Returns: + intptr_t: Reference in which to return the device handle. + + .. seealso:: `nvmlDeviceGetHandleByIndex_v2` + """ + cdef Device device + with nogil: + __status__ = nvmlDeviceGetHandleByIndex_v2(index, &device) + check_status(__status__) + return device + + +cpdef intptr_t device_get_handle_by_serial(serial) except? 0: + """Acquire the handle for a particular device, based on its board serial number. + + Args: + serial (str): The board serial number of the target GPU. + + Returns: + intptr_t: Reference in which to return the device handle. + + .. seealso:: `nvmlDeviceGetHandleBySerial` + """ + if not isinstance(serial, str): + raise TypeError("serial must be a Python str") + cdef bytes _temp_serial_ = (serial).encode() + cdef char* _serial_ = _temp_serial_ + cdef Device device + with nogil: + __status__ = nvmlDeviceGetHandleBySerial(_serial_, &device) + check_status(__status__) + return device + + +cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0: + """Acquire the handle for a particular device, based on its globally unique immutable UUID (in ASCII format) associated with each device. + + Args: + uuid (str): The UUID of the target GPU or MIG instance. + + Returns: + intptr_t: Reference in which to return the device handle or + MIG device handle. + + .. seealso:: `nvmlDeviceGetHandleByUUID` + """ + if not isinstance(uuid, str): + raise TypeError("uuid must be a Python str") + cdef bytes _temp_uuid_ = (uuid).encode() + cdef char* _uuid_ = _temp_uuid_ + cdef Device device + with nogil: + __status__ = nvmlDeviceGetHandleByUUID(_uuid_, &device) + check_status(__status__) + return device + + +cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0: + """Acquire the handle for a particular device, based on its PCI bus id. + + Args: + pci_bus_id (str): The PCI bus id of the target GPU Accept the + following formats (all numbers in hexadecimal): + domain:bus:device.function in format x:x:x.x + domain:bus:device in format x:x:x bus:device.function in + format x:x.x. + + Returns: + intptr_t: Reference in which to return the device handle. + + .. seealso:: `nvmlDeviceGetHandleByPciBusId_v2` + """ + if not isinstance(pci_bus_id, str): + raise TypeError("pci_bus_id must be a Python str") + cdef bytes _temp_pci_bus_id_ = (pci_bus_id).encode() + cdef char* _pci_bus_id_ = _temp_pci_bus_id_ + cdef Device device + with nogil: + __status__ = nvmlDeviceGetHandleByPciBusId_v2(_pci_bus_id_, &device) + check_status(__status__) + return device + + +cpdef str device_get_name(intptr_t device): + """Retrieves the name of this 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 + cdef char[96] name + with nogil: + __status__ = nvmlDeviceGetName(device, name, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(name) + + +cpdef int device_get_brand(intptr_t device) except? -1: + """Retrieves the brand of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the product brand type. + + .. seealso:: `nvmlDeviceGetBrand` + """ + cdef _BrandType type + with nogil: + __status__ = nvmlDeviceGetBrand(device, &type) + check_status(__status__) + return type + + +cpdef unsigned int device_get_index(intptr_t device) except? 0: + """Retrieves the NVML index of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the NVML index of + the device. + + .. seealso:: `nvmlDeviceGetIndex` + """ + cdef unsigned int index + with nogil: + __status__ = nvmlDeviceGetIndex(device, &index) + check_status(__status__) + return index + + +cpdef str device_get_serial(intptr_t device): + """Retrieves the globally unique board serial number associated with this device's board. + + 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 + cdef char[30] serial + with nogil: + __status__ = nvmlDeviceGetSerial(device, serial, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(serial) + + +cpdef unsigned int device_get_module_id(intptr_t device) except? 0: + """Get a unique identifier for the device module on the baseboard. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Unique identifier for the GPU module. + + .. seealso:: `nvmlDeviceGetModuleId` + """ + cdef unsigned int module_id + with nogil: + __status__ = nvmlDeviceGetModuleId(device, &module_id) + check_status(__status__) + return module_id + + +cpdef object device_get_c2c_mode_info_v(intptr_t device): + """Retrieves the Device's C2C Mode information. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlC2cModeInfo_v1_t: Output struct containing the device's + C2C Mode info. + + .. seealso:: `nvmlDeviceGetC2cModeInfoV` + """ + cdef C2cModeInfo_v1 c2c_mode_info_py = C2cModeInfo_v1() + cdef nvmlC2cModeInfo_v1_t *c2c_mode_info = (c2c_mode_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetC2cModeInfoV(device, c2c_mode_info) + check_status(__status__) + return c2c_mode_info_py + + +cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_size, unsigned int scope): + """Retrieves an array of unsigned ints (sized to node_set_size) of bitmasks with the ideal memory affinity within node or socket for the device. For example, if NUMA node 0, 1 are ideal within the socket for the device and node_set_size == 1, result[0] = 0x3. + + Args: + device (intptr_t): The identifier of the target device. + 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 _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) + check_status(__status__) + return node_set + + +cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int cpu_set_size, unsigned int scope): + """Retrieves an array of unsigned ints (sized to cpu_set_size) of bitmasks with the ideal CPU affinity within node or socket for the device. For example, if processors 0, 1, 32, and 33 are ideal for the device and cpu_set_size == 2, result[0] = 0x3, result[1] = 0x3. + + Args: + device (intptr_t): The identifier of the target device. + 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 _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) + check_status(__status__) + return cpu_set + + +cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size): + """Retrieves an array of unsigned ints (sized to cpu_set_size) of bitmasks with the ideal CPU affinity for the device For example, if processors 0, 1, 32, and 33 are ideal for the device and cpu_set_size == 2, result[0] = 0x3, result[1] = 0x3 This is equivalent to calling ``nvmlDeviceGetCpuAffinityWithinScope`` with ``NVML_AFFINITY_SCOPE_NODE``. + + Args: + device (intptr_t): The identifier of the target device. + 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 _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) + check_status(__status__) + return cpu_set + + +cpdef device_set_cpu_affinity(intptr_t device): + """Sets the ideal affinity for the calling thread and device using the guidelines given in :func:`device_get_cpu_affinity`. Note, this is a change as of version 8.0. Older versions set the affinity for a calling process and all children. Currently supports up to 1024 processors. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceSetCpuAffinity` + """ + with nogil: + __status__ = nvmlDeviceSetCpuAffinity(device) + check_status(__status__) + + +cpdef device_clear_cpu_affinity(intptr_t device): + """Clear all affinity bindings for the calling thread. Note, this is a change as of version 8.0 as older versions cleared the affinity for a calling process and all children. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceClearCpuAffinity` + """ + with nogil: + __status__ = nvmlDeviceClearCpuAffinity(device) + check_status(__status__) + + +cpdef unsigned int device_get_numa_node_id(intptr_t device) except? 0: + """Get the NUMA node of the given GPU device. This only applies to platforms where the GPUs are NUMA nodes. + + Args: + device (intptr_t): The device handle. + + Returns: + unsigned int: NUMA node ID of the device. + + .. seealso:: `nvmlDeviceGetNumaNodeId` + """ + cdef unsigned int node + with nogil: + __status__ = nvmlDeviceGetNumaNodeId(device, &node) + check_status(__status__) + return node + + +cpdef int device_get_topology_common_ancestor(intptr_t device1, intptr_t device2) except? -1: + """Retrieve the common ancestor for two devices For all products. Supported on Linux only. + + Args: + device1 (intptr_t): The identifier of the first device. + device2 (intptr_t): The identifier of the second device. + + Returns: + int: A ``nvmlGpuTopologyLevel_t`` that gives the path type. + + .. seealso:: `nvmlDeviceGetTopologyCommonAncestor` + """ + cdef _GpuTopologyLevel path_info + with nogil: + __status__ = nvmlDeviceGetTopologyCommonAncestor(device1, device2, &path_info) + check_status(__status__) + return path_info + + +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_index (GpuP2PCapsIndex): p2p Capability Index being looked + for between ``device1`` and ``device2``. + + Returns: + 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_index, &p2p_status) + check_status(__status__) + return p2p_status + + +cpdef str device_get_uuid(intptr_t device): + """Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string, that augments the immutable, board serial identifier. + + 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 + cdef char[96] uuid + with nogil: + __status__ = nvmlDeviceGetUUID(device, uuid, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(uuid) + + +cpdef unsigned int device_get_minor_number(intptr_t device) except? 0: + """Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for each GPU will have the form /dev/nvidia[minor number]. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the minor number + for the device. + + .. seealso:: `nvmlDeviceGetMinorNumber` + """ + cdef unsigned int minor_number + with nogil: + __status__ = nvmlDeviceGetMinorNumber(device, &minor_number) + check_status(__status__) + return minor_number + + +cpdef str device_get_board_part_number(intptr_t device): + """Retrieves the the device board part number which is programmed into the board's InfoROM. + + Args: + device (intptr_t): Identifier of the target device. + + Returns: + char: Reference to the buffer to return. + + .. seealso:: `nvmlDeviceGetBoardPartNumber` + """ + cdef unsigned int length = 80 + cdef char[80] part_number + with nogil: + __status__ = nvmlDeviceGetBoardPartNumber(device, part_number, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(part_number) + + +cpdef str device_get_inforom_version(intptr_t device, int object): + """Retrieves the version information for the device's infoROM object. + + Args: + 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 + cdef char[16] version + with nogil: + __status__ = nvmlDeviceGetInforomVersion(device, <_InforomObject>object, version, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(version) + + +cpdef str device_get_inforom_image_version(intptr_t device): + """Retrieves the global infoROM image version. + + 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 + cdef char[16] version + with nogil: + __status__ = nvmlDeviceGetInforomImageVersion(device, version, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(version) + + +cpdef unsigned int device_get_inforom_configuration_checksum(intptr_t device) except? 0: + """Retrieves the checksum of the configuration stored in the device's infoROM. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the infoROM + configuration checksum. + + .. seealso:: `nvmlDeviceGetInforomConfigurationChecksum` + """ + cdef unsigned int checksum + with nogil: + __status__ = nvmlDeviceGetInforomConfigurationChecksum(device, &checksum) + check_status(__status__) + return checksum + + +cpdef device_validate_inforom(intptr_t device): + """Reads the infoROM from the flash and verifies the checksums. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceValidateInforom` + """ + with nogil: + __status__ = nvmlDeviceValidateInforom(device) + check_status(__status__) + + +cpdef tuple device_get_last_bbx_flush_time(intptr_t device): + """Retrieves the timestamp and the duration of the last flush of the BBX (blackbox) infoROM object during the current run. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned long long: The start timestamp of the last BBX Flush. + - unsigned long: The duration (us) of the last BBX Flush. + + .. seealso:: `nvmlDeviceGetLastBBXFlushTime` + """ + cdef unsigned long long timestamp + cdef unsigned long duration_us + with nogil: + __status__ = nvmlDeviceGetLastBBXFlushTime(device, ×tamp, &duration_us) + check_status(__status__) + return (timestamp, duration_us) + + +cpdef int device_get_display_mode(intptr_t device) except? -1: + """Retrieves the display mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the display mode. + + .. seealso:: `nvmlDeviceGetDisplayMode` + """ + cdef _EnableState display + with nogil: + __status__ = nvmlDeviceGetDisplayMode(device, &display) + check_status(__status__) + return display + + +cpdef int device_get_display_active(intptr_t device) except? -1: + """Retrieves the display active state for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the display active state. + + .. seealso:: `nvmlDeviceGetDisplayActive` + """ + cdef _EnableState is_active + with nogil: + __status__ = nvmlDeviceGetDisplayActive(device, &is_active) + check_status(__status__) + return is_active + + +cpdef int device_get_persistence_mode(intptr_t device) except? -1: + """Retrieves the persistence mode associated with this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the current driver + persistence mode. + + .. seealso:: `nvmlDeviceGetPersistenceMode` + """ + cdef _EnableState mode + with nogil: + __status__ = nvmlDeviceGetPersistenceMode(device, &mode) + check_status(__status__) + return mode + + +cpdef object device_get_pci_info_ext(intptr_t device): + """Retrieves PCI attributes of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlPciInfoExt_v1_t: Reference in which to return the PCI + info. + + .. seealso:: `nvmlDeviceGetPciInfoExt` + """ + cdef PciInfoExt_v1 pci_py = PciInfoExt_v1() + cdef nvmlPciInfoExt_t *pci = (pci_py._get_ptr()) + pci.version = NVML_VERSION_STRUCT(sizeof(nvmlPciInfoExt_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetPciInfoExt(device, pci) + check_status(__status__) + return pci_py + + +cpdef object device_get_pci_info_v3(intptr_t device): + """Retrieves the PCI attributes of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlPciInfo_t: Reference in which to return the PCI info. + + .. seealso:: `nvmlDeviceGetPciInfo_v3` + """ + cdef PciInfo pci_py = PciInfo() + cdef nvmlPciInfo_t *pci = (pci_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetPciInfo_v3(device, pci) + check_status(__status__) + return pci_py + + +cpdef unsigned int device_get_max_pcie_link_generation(intptr_t device) except? 0: + """Retrieves the maximum PCIe link generation possible with this device and system. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the max PCIe link + generation. + + .. seealso:: `nvmlDeviceGetMaxPcieLinkGeneration` + """ + cdef unsigned int max_link_gen + with nogil: + __status__ = nvmlDeviceGetMaxPcieLinkGeneration(device, &max_link_gen) + check_status(__status__) + return max_link_gen + + +cpdef unsigned int device_get_gpu_max_pcie_link_generation(intptr_t device) except? 0: + """Retrieves the maximum PCIe link generation supported by this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the max PCIe link + generation. + + .. seealso:: `nvmlDeviceGetGpuMaxPcieLinkGeneration` + """ + cdef unsigned int max_link_gen_device + with nogil: + __status__ = nvmlDeviceGetGpuMaxPcieLinkGeneration(device, &max_link_gen_device) + check_status(__status__) + return max_link_gen_device + + +cpdef unsigned int device_get_max_pcie_link_width(intptr_t device) except? 0: + """Retrieves the maximum PCIe link width possible with this device and system. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the max PCIe link + generation. + + .. seealso:: `nvmlDeviceGetMaxPcieLinkWidth` + """ + cdef unsigned int max_link_width + with nogil: + __status__ = nvmlDeviceGetMaxPcieLinkWidth(device, &max_link_width) + check_status(__status__) + return max_link_width + + +cpdef unsigned int device_get_curr_pcie_link_generation(intptr_t device) except? 0: + """Retrieves the current PCIe link generation. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the current PCIe + link generation. + + .. seealso:: `nvmlDeviceGetCurrPcieLinkGeneration` + """ + cdef unsigned int curr_link_gen + with nogil: + __status__ = nvmlDeviceGetCurrPcieLinkGeneration(device, &curr_link_gen) + check_status(__status__) + return curr_link_gen + + +cpdef unsigned int device_get_curr_pcie_link_width(intptr_t device) except? 0: + """Retrieves the current PCIe link width. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the current PCIe + link generation. + + .. seealso:: `nvmlDeviceGetCurrPcieLinkWidth` + """ + cdef unsigned int curr_link_width + with nogil: + __status__ = nvmlDeviceGetCurrPcieLinkWidth(device, &curr_link_width) + check_status(__status__) + return curr_link_width + + +cpdef unsigned int device_get_pcie_throughput(intptr_t device, int counter) except? 0: + """Retrieve PCIe utilization information. This function is querying a byte counter over a 20ms interval and thus is the PCIe throughput over that interval. + + Args: + device (intptr_t): The identifier of the target device. + counter (PcieUtilCounter): The specific counter that should be + queried ``nvmlPcieUtilCounter_t``. + + Returns: + unsigned int: Reference in which to return throughput in KB/s. + + .. seealso:: `nvmlDeviceGetPcieThroughput` + """ + cdef unsigned int value + with nogil: + __status__ = nvmlDeviceGetPcieThroughput(device, <_PcieUtilCounter>counter, &value) + check_status(__status__) + return value + + +cpdef unsigned int device_get_pcie_replay_counter(intptr_t device) except? 0: + """Retrieve the PCIe replay counter. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the counter's + value. + + .. seealso:: `nvmlDeviceGetPcieReplayCounter` + """ + cdef unsigned int value + with nogil: + __status__ = nvmlDeviceGetPcieReplayCounter(device, &value) + check_status(__status__) + return value + + +cpdef unsigned int device_get_clock_info(intptr_t device, int type) except? 0: + """Retrieves the current clock speeds for the device. + + Args: + device (intptr_t): The identifier of the target device. + type (ClockType): Identify which clock domain to query. + + Returns: + unsigned int: Reference in which to return the clock speed in + MHz. + + .. seealso:: `nvmlDeviceGetClockInfo` + """ + cdef unsigned int clock + with nogil: + __status__ = nvmlDeviceGetClockInfo(device, <_ClockType>type, &clock) + check_status(__status__) + return clock + + +cpdef unsigned int device_get_max_clock_info(intptr_t device, int type) except? 0: + """Retrieves the maximum clock speeds for the device. + + Args: + device (intptr_t): The identifier of the target device. + type (ClockType): Identify which clock domain to query. + + Returns: + unsigned int: Reference in which to return the clock speed in + MHz. + + .. seealso:: `nvmlDeviceGetMaxClockInfo` + """ + cdef unsigned int clock + with nogil: + __status__ = nvmlDeviceGetMaxClockInfo(device, <_ClockType>type, &clock) + check_status(__status__) + return clock + + +cpdef int device_get_gpc_clk_vf_offset(intptr_t device) except? 0: + """Retrieve the GPCCLK VF offset value. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: The retrieved GPCCLK VF offset value. + + .. seealso:: `nvmlDeviceGetGpcClkVfOffset` + """ + cdef int offset + with nogil: + __status__ = nvmlDeviceGetGpcClkVfOffset(device, &offset) + check_status(__status__) + return offset + + +cpdef unsigned int device_get_clock(intptr_t device, int clock_type, int clock_id) except? 0: + """Retrieves the clock speed for the clock specified by the clock type and clock ID. + + Args: + device (intptr_t): The identifier of the target device. + clock_type (ClockType): Identify which clock domain to query. + clock_id (ClockId): Identify which clock in the domain to + query. + + Returns: + unsigned int: Reference in which to return the clock in MHz. + + .. seealso:: `nvmlDeviceGetClock` + """ + cdef unsigned int clock_m_hz + with nogil: + __status__ = nvmlDeviceGetClock(device, <_ClockType>clock_type, <_ClockId>clock_id, &clock_m_hz) + check_status(__status__) + return clock_m_hz + + +cpdef unsigned int device_get_max_customer_boost_clock(intptr_t device, int clock_type) except? 0: + """Retrieves the customer defined maximum boost clock speed specified by the given clock type. + + Args: + device (intptr_t): The identifier of the target device. + clock_type (ClockType): Identify which clock domain to query. + + Returns: + unsigned int: Reference in which to return the clock in MHz. + + .. seealso:: `nvmlDeviceGetMaxCustomerBoostClock` + """ + cdef unsigned int clock_m_hz + with nogil: + __status__ = nvmlDeviceGetMaxCustomerBoostClock(device, <_ClockType>clock_type, &clock_m_hz) + check_status(__status__) + return clock_m_hz + + +cpdef object device_get_supported_memory_clocks(intptr_t device): + """Retrieves the list of possible memory clocks that can be used as an argument for ``nvmlDeviceSetMemoryLockedClocks``. + + 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] + with nogil: + __status__ = nvmlDeviceGetSupportedMemoryClocks(device, count, NULL) + check_status_size(__status__) + if count[0] == 0: + 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) + check_status(__status__) + return clocks_m_hz + + +cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int memory_clock_m_hz): + """Retrieves the list of possible graphics clocks that can be used as an argument for ``nvmlDeviceSetGpuLockedClocks``. + + Args: + 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] + with nogil: + __status__ = nvmlDeviceGetSupportedGraphicsClocks(device, memory_clock_m_hz, count, NULL) + check_status_size(__status__) + if count[0] == 0: + 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) + check_status(__status__) + return clocks_m_hz + + +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 ``is_enabled``. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: Where to store the current state of Auto Boosted clocks + of the target device. + - int: Where to store the default Auto Boosted clocks behavior + of the target device that the device will revert to when + no applications are using the GPU. + + .. seealso:: `nvmlDeviceGetAutoBoostedClocksEnabled` + """ + cdef _EnableState is_enabled + cdef _EnableState default_is_enabled + with nogil: + __status__ = nvmlDeviceGetAutoBoostedClocksEnabled(device, &is_enabled, &default_is_enabled) + check_status(__status__) + return (is_enabled, default_is_enabled) + + +cpdef unsigned int device_get_fan_speed(intptr_t device) except? 0: + """Retrieves the intended operating speed of the device's fan. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the fan speed + percentage. + + .. seealso:: `nvmlDeviceGetFanSpeed` + """ + cdef unsigned int speed + with nogil: + __status__ = nvmlDeviceGetFanSpeed(device, &speed) + check_status(__status__) + return speed + + +cpdef unsigned int device_get_fan_speed_v2(intptr_t device, unsigned int fan) except? 0: + """Retrieves the intended operating speed of the device's specified fan. + + Args: + device (intptr_t): The identifier of the target device. + fan (unsigned int): The index of the target fan, zero indexed. + + Returns: + unsigned int: Reference in which to return the fan speed + percentage. + + .. seealso:: `nvmlDeviceGetFanSpeed_v2` + """ + cdef unsigned int speed + with nogil: + __status__ = nvmlDeviceGetFanSpeed_v2(device, fan, &speed) + check_status(__status__) + return speed + + +cpdef unsigned int device_get_target_fan_speed(intptr_t device, unsigned int fan) except? 0: + """Retrieves the intended target speed of the device's specified fan. + + Args: + device (intptr_t): The identifier of the target device. + fan (unsigned int): The index of the target fan, zero indexed. + + Returns: + unsigned int: Reference in which to return the fan speed + percentage. + + .. seealso:: `nvmlDeviceGetTargetFanSpeed` + """ + cdef unsigned int target_speed + with nogil: + __status__ = nvmlDeviceGetTargetFanSpeed(device, fan, &target_speed) + check_status(__status__) + return target_speed + + +cpdef tuple device_get_min_max_fan_speed(intptr_t device): + """Retrieves the min and max fan speed that user can set for the GPU fan. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: The minimum speed allowed to set. + - unsigned int: The maximum speed allowed to set. + + .. seealso:: `nvmlDeviceGetMinMaxFanSpeed` + """ + cdef unsigned int min_speed + cdef unsigned int max_speed + with nogil: + __status__ = nvmlDeviceGetMinMaxFanSpeed(device, &min_speed, &max_speed) + check_status(__status__) + return (min_speed, max_speed) + + +cpdef unsigned int device_get_fan_control_policy_v2(intptr_t device, unsigned int fan) except *: + """Gets current fan control policy. + + Args: + device (intptr_t): The identifier of the target ``device``. + fan (unsigned int): The index of the target fan, zero indexed. + + Returns: + unsigned int: Reference in which to return the fan control + ``policy``. + + .. seealso:: `nvmlDeviceGetFanControlPolicy_v2` + """ + cdef nvmlFanControlPolicy_t policy + with nogil: + __status__ = nvmlDeviceGetFanControlPolicy_v2(device, fan, &policy) + check_status(__status__) + return policy + + +cpdef unsigned int device_get_num_fans(intptr_t device) except? 0: + """Retrieves the number of fans on the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The number of fans. + + .. seealso:: `nvmlDeviceGetNumFans` + """ + cdef unsigned int num_fans + with nogil: + __status__ = nvmlDeviceGetNumFans(device, &num_fans) + check_status(__status__) + return num_fans + + +cpdef object device_get_cooler_info(intptr_t device): + """Retrieves the cooler's information. Returns a cooler's control signal characteristics. The possible types are restricted, Variable and Toggle. See ``nvmlCoolerControl_t`` for details on available signal types. Returns objects that cooler cools. Targets may be GPU, Memory, Power Supply or All of these. See ``nvmlCoolerTarget_t`` for details on available targets. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlCoolerInfo_v1_t: Structure specifying the cooler's control + signal characteristics (out) and the target that cooler + cools (out). + + .. seealso:: `nvmlDeviceGetCoolerInfo` + """ + cdef CoolerInfo_v1 cooler_info_py = CoolerInfo_v1() + cdef nvmlCoolerInfo_t *cooler_info = (cooler_info_py._get_ptr()) + cooler_info.version = NVML_VERSION_STRUCT(sizeof(nvmlCoolerInfo_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetCoolerInfo(device, cooler_info) + check_status(__status__) + return cooler_info_py + + +cpdef unsigned int device_get_temperature_threshold(intptr_t device, int threshold_type) except? 0: + """Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C. + + Args: + device (intptr_t): The identifier of the target device. + threshold_type (TemperatureThresholds): The type of threshold + value queried. + + Returns: + unsigned int: Reference in which to return the temperature + reading. + + .. seealso:: `nvmlDeviceGetTemperatureThreshold` + """ + cdef unsigned int temp + with nogil: + __status__ = nvmlDeviceGetTemperatureThreshold(device, <_TemperatureThresholds>threshold_type, &temp) + check_status(__status__) + return temp + + +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_index (unsigned int): The index of the thermal sensor. + + Returns: + nvmlGpuThermalSettings_t: Reference in which to return the + thermal sensor information. + + .. seealso:: `nvmlDeviceGetThermalSettings` + """ + 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_index, p_thermal_settings) + check_status(__status__) + return p_thermal_settings_py + + +cpdef int device_get_performance_state(intptr_t device) except? -1: + """Retrieves the current performance state for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the performance state + reading. + + .. seealso:: `nvmlDeviceGetPerformanceState` + """ + cdef _Pstates p_state + with nogil: + __status__ = nvmlDeviceGetPerformanceState(device, &p_state) + check_status(__status__) + return p_state + + +cpdef unsigned long long device_get_current_clocks_event_reasons(intptr_t device) except? 0: + """Retrieves current clocks event reasons. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned long long: Reference in which to return bitmask of + active clocks event reasons. + + .. seealso:: `nvmlDeviceGetCurrentClocksEventReasons` + """ + cdef unsigned long long clocks_event_reasons + with nogil: + __status__ = nvmlDeviceGetCurrentClocksEventReasons(device, &clocks_event_reasons) + check_status(__status__) + return clocks_event_reasons + + +cpdef unsigned long long device_get_supported_clocks_event_reasons(intptr_t device) except? 0: + """Retrieves bitmask of supported clocks event reasons that can be returned by ``nvmlDeviceGetCurrentClocksEventReasons``. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned long long: Reference in which to return bitmask of + supported clocks event reasons. + + .. seealso:: `nvmlDeviceGetSupportedClocksEventReasons` + """ + cdef unsigned long long supported_clocks_event_reasons + with nogil: + __status__ = nvmlDeviceGetSupportedClocksEventReasons(device, &supported_clocks_event_reasons) + check_status(__status__) + return supported_clocks_event_reasons + + +cpdef int device_get_power_state(intptr_t device) except? -1: + """Deprecated: Use ``nvmlDeviceGetPerformanceState``. This function exposes an incorrect generalization. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the performance state + reading. + + .. seealso:: `nvmlDeviceGetPowerState` + """ + cdef _Pstates p_state + with nogil: + __status__ = nvmlDeviceGetPowerState(device, &p_state) + check_status(__status__) + return p_state + + +cpdef object device_get_dynamic_pstates_info(intptr_t device): + """Retrieve performance monitor samples from the associated subdevice. + + Args: + device (intptr_t): . + + Returns: + nvmlGpuDynamicPstatesInfo_t: . + + .. seealso:: `nvmlDeviceGetDynamicPstatesInfo` + """ + cdef GpuDynamicPstatesInfo p_dynamic_pstates_info_py = GpuDynamicPstatesInfo() + cdef nvmlGpuDynamicPstatesInfo_t *p_dynamic_pstates_info = (p_dynamic_pstates_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetDynamicPstatesInfo(device, p_dynamic_pstates_info) + check_status(__status__) + return p_dynamic_pstates_info_py + + +cpdef int device_get_mem_clk_vf_offset(intptr_t device) except? 0: + """Retrieve the MemClk (Memory Clock) VF offset value. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: The retrieved MemClk VF offset value. + + .. seealso:: `nvmlDeviceGetMemClkVfOffset` + """ + cdef int offset + with nogil: + __status__ = nvmlDeviceGetMemClkVfOffset(device, &offset) + check_status(__status__) + return offset + + +cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int pstate): + """Retrieve min and max clocks of some clock domain for a given PState. + + Args: + device (intptr_t): The identifier of the target device. + type (ClockType): Clock domain. + pstate (Pstates): PState to query. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference in which to return min clock + frequency. + - unsigned int: Reference in which to return max clock + frequency. + + .. seealso:: `nvmlDeviceGetMinMaxClockOfPState` + """ + cdef unsigned int min_clock_m_hz + cdef unsigned int max_clock_m_hz + with nogil: + __status__ = nvmlDeviceGetMinMaxClockOfPState(device, <_ClockType>type, <_Pstates>pstate, &min_clock_m_hz, &max_clock_m_hz) + check_status(__status__) + return (min_clock_m_hz, max_clock_m_hz) + + +cpdef tuple device_get_gpc_clk_min_max_vf_offset(intptr_t device): + """Retrieve the GPCCLK min max VF offset value. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: The retrieved GPCCLK VF min offset value. + - int: The retrieved GPCCLK VF max offset value. + + .. seealso:: `nvmlDeviceGetGpcClkMinMaxVfOffset` + """ + cdef int min_offset + cdef int max_offset + with nogil: + __status__ = nvmlDeviceGetGpcClkMinMaxVfOffset(device, &min_offset, &max_offset) + check_status(__status__) + return (min_offset, max_offset) + + +cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device): + """Retrieve the MemClk (Memory Clock) min max VF offset value. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: The retrieved MemClk VF min offset value. + - int: The retrieved MemClk VF max offset value. + + .. seealso:: `nvmlDeviceGetMemClkMinMaxVfOffset` + """ + cdef int min_offset + cdef int max_offset + with nogil: + __status__ = nvmlDeviceGetMemClkMinMaxVfOffset(device, &min_offset, &max_offset) + check_status(__status__) + return (min_offset, max_offset) + + +cpdef device_set_clock_offsets(intptr_t device, intptr_t info): + """Control current clock offset of some clock domain for a given PState. + + Args: + device (intptr_t): The identifier of the target device. + info (intptr_t): Structure specifying the clock type (input), + the pstate (input) and clock offset value (input). + + .. seealso:: `nvmlDeviceSetClockOffsets` + """ + with nogil: + __status__ = nvmlDeviceSetClockOffsets(device, info) + check_status(__status__) + + +cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0: + """Retrieves the power management limit associated with this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the power + management limit in milliwatts. + + .. seealso:: `nvmlDeviceGetPowerManagementLimit` + """ + cdef unsigned int limit + with nogil: + __status__ = nvmlDeviceGetPowerManagementLimit(device, &limit) + check_status(__status__) + return limit + + +cpdef tuple device_get_power_management_limit_constraints(intptr_t device): + """Retrieves information about possible values of power management limits on this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference in which to return the minimum power + management limit in milliwatts. + - unsigned int: Reference in which to return the maximum power + management limit in milliwatts. + + .. seealso:: `nvmlDeviceGetPowerManagementLimitConstraints` + """ + cdef unsigned int min_limit + cdef unsigned int max_limit + with nogil: + __status__ = nvmlDeviceGetPowerManagementLimitConstraints(device, &min_limit, &max_limit) + check_status(__status__) + return (min_limit, max_limit) + + +cpdef unsigned int device_get_power_management_default_limit(intptr_t device) except? 0: + """Retrieves default power management limit on this device, in milliwatts. Default power management limit is a power management limit that the device boots with. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the default power + management limit in milliwatts. + + .. seealso:: `nvmlDeviceGetPowerManagementDefaultLimit` + """ + cdef unsigned int default_limit + with nogil: + __status__ = nvmlDeviceGetPowerManagementDefaultLimit(device, &default_limit) + check_status(__status__) + return default_limit + + +cpdef unsigned int device_get_power_usage(intptr_t device) except? 0: + """Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return the power usage + information. + + .. seealso:: `nvmlDeviceGetPowerUsage` + """ + cdef unsigned int power + with nogil: + __status__ = nvmlDeviceGetPowerUsage(device, &power) + check_status(__status__) + return power + + +cpdef unsigned long long device_get_total_energy_consumption(intptr_t device) except? 0: + """Retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was last reloaded. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned long long: Reference in which to return the energy + consumption information. + + .. seealso:: `nvmlDeviceGetTotalEnergyConsumption` + """ + cdef unsigned long long energy + with nogil: + __status__ = nvmlDeviceGetTotalEnergyConsumption(device, &energy) + check_status(__status__) + return energy + + +cpdef unsigned int device_get_enforced_power_limit(intptr_t device) except? 0: + """Get the effective power limit that the driver enforces after taking into account all limiters. + + Args: + device (intptr_t): The device to communicate with. + + Returns: + unsigned int: Reference in which to return the power + management limit in milliwatts. + + .. seealso:: `nvmlDeviceGetEnforcedPowerLimit` + """ + cdef unsigned int limit + with nogil: + __status__ = nvmlDeviceGetEnforcedPowerLimit(device, &limit) + check_status(__status__) + return limit + + +cpdef tuple device_get_gpu_operation_mode(intptr_t device): + """Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: Reference in which to return the current GOM. + - int: Reference in which to return the pending GOM. + + .. seealso:: `nvmlDeviceGetGpuOperationMode` + """ + cdef _GpuOperationMode current + cdef _GpuOperationMode pending + with nogil: + __status__ = nvmlDeviceGetGpuOperationMode(device, ¤t, &pending) + check_status(__status__) + return (current, pending) + + +cpdef object device_get_memory_info_v2(intptr_t device): + """Retrieves the amount of used, free, reserved and total memory available on the device, in bytes. nvmlDeviceGetMemoryInfo_v2 accounts separately for reserved memory and includes it in the used memory amount. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlMemory_v2_t: Reference in which to return the memory + information. + + .. seealso:: `nvmlDeviceGetMemoryInfo_v2` + """ + cdef Memory_v2 memory_py = Memory_v2() + cdef nvmlMemory_v2_t *memory = (memory_py._get_ptr()) + memory.version = NVML_VERSION_STRUCT(sizeof(nvmlMemory_v2_t), 2) + with nogil: + __status__ = nvmlDeviceGetMemoryInfo_v2(device, memory) + check_status(__status__) + return memory_py + + +cpdef int device_get_compute_mode(intptr_t device) except? -1: + """Retrieves the current compute mode for the device or MIG device. + + Args: + 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. + + .. seealso:: `nvmlDeviceGetComputeMode` + """ + cdef _ComputeMode mode + with nogil: + __status__ = nvmlDeviceGetComputeMode(device, &mode) + check_status(__status__) + return mode + + +cpdef tuple device_get_cuda_compute_capability(intptr_t device): + """Retrieves the CUDA compute capability of the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: Reference in which to return the major CUDA compute + capability. + - int: Reference in which to return the minor CUDA compute + capability. + + .. seealso:: `nvmlDeviceGetCudaComputeCapability` + """ + cdef int major + cdef int minor + with nogil: + __status__ = nvmlDeviceGetCudaComputeCapability(device, &major, &minor) + check_status(__status__) + return (major, minor) + + +cpdef tuple device_get_ecc_mode(intptr_t device): + """Retrieves the current and pending ECC modes for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: Reference in which to return the current ECC mode. + - int: Reference in which to return the pending ECC mode. + + .. seealso:: `nvmlDeviceGetEccMode` + """ + cdef _EnableState current + cdef _EnableState pending + with nogil: + __status__ = nvmlDeviceGetEccMode(device, ¤t, &pending) + check_status(__status__) + return (current, pending) + + +cpdef int device_get_default_ecc_mode(intptr_t device) except? -1: + """Retrieves the default ECC modes for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the default ECC mode. + + .. seealso:: `nvmlDeviceGetDefaultEccMode` + """ + cdef _EnableState default_mode + with nogil: + __status__ = nvmlDeviceGetDefaultEccMode(device, &default_mode) + check_status(__status__) + return default_mode + + +cpdef unsigned int device_get_board_id(intptr_t device) except? 0: + """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. + + Returns: + unsigned int: Reference in which to return the device's board + ID. + + .. seealso:: `nvmlDeviceGetBoardId` + """ + cdef unsigned int board_id + with nogil: + __status__ = nvmlDeviceGetBoardId(device, &board_id) + check_status(__status__) + return board_id + + +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 ``multi_gpu_bool`` to a non-zero value. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to return a zero or non-zero + value to indicate whether the device is on a multi GPU + board. + + .. seealso:: `nvmlDeviceGetMultiGpuBoard` + """ + cdef unsigned int multi_gpu_bool + with nogil: + __status__ = nvmlDeviceGetMultiGpuBoard(device, &multi_gpu_bool) + check_status(__status__) + return multi_gpu_bool + + +cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_type, int counter_type) except? 0: + """Retrieves the total ECC error counts for the device. + + Args: + device (intptr_t): The identifier of the target device. + error_type (MemoryErrorType): Flag that specifies the type of + the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. + + Returns: + unsigned long long: Reference in which to return the specified + ECC errors. + + .. seealso:: `nvmlDeviceGetTotalEccErrors` + """ + cdef unsigned long long ecc_counts + with nogil: + __status__ = nvmlDeviceGetTotalEccErrors(device, <_MemoryErrorType>error_type, <_EccCounterType>counter_type, &ecc_counts) + check_status(__status__) + return ecc_counts + + +cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int error_type, int counter_type, int location_type) except? 0: + """Retrieves the requested memory error counter for the device. + + Args: + device (intptr_t): The identifier of the target device. + error_type (MemoryErrorType): Flag that specifies the type of + error. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. + location_type (MemoryLocation): Specifies the location of the + counter. + + Returns: + unsigned long long: Reference in which to return the ECC + counter. + + .. seealso:: `nvmlDeviceGetMemoryErrorCounter` + """ + cdef unsigned long long count + with nogil: + __status__ = nvmlDeviceGetMemoryErrorCounter(device, <_MemoryErrorType>error_type, <_EccCounterType>counter_type, <_MemoryLocation>location_type, &count) + check_status(__status__) + return count + + +cpdef object device_get_utilization_rates(intptr_t device): + """Retrieves the current utilization rates for the device's major subsystems. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlUtilization_t: Reference in which to return the + utilization information. + + .. seealso:: `nvmlDeviceGetUtilizationRates` + """ + cdef Utilization utilization_py = Utilization() + cdef nvmlUtilization_t *utilization = (utilization_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetUtilizationRates(device, utilization) + check_status(__status__) + return utilization_py + + +cpdef tuple device_get_encoder_utilization(intptr_t device): + """Retrieves the current utilization and sampling size in microseconds for the Encoder. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference to an unsigned int for encoder + utilization info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. + + .. seealso:: `nvmlDeviceGetEncoderUtilization` + """ + cdef unsigned int utilization + cdef unsigned int sampling_period_us + with nogil: + __status__ = nvmlDeviceGetEncoderUtilization(device, &utilization, &sampling_period_us) + check_status(__status__) + return (utilization, sampling_period_us) + + +cpdef unsigned int device_get_encoder_capacity(intptr_t device, int encoder_query_type) except? 0: + """Retrieves the current capacity of the device's encoder, as a percentage of maximum encoder capacity with valid values in the range 0-100. + + Args: + device (intptr_t): The identifier of the target device. + encoder_query_type (EncoderType): Type of encoder to query. + + Returns: + unsigned int: Reference to an unsigned int for the encoder + capacity. + + .. seealso:: `nvmlDeviceGetEncoderCapacity` + """ + cdef unsigned int encoder_capacity + with nogil: + __status__ = nvmlDeviceGetEncoderCapacity(device, <_EncoderType>encoder_query_type, &encoder_capacity) + check_status(__status__) + return encoder_capacity + + +cpdef tuple device_get_encoder_stats(intptr_t device): + """Retrieves the current encoder statistics for a given device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 3-tuple containing: + + - unsigned int: Reference to an unsigned int for count of active + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing + average FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency + in microseconds. + + .. seealso:: `nvmlDeviceGetEncoderStats` + """ + cdef unsigned int session_count + cdef unsigned int average_fps + cdef unsigned int average_latency + with nogil: + __status__ = nvmlDeviceGetEncoderStats(device, &session_count, &average_fps, &average_latency) + check_status(__status__) + return (session_count, average_fps, average_latency) + + +cpdef object device_get_encoder_sessions(intptr_t device): + """Retrieves information about active encoder sessions on a target 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] + with nogil: + __status__ = nvmlDeviceGetEncoderSessions(device, session_count, NULL) + check_status_size(__status__) + cdef EncoderSessionInfo session_infos = EncoderSessionInfo(session_count[0]) + cdef nvmlEncoderSessionInfo_t *session_infos_ptr = (session_infos._get_ptr()) + if session_count[0] == 0: + return session_infos + with nogil: + __status__ = nvmlDeviceGetEncoderSessions(device, session_count, session_infos_ptr) + check_status(__status__) + return session_infos + + +cpdef tuple device_get_decoder_utilization(intptr_t device): + """Retrieves the current utilization and sampling size in microseconds for the Decoder. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference to an unsigned int for decoder + utilization info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. + + .. seealso:: `nvmlDeviceGetDecoderUtilization` + """ + cdef unsigned int utilization + cdef unsigned int sampling_period_us + with nogil: + __status__ = nvmlDeviceGetDecoderUtilization(device, &utilization, &sampling_period_us) + check_status(__status__) + return (utilization, sampling_period_us) + + +cpdef tuple device_get_jpg_utilization(intptr_t device): + """Retrieves the current utilization and sampling size in microseconds for the JPG. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference to an unsigned int for jpg utilization + info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. + + .. seealso:: `nvmlDeviceGetJpgUtilization` + """ + cdef unsigned int utilization + cdef unsigned int sampling_period_us + with nogil: + __status__ = nvmlDeviceGetJpgUtilization(device, &utilization, &sampling_period_us) + check_status(__status__) + return (utilization, sampling_period_us) + + +cpdef tuple device_get_ofa_utilization(intptr_t device): + """Retrieves the current utilization and sampling size in microseconds for the OFA (Optical Flow Accelerator). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Reference to an unsigned int for ofa utilization + info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. + + .. seealso:: `nvmlDeviceGetOfaUtilization` + """ + cdef unsigned int utilization + cdef unsigned int sampling_period_us + with nogil: + __status__ = nvmlDeviceGetOfaUtilization(device, &utilization, &sampling_period_us) + check_status(__status__) + return (utilization, sampling_period_us) + + +cpdef object device_get_fbc_stats(intptr_t device): + """Retrieves the active frame buffer capture sessions statistics for a given device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure + containing NvFBC stats. + + .. seealso:: `nvmlDeviceGetFBCStats` + """ + cdef FBCStats fbc_stats_py = FBCStats() + cdef nvmlFBCStats_t *fbc_stats = (fbc_stats_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetFBCStats(device, fbc_stats) + check_status(__status__) + return fbc_stats_py + + +cpdef object device_get_fbc_sessions(intptr_t device): + """Retrieves information about active frame buffer capture sessions on a target 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] + with nogil: + __status__ = nvmlDeviceGetFBCSessions(device, session_count, NULL) + check_status_size(__status__) + cdef FBCSessionInfo session_info = FBCSessionInfo(session_count[0]) + cdef nvmlFBCSessionInfo_t *session_info_ptr = (session_info._get_ptr()) + if session_count[0] == 0: + return session_info + with nogil: + __status__ = nvmlDeviceGetFBCSessions(device, session_count, session_info_ptr) + check_status(__status__) + return session_info + + +cpdef tuple device_get_driver_model_v2(intptr_t device): + """Retrieves the current and pending driver model for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - int: Reference in which to return the current driver model. + - int: Reference in which to return the pending driver model. + + .. seealso:: `nvmlDeviceGetDriverModel_v2` + """ + cdef _DriverModel current + cdef _DriverModel pending + with nogil: + __status__ = nvmlDeviceGetDriverModel_v2(device, ¤t, &pending) + check_status(__status__) + return (current, pending) + + +cpdef str device_get_vbios_version(intptr_t device): + """Get VBIOS version of the 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 + cdef char[32] version + with nogil: + __status__ = nvmlDeviceGetVbiosVersion(device, version, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(version) + + +cpdef object device_get_bridge_chip_info(intptr_t device): + """Get Bridge Chip Information for all the bridge chips on the board. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlBridgeChipHierarchy_t: Reference to the returned bridge + chip Hierarchy. + + .. seealso:: `nvmlDeviceGetBridgeChipInfo` + """ + cdef BridgeChipHierarchy bridge_hierarchy_py = BridgeChipHierarchy() + cdef nvmlBridgeChipHierarchy_t *bridge_hierarchy = (bridge_hierarchy_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetBridgeChipInfo(device, bridge_hierarchy) + check_status(__status__) + return bridge_hierarchy_py + + +cpdef object device_get_compute_running_processes_v3(intptr_t device): + """Get information about processes with a 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:: `nvmlDeviceGetComputeRunningProcesses_v3` + """ + cdef unsigned int[1] info_count = [0] + with nogil: + __status__ = nvmlDeviceGetComputeRunningProcesses_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__ = nvmlDeviceGetComputeRunningProcesses_v3(device, info_count, infos_ptr) + check_status(__status__) + 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] + with nogil: + __status__ = nvmlDeviceGetMPSComputeRunningProcesses_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__ = nvmlDeviceGetMPSComputeRunningProcesses_v3(device, info_count, infos_ptr) + check_status(__status__) + return infos + + +cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0: + """Check if the GPU devices are on the same physical board. + + Args: + device1 (intptr_t): The first GPU device. + device2 (intptr_t): The second GPU device. + + Returns: + int: Reference in which to return the status. Non-zero + indicates that the GPUs are on the same board. + + .. seealso:: `nvmlDeviceOnSameBoard` + """ + cdef int on_same_board + with nogil: + __status__ = nvmlDeviceOnSameBoard(device1, device2, &on_same_board) + check_status(__status__) + return on_same_board + + +cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1: + """Retrieves the root/admin permissions on the target API. See ``nvmlRestrictedAPI_t`` for the list of supported APIs. If an API is restricted only root users can call that API. See ``nvmlDeviceSetAPIRestriction`` to change current permissions. + + Args: + device (intptr_t): The identifier of the target device. + api_type (RestrictedAPI): Target API type for this operation. + + Returns: + int: Reference in which to return the current restriction + NVML_FEATURE_ENABLED indicates that the API is root-only + NVML_FEATURE_DISABLED indicates that the API is accessible + to all users. + + .. seealso:: `nvmlDeviceGetAPIRestriction` + """ + cdef _EnableState is_restricted + with nogil: + __status__ = nvmlDeviceGetAPIRestriction(device, <_RestrictedAPI>api_type, &is_restricted) + check_status(__status__) + return is_restricted + + +cpdef object device_get_bar1_memory_info(intptr_t device): + """Gets Total, Available and Used size of BAR1 memory. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlBAR1Memory_t: Reference in which BAR1 memory information + is returned. + + .. seealso:: `nvmlDeviceGetBAR1MemoryInfo` + """ + cdef BAR1Memory bar1memory_py = BAR1Memory() + cdef nvmlBAR1Memory_t *bar1memory = (bar1memory_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetBAR1MemoryInfo(device, bar1memory) + check_status(__status__) + return bar1memory_py + + +cpdef unsigned int device_get_irq_num(intptr_t device) except? 0: + """Gets the device's interrupt number. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The interrupt number associated with the + specified device. + + .. seealso:: `nvmlDeviceGetIrqNum` + """ + cdef unsigned int irq_num + with nogil: + __status__ = nvmlDeviceGetIrqNum(device, &irq_num) + check_status(__status__) + return irq_num + + +cpdef unsigned int device_get_num_gpu_cores(intptr_t device) except? 0: + """Gets the device's core count. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The number of cores for the specified device. + + .. seealso:: `nvmlDeviceGetNumGpuCores` + """ + cdef unsigned int num_cores + with nogil: + __status__ = nvmlDeviceGetNumGpuCores(device, &num_cores) + check_status(__status__) + return num_cores + + +cpdef unsigned int device_get_power_source(intptr_t device) except *: + """Gets the devices power source. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The power source of the device. + + .. seealso:: `nvmlDeviceGetPowerSource` + """ + cdef nvmlPowerSource_t power_source + with nogil: + __status__ = nvmlDeviceGetPowerSource(device, &power_source) + check_status(__status__) + return power_source + + +cpdef unsigned int device_get_memory_bus_width(intptr_t device) except? 0: + """Gets the device's memory bus width. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The devices's memory bus width. + + .. seealso:: `nvmlDeviceGetMemoryBusWidth` + """ + cdef unsigned int bus_width + with nogil: + __status__ = nvmlDeviceGetMemoryBusWidth(device, &bus_width) + check_status(__status__) + return bus_width + + +cpdef unsigned int device_get_pcie_link_max_speed(intptr_t device) except? 0: + """Gets the device's PCIE Max Link speed in MBPS. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The devices's PCIE Max Link speed in MBPS. + + .. seealso:: `nvmlDeviceGetPcieLinkMaxSpeed` + """ + cdef unsigned int max_speed + with nogil: + __status__ = nvmlDeviceGetPcieLinkMaxSpeed(device, &max_speed) + check_status(__status__) + return max_speed + + +cpdef unsigned int device_get_pcie_speed(intptr_t device) except? 0: + """Gets the device's PCIe Link speed in Mbps. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The devices's PCIe Max Link speed in Mbps. + + .. seealso:: `nvmlDeviceGetPcieSpeed` + """ + cdef unsigned int pcie_speed + with nogil: + __status__ = nvmlDeviceGetPcieSpeed(device, &pcie_speed) + check_status(__status__) + return pcie_speed + + +cpdef unsigned int device_get_adaptive_clock_info_status(intptr_t device) except? 0: + """Gets the device's Adaptive Clock status. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The current adaptive clocking status, either + NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED or + NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED. + + .. seealso:: `nvmlDeviceGetAdaptiveClockInfoStatus` + """ + cdef unsigned int adaptive_clock_status + with nogil: + __status__ = nvmlDeviceGetAdaptiveClockInfoStatus(device, &adaptive_clock_status) + check_status(__status__) + return adaptive_clock_status + + +cpdef unsigned int device_get_bus_type(intptr_t device) except? 0: + """Get the type of the GPU Bus (PCIe, PCI, ...). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The PCI Bus type. + + .. seealso:: `nvmlDeviceGetBusType` + """ + cdef nvmlBusType_t type + with nogil: + __status__ = nvmlDeviceGetBusType(device, &type) + check_status(__status__) + return type + + +cpdef object system_get_conf_compute_capabilities(): + """Get Conf Computing System capabilities. + + Returns: + nvmlConfComputeSystemCaps_t: System CC capabilities. + + .. seealso:: `nvmlSystemGetConfComputeCapabilities` + """ + cdef ConfComputeSystemCaps capabilities_py = ConfComputeSystemCaps() + cdef nvmlConfComputeSystemCaps_t *capabilities = (capabilities_py._get_ptr()) + with nogil: + __status__ = nvmlSystemGetConfComputeCapabilities(capabilities) + check_status(__status__) + return capabilities_py + + +cpdef object system_get_conf_compute_state(): + """Get Conf Computing System State. + + Returns: + nvmlConfComputeSystemState_t: System CC State. + + .. seealso:: `nvmlSystemGetConfComputeState` + """ + cdef ConfComputeSystemState state_py = ConfComputeSystemState() + cdef nvmlConfComputeSystemState_t *state = (state_py._get_ptr()) + with nogil: + __status__ = nvmlSystemGetConfComputeState(state) + check_status(__status__) + return state_py + + +cpdef object device_get_conf_compute_mem_size_info(intptr_t device): + """Get Conf Computing Protected and Unprotected Memory Sizes. + + Args: + device (intptr_t): Device handle. + + Returns: + nvmlConfComputeMemSizeInfo_t: Protected/Unprotected Memory + sizes. + + .. seealso:: `nvmlDeviceGetConfComputeMemSizeInfo` + """ + cdef ConfComputeMemSizeInfo mem_info_py = ConfComputeMemSizeInfo() + cdef nvmlConfComputeMemSizeInfo_t *mem_info = (mem_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetConfComputeMemSizeInfo(device, mem_info) + check_status(__status__) + return mem_info_py + + +cpdef unsigned int system_get_conf_compute_gpus_ready_state() except? 0: + """Get Conf Computing GPUs ready state. + + Returns: + unsigned int: Returns GPU current work accepting state, + NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or + NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. + + .. seealso:: `nvmlSystemGetConfComputeGpusReadyState` + """ + cdef unsigned int is_accepting_work + with nogil: + __status__ = nvmlSystemGetConfComputeGpusReadyState(&is_accepting_work) + check_status(__status__) + return is_accepting_work + + +cpdef object device_get_conf_compute_protected_memory_usage(intptr_t device): + """Get Conf Computing protected memory usage. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlMemory_t: Reference in which to return the memory + information. + + .. seealso:: `nvmlDeviceGetConfComputeProtectedMemoryUsage` + """ + cdef Memory memory_py = Memory() + cdef nvmlMemory_t *memory = (memory_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetConfComputeProtectedMemoryUsage(device, memory) + check_status(__status__) + return memory_py + + +cpdef object device_get_conf_compute_gpu_certificate(intptr_t device): + """Get Conf Computing GPU certificate details. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlConfComputeGpuCertificate_t: Reference in which to return + the gpu certificate information. + + .. seealso:: `nvmlDeviceGetConfComputeGpuCertificate` + """ + cdef ConfComputeGpuCertificate gpu_cert_py = ConfComputeGpuCertificate() + cdef nvmlConfComputeGpuCertificate_t *gpu_cert = (gpu_cert_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetConfComputeGpuCertificate(device, gpu_cert) + check_status(__status__) + return gpu_cert_py + + +cpdef device_set_conf_compute_unprotected_mem_size(intptr_t device, unsigned long long size_ki_b): + """Set Conf Computing Unprotected Memory Size. + + Args: + device (intptr_t): Device Handle. + size_ki_b (unsigned long long): Unprotected Memory size to be + set in KiB. + + .. seealso:: `nvmlDeviceSetConfComputeUnprotectedMemSize` + """ + with nogil: + __status__ = nvmlDeviceSetConfComputeUnprotectedMemSize(device, size_ki_b) + check_status(__status__) + + +cpdef system_set_conf_compute_gpus_ready_state(unsigned int is_accepting_work): + """Set Conf Computing GPUs ready state. + + Args: + is_accepting_work (unsigned int): GPU accepting new work, + NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or + NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. + + .. seealso:: `nvmlSystemSetConfComputeGpusReadyState` + """ + with nogil: + __status__ = nvmlSystemSetConfComputeGpusReadyState(is_accepting_work) + check_status(__status__) + + +cpdef object system_get_conf_compute_settings(): + """Get Conf Computing System Settings. + + Returns: + nvmlSystemConfComputeSettings_v1_t: System CC settings. + + .. seealso:: `nvmlSystemGetConfComputeSettings` + """ + cdef SystemConfComputeSettings_v1 settings_py = SystemConfComputeSettings_v1() + cdef nvmlSystemConfComputeSettings_t *settings = (settings_py._get_ptr()) + settings.version = NVML_VERSION_STRUCT(sizeof(nvmlSystemConfComputeSettings_v1_t), 1) + with nogil: + __status__ = nvmlSystemGetConfComputeSettings(settings) + check_status(__status__) + return settings_py + + +cpdef char device_get_gsp_firmware_version(intptr_t device) except? 0: + """Retrieve GSP firmware version. + + Args: + device (intptr_t): Device handle. + + Returns: + char: The retrieved GSP firmware version. + + .. seealso:: `nvmlDeviceGetGspFirmwareVersion` + """ + cdef char version + with nogil: + __status__ = nvmlDeviceGetGspFirmwareVersion(device, &version) + check_status(__status__) + return version + + +cpdef tuple device_get_gsp_firmware_mode(intptr_t device): + """Retrieve GSP firmware mode. + + Args: + device (intptr_t): Device handle. + + Returns: + A 2-tuple containing: + + - unsigned int: Pointer to specify if GSP firmware is enabled. + - unsigned int: Pointer to specify if GSP firmware is supported + by default on ``device``. + + .. seealso:: `nvmlDeviceGetGspFirmwareMode` + """ + cdef unsigned int is_enabled + cdef unsigned int default_mode + with nogil: + __status__ = nvmlDeviceGetGspFirmwareMode(device, &is_enabled, &default_mode) + check_status(__status__) + return (is_enabled, default_mode) + + +cpdef object device_get_sram_ecc_error_status(intptr_t device): + """Get SRAM ECC error status of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlEccSramErrorStatus_v1_t: Returns SRAM ECC error status. + + .. seealso:: `nvmlDeviceGetSramEccErrorStatus` + """ + cdef EccSramErrorStatus_v1 status_py = EccSramErrorStatus_v1() + cdef nvmlEccSramErrorStatus_t *status = (status_py._get_ptr()) + status.version = NVML_VERSION_STRUCT(sizeof(nvmlEccSramErrorStatus_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetSramEccErrorStatus(device, status) + check_status(__status__) + return status_py + + +cpdef int device_get_accounting_mode(intptr_t device) except? -1: + """Queries the state of per process accounting mode. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the current accounting mode. + + .. seealso:: `nvmlDeviceGetAccountingMode` + """ + cdef _EnableState mode + with nogil: + __status__ = nvmlDeviceGetAccountingMode(device, &mode) + check_status(__status__) + return mode + + +cpdef object device_get_accounting_stats(intptr_t device, unsigned int pid): + """Queries process's accounting stats. + + Args: + device (intptr_t): The identifier of the target device. + pid (unsigned int): Process Id of the target process to query + stats for. + + Returns: + nvmlAccountingStats_t: Reference in which to return the + process's accounting stats. + + .. seealso:: `nvmlDeviceGetAccountingStats` + """ + cdef AccountingStats stats_py = AccountingStats() + cdef nvmlAccountingStats_t *stats = (stats_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetAccountingStats(device, pid, stats) + check_status(__status__) + return stats_py + + +cpdef object device_get_accounting_pids(intptr_t device): + """Queries list of processes that can be queried for accounting stats. The list of processes returned can be in running or terminated state. + + 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] + with nogil: + __status__ = nvmlDeviceGetAccountingPids(device, count, NULL) + check_status_size(__status__) + if count[0] == 0: + 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) + check_status(__status__) + return pids + + +cpdef unsigned int device_get_accounting_buffer_size(intptr_t device) except? 0: + """Returns the number of processes that the circular buffer with accounting pids can hold. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference in which to provide the size (in + number of elements) of the circular buffer for accounting + stats. + + .. seealso:: `nvmlDeviceGetAccountingBufferSize` + """ + cdef unsigned int buffer_size + with nogil: + __status__ = nvmlDeviceGetAccountingBufferSize(device, &buffer_size) + check_status(__status__) + return buffer_size + + +cpdef object device_get_retired_pages(intptr_t device, int cause): + """Returns the list of retired pages by source, including pages that are pending retirement The address information provided from this API is the hardware address of the page that was retired. Note that this does not match the virtual address used in CUDA, but will match the address information in Xid 63. + + Args: + 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] + with nogil: + __status__ = nvmlDeviceGetRetiredPages(device, <_PageRetirementCause>cause, page_count, NULL) + check_status_size(__status__) + if page_count[0] == 0: + 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) + check_status(__status__) + return addresses + + +cpdef int device_get_retired_pages_pending_status(intptr_t device) except? -1: + """Check if any pages are pending retirement and need a reboot to fully retire. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the pending status. + + .. seealso:: `nvmlDeviceGetRetiredPagesPendingStatus` + """ + cdef _EnableState is_pending + with nogil: + __status__ = nvmlDeviceGetRetiredPagesPendingStatus(device, &is_pending) + check_status(__status__) + return is_pending + + +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. 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. + + Returns: + A 4-tuple containing: + + - unsigned int: Reference for number of rows remapped due to + correctable errors. + - unsigned int: Reference for number of rows remapped due to + uncorrectable errors. + - unsigned int: Reference for whether or not remappings are + pending. + - unsigned int: Reference that is set when a remapping has + failed in the past. + + .. seealso:: `nvmlDeviceGetRemappedRows` + """ + cdef unsigned int corr_rows + cdef unsigned int unc_rows + cdef unsigned int is_pending + cdef unsigned int failure_occurred + with nogil: + __status__ = nvmlDeviceGetRemappedRows(device, &corr_rows, &unc_rows, &is_pending, &failure_occurred) + check_status(__status__) + return (corr_rows, unc_rows, is_pending, failure_occurred) + + +cpdef object device_get_row_remapper_histogram(intptr_t device): + """Get the row remapper histogram. Returns the remap availability for each bank on the GPU. + + Args: + device (intptr_t): Device handle. + + Returns: + nvmlRowRemapperHistogramValues_t: Histogram values. + + .. seealso:: `nvmlDeviceGetRowRemapperHistogram` + """ + cdef RowRemapperHistogramValues values_py = RowRemapperHistogramValues() + cdef nvmlRowRemapperHistogramValues_t *values = (values_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetRowRemapperHistogram(device, values) + check_status(__status__) + return values_py + + +cpdef unsigned int device_get_architecture(intptr_t device) except? 0: + """Get architecture for device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: Reference where architecture is returned, if + call successful. Set to NVML_DEVICE_ARCH_* upon success. + + .. seealso:: `nvmlDeviceGetArchitecture` + """ + cdef nvmlDeviceArchitecture_t arch + with nogil: + __status__ = nvmlDeviceGetArchitecture(device, &arch) + check_status(__status__) + return arch + + +cpdef object device_get_clk_mon_status(intptr_t device): + """Retrieves the frequency monitor fault status for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlClkMonStatus_t: Reference in which to return the clkmon + fault status. + + .. seealso:: `nvmlDeviceGetClkMonStatus` + """ + cdef ClkMonStatus status_py = ClkMonStatus() + cdef nvmlClkMonStatus_t *status = (status_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetClkMonStatus(device, status) + check_status(__status__) + return status_py + + +cpdef object device_get_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp): + """Retrieves the current utilization and process ID. + + Args: + device (intptr_t): The identifier of the target device. + 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` + """ + cdef unsigned int[1] process_samples_count = [0] + with nogil: + __status__ = nvmlDeviceGetProcessUtilization(device, NULL, process_samples_count, last_seen_time_stamp) + check_status_size(__status__) + cdef ProcessUtilizationSample utilization = ProcessUtilizationSample(process_samples_count[0]) + cdef nvmlProcessUtilizationSample_t *utilization_ptr = (utilization._get_ptr()) + if process_samples_count[0] == 0: + return utilization + with nogil: + __status__ = nvmlDeviceGetProcessUtilization(device, utilization_ptr, process_samples_count, last_seen_time_stamp) + check_status(__status__) + return utilization + + +cpdef unit_set_led_state(intptr_t unit, int color): + """Set the LED state for the unit. The LED can be either green (0) or amber (1). + + Args: + unit (intptr_t): The identifier of the target unit. + color (LedColor): The target LED color. + + .. seealso:: `nvmlUnitSetLedState` + """ + with nogil: + __status__ = nvmlUnitSetLedState(unit, <_LedColor>color) + check_status(__status__) + + +cpdef device_set_persistence_mode(intptr_t device, int mode): + """Set the persistence mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + mode (EnableState): The target persistence mode. + + .. seealso:: `nvmlDeviceSetPersistenceMode` + """ + with nogil: + __status__ = nvmlDeviceSetPersistenceMode(device, <_EnableState>mode) + check_status(__status__) + + +cpdef device_set_compute_mode(intptr_t device, int mode): + """Set the compute mode for the device or MIG device. + + Args: + device (intptr_t): The identifier of the target device handle + or MIG device handle. + mode (ComputeMode): The target compute mode. + + .. seealso:: `nvmlDeviceSetComputeMode` + """ + with nogil: + __status__ = nvmlDeviceSetComputeMode(device, <_ComputeMode>mode) + check_status(__status__) + + +cpdef device_set_ecc_mode(intptr_t device, int ecc): + """Set the ECC mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + ecc (EnableState): The target ECC mode. + + .. seealso:: `nvmlDeviceSetEccMode` + """ + with nogil: + __status__ = nvmlDeviceSetEccMode(device, <_EnableState>ecc) + check_status(__status__) + + +cpdef device_clear_ecc_error_counts(intptr_t device, int counter_type): + """Clear the ECC error and other memory error counts for the device. + + Args: + device (intptr_t): The identifier of the target device. + counter_type (EccCounterType): Flag that indicates which type + of errors should be cleared. + + .. seealso:: `nvmlDeviceClearEccErrorCounts` + """ + with nogil: + __status__ = nvmlDeviceClearEccErrorCounts(device, <_EccCounterType>counter_type) + check_status(__status__) + + +cpdef device_set_driver_model(intptr_t device, int driver_model, unsigned int flags): + """Set the driver model for the device. + + Args: + device (intptr_t): The identifier of the target device. + driver_model (DriverModel): The target driver model. + flags (unsigned int): Flags that change the default behavior. + + .. seealso:: `nvmlDeviceSetDriverModel` + """ + with nogil: + __status__ = nvmlDeviceSetDriverModel(device, <_DriverModel>driver_model, flags) + check_status(__status__) + + +cpdef device_set_gpu_locked_clocks(intptr_t device, unsigned int min_gpu_clock_m_hz, unsigned int max_gpu_clock_m_hz): + """Set clocks that device will lock to. + + Args: + device (intptr_t): The identifier of the target device. + min_gpu_clock_m_hz (unsigned int): Requested minimum gpu clock + in MHz. + max_gpu_clock_m_hz (unsigned int): Requested maximum gpu clock + in MHz. + + .. seealso:: `nvmlDeviceSetGpuLockedClocks` + """ + with nogil: + __status__ = nvmlDeviceSetGpuLockedClocks(device, min_gpu_clock_m_hz, max_gpu_clock_m_hz) + check_status(__status__) + + +cpdef device_reset_gpu_locked_clocks(intptr_t device): + """Resets the gpu clock to the default value. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceResetGpuLockedClocks` + """ + with nogil: + __status__ = nvmlDeviceResetGpuLockedClocks(device) + check_status(__status__) + + +cpdef device_set_memory_locked_clocks(intptr_t device, unsigned int min_mem_clock_m_hz, unsigned int max_mem_clock_m_hz): + """Set memory clocks that device will lock to. + + Args: + device (intptr_t): The identifier of the target device. + min_mem_clock_m_hz (unsigned int): Requested minimum memory + clock in MHz. + max_mem_clock_m_hz (unsigned int): Requested maximum memory + clock in MHz. + + .. seealso:: `nvmlDeviceSetMemoryLockedClocks` + """ + with nogil: + __status__ = nvmlDeviceSetMemoryLockedClocks(device, min_mem_clock_m_hz, max_mem_clock_m_hz) + check_status(__status__) + + +cpdef device_reset_memory_locked_clocks(intptr_t device): + """Resets the memory clock to the default value. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceResetMemoryLockedClocks` + """ + with nogil: + __status__ = nvmlDeviceResetMemoryLockedClocks(device) + check_status(__status__) + + +cpdef device_set_auto_boosted_clocks_enabled(intptr_t device, int enabled): + """Try to set the current state of Auto Boosted clocks on a device. + + Args: + device (intptr_t): The identifier of the target device. + enabled (EnableState): What state to try to set Auto Boosted + clocks of the target device to. + + .. seealso:: `nvmlDeviceSetAutoBoostedClocksEnabled` + """ + with nogil: + __status__ = nvmlDeviceSetAutoBoostedClocksEnabled(device, <_EnableState>enabled) + check_status(__status__) + + +cpdef device_set_default_auto_boosted_clocks_enabled(intptr_t device, int enabled, unsigned int flags): + """Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will return to when no compute running processes (e.g. CUDA application which have an active context) are running. + + Args: + device (intptr_t): The identifier of the target device. + enabled (EnableState): What state to try to set default Auto + Boosted clocks of the target device to. + flags (unsigned int): Flags that change the default behavior. + Currently Unused. + + .. seealso:: `nvmlDeviceSetDefaultAutoBoostedClocksEnabled` + """ + with nogil: + __status__ = nvmlDeviceSetDefaultAutoBoostedClocksEnabled(device, <_EnableState>enabled, flags) + check_status(__status__) + + +cpdef device_set_default_fan_speed_v2(intptr_t device, unsigned int fan): + """Sets the speed of the fan control policy to default. + + Args: + device (intptr_t): The identifier of the target device. + fan (unsigned int): The index of the fan, starting at zero. + + .. seealso:: `nvmlDeviceSetDefaultFanSpeed_v2` + """ + with nogil: + __status__ = nvmlDeviceSetDefaultFanSpeed_v2(device, fan) + check_status(__status__) + + +cpdef device_set_fan_control_policy(intptr_t device, unsigned int fan, unsigned int policy): + """Sets current fan control policy. + + Args: + device (intptr_t): The identifier of the target ``device``. + fan (unsigned int): The index of the fan, starting at zero. + policy (unsigned int): The fan control ``policy`` to set. + + .. seealso:: `nvmlDeviceSetFanControlPolicy` + """ + with nogil: + __status__ = nvmlDeviceSetFanControlPolicy(device, fan, policy) + check_status(__status__) + + +cpdef device_set_gpu_operation_mode(intptr_t device, int mode): + """Sets new GOM. See ``nvmlGpuOperationMode_t`` for details. + + Args: + device (intptr_t): The identifier of the target device. + mode (GpuOperationMode): Target GOM. + + .. seealso:: `nvmlDeviceSetGpuOperationMode` + """ + with nogil: + __status__ = nvmlDeviceSetGpuOperationMode(device, <_GpuOperationMode>mode) + check_status(__status__) + + +cpdef device_set_api_restriction(intptr_t device, int api_type, int is_restricted): + """Changes the root/admin restructions on certain APIs. See ``nvmlRestrictedAPI_t`` for the list of supported APIs. This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs. The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See ``nvmlDeviceGetAPIRestriction`` to query the current restriction settings. + + Args: + device (intptr_t): The identifier of the target device. + api_type (RestrictedAPI): Target API type for this operation. + is_restricted (EnableState): The target restriction. + + .. seealso:: `nvmlDeviceSetAPIRestriction` + """ + with nogil: + __status__ = nvmlDeviceSetAPIRestriction(device, <_RestrictedAPI>api_type, <_EnableState>is_restricted) + check_status(__status__) + + +cpdef device_set_fan_speed_v2(intptr_t device, unsigned int fan, unsigned int speed): + """Sets the speed of a specified fan. + + Args: + device (intptr_t): The identifier of the target device. + fan (unsigned int): The index of the fan, starting at zero. + speed (unsigned int): The target speed of the fan [0-100] in % + of max speed. + + .. seealso:: `nvmlDeviceSetFanSpeed_v2` + """ + with nogil: + __status__ = nvmlDeviceSetFanSpeed_v2(device, fan, speed) + check_status(__status__) + + +cpdef device_set_accounting_mode(intptr_t device, int mode): + """Enables or disables per process accounting. + + Args: + device (intptr_t): The identifier of the target device. + mode (EnableState): The target accounting mode. + + .. seealso:: `nvmlDeviceSetAccountingMode` + """ + with nogil: + __status__ = nvmlDeviceSetAccountingMode(device, <_EnableState>mode) + check_status(__status__) + + +cpdef device_clear_accounting_pids(intptr_t device): + """Clears accounting information about all processes that have already terminated. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceClearAccountingPids` + """ + with nogil: + __status__ = nvmlDeviceClearAccountingPids(device) + check_status(__status__) + + +cpdef int device_get_nvlink_state(intptr_t device, unsigned int link) except? -1: + """Retrieves the state of the device's NvLink for the link specified. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + + Returns: + int: ``nvmlEnableState_t`` where NVML_FEATURE_ENABLED + indicates that the link is active and + NVML_FEATURE_DISABLED indicates it is inactive. + + .. seealso:: `nvmlDeviceGetNvLinkState` + """ + cdef _EnableState is_active + with nogil: + __status__ = nvmlDeviceGetNvLinkState(device, link, &is_active) + check_status(__status__) + return is_active + + +cpdef unsigned int device_get_nvlink_version(intptr_t device, unsigned int link) except? 0: + """Retrieves the version of the device's NvLink for the link specified. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + + Returns: + unsigned int: Requested NvLink version from + ``nvmlNvlinkVersion_t``. + + .. seealso:: `nvmlDeviceGetNvLinkVersion` + """ + cdef unsigned int version + with nogil: + __status__ = nvmlDeviceGetNvLinkVersion(device, link, &version) + check_status(__status__) + return version + + +cpdef unsigned int device_get_nvlink_capability(intptr_t device, unsigned int link, int capability) except? 0: + """Retrieves the requested capability from the device's NvLink for the link specified Please refer to the ``nvmlNvLinkCapability_t`` structure for the specific caps that can be queried The return value should be treated as a boolean. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + capability (NvLinkCapability): Specifies the + ``nvmlNvLinkCapability_t`` to be queried. + + Returns: + unsigned int: A boolean for the queried capability indicating + that feature is available. + + .. seealso:: `nvmlDeviceGetNvLinkCapability` + """ + cdef unsigned int cap_result + with nogil: + __status__ = nvmlDeviceGetNvLinkCapability(device, link, <_NvLinkCapability>capability, &cap_result) + check_status(__status__) + return cap_result + + +cpdef object device_get_nvlink_remote_pci_info_v2(intptr_t device, unsigned int link): + """Retrieves the PCI information for the remote node on a NvLink link Note: pciSubSystemId is not filled in this function and is indeterminate. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + + Returns: + nvmlPciInfo_t: ``nvmlPciInfo_t`` of the remote node for the + specified link. + + .. seealso:: `nvmlDeviceGetNvLinkRemotePciInfo_v2` + """ + cdef PciInfo pci_py = PciInfo() + cdef nvmlPciInfo_t *pci = (pci_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetNvLinkRemotePciInfo_v2(device, link, pci) + check_status(__status__) + return pci_py + + +cpdef unsigned long long device_get_nvlink_error_counter(intptr_t device, unsigned int link, int counter) except? 0: + """Retrieves the specified error counter value Please refer to ``nvmlNvLinkErrorCounter_t`` for error counters that are available. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + counter (NvLinkErrorCounter): Specifies the NvLink counter to + be queried. + + Returns: + unsigned long long: Returned counter value. + + .. seealso:: `nvmlDeviceGetNvLinkErrorCounter` + """ + cdef unsigned long long counter_value + with nogil: + __status__ = nvmlDeviceGetNvLinkErrorCounter(device, link, <_NvLinkErrorCounter>counter, &counter_value) + check_status(__status__) + return counter_value + + +cpdef device_reset_nvlink_error_counters(intptr_t device, unsigned int link): + """Resets all error counters to zero Please refer to ``nvmlNvLinkErrorCounter_t`` for the list of error counters that are reset. + + Args: + device (intptr_t): The identifier of the target device. + link (unsigned int): Specifies the NvLink link to be queried. + + .. seealso:: `nvmlDeviceResetNvLinkErrorCounters` + """ + with nogil: + __status__ = nvmlDeviceResetNvLinkErrorCounters(device, link) + check_status(__status__) + + +cpdef int device_get_nvlink_remote_device_type(intptr_t device, unsigned int link) except? -1: + """Get the NVLink device type of the remote device connected over the given link. + + Args: + device (intptr_t): The device handle of the target GPU. + link (unsigned int): The NVLink link index on the target GPU. + + Returns: + int: Pointer in which the output remote device type is + returned. + + .. seealso:: `nvmlDeviceGetNvLinkRemoteDeviceType` + """ + cdef _IntNvLinkDeviceType p_nv_link_device_type + with nogil: + __status__ = nvmlDeviceGetNvLinkRemoteDeviceType(device, link, &p_nv_link_device_type) + check_status(__status__) + return p_nv_link_device_type + + +cpdef system_set_nvlink_bw_mode(unsigned int nvlink_bw_mode): + """Set the global nvlink bandwith mode. + + Args: + nvlink_bw_mode (unsigned int): nvlink bandwidth mode. + + .. seealso:: `nvmlSystemSetNvlinkBwMode` + """ + with nogil: + __status__ = nvmlSystemSetNvlinkBwMode(nvlink_bw_mode) + check_status(__status__) + + +cpdef unsigned int system_get_nvlink_bw_mode() except? 0: + """Get the global nvlink bandwith mode. + + Returns: + unsigned int: reference of nvlink bandwidth mode. + + .. seealso:: `nvmlSystemGetNvlinkBwMode` + """ + cdef unsigned int nvlink_bw_mode + with nogil: + __status__ = nvmlSystemGetNvlinkBwMode(&nvlink_bw_mode) + check_status(__status__) + return nvlink_bw_mode + + +cpdef object device_get_nvlink_supported_bw_modes(intptr_t device): + """Get the supported NvLink Reduced Bandwidth Modes of the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvlinkSupportedBwModes_v1_t: Reference to + ``nvmlNvlinkSupportedBwModes_t``. + + .. seealso:: `nvmlDeviceGetNvlinkSupportedBwModes` + """ + cdef NvlinkSupportedBwModes_v1 supported_bw_mode_py = NvlinkSupportedBwModes_v1() + cdef nvmlNvlinkSupportedBwModes_t *supported_bw_mode = (supported_bw_mode_py._get_ptr()) + supported_bw_mode.version = NVML_VERSION_STRUCT(sizeof(nvmlNvlinkSupportedBwModes_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetNvlinkSupportedBwModes(device, supported_bw_mode) + check_status(__status__) + return supported_bw_mode_py + + +cpdef object device_get_nvlink_bw_mode(intptr_t device): + """Get the NvLink Reduced Bandwidth Mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvlinkGetBwMode_v1_t: Reference to + ``nvmlNvlinkGetBwMode_t``. + + .. seealso:: `nvmlDeviceGetNvlinkBwMode` + """ + cdef NvlinkGetBwMode_v1 get_bw_mode_py = NvlinkGetBwMode_v1() + cdef nvmlNvlinkGetBwMode_t *get_bw_mode = (get_bw_mode_py._get_ptr()) + get_bw_mode.version = NVML_VERSION_STRUCT(sizeof(nvmlNvlinkGetBwMode_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetNvlinkBwMode(device, get_bw_mode) + check_status(__status__) + return get_bw_mode_py + + +cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode): + """Set the NvLink Reduced Bandwidth Mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + set_bw_mode (intptr_t): Reference to + ``nvmlNvlinkSetBwMode_t``. + + .. seealso:: `nvmlDeviceSetNvlinkBwMode` + """ + set_bw_mode.version = NVML_VERSION_STRUCT(sizeof(nvmlNvlinkSetBwMode_v1_t), 1) + with nogil: + __status__ = nvmlDeviceSetNvlinkBwMode(device, set_bw_mode) + check_status(__status__) + + +cpdef intptr_t event_set_create() except? 0: + """Create an empty set of events. Event set should be freed by ``nvmlEventSetFree``. + + Returns: + intptr_t: Reference in which to return the event handle. + + .. seealso:: `nvmlEventSetCreate` + """ + cdef EventSet set + with nogil: + __status__ = nvmlEventSetCreate(&set) + check_status(__status__) + return set + + +cpdef device_register_events(intptr_t device, unsigned long long event_types, intptr_t set): + """Starts recording of events on a specified devices and add the events to specified ``nvmlEventSet_t``. + + Args: + device (intptr_t): The identifier of the target device. + event_types (unsigned long long): Bitmask of ``Event Types`` + to record. + set (intptr_t): Set to which add new event types. + + .. seealso:: `nvmlDeviceRegisterEvents` + """ + with nogil: + __status__ = nvmlDeviceRegisterEvents(device, event_types, set) + check_status(__status__) + + +cpdef unsigned long long device_get_supported_event_types(intptr_t device) except? 0: + """Returns information about events supported on device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned long long: Reference in which to return bitmask of + supported events. + + .. seealso:: `nvmlDeviceGetSupportedEventTypes` + """ + cdef unsigned long long event_types + with nogil: + __status__ = nvmlDeviceGetSupportedEventTypes(device, &event_types) + check_status(__status__) + return event_types + + +cpdef object event_set_wait_v2(intptr_t set, unsigned int timeoutms): + """Waits on events and delivers events. + + Args: + set (intptr_t): Reference to set of events to wait on. + timeoutms (unsigned int): Maximum amount of wait time in + milliseconds for registered event. + + Returns: + nvmlEventData_t: Reference in which to return event data. + + .. seealso:: `nvmlEventSetWait_v2` + """ + cdef EventData data_py = EventData() + cdef nvmlEventData_t *data = (data_py._get_ptr()) + with nogil: + __status__ = nvmlEventSetWait_v2(set, data, timeoutms) + check_status(__status__) + return data_py + + +cpdef event_set_free(intptr_t set): + """Releases events in the set. + + Args: + set (intptr_t): Reference to events to be released. + + .. seealso:: `nvmlEventSetFree` + """ + with nogil: + __status__ = nvmlEventSetFree(set) + check_status(__status__) + + +cpdef device_modify_drain_state(intptr_t pci_info, int new_state): + """Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests. Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before this call is made. Must be called as administrator. For Linux only. + + Args: + pci_info (intptr_t): The PCI address of the GPU drain state to + be modified. + new_state (EnableState): The drain state that should be + entered, see ``nvmlEnableState_t``. + + .. seealso:: `nvmlDeviceModifyDrainState` + """ + with nogil: + __status__ = nvmlDeviceModifyDrainState(pci_info, <_EnableState>new_state) + check_status(__status__) + + +cpdef int device_query_drain_state(intptr_t pci_info) except? -1: + """Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining state. For Linux only. + + Args: + pci_info (intptr_t): The PCI address of the GPU drain state to + be queried. + + Returns: + int: The current drain state for this GPU, see + ``nvmlEnableState_t``. + + .. seealso:: `nvmlDeviceQueryDrainState` + """ + cdef _EnableState current_state + with nogil: + __status__ = nvmlDeviceQueryDrainState(pci_info, ¤t_state) + check_status(__status__) + return current_state + + +cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state): + """This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver as long as no other processes are attached. If other processes are attached, this call will return NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the only situation where a process can still be attached after :func:`device_modify_drain_state` is called to initiate the draining state is if that process was using, and is still using, a GPU before the call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled prior to this call. + + Args: + pci_info (intptr_t): The PCI address of the GPU to be removed. + gpu_state (DetachGpuState): Whether the GPU is to be removed, + from the OS see ``nvmlDetachGpuState_t``. + link_state (PcieLinkState): Requested upstream PCIe link + state, see ``nvmlPcieLinkState_t``. + + .. seealso:: `nvmlDeviceRemoveGpu_v2` + """ + with nogil: + __status__ = nvmlDeviceRemoveGpu_v2(pci_info, <_DetachGpuState>gpu_state, <_PcieLinkState>link_state) + check_status(__status__) + + +cpdef device_discover_gpus(intptr_t pci_info): + """Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device. If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order. + + Args: + pci_info (intptr_t): The PCI tree to be searched. Only the + domain, bus, and device fields are used in this call. + + .. seealso:: `nvmlDeviceDiscoverGpus` + """ + with nogil: + __status__ = nvmlDeviceDiscoverGpus(pci_info) + check_status(__status__) + + +cpdef int device_get_virtualization_mode(intptr_t device) except? -1: + """This method is used to get the virtualization mode corresponding to the GPU. + + Args: + device (intptr_t): Identifier of the target device. + + Returns: + int: Reference to virtualization mode. One of + ``NVML_GPU_VIRTUALIZATION_?``. + + .. seealso:: `nvmlDeviceGetVirtualizationMode` + """ + cdef _GpuVirtualizationMode p_virtual_mode + with nogil: + __status__ = nvmlDeviceGetVirtualizationMode(device, &p_virtual_mode) + check_status(__status__) + return p_virtual_mode + + +cpdef int device_get_host_vgpu_mode(intptr_t device) except? -1: + """Queries if SR-IOV host operation is supported on a vGPU supported device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + int: Reference in which to return the current vGPU mode. + + .. seealso:: `nvmlDeviceGetHostVgpuMode` + """ + cdef _HostVgpuMode p_host_vgpu_mode + with nogil: + __status__ = nvmlDeviceGetHostVgpuMode(device, &p_host_vgpu_mode) + check_status(__status__) + return p_host_vgpu_mode + + +cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode): + """This method is used to set the virtualization mode corresponding to the GPU. + + Args: + device (intptr_t): Identifier of the target device. + virtual_mode (GpuVirtualizationMode): virtualization mode. One + of ``NVML_GPU_VIRTUALIZATION_?``. + + .. seealso:: `nvmlDeviceSetVirtualizationMode` + """ + with nogil: + __status__ = nvmlDeviceSetVirtualizationMode(device, <_GpuVirtualizationMode>virtual_mode) + check_status(__status__) + + +cpdef unsigned long long vgpu_type_get_gsp_heap_size(unsigned int vgpu_type_id) except? 0: + """Retrieve the static GSP heap size of the vGPU type in bytes. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned long long: Reference to return the GSP heap size + value. + + .. seealso:: `nvmlVgpuTypeGetGspHeapSize` + """ + cdef unsigned long long gsp_heap_size + with nogil: + __status__ = nvmlVgpuTypeGetGspHeapSize(vgpu_type_id, &gsp_heap_size) + check_status(__status__) + return gsp_heap_size + + +cpdef unsigned long long vgpu_type_get_fb_reservation(unsigned int vgpu_type_id) except? 0: + """Retrieve the static framebuffer reservation of the vGPU type in bytes. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned long long: Reference to return the framebuffer + reservation. + + .. seealso:: `nvmlVgpuTypeGetFbReservation` + """ + cdef unsigned long long fb_reservation + with nogil: + __status__ = nvmlVgpuTypeGetFbReservation(vgpu_type_id, &fb_reservation) + check_status(__status__) + return fb_reservation + + +cpdef device_set_vgpu_capabilities(intptr_t device, int capability, int state): + """Set the desirable vGPU capability of a device. + + Args: + device (intptr_t): The identifier of the target device. + capability (DeviceVgpuCapability): Specifies the + ``nvmlDeviceVgpuCapability_t`` to be set. + state (EnableState): The target capability mode. + + .. seealso:: `nvmlDeviceSetVgpuCapabilities` + """ + with nogil: + __status__ = nvmlDeviceSetVgpuCapabilities(device, <_DeviceVgpuCapability>capability, <_EnableState>state) + check_status(__status__) + + +cpdef object device_get_grid_licensable_features_v4(intptr_t device): + """Retrieve the vGPU Software licensable features. + + Args: + device (intptr_t): Identifier of the target device. + + Returns: + nvmlGridLicensableFeatures_t: Pointer to structure in which + vGPU software licensable features are returned. + + .. seealso:: `nvmlDeviceGetGridLicensableFeatures_v4` + """ + cdef GridLicensableFeatures p_grid_licensable_features_py = GridLicensableFeatures() + cdef nvmlGridLicensableFeatures_t *p_grid_licensable_features = (p_grid_licensable_features_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetGridLicensableFeatures_v4(device, p_grid_licensable_features) + check_status(__status__) + return p_grid_licensable_features_py + + +cpdef unsigned int get_vgpu_driver_capabilities(int capability) except? 0: + """Retrieve the requested vGPU driver capability. + + Args: + capability (VgpuDriverCapability): Specifies the + ``nvmlVgpuDriverCapability_t`` to be queried. + + Returns: + unsigned int: A boolean for the queried capability indicating + that feature is supported. + + .. seealso:: `nvmlGetVgpuDriverCapabilities` + """ + cdef unsigned int cap_result + with nogil: + __status__ = nvmlGetVgpuDriverCapabilities(<_VgpuDriverCapability>capability, &cap_result) + check_status(__status__) + return cap_result + + +cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) except? 0: + """Retrieve the requested vGPU capability for GPU. + + Args: + device (intptr_t): The identifier of the target device. + capability (DeviceVgpuCapability): Specifies the + ``nvmlDeviceVgpuCapability_t`` to be queried. + + Returns: + unsigned int: Specifies that the queried capability is + supported, and also returns capability's data. + + .. seealso:: `nvmlDeviceGetVgpuCapabilities` + """ + cdef unsigned int cap_result + with nogil: + __status__ = nvmlDeviceGetVgpuCapabilities(device, <_DeviceVgpuCapability>capability, &cap_result) + check_status(__status__) + return cap_result + + +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. + + 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] + with nogil: + __status__ = nvmlVgpuTypeGetClass(vgpu_type_id, NULL, size) + check_status_size(__status__) + if size[0] == 0: + return "" + cdef bytes _vgpu_type_class_ = bytes(size[0]) + cdef char* vgpu_type_class = _vgpu_type_class_ + with nogil: + __status__ = nvmlVgpuTypeGetClass(vgpu_type_id, vgpu_type_class, size) + check_status(__status__) + 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: + """Retrieve the GPU Instance Profile ID for the given vGPU type ID. The API will return a valid GPU Instance Profile ID for the MIG capable vGPU types, else INVALID_GPU_INSTANCE_PROFILE_ID is returned. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned int: GPU Instance Profile ID. + + .. seealso:: `nvmlVgpuTypeGetGpuInstanceProfileId` + """ + cdef unsigned int gpu_instance_profile_id + with nogil: + __status__ = nvmlVgpuTypeGetGpuInstanceProfileId(vgpu_type_id, &gpu_instance_profile_id) + check_status(__status__) + return gpu_instance_profile_id + + +cpdef tuple vgpu_type_get_device_id(unsigned int vgpu_type_id): + """Retrieve the device ID of a vGPU type. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + A 2-tuple containing: + + - unsigned long long: Device ID and vendor ID of the device + contained in single 32 bit value. + - unsigned long long: Subsystem ID and subsystem vendor ID of + the device contained in single 32 bit value. + + .. seealso:: `nvmlVgpuTypeGetDeviceID` + """ + cdef unsigned long long device_id + cdef unsigned long long subsystem_id + with nogil: + __status__ = nvmlVgpuTypeGetDeviceID(vgpu_type_id, &device_id, &subsystem_id) + check_status(__status__) + return (device_id, subsystem_id) + + +cpdef unsigned long long vgpu_type_get_framebuffer_size(unsigned int vgpu_type_id) except? 0: + """Retrieve the vGPU framebuffer size in bytes. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned long long: Pointer to framebuffer size in bytes. + + .. seealso:: `nvmlVgpuTypeGetFramebufferSize` + """ + cdef unsigned long long fb_size + with nogil: + __status__ = nvmlVgpuTypeGetFramebufferSize(vgpu_type_id, &fb_size) + check_status(__status__) + return fb_size + + +cpdef unsigned int vgpu_type_get_num_display_heads(unsigned int vgpu_type_id) except? 0: + """Retrieve count of vGPU's supported display heads. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned int: Pointer to number of display heads. + + .. seealso:: `nvmlVgpuTypeGetNumDisplayHeads` + """ + cdef unsigned int num_display_heads + with nogil: + __status__ = nvmlVgpuTypeGetNumDisplayHeads(vgpu_type_id, &num_display_heads) + check_status(__status__) + return num_display_heads + + +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_index (unsigned int): Zero-based index of display + head. + + Returns: + A 2-tuple containing: + + - unsigned int: Pointer to maximum number of pixels in X + dimension. + - unsigned int: Pointer to maximum number of pixels in Y + dimension. + + .. seealso:: `nvmlVgpuTypeGetResolution` + """ + cdef unsigned int xdim + cdef unsigned int ydim + with nogil: + __status__ = nvmlVgpuTypeGetResolution(vgpu_type_id, display_index, &xdim, &ydim) + check_status(__status__) + return (xdim, ydim) + + +cpdef str vgpu_type_get_license(unsigned int vgpu_type_id): + """Retrieve license requirements for a vGPU type. + + 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 + cdef char[128] vgpu_type_license_string + with nogil: + __status__ = nvmlVgpuTypeGetLicense(vgpu_type_id, vgpu_type_license_string, size) + check_status(__status__) + 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: + """Retrieve the static frame rate limit value of the vGPU type. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned int: Reference to return the frame rate limit value. + + .. seealso:: `nvmlVgpuTypeGetFrameRateLimit` + """ + cdef unsigned int frame_rate_limit + with nogil: + __status__ = nvmlVgpuTypeGetFrameRateLimit(vgpu_type_id, &frame_rate_limit) + check_status(__status__) + return frame_rate_limit + + +cpdef unsigned int vgpu_type_get_max_instances(intptr_t device, unsigned int vgpu_type_id) except? 0: + """Retrieve the maximum number of vGPU instances creatable on a device for given vGPU type. + + Args: + device (intptr_t): The identifier of the target device. + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned int: Pointer to get the max number of vGPU instances + that can be created on a deicve for given vgpu_type_id. + + .. seealso:: `nvmlVgpuTypeGetMaxInstances` + """ + cdef unsigned int vgpu_instance_count + with nogil: + __status__ = nvmlVgpuTypeGetMaxInstances(device, vgpu_type_id, &vgpu_instance_count) + check_status(__status__) + return vgpu_instance_count + + +cpdef unsigned int vgpu_type_get_max_instances_per_vm(unsigned int vgpu_type_id) except? 0: + """Retrieve the maximum number of vGPU instances supported per VM for given vGPU type. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + unsigned int: Pointer to get the max number of vGPU instances + supported per VM for given ``vgpu_type_id``. + + .. seealso:: `nvmlVgpuTypeGetMaxInstancesPerVm` + """ + cdef unsigned int vgpu_instance_count_per_vm + with nogil: + __status__ = nvmlVgpuTypeGetMaxInstancesPerVm(vgpu_type_id, &vgpu_instance_count_per_vm) + check_status(__status__) + return vgpu_instance_count_per_vm + + +cpdef object vgpu_type_get_bar1_info(unsigned int vgpu_type_id): + """Retrieve the BAR1 info for given vGPU type. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + Returns: + nvmlVgpuTypeBar1Info_v1_t: Pointer to the vGPU type BAR1 + information structure ``nvmlVgpuTypeBar1Info_t``. + + .. seealso:: `nvmlVgpuTypeGetBAR1Info` + """ + cdef VgpuTypeBar1Info_v1 bar1info_py = VgpuTypeBar1Info_v1() + cdef nvmlVgpuTypeBar1Info_t *bar1info = (bar1info_py._get_ptr()) + bar1info.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuTypeBar1Info_v1_t), 1) + with nogil: + __status__ = nvmlVgpuTypeGetBAR1Info(vgpu_type_id, bar1info) + check_status(__status__) + return bar1info_py + + +cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance): + """Retrieve the UUID of a 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 + cdef char[80] uuid + with nogil: + __status__ = nvmlVgpuInstanceGetUUID(vgpu_instance, uuid, size) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(uuid) + + +cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance): + """Retrieve the NVIDIA driver version installed in the VM associated with a vGPU. + + 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 + cdef char[80] version + with nogil: + __status__ = nvmlVgpuInstanceGetVmDriverVersion(vgpu_instance, version, length) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(version) + + +cpdef unsigned long long vgpu_instance_get_fb_usage(unsigned int vgpu_instance) except? 0: + """Retrieve the framebuffer usage in bytes. + + Args: + vgpu_instance (unsigned int): The identifier of the target + instance. + + Returns: + unsigned long long: Pointer to framebuffer usage in bytes. + + .. seealso:: `nvmlVgpuInstanceGetFbUsage` + """ + cdef unsigned long long fb_usage + with nogil: + __status__ = nvmlVgpuInstanceGetFbUsage(vgpu_instance, &fb_usage) + check_status(__status__) + return fb_usage + + +cpdef unsigned int vgpu_instance_get_license_status(unsigned int vgpu_instance) except? 0: + """[Deprecated]. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + unsigned int: Reference to return the licensing status. + + .. seealso:: `nvmlVgpuInstanceGetLicenseStatus` + """ + cdef unsigned int licensed + with nogil: + __status__ = nvmlVgpuInstanceGetLicenseStatus(vgpu_instance, &licensed) + check_status(__status__) + return licensed + + +cpdef unsigned int vgpu_instance_get_type(unsigned int vgpu_instance) except? 0: + """Retrieve the vGPU type of a vGPU instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + unsigned int: Reference to return the vgpu_type_id. + + .. seealso:: `nvmlVgpuInstanceGetType` + """ + cdef nvmlVgpuTypeId_t vgpu_type_id + with nogil: + __status__ = nvmlVgpuInstanceGetType(vgpu_instance, &vgpu_type_id) + check_status(__status__) + return vgpu_type_id + + +cpdef unsigned int vgpu_instance_get_frame_rate_limit(unsigned int vgpu_instance) except? 0: + """Retrieve the frame rate limit set for the vGPU instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + unsigned int: Reference to return the frame rate limit. + + .. seealso:: `nvmlVgpuInstanceGetFrameRateLimit` + """ + cdef unsigned int frame_rate_limit + with nogil: + __status__ = nvmlVgpuInstanceGetFrameRateLimit(vgpu_instance, &frame_rate_limit) + check_status(__status__) + return frame_rate_limit + + +cpdef int vgpu_instance_get_ecc_mode(unsigned int vgpu_instance) except? -1: + """Retrieve the current ECC mode of vGPU instance. + + Args: + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. + + Returns: + int: Reference in which to return the current ECC mode. + + .. seealso:: `nvmlVgpuInstanceGetEccMode` + """ + cdef _EnableState ecc_mode + with nogil: + __status__ = nvmlVgpuInstanceGetEccMode(vgpu_instance, &ecc_mode) + check_status(__status__) + return ecc_mode + + +cpdef unsigned int vgpu_instance_get_encoder_capacity(unsigned int vgpu_instance) except? 0: + """Retrieve the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + unsigned int: Reference to an unsigned int for the encoder + capacity. + + .. seealso:: `nvmlVgpuInstanceGetEncoderCapacity` + """ + cdef unsigned int encoder_capacity + with nogil: + __status__ = nvmlVgpuInstanceGetEncoderCapacity(vgpu_instance, &encoder_capacity) + check_status(__status__) + return encoder_capacity + + +cpdef vgpu_instance_set_encoder_capacity(unsigned int vgpu_instance, unsigned int encoder_capacity): + """Set the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + encoder_capacity (unsigned int): Unsigned int for the encoder + capacity value. + + .. seealso:: `nvmlVgpuInstanceSetEncoderCapacity` + """ + with nogil: + __status__ = nvmlVgpuInstanceSetEncoderCapacity(vgpu_instance, encoder_capacity) + check_status(__status__) + + +cpdef tuple vgpu_instance_get_encoder_stats(unsigned int vgpu_instance): + """Retrieves the current encoder statistics of a vGPU Instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + A 3-tuple containing: + + - unsigned int: Reference to an unsigned int for count of active + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing + average FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency + in microseconds. + + .. seealso:: `nvmlVgpuInstanceGetEncoderStats` + """ + cdef unsigned int session_count + cdef unsigned int average_fps + cdef unsigned int average_latency + with nogil: + __status__ = nvmlVgpuInstanceGetEncoderStats(vgpu_instance, &session_count, &average_fps, &average_latency) + check_status(__status__) + return (session_count, average_fps, average_latency) + + +cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance): + """Retrieves information about all active encoder sessions on a 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] + with nogil: + __status__ = nvmlVgpuInstanceGetEncoderSessions(vgpu_instance, session_count, NULL) + check_status_size(__status__) + cdef EncoderSessionInfo session_info = EncoderSessionInfo(session_count[0]) + cdef nvmlEncoderSessionInfo_t *session_info_ptr = (session_info._get_ptr()) + if session_count[0] == 0: + return session_info + with nogil: + __status__ = nvmlVgpuInstanceGetEncoderSessions(vgpu_instance, session_count, session_info_ptr) + check_status(__status__) + return session_info + + +cpdef object vgpu_instance_get_fbc_stats(unsigned int vgpu_instance): + """Retrieves the active frame buffer capture sessions statistics of a vGPU Instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure + containing NvFBC stats. + + .. seealso:: `nvmlVgpuInstanceGetFBCStats` + """ + cdef FBCStats fbc_stats_py = FBCStats() + cdef nvmlFBCStats_t *fbc_stats = (fbc_stats_py._get_ptr()) + with nogil: + __status__ = nvmlVgpuInstanceGetFBCStats(vgpu_instance, fbc_stats) + check_status(__status__) + return fbc_stats_py + + +cpdef object vgpu_instance_get_fbc_sessions(unsigned int vgpu_instance): + """Retrieves information about active frame buffer capture sessions on a 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] + with nogil: + __status__ = nvmlVgpuInstanceGetFBCSessions(vgpu_instance, session_count, NULL) + check_status_size(__status__) + cdef FBCSessionInfo session_info = FBCSessionInfo(session_count[0]) + cdef nvmlFBCSessionInfo_t *session_info_ptr = (session_info._get_ptr()) + if session_count[0] == 0: + return session_info + with nogil: + __status__ = nvmlVgpuInstanceGetFBCSessions(vgpu_instance, session_count, session_info_ptr) + check_status(__status__) + return session_info + + +cpdef unsigned int vgpu_instance_get_gpu_instance_id(unsigned int vgpu_instance) except? 0: + """Retrieve the GPU Instance ID for the given vGPU Instance. The API will return a valid GPU Instance ID for MIG backed vGPU Instance, else INVALID_GPU_INSTANCE_ID is returned. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + unsigned int: GPU Instance ID. + + .. seealso:: `nvmlVgpuInstanceGetGpuInstanceId` + """ + cdef unsigned int gpu_instance_id + with nogil: + __status__ = nvmlVgpuInstanceGetGpuInstanceId(vgpu_instance, &gpu_instance_id) + check_status(__status__) + return gpu_instance_id + + +cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance): + """Retrieves the PCI Id of the given vGPU Instance i.e. the PCI Id of the GPU as seen inside the VM. + + 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] + with nogil: + __status__ = nvmlVgpuInstanceGetGpuPciId(vgpu_instance, NULL, length) + check_status_size(__status__) + if length[0] == 0: + return "" + cdef bytes _vgpu_pci_id_ = bytes(length[0]) + cdef char* vgpu_pci_id = _vgpu_pci_id_ + with nogil: + __status__ = nvmlVgpuInstanceGetGpuPciId(vgpu_instance, vgpu_pci_id, length) + check_status(__status__) + 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 ``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. + capability (VgpuCapability): Specifies the + ``nvmlVgpuCapability_t`` to be queried. + + Returns: + unsigned int: A boolean for the queried capability indicating + that feature is supported. + + .. seealso:: `nvmlVgpuTypeGetCapabilities` + """ + cdef unsigned int cap_result + with nogil: + __status__ = nvmlVgpuTypeGetCapabilities(vgpu_type_id, <_VgpuCapability>capability, &cap_result) + check_status(__status__) + return cap_result + + +cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance): + """Retrieve the MDEV UUID of a 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 + cdef char[80] mdev_uuid + with nogil: + __status__ = nvmlVgpuInstanceGetMdevUUID(vgpu_instance, mdev_uuid, size) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(mdev_uuid) + + +cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler): + """Set vGPU scheduler state for the given GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + p_scheduler (intptr_t): Pointer to the caller-provided + structure of ``nvmlVgpuSchedulerState_t``. + + .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState` + """ + (p_scheduler).version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuSchedulerState_v1_t), 1) + with nogil: + __status__ = nvmlGpuInstanceSetVgpuSchedulerState(gpu_instance, p_scheduler) + check_status(__status__) + + +cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance): + """Returns the vGPU scheduler state for the given GPU instance. The information returned in ``nvmlVgpuSchedulerStateInfo_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlVgpuSchedulerStateInfo_v1_t: Reference in which + ``p_scheduler_state_info`` is returned. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState` + """ + cdef VgpuSchedulerStateInfo_v1 p_scheduler_state_info_py = VgpuSchedulerStateInfo_v1() + cdef nvmlVgpuSchedulerStateInfo_t *p_scheduler_state_info = (p_scheduler_state_info_py._get_ptr()) + p_scheduler_state_info.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuSchedulerState_v1_t), 1) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerState(gpu_instance, p_scheduler_state_info) + check_status(__status__) + return p_scheduler_state_info_py + + +cpdef object gpu_instance_get_vgpu_scheduler_log(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_v1_t: Reference in which + ``p_scheduler_log_info`` is written. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog` + """ + cdef VgpuSchedulerLogInfo_v1 p_scheduler_log_info_py = VgpuSchedulerLogInfo_v1() + cdef nvmlVgpuSchedulerLogInfo_t *p_scheduler_log_info = (p_scheduler_log_info_py._get_ptr()) + p_scheduler_log_info.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuSchedulerLogInfo_v1_t), 1) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerLog(gpu_instance, p_scheduler_log_info) + check_status(__status__) + return p_scheduler_log_info_py + + +cpdef str device_get_pgpu_metadata_string(intptr_t device): + """Returns the properties of the physical GPU indicated by the device in an ascii-encoded string format. + + 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] + with nogil: + __status__ = nvmlDeviceGetPgpuMetadataString(device, NULL, buffer_size) + check_status_size(__status__) + if buffer_size[0] == 0: + return "" + cdef bytes _pgpu_metadata_ = bytes(buffer_size[0]) + cdef char* pgpu_metadata = _pgpu_metadata_ + with nogil: + __status__ = nvmlDeviceGetPgpuMetadataString(device, pgpu_metadata, buffer_size) + check_status(__status__) + return _cyb_cpython.PyUnicode_FromString(pgpu_metadata) + + +cpdef object device_get_vgpu_scheduler_log(intptr_t device): + """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 ``p_scheduler_log`` + is written. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerLog` + """ + cdef VgpuSchedulerLog p_scheduler_log_py = VgpuSchedulerLog() + cdef nvmlVgpuSchedulerLog_t *p_scheduler_log = (p_scheduler_log_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerLog(device, p_scheduler_log) + check_status(__status__) + return p_scheduler_log_py + + +cpdef object device_get_vgpu_scheduler_state(intptr_t device): + """Returns the vGPU scheduler state. The information returned in ``nvmlVgpuSchedulerGetState_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerGetState_t: Reference in which + ``p_scheduler_state`` is returned. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerState` + """ + cdef VgpuSchedulerGetState p_scheduler_state_py = VgpuSchedulerGetState() + cdef nvmlVgpuSchedulerGetState_t *p_scheduler_state = (p_scheduler_state_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerState(device, p_scheduler_state) + check_status(__status__) + return p_scheduler_state_py + + +cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device): + """Returns the vGPU scheduler capabilities. The list of supported vGPU schedulers returned in ``nvmlVgpuSchedulerCapabilities_t`` is from the NVML_VGPU_SCHEDULER_POLICY_*. This list enumerates the supported scheduler policies if the engine is Graphics type. The other values in ``nvmlVgpuSchedulerCapabilities_t`` are also applicable if the engine is Graphics type. For other engine types, it is BEST EFFORT policy. If ARR is supported and enabled, scheduling frequency and averaging factor are applicable else timeSlice is applicable. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerCapabilities_t: Reference in which + ``p_capabilities`` is written. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerCapabilities` + """ + cdef VgpuSchedulerCapabilities p_capabilities_py = VgpuSchedulerCapabilities() + cdef nvmlVgpuSchedulerCapabilities_t *p_capabilities = (p_capabilities_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerCapabilities(device, p_capabilities) + check_status(__status__) + return p_capabilities_py + + +cpdef device_set_vgpu_scheduler_state(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` + """ + with nogil: + __status__ = nvmlDeviceSetVgpuSchedulerState(device, p_scheduler_state) + check_status(__status__) + + +cpdef set_vgpu_version(intptr_t vgpu_version): + """Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator. + + Args: + vgpu_version (intptr_t): Pointer to a caller-supplied range of + supported vGPU versions. + + .. seealso:: `nvmlSetVgpuVersion` + """ + with nogil: + __status__ = nvmlSetVgpuVersion(vgpu_version) + check_status(__status__) + + +cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp): + """Retrieves current utilization for processes running on vGPUs on a physical GPU (device). + + Args: + device (intptr_t): The identifier for the target device. + last_seen_time_stamp (unsigned long long): Return only samples + with timestamp greater than last_seen_time_stamp. + + Returns: + A 2-tuple containing: + + - unsigned int: Pointer to caller-supplied array size, and + returns number of processes running on vGPU instances. + - nvmlVgpuProcessUtilizationSample_t: Pointer to caller-supplied + buffer in which vGPU sub process utilization samples are + returned. + + .. seealso:: `nvmlDeviceGetVgpuProcessUtilization` + """ + cdef unsigned int vgpu_process_samples_count + cdef nvmlVgpuProcessUtilizationSample_t utilization_samples + with nogil: + __status__ = nvmlDeviceGetVgpuProcessUtilization(device, last_seen_time_stamp, &vgpu_process_samples_count, &utilization_samples) + check_status(__status__) + return (vgpu_process_samples_count, utilization_samples) + + +cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? -1: + """Queries the state of per process accounting mode on vGPU. + + Args: + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. + + Returns: + int: Reference in which to return the current accounting mode. + + .. seealso:: `nvmlVgpuInstanceGetAccountingMode` + """ + cdef _EnableState mode + with nogil: + __status__ = nvmlVgpuInstanceGetAccountingMode(vgpu_instance, &mode) + check_status(__status__) + return mode + + +cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance): + """Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes returned can be in running or terminated state. + + 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] + with nogil: + __status__ = nvmlVgpuInstanceGetAccountingPids(vgpu_instance, count, NULL) + check_status_size(__status__) + if count[0] == 0: + 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) + check_status(__status__) + return pids + + +cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsigned int pid): + """Queries process's accounting stats. + + Args: + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. + pid (unsigned int): Process Id of the target process to query + stats for. + + Returns: + nvmlAccountingStats_t: Reference in which to return the + process's accounting stats. + + .. seealso:: `nvmlVgpuInstanceGetAccountingStats` + """ + cdef AccountingStats stats_py = AccountingStats() + cdef nvmlAccountingStats_t *stats = (stats_py._get_ptr()) + with nogil: + __status__ = nvmlVgpuInstanceGetAccountingStats(vgpu_instance, pid, stats) + check_status(__status__) + return stats_py + + +cpdef vgpu_instance_clear_accounting_pids(unsigned int vgpu_instance): + """Clears accounting information of the vGPU instance that have already terminated. + + Args: + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. + + .. seealso:: `nvmlVgpuInstanceClearAccountingPids` + """ + with nogil: + __status__ = nvmlVgpuInstanceClearAccountingPids(vgpu_instance) + check_status(__status__) + + +cpdef object vgpu_instance_get_license_info_v2(unsigned int vgpu_instance): + """Query the license information of the vGPU instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + + Returns: + nvmlVgpuLicenseInfo_t: Pointer to vGPU license information + structure. + + .. seealso:: `nvmlVgpuInstanceGetLicenseInfo_v2` + """ + cdef VgpuLicenseInfo license_info_py = VgpuLicenseInfo() + cdef nvmlVgpuLicenseInfo_t *license_info = (license_info_py._get_ptr()) + with nogil: + __status__ = nvmlVgpuInstanceGetLicenseInfo_v2(vgpu_instance, license_info) + check_status(__status__) + return license_info_py + + +cpdef unsigned int get_excluded_device_count() except? 0: + """Retrieves the number of excluded GPU devices in the system. + + Returns: + unsigned int: Reference in which to return the number of + excluded devices. + + .. seealso:: `nvmlGetExcludedDeviceCount` + """ + cdef unsigned int device_count + with nogil: + __status__ = nvmlGetExcludedDeviceCount(&device_count) + check_status(__status__) + return device_count + + +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: + index (unsigned int): The index of the target GPU, >= 0 and < + ``deviceCount``. + + Returns: + nvmlExcludedDeviceInfo_t: Reference in which to return the + device information. + + .. seealso:: `nvmlGetExcludedDeviceInfoByIndex` + """ + cdef ExcludedDeviceInfo info_py = ExcludedDeviceInfo() + cdef nvmlExcludedDeviceInfo_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlGetExcludedDeviceInfoByIndex(index, info) + check_status(__status__) + return info_py + + +cpdef int device_set_mig_mode(intptr_t device, unsigned int mode) except? -1: + """Set MIG mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + mode (unsigned int): The mode to be set, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + + Returns: + int: The activation_status status. + + .. seealso:: `nvmlDeviceSetMigMode` + """ + cdef _Return activation_status + with nogil: + __status__ = nvmlDeviceSetMigMode(device, mode, &activation_status) + check_status(__status__) + return activation_status + + +cpdef tuple device_get_mig_mode(intptr_t device): + """Get MIG mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - unsigned int: Returns the current mode, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + - unsigned int: Returns the pending mode, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + + .. seealso:: `nvmlDeviceGetMigMode` + """ + cdef unsigned int current_mode + cdef unsigned int pending_mode + with nogil: + __status__ = nvmlDeviceGetMigMode(device, ¤t_mode, &pending_mode) + check_status(__status__) + return (current_mode, pending_mode) + + +cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, unsigned int profile_id): + """Get GPU instance placements. + + Args: + 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] + with nogil: + __status__ = nvmlDeviceGetGpuInstancePossiblePlacements_v2(device, profile_id, NULL, count) + check_status_size(__status__) + cdef GpuInstancePlacement placements = GpuInstancePlacement(count[0]) + cdef nvmlGpuInstancePlacement_t *placements_ptr = (placements._get_ptr()) + if count[0] == 0: + return placements + with nogil: + __status__ = nvmlDeviceGetGpuInstancePossiblePlacements_v2(device, profile_id, placements_ptr, count) + check_status(__status__) + return placements + + +cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, unsigned int profile_id) except? 0: + """Get GPU instance profile capacity. + + Args: + device (intptr_t): The identifier of the target device. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. + + Returns: + unsigned int: Returns remaining instance count for the profile + ID. + + .. seealso:: `nvmlDeviceGetGpuInstanceRemainingCapacity` + """ + cdef unsigned int count + with nogil: + __status__ = nvmlDeviceGetGpuInstanceRemainingCapacity(device, profile_id, &count) + check_status(__status__) + return count + + +cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_id) except? 0: + """Create GPU instance. + + Args: + device (intptr_t): The identifier of the target device. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. + + Returns: + intptr_t: Returns the GPU instance handle. + + .. seealso:: `nvmlDeviceCreateGpuInstance` + """ + cdef GpuInstance gpu_instance + with nogil: + __status__ = nvmlDeviceCreateGpuInstance(device, profile_id, &gpu_instance) + check_status(__status__) + return gpu_instance + + +cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, intptr_t placement) except? 0: + """Create GPU instance with the specified placement. + + Args: + device (intptr_t): The identifier of the target device. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. + placement (intptr_t): The requested placement. See + ``nvmlDeviceGetGpuInstancePossiblePlacements_v2``. + + Returns: + intptr_t: Returns the GPU instance handle. + + .. seealso:: `nvmlDeviceCreateGpuInstanceWithPlacement` + """ + cdef GpuInstance gpu_instance + with nogil: + __status__ = nvmlDeviceCreateGpuInstanceWithPlacement(device, profile_id, placement, &gpu_instance) + check_status(__status__) + return gpu_instance + + +cpdef gpu_instance_destroy(intptr_t gpu_instance): + """Destroy GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + .. seealso:: `nvmlGpuInstanceDestroy` + """ + with nogil: + __status__ = nvmlGpuInstanceDestroy(gpu_instance) + check_status(__status__) + + +cpdef intptr_t device_get_gpu_instance_by_id(intptr_t device, unsigned int id) except? 0: + """Get GPU instances for given instance ID. + + Args: + device (intptr_t): The identifier of the target device. + id (unsigned int): The GPU instance ID. + + Returns: + intptr_t: Returns GPU instance. + + .. seealso:: `nvmlDeviceGetGpuInstanceById` + """ + cdef GpuInstance gpu_instance + with nogil: + __status__ = nvmlDeviceGetGpuInstanceById(device, id, &gpu_instance) + check_status(__status__) + return gpu_instance + + +cpdef object gpu_instance_get_info(intptr_t gpu_instance): + """Get GPU instance information. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlGpuInstanceInfo_t: Return GPU instance information. + + .. seealso:: `nvmlGpuInstanceGetInfo` + """ + cdef GpuInstanceInfo info_py = GpuInstanceInfo() + cdef nvmlGpuInstanceInfo_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlGpuInstanceGetInfo(gpu_instance, info) + check_status(__status__) + return info_py + + +cpdef object gpu_instance_get_compute_instance_profile_info_v(intptr_t gpu_instance, unsigned int profile, unsigned int eng_profile): + """Versioned wrapper around ``nvmlGpuInstanceGetComputeInstanceProfileInfo`` that accepts a versioned ``nvmlComputeInstanceProfileInfo_v2_t`` or later output structure. + + Args: + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile (unsigned int): One of the + NVML_COMPUTE_INSTANCE_PROFILE_*. + eng_profile (unsigned int): One of the + NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_*. + + Returns: + nvmlComputeInstanceProfileInfo_v2_t: Returns detailed profile + information. + + .. seealso:: `nvmlGpuInstanceGetComputeInstanceProfileInfoV` + """ + cdef ComputeInstanceProfileInfo_v2 info_py = ComputeInstanceProfileInfo_v2() + cdef nvmlComputeInstanceProfileInfo_v2_t *info = (info_py._get_ptr()) + info.version = NVML_VERSION_STRUCT(sizeof(nvmlComputeInstanceProfileInfo_v2_t), 2) + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstanceProfileInfoV(gpu_instance, profile, eng_profile, info) + check_status(__status__) + return info_py + + +cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t gpu_instance, unsigned int profile_id) except? 0: + """Get compute instance profile capacity. + + Args: + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + + Returns: + unsigned int: Returns remaining instance count for the profile + ID. + + .. seealso:: `nvmlGpuInstanceGetComputeInstanceRemainingCapacity` + """ + cdef unsigned int count + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstanceRemainingCapacity(gpu_instance, profile_id, &count) + check_status(__status__) + return count + + +cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_instance, unsigned int profile_id): + """Get compute instance placements. + + Args: + 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] + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpu_instance, profile_id, NULL, count) + check_status_size(__status__) + cdef ComputeInstancePlacement placements = ComputeInstancePlacement(count[0]) + cdef nvmlComputeInstancePlacement_t *placements_ptr = (placements._get_ptr()) + if count[0] == 0: + return placements + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstancePossiblePlacements(gpu_instance, profile_id, placements_ptr, count) + check_status(__status__) + return placements + + +cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsigned int profile_id) except? 0: + """Create compute instance. + + Args: + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + + Returns: + intptr_t: Returns the compute instance handle. + + .. seealso:: `nvmlGpuInstanceCreateComputeInstance` + """ + cdef ComputeInstance compute_instance + with nogil: + __status__ = nvmlGpuInstanceCreateComputeInstance(gpu_instance, profile_id, &compute_instance) + check_status(__status__) + return compute_instance + + +cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, intptr_t placement) except? 0: + """Create compute instance with the specified placement. + + Args: + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + placement (intptr_t): The requested placement. See + ``nvmlGpuInstanceGetComputeInstancePossiblePlacements``. + + Returns: + intptr_t: Returns the compute instance handle. + + .. seealso:: `nvmlGpuInstanceCreateComputeInstanceWithPlacement` + """ + cdef ComputeInstance compute_instance + with nogil: + __status__ = nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpu_instance, profile_id, placement, &compute_instance) + check_status(__status__) + return compute_instance + + +cpdef compute_instance_destroy(intptr_t compute_instance): + """Destroy compute instance. + + Args: + compute_instance (intptr_t): The compute instance handle. + + .. seealso:: `nvmlComputeInstanceDestroy` + """ + with nogil: + __status__ = nvmlComputeInstanceDestroy(compute_instance) + check_status(__status__) + + +cpdef intptr_t gpu_instance_get_compute_instance_by_id(intptr_t gpu_instance, unsigned int id) except? 0: + """Get compute instance for given instance ID. + + Args: + gpu_instance (intptr_t): The identifier of the target GPU + instance. + id (unsigned int): The compute instance ID. + + Returns: + intptr_t: Returns compute instance. + + .. seealso:: `nvmlGpuInstanceGetComputeInstanceById` + """ + cdef ComputeInstance compute_instance + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstanceById(gpu_instance, id, &compute_instance) + check_status(__status__) + return compute_instance + + +cpdef object compute_instance_get_info_v2(intptr_t compute_instance): + """Get compute instance information. + + Args: + compute_instance (intptr_t): The compute instance handle. + + Returns: + nvmlComputeInstanceInfo_t: Return compute instance + information. + + .. seealso:: `nvmlComputeInstanceGetInfo_v2` + """ + cdef ComputeInstanceInfo info_py = ComputeInstanceInfo() + cdef nvmlComputeInstanceInfo_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlComputeInstanceGetInfo_v2(compute_instance, info) + check_status(__status__) + return info_py + + +cpdef unsigned int device_is_mig_device_handle(intptr_t device) except? 0: + """Test if the given handle refers to a MIG device. + + Args: + device (intptr_t): NVML handle to test. + + Returns: + unsigned int: True when handle refers to a MIG device. + + .. seealso:: `nvmlDeviceIsMigDeviceHandle` + """ + cdef unsigned int is_mig_device + with nogil: + __status__ = nvmlDeviceIsMigDeviceHandle(device, &is_mig_device) + check_status(__status__) + return is_mig_device + + +cpdef unsigned int device_get_gpu_instance_id(intptr_t device) except? 0: + """Get GPU instance ID for the given MIG device handle. + + Args: + device (intptr_t): Target MIG device handle. + + Returns: + unsigned int: GPU instance ID. + + .. seealso:: `nvmlDeviceGetGpuInstanceId` + """ + cdef unsigned int id + with nogil: + __status__ = nvmlDeviceGetGpuInstanceId(device, &id) + check_status(__status__) + return id + + +cpdef unsigned int device_get_compute_instance_id(intptr_t device) except? 0: + """Get compute instance ID for the given MIG device handle. + + Args: + device (intptr_t): Target MIG device handle. + + Returns: + unsigned int: Compute instance ID. + + .. seealso:: `nvmlDeviceGetComputeInstanceId` + """ + cdef unsigned int id + with nogil: + __status__ = nvmlDeviceGetComputeInstanceId(device, &id) + check_status(__status__) + return id + + +cpdef unsigned int device_get_max_mig_device_count(intptr_t device) except? 0: + """Get the maximum number of MIG devices that can exist under a given parent NVML device. + + Args: + device (intptr_t): Target device handle. + + Returns: + unsigned int: Count of MIG devices. + + .. seealso:: `nvmlDeviceGetMaxMigDeviceCount` + """ + cdef unsigned int count + with nogil: + __status__ = nvmlDeviceGetMaxMigDeviceCount(device, &count) + check_status(__status__) + return count + + +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. + index (unsigned int): Index of the MIG device. + + Returns: + intptr_t: Reference to the MIG device handle. + + .. seealso:: `nvmlDeviceGetMigDeviceHandleByIndex` + """ + cdef Device mig_device + with nogil: + __status__ = nvmlDeviceGetMigDeviceHandleByIndex(device, index, &mig_device) + check_status(__status__) + return mig_device + + +cpdef intptr_t device_get_device_handle_from_mig_device_handle(intptr_t mig_device) except? 0: + """Get parent device handle from a MIG device handle. + + Args: + mig_device (intptr_t): MIG device handle. + + Returns: + intptr_t: Device handle. + + .. seealso:: `nvmlDeviceGetDeviceHandleFromMigDeviceHandle` + """ + cdef Device device + with nogil: + __status__ = nvmlDeviceGetDeviceHandleFromMigDeviceHandle(mig_device, &device) + check_status(__status__) + return device + + +cpdef device_power_smoothing_activate_preset_profile(intptr_t device, intptr_t profile): + """Activiate a specific preset profile for datacenter power smoothing. The API only sets the active preset profile based on the input profileId, and ignores the other parameters of the structure. Requires root/admin permissions. + + Args: + device (intptr_t): The identifier of the target device. + profile (intptr_t): Reference to + ``nvmlPowerSmoothingProfile_v1_t``. Note that only + ``profile->profileId`` is used and the rest of the + structure is ignored. + + .. seealso:: `nvmlDevicePowerSmoothingActivatePresetProfile` + """ + with nogil: + __status__ = nvmlDevicePowerSmoothingActivatePresetProfile(device, profile) + check_status(__status__) + + +cpdef device_power_smoothing_update_preset_profile_param(intptr_t device, intptr_t profile): + """Update the value of a specific profile parameter contained within ``nvmlPowerSmoothingProfile_v1_t``. Requires root/admin permissions. + + Args: + device (intptr_t): The identifier of the target device. + profile (intptr_t): Reference to + ``nvmlPowerSmoothingProfile_v1_t`` struct. + + .. seealso:: `nvmlDevicePowerSmoothingUpdatePresetProfileParam` + """ + with nogil: + __status__ = nvmlDevicePowerSmoothingUpdatePresetProfileParam(device, profile) + check_status(__status__) + + +cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state): + """Enable or disable the Power Smoothing Feature. Requires root/admin permissions. + + Args: + device (intptr_t): The identifier of the target device. + state (intptr_t): Reference to + ``nvmlPowerSmoothingState_v1_t``. + + .. seealso:: `nvmlDevicePowerSmoothingSetState` + """ + with nogil: + __status__ = nvmlDevicePowerSmoothingSetState(device, state) + check_status(__status__) + + +cpdef object device_get_addressing_mode(intptr_t device): + """Get the addressing mode for a given GPU. Addressing modes can be one of:. + + Args: + device (intptr_t): The device handle. + + Returns: + nvmlDeviceAddressingMode_v1_t: Pointer to addressing mode of + the device. + + .. seealso:: `nvmlDeviceGetAddressingMode` + """ + cdef DeviceAddressingMode_v1 mode_py = DeviceAddressingMode_v1() + cdef nvmlDeviceAddressingMode_t *mode = (mode_py._get_ptr()) + mode.version = NVML_VERSION_STRUCT(sizeof(nvmlDeviceAddressingMode_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetAddressingMode(device, mode) + check_status(__status__) + return mode_py + + +cpdef object device_get_repair_status(intptr_t device): + """Get the repair status for TPC/Channel repair. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlRepairStatus_v1_t: Reference to ``nvmlRepairStatus_t``. + + .. seealso:: `nvmlDeviceGetRepairStatus` + """ + cdef RepairStatus_v1 repair_status_py = RepairStatus_v1() + cdef nvmlRepairStatus_t *repair_status = (repair_status_py._get_ptr()) + repair_status.version = NVML_VERSION_STRUCT(sizeof(nvmlRepairStatus_v1_t), 1) + with nogil: + __status__ = nvmlDeviceGetRepairStatus(device, repair_status) + check_status(__status__) + return repair_status_py + + +cpdef object device_get_power_mizer_mode_v1(intptr_t device): + """Retrieves current power mizer mode on this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlDevicePowerMizerModes_v1_t: Reference in which to return + the power mizer mode. + + .. seealso:: `nvmlDeviceGetPowerMizerMode_v1` + """ + cdef DevicePowerMizerModes_v1 power_mizer_mode_py = DevicePowerMizerModes_v1() + cdef nvmlDevicePowerMizerModes_v1_t *power_mizer_mode = (power_mizer_mode_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetPowerMizerMode_v1(device, power_mizer_mode) + check_status(__status__) + return power_mizer_mode_py + + +cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode): + """Sets the new power mizer mode. + + Args: + device (intptr_t): The identifier of the target device. + power_mizer_mode (intptr_t): Reference in which to set the + power mizer mode. + + .. seealso:: `nvmlDeviceSetPowerMizerMode_v1` + """ + with nogil: + __status__ = nvmlDeviceSetPowerMizerMode_v1(device, 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_cper_v1(): + """Retrieves Common Platform Error Record (CPER) data. + + Returns: + nvmlGetCPER_v1_t: Pointer to an ``nvmlGetCPER_v1_t``. On entry + set ``cursor.cperTypeMask``, ``cursor.uuid`` (empty string + for all), ``cursor.handle`` (to + ``NVML_CPER_CURSOR_HANDLE_INIT`` for first call), + ``buffer`` (or NULL), ``bufferSize``. On return + ``cursor.handle`` and ``bufferSize`` are updated. + + .. seealso:: `nvmlSystemGetCPER_v1` + """ + cdef GetCPER_v1 cper_py = GetCPER_v1() + cdef nvmlGetCPER_v1_t *cper = (cper_py._get_ptr()) + with nogil: + __status__ = nvmlSystemGetCPER_v1(cper) + check_status(__status__) + return cper_py + + +cpdef object device_get_bbx_time_data_v1(intptr_t device): + """Retrieves the cumulative number of seconds the GPU has had the driver loaded. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlBBXTimeData_v1_t: Reference in which to return the + cumulative number of seconds the GPU has had the driver + loaded. + + .. seealso:: `nvmlDeviceGetBBXTimeData_v1` + """ + cdef BBXTimeData_v1 time_data_py = BBXTimeData_v1() + cdef nvmlBBXTimeData_v1_t *time_data = (time_data_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetBBXTimeData_v1(device, time_data) + check_status(__status__) + return time_data_py + + +cpdef object device_get_accounting_stats_v2(intptr_t device): + """Queries process's accounting stats (v2). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlAccountingStats_v2_t: Reference in which to return the + process's accounting stats (v2). + + .. seealso:: `nvmlDeviceGetAccountingStats_v2` + """ + cdef AccountingStats_v2 stats_py = AccountingStats_v2() + cdef nvmlAccountingStats_v2_t *stats = (stats_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetAccountingStats_v2(device, stats) + check_status(__status__) + return stats_py + + +cpdef object device_get_remapped_rows_v2(intptr_t device): + """Get the status of row remapper. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlRemappedRowsInfo_v2_t: Reference for + ``nvmlRemappedRowsInfo_v2_t``. + + .. seealso:: `nvmlDeviceGetRemappedRows_v2` + """ + cdef RemappedRowsInfo_v2 info_py = RemappedRowsInfo_v2() + cdef nvmlRemappedRowsInfo_v2_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetRemappedRows_v2(device, info) + check_status(__status__) + return info_py + + +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 + + Args: + cpuNumber (unsigned int): The CPU number + + Returns: + array: An array of device handles for GPUs found with affinity to cpuNumber + """ + cdef unsigned int[1] count = [0] + with nogil: + __status__ = nvmlSystemGetTopologyGpuSet(cpuNumber, count, NULL) + check_status_size(__status__) + if count[0] == 0: + return view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0] + cdef view.array deviceArray = view.array(shape=(count[0],), itemsize=sizeof(intptr_t), format="P", mode="c") + with nogil: + __status__ = nvmlSystemGetTopologyGpuSet(cpuNumber, count, deviceArray.data) + check_status(__status__) + return deviceArray + + +cpdef str system_get_driver_branch(): + """Retrieves the driver branch of the NVIDIA driver installed on the system. + + Returns: + str: driver branch. + """ + cdef nvmlSystemDriverBranchInfo_t info + # Calculation copied from the macro NVML_STRUCT_VERSION in nvml.h + # Needs to be updated if the version of the nvmlSystemDriverBranchInfo_t + # struct changes in the future. + info.version = NVML_VERSION_STRUCT(sizeof(nvmlSystemDriverBranchInfo_v1_t), 1) + cdef unsigned int length = 80 + with nogil: + __status__ = nvmlSystemGetDriverBranch(&info, length) + check_status(__status__) + return cpython.PyUnicode_FromString(info.branch) + + +cpdef object unit_get_devices(intptr_t unit): + """Retrieves the set of GPU devices that are attached to the specified unit. + + Args: + unit (Unit): The identifier of the target unit. + + Returns: + array: An array of device handles for GPUs attached to the unit. + """ + cdef unsigned int[1] deviceCount = [0] + with nogil: + __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) + check_status(__status__) + return deviceArray + + +cpdef object device_get_topology_nearest_gpus(intptr_t device, unsigned int level): + """Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level + + Args: + device (Device): The identifier of the first device + level (GpuTopologyLevel): The level to search for other GPUs + + Returns: + array: An array of device handles for GPUs found at level + """ + cdef unsigned int[1] count = [0] + with nogil: + __status__ = nvmlDeviceGetTopologyNearestGpus( + device, + level, + count, + NULL + ) + check_status_size(__status__) + if count[0] == 0: + return view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0] + cdef view.array deviceArray = view.array(shape=(count[0],), itemsize=sizeof(intptr_t), format="P", mode="c") + with nogil: + __status__ = nvmlDeviceGetTopologyNearestGpus( + device, + level, + count, + deviceArray.data + ) + check_status(__status__) + return deviceArray + + +cpdef int device_get_temperature_v(intptr_t device, nvmlTemperatureSensors_t sensorType): + """Retrieves the current temperature readings (in degrees C) for the given device. + + Args: + device (intptr_t): Target device identifier. + + Returns: + nvmlTemperature_v1_t: Structure specifying the sensor type (input) and retrieved temperature value (output). + + .. seealso:: `nvmlDeviceGetTemperatureV` + """ + cdef nvmlTemperature_v1_t[1] temperature + + with nogil: + temperature[0].version = NVML_VERSION_STRUCT(sizeof(nvmlTemperature_v1_t), 1) + temperature[0].sensorType = sensorType + __status__ = nvmlDeviceGetTemperatureV(device, temperature) + check_status(__status__) + return temperature.temperature + + +cpdef object device_get_supported_performance_states(intptr_t device): + """Get all supported Performance States (P-States) for the device. + + Args: + device (Device): The identifier of the target device. + """ + cdef int size = 16 # NVML_MAX_GPU_PERF_STATES + cdef view.array pstates = view.array(shape=(size,), itemsize=sizeof(unsigned int), format="I", mode="c") + + # The header says "size is the size of the pstates array in bytes". + # The size of an enum in C is implementation-defined, so we multiply by `sizeof(nvmlPstates_t)` here. + with nogil: + __status__ = nvmlDeviceGetSupportedPerformanceStates( + device, + pstates.data, + size * sizeof(nvmlPstates_t) + ) + check_status(__status__) + return pstates + + +cpdef object device_get_running_process_detail_list(intptr_t device, unsigned int mode): + """Get information about running processes on a device for input context + + Args: + device (Device): The device handle or MIG handle + mode (unsigned int): The process mode (Compute/Graphics/MPSCompute) + """ + + cdef ProcessDetailList_v1 plist = ProcessDetailList_v1() + cdef nvmlProcessDetailList_v1_t *ptr = plist._get_ptr() + + # Get size of array + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlProcessDetailList_v1_t), 1) + ptr.mode = mode + ptr.numProcArrayEntries = 0 + ptr.procArray = NULL + __status__ = nvmlDeviceGetRunningProcessDetailList(device, ptr) + check_status_size(__status__) + + if ptr.numProcArrayEntries == 0: + return plist + + procArray = ProcessDetail_v1(ptr.numProcArrayEntries) + plist.proc_array = procArray + + with nogil: + __status__ = nvmlDeviceGetRunningProcessDetailList(device, ptr) + check_status(__status__) + return plist + + +cpdef tuple device_get_samples(intptr_t device, int type, unsigned long long last_seen_time_stamp): + """Gets recent samples for the GPU. + + Args: + device (intptr_t): The identifier for the target device. + type (SamplingType): Type of sampling event. + last_seen_time_stamp (unsigned long long): Return only samples with timestamp greater than last_seen_time_stamp. + + .. seealso:: `nvmlDeviceGetSamples` + """ + cdef unsigned int[1] sample_count = [0] + cdef unsigned int[1] sample_val_type = [0] + with nogil: + __status__ = nvmlDeviceGetSamples(device, <_SamplingType>type, last_seen_time_stamp, <_ValueType*>sample_val_type, sample_count, NULL) + check_status_size(__status__) + cdef Sample samples = Sample(sample_count[0]) + cdef nvmlSample_t *samples_ptr = samples._get_ptr() + if sample_count[0] == 0: + return samples + with nogil: + __status__ = nvmlDeviceGetSamples(device, <_SamplingType>type, last_seen_time_stamp, <_ValueType*>sample_val_type, sample_count, samples_ptr) + check_status(__status__) + return (sample_val_type[0], samples) + + +cpdef tuple device_get_retired_pages_v2(intptr_t device, int cause): + """Returns the list of retired pages by source, including pages that are pending retirement + + Args: + device (Device): The identifier of the target device. + cause (PageRetirementCause): Filter page addresses by cause of retirement. + + Returns: + tuple: A tuple of two arrays (addresses, timestamps). + """ + cdef unsigned int[1] page_count = [0] + with nogil: + __status__ = nvmlDeviceGetRetiredPages_v2(device, <_PageRetirementCause>cause, page_count, NULL, 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], + 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") + cdef view.array timestamps = view.array(shape=(page_count[0],), itemsize=sizeof(unsigned long long), format="Q", mode="c") + with nogil: + __status__ = nvmlDeviceGetRetiredPages_v2(device, <_PageRetirementCause>cause, page_count, addresses.data, timestamps.data) + check_status(__status__) + return (addresses, timestamps) + + +cpdef object device_get_processes_utilization_info(intptr_t device, unsigned long long last_seen_time_stamp): + """Retrieves the recent utilization and process ID for all running processes + + Args: + device (Device): The identifier of the target device. + last_seen_time_stamp (unsigned long long): Timestamp in microseconds. Set it to 0 to read utilization based + on all the samples maintained by the driver's internal sample buffer. Set to a timeStamp retrieved from + a previous query to read utilization since the previous query. + + Returns: + ProcessesUtilizationInfo_v1: The processes utilization information structure. + """ + cdef ProcessesUtilizationInfo_v1 procesesUtilInfo = ProcessesUtilizationInfo_v1() + cdef nvmlProcessesUtilizationInfo_t *ptr = procesesUtilInfo._get_ptr() + + # Get size of array + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlProcessesUtilizationInfo_v1_t), 1) + ptr.processSamplesCount = 0 + ptr.lastSeenTimeStamp = last_seen_time_stamp + ptr.procUtilArray = NULL + __status__ = nvmlDeviceGetProcessesUtilizationInfo( + device, ptr + ) + check_status_size(__status__) + + if ptr.processSamplesCount == 0: + return procesesUtilInfo + + cdef ProcessUtilizationInfo_v1 procUtilArray = ProcessUtilizationInfo_v1(ptr.processSamplesCount) + procesesUtilInfo.proc_util_array = procUtilArray + + with nogil: + __status__ = nvmlDeviceGetProcessesUtilizationInfo( + device, ptr + ) + check_status(__status__) + + return procesesUtilInfo + + +cpdef device_set_hostname_v1(intptr_t device, str hostname): + """Set the hostname for the device. + + Args: + device (Device): The identifier of the target device. + hostname (str): The new hostname to set. + """ + cdef bytes = cpython.PyUnicode_AsASCIIString(hostname) + if len(bytes) > 64: + raise ValueError("hostname must 64 characters or less") + + cdef nvmlHostname_v1_t hostname_struct + memcpy(hostname_struct.value, cpython.PyBytes_AsString(bytes), len(bytes)) + + with nogil: + __status__ = nvmlDeviceSetHostname_v1(device, &hostname_struct) + check_status(__status__) + + +cpdef str device_get_hostname_v1(intptr_t device): + """Get the hostname for the device. + + Args: + device (Device): The identifier of the target device. + + Returns: + str: Hostname of the device. + """ + cdef nvmlHostname_v1_t hostname + with nogil: + __status__ = nvmlDeviceGetHostname_v1(device, &hostname) + check_status(__status__) + return cpython.PyUnicode_FromString(hostname.value) + + +cdef FieldValue _cast_field_values(values): + if isinstance(values, FieldValue): + return values + cdef FieldValue values_ + cdef unsigned int valuesCount = len(values) + values_ = FieldValue(valuesCount) + for i, v in enumerate(values): + if isinstance(v, tuple): + if len(v) != 2: + raise ValueError("FieldValue tuple must be of length 2") + if not isinstance(v[0], int) or not isinstance(v[1], int): + raise ValueError("FieldValue tuple elements must be integers") + values_[i].field_id = v[0] + values_[i].scope_id = v[1] + elif isinstance(v, int): + values_[i].field_id = v + else: + raise ValueError("Each entry must be an integer field ID, or a tuple of (field ID, scope ID)") + return values_ + + +cpdef object device_get_field_values(intptr_t device, values): + """Request values for a list of fields for a device. This API allows multiple fields to be queried at once. If any of the underlying fieldIds are populated by the same driver call, the results for those field IDs will be populated from a single call rather than making a driver call for each fieldId. + + Args: + device (intptr_t): The device handle of the GPU to request field values for. + values (FieldValue): Array of FieldValue specifying what to retrieve. + + .. seealso:: `nvmlDeviceGetFieldValues` + """ + 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__) + + values_._data.resize((valuesCount,)) + return values_ + + +cpdef device_clear_field_values(intptr_t device, values): + """Clear values for a list of fields for a device. This API allows multiple fields to be cleared at once. + + Args: + device (Device): The device handle of the GPU to request field values for + values (FieldValue): FieldValue instance to hold field values. Each value's fieldId must be populated + prior to this call + """ + 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 nvmlDeviceClearFieldValues returns NVML_INVALID_ARGUMENT + if valuesCount == 0: + return values_ + + with nogil: + __status__ = nvmlDeviceClearFieldValues(device, valuesCount, ptr) + check_status(__status__) + + +cpdef object device_get_supported_vgpus(intptr_t device): + """Retrieve the supported vGPU types on a physical GPU (device). + + Args: + device (Device): The identifier of the target device. + + Returns: + array: An array of supported vGPU type IDs. + """ + cdef unsigned int[1] vgpuCount = [0] + with nogil: + __status__ = nvmlDeviceGetSupportedVgpus(device, vgpuCount, NULL) + check_status_size(__status__) + if vgpuCount[0] == 0: + return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef view.array vgpuTypeIds = view.array(shape=(deviceCount[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + with nogil: + __status__ = nvmlDeviceGetSupportedVgpus(device, vgpuCount, vgpuTypeIds.data) + check_status(__status__) + return vgpuTypeIds + + +cpdef object device_get_creatable_vgpus(intptr_t device): + """Retrieve the currently creatable vGPU types on a physical GPU (device). + + Args: + device (Device): The identifier of the target device. + + Returns: + array: An array of createable vGPU type IDs. + """ + cdef unsigned int[1] vgpuCount = [0] + with nogil: + __status__ = nvmlDeviceGetCreatableVgpus(device, vgpuCount, NULL) + check_status_size(__status__) + if vgpuCount[0] == 0: + return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef view.array vgpuTypeIds = view.array(shape=(deviceCount[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + with nogil: + __status__ = nvmlDeviceGetCreatableVgpus(device, vgpuCount, vgpuTypeIds.data) + check_status(__status__) + return vgpuTypeIds + + +cpdef object device_get_active_vgpus(intptr_t device): + """Retrieve the active vGPU instances on a device. + + Args: + device (Device): The identifier of the target device. + + Returns: + array: An array of active vGPU instance IDs. + """ + cdef unsigned int[1] vgpuCount = [0] + with nogil: + __status__ = nvmlDeviceGetActiveVgpus(device, vgpuCount, NULL) + check_status_size(__status__) + if vgpuCount[0] == 0: + return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef view.array vgpuInstances = view.array(shape=(deviceCount[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + with nogil: + __status__ = nvmlDeviceGetActiveVgpus(device, vgpuCount, vgpuInstances.data) + check_status(__status__) + return vgpuInstances + + +cpdef tuple vgpu_instance_get_vm_id(unsigned int vgpu_instance): + """Retrieve the VM ID associated with a vGPU instance. + + Args: + vgpu_instance (unsigned int): The identifier of the target vGPU instance. + + Returns: + tuple[str, VgpuVmIdType]: A tuple of (id, id_type). + """ + cdef unsigned int size = 80 + cdef char[80] vmId + cdef nvmlVgpuVmIdType_t[1] vmIdType + with nogil: + __status__ = nvmlVgpuInstanceGetVmID(vgpu_instance, vmId, size, vmIdType) + check_status(__status__) + return (cpython.PyUnicode_FromString(vmId), vmIdType[0]) + + +cpdef object gpu_instance_get_creatable_vgpus(intptr_t gpu_instance): + """Query the currently creatable vGPU types on a specific GPU Instance. + + Args: + gpu_instance (GpuInstance): The identifier of the target GPU Instance. + + Returns: + VgpuTypeIdInfo_v1: The vGPU type ID information structure. + """ + + cdef VgpuTypeIdInfo_v1 pVgpus = VgpuTypeIdInfo_v1() + cdef nvmlVgpuTypeIdInfo_v1_t *ptr = pVgpus._get_ptr() + + # Get size of array + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuTypeIdInfo_v1_t), 1) + ptr.vgpuCount = 0 + ptr.vgpuTypeIds = NULL + __status__ = nvmlGpuInstanceGetCreatableVgpus(gpu_instance, ptr) + check_status_size(__status__) + + if ptr.vgpuCount == 0: + return pVgpus + + cdef view.array vgpuTypeIds = view.array(shape=(ptr.vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c") + pVgpus.vgpu_type_ids = vgpuTypeIds + + with nogil: + __status__ = nvmlGpuInstanceGetCreatableVgpus(gpu_instance, ptr) + check_status(__status__) + + return pVgpus + + +cpdef object gpu_instance_get_active_vgpus(intptr_t gpu_instance): + """Retrieve the active vGPU instances within a GPU instance. + + Args: + gpu_instance (GpuInstance): The identifier of the target GPU Instance. + + Returns: + ActiveVgpuInstanceInfo: The vGPU instance ID information structure. + """ + cdef ActiveVgpuInstanceInfo_v1 activeVgpuInfo = ActiveVgpuInstanceInfo_v1() + cdef nvmlActiveVgpuInstanceInfo_v1_t *ptr = activeVgpuInfo._get_ptr() + + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlActiveVgpuInstanceInfo_v1_t), 1) + ptr.vgpuCount = 0 + ptr.vgpuInstances = NULL + __status__ = nvmlGpuInstanceGetActiveVgpus(gpu_instance, ptr) + check_status_size(__status__) + + if ptr.vgpuCount == 0: + return activeVgpuInfo + + cdef view.array vgpuInstances = view.array(shape=(ptr.vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c") + activeVgpuInfo.vgpu_instances = vgpuInstances + + with nogil: + __status__ = nvmlGpuInstanceGetActiveVgpus(gpu_instance, ptr) + check_status(__status__) + + return activeVgpuInfo + + +cpdef object gpu_instance_get_vgpu_type_creatable_placements(intptr_t gpu_instance, unsigned int vgpu_type_id): + """Query the creatable vGPU placement ID of the vGPU type within a GPU instance. + + Args: + gpu_instance (GpuInstance): The identifier of the target GPU Instance. + vgpu_type_id (unsigned int): The vGPU type ID. + + Returns: + VgpuPlacementList_v2: The vGPU placement list structure. + """ + + cdef VgpuCreatablePlacementInfo_v1 pCreatablePlacementInfo = VgpuCreatablePlacementInfo_v1() + cdef nvmlVgpuCreatablePlacementInfo_v1_t *ptr = pCreatablePlacementInfo._get_ptr() + + # Get size of array + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), 1) + ptr.count = 0 + ptr.placementIds = NULL + ptr.vgpuTypeId = vgpu_type_id + __status__ = nvmlGpuInstanceGetVgpuTypeCreatablePlacements(gpu_instance, ptr) + check_status_size(__status__) + + if ptr.count == 0: + return pCreatablePlacementInfo + + cdef view.array placementIds = view.array(shape=(ptr.count,), itemsize=sizeof(unsigned int), format="I", mode="c") + pCreatablePlacementInfo.placement_ids = placementIds + + with nogil: + __status__ = nvmlGpuInstanceGetVgpuTypeCreatablePlacements(gpu_instance, ptr) + check_status(__status__) + + return pCreatablePlacementInfo + + +cpdef object device_get_vgpu_type_creatable_placements(intptr_t device, unsigned int vgpu_type_id, unsigned int mode): + """Query the creatable vGPU placement ID of the vGPU type within a GPU instance. + + Args: + device (Device): The identifier of the target device. + vgpu_type_id (unsigned int): The vGPU type ID. + mode (unsigned int): The placement mode. 0: Heterogeneous, 1: Homogeneous. + + Returns: + VgpuPlacementList_v2: The vGPU placement list structure. + """ + + cdef VgpuPlacementList_v2 pPlacementList = VgpuPlacementList_v2() + cdef nvmlVgpuPlacementList_v2_t *ptr = pPlacementList._get_ptr() + + # Get size of array + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuPlacementList_v2_t), 2) + ptr.count = 0 + ptr.placementIds = NULL + ptr.mode = mode + __status__ = nvmlDeviceGetVgpuTypeCreatablePlacements(device, vgpu_type_id, ptr) + check_status_size(__status__) + + if ptr.count == 0: + return pPlacementList + + cdef view.array placementIds = view.array(shape=(ptr.count,), itemsize=sizeof(unsigned int), format="I", mode="c") + pPlacementList.placement_ids = placementIds + + with nogil: + __status__ = nvmlDeviceGetVgpuTypeCreatablePlacements(device, vgpu_type_id, ptr) + check_status(__status__) + + return pPlacementList + + +cpdef object vgpu_instance_get_metadata(unsigned int vgpu_instance): + """Returns vGPU metadata structure for a running vGPU. The structure contains information about the vGPU and its + associated VM such as the currently installed NVIDIA guest driver version, together with host driver version and + an opaque data section containing internal state. + + Args: + vgpu_instance (unsigned int): The identifier of the target vGPU instance. + + Returns: + VgpuMetadata: Metadata. + """ + cdef VgpuMetadata vgpuMetadata = VgpuMetadata() + cdef unsigned int[1] bufferSize = [sizeof(nvmlVgpuMetadata_t)] + cdef nvmlVgpuMetadata_t *ptr = vgpuMetadata._get_ptr() + + with nogil: + __status__ = nvmlVgpuInstanceGetMetadata(vgpu_instance, ptr, bufferSize) + check_status_size(__status__) + + return vgpuMetadata + + +cpdef object device_get_vgpu_metadata(intptr_t device): + """Returns a vGPU metadata structure for the physical GPU indicated by device. The structure contains + information about the GPU and the currently installed NVIDIA host driver version that's controlling it, + together with an opaque data section containing internal state. + + Args: + device (Device): The identifier of the target device. + + Returns: + VgpuPgpuMetadata: Metadata. + """ + cdef VgpuPgpuMetadata pgpuMetadata = VgpuPgpuMetadata() + cdef unsigned int[1] bufferSize = [sizeof(nvmlVgpuPgpuMetadata_t)] + cdef nvmlVgpuPgpuMetadata_t *ptr = pgpuMetadata._get_ptr() + + with nogil: + __status__ = nvmlDeviceGetVgpuMetadata(device, ptr, bufferSize) + check_status_size(__status__) + + return pgpuMetadata + + +cpdef object get_vgpu_compatibility(VgpuMetadata vgpu_metadata, VgpuPgpuMetadata pgpu_metadata): + """Takes a vGPU instance metadata structure read from vgpu_instance_get_metadata() and a vGPU metadata structure + for a physical GPU read from device_get_vgpu_metadata, and returns compatibility information of the vGPU instance + and the physical GPU. + + Args: + vgpu_metadata (VgpuMetadata): The vGPU instance metadata. + pgpu_metadata (VgpuPgpuMetadata): The physical GPU metadata. + + Returns: + VgpuPgpuCompatibility: Compatibility information. + """ + cdef VgpuPgpuCompatibility compatibilityInfo = VgpuPgpuCompatibility() + cdef nvmlVgpuPgpuCompatibility_t *ptr = compatibilityInfo._get_ptr() + cdef nvmlVgpuMetadata_t *vgpu_metadata_ptr = vgpu_metadata._get_ptr() + cdef nvmlVgpuPgpuMetadata_t *pgpu_metadata_ptr = pgpu_metadata._get_ptr() + + with nogil: + __status__ = nvmlGetVgpuCompatibility(vgpu_metadata_ptr, pgpu_metadata_ptr, ptr) + check_status(__status__) + + return compatibilityInfo + + +cpdef tuple get_vgpu_version(): + """Query the ranges of supported vGPU versions. + + Returns: + tuple: A tuple of (VgpuVersion supported, VgpuVersion current). + """ + cdef VgpuVersion supported = VgpuVersion() + cdef nvmlVgpuVersion_t *supported_ptr = supported._get_ptr() + cdef VgpuVersion current = VgpuVersion() + cdef nvmlVgpuVersion_t *current_ptr = current._get_ptr() + + with nogil: + __status__ = nvmlGetVgpuVersion(supported_ptr, current_ptr) + + check_status(__status__) + return (supported, current) + + +cpdef object device_get_vgpu_instances_utilization_info(intptr_t device): + """ + Retrieves recent utilization for vGPU instances running on a physical GPU (device). + + Args: + device (Device): The identifier of the target device. + + Returns: + VgpuInstancesUtilizationInfo_v1: The vGPU instances utilization information structure. + """ + cdef VgpuInstancesUtilizationInfo_v1 vgpuUtilInfo = VgpuInstancesUtilizationInfo_v1() + cdef nvmlVgpuInstancesUtilizationInfo_v1_t *ptr = vgpuUtilInfo._get_ptr() + + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), 1) + ptr.vgpuInstanceCount = 0 + ptr.vgpuUtilArray = NULL + __status__ = nvmlDeviceGetVgpuInstancesUtilizationInfo(device, ptr) + check_status_size(__status__) + + if ptr.vgpuInstanceCount == 0: + return vgpuUtilInfo + + cdef VgpuInstanceUtilizationInfo_v1 vgpuUtilArray = VgpuInstanceUtilizationInfo_v1(ptr.vgpuInstanceCount) + vgpuUtilInfo.vgpu_util_array = vgpuUtilArray + + with nogil: + __status__ = nvmlDeviceGetVgpuInstancesUtilizationInfo(device, ptr) + check_status(__status__) + + return vgpuUtilInfo + + +cpdef object device_get_vgpu_processes_utilization_info(intptr_t device, unsigned int last_seen_time_stamp): + """ + Retrieves recent utilization for processes running on vGPU instances on a physical GPU (device). + + Args: + device (Device): The identifier of the target device. + + Returns: + VgpuProcessesUtilizationInfo: The vGPU processes utilization information structure. + """ + cdef VgpuProcessesUtilizationInfo_v1 vgpuProcUtilInfo = VgpuProcessesUtilizationInfo_v1() + cdef nvmlVgpuProcessesUtilizationInfo_v1_t *ptr = vgpuProcUtilInfo._get_ptr() + + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), 1) + ptr.vgpuProcessCount = 0 + ptr.vgpuProcUtilArray = NULL + ptr.lastSeenTimeStamp = last_seen_time_stamp + __status__ = nvmlDeviceGetVgpuProcessesUtilizationInfo(device, ptr) + check_status_size(__status__) + + if ptr.vgpuProcessCount == 0: + return vgpuProcUtilInfo + + cdef VgpuProcessUtilizationInfo_v1 vgpuProcUtilArray = VgpuProcessUtilizationInfo_v1(ptr.vgpuProcessCount) + vgpuProcUtilInfo.vgpu_proc_util_array = vgpuProcUtilArray + + with nogil: + __status__ = nvmlDeviceGetVgpuProcessesUtilizationInfo(device, ptr) + check_status(__status__) + + return vgpuProcUtilInfo + + +cpdef object device_get_gpu_instances(intptr_t device, unsigned int profile_id): + """Get GPU instances for given profile ID. + + Args: + device (Device): The identifier of the target device. + profile_id (unsigned int): The GPU instance profile ID. See device_get_gpu_instance_profile_info(). + + Returns: + array: An array of GPU instance handles. + """ + cdef unsigned int[1] count = [0] + with nogil: + __status__ = nvmlDeviceGetGpuInstances(device, profile_id, NULL, count) + check_status_size(__status__) + + if count[0] == 0: + view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0] + + cdef view.array gpuInstances = view.array(shape=(count[0],), itemsize=sizeof(intptr_t), format="P", mode="c") + with nogil: + __status__ = nvmlDeviceGetGpuInstances(device, profile_id, gpuInstances.data, count) + check_status(__status__) + + return gpuInstances + + +cpdef object gpu_instance_get_compute_instances(intptr_t gpu_instance, unsigned int profile_id): + """Get Compute instances for given profile ID. + + Args: + gpu_instance (GpuInstance): The identifier of the target GPU Instance. + profile_id (unsigned int): The Compute instance profile ID. + + Returns: + array: An array of Compute instance handles. + """ + cdef unsigned int[1] count = [0] + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstances(gpu_instance, profile_id, NULL, count) + check_status_size(__status__) + + if count[0] == 0: + view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0] + + cdef view.array computeInstances = view.array(shape=(count[0],), itemsize=sizeof(intptr_t), format="P", mode="c") + with nogil: + __status__ = nvmlGpuInstanceGetComputeInstances(gpu_instance, profile_id, computeInstances.data, count) + check_status(__status__) + + return computeInstances + + +cpdef object device_get_sram_unique_uncorrected_ecc_error_counts(intptr_t device): + """Retrieves the counts of SRAM unique uncorrected ECC errors + + Args: + device (Device): The identifier of the target device. + + Returns: + EccSramUniqueUncorrectedErrorCounts_v1: The ECC SRAM unique uncorrected error counts structure. + """ + + cdef EccSramUniqueUncorrectedErrorCounts_v1 errorCounts = EccSramUniqueUncorrectedErrorCounts_v1() + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *ptr = errorCounts._get_ptr() + + with nogil: + ptr.version = NVML_VERSION_STRUCT(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), 1) + ptr.entryCount = 0 + ptr.entries = NULL + __status__ = nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(device, ptr) + check_status_size(__status__) + + cdef EccSramUniqueUncorrectedErrorEntry_v1 entries = EccSramUniqueUncorrectedErrorEntry_v1(ptr.entryCount) + errorCounts.entries = entries + + if ptr.entryCount == 0: + return errorCounts + + with nogil: + __status__ = nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(device, ptr) + check_status(__status__) + + return errorCounts + + +cpdef object device_get_gpu_fabric_info_v(intptr_t device): + """Versioned wrapper around nvmlDeviceGetGpuFabricInfo that accepts a versioned ``nvmlGpuFabricInfo_v2_t`` or later output structure. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlGpuFabricInfo_v3_t: Information about GPU fabric state. + + .. seealso:: `nvmlDeviceGetGpuFabricInfoV` + """ + cdef GpuFabricInfo_v3 gpu_fabric_info_v3_py + cdef GpuFabricInfo_v2 gpu_fabric_info_v2_py + cdef nvmlGpuFabricInfoV_t *gpu_fabric_info + if CUDA_VERSION >= 13000: + gpu_fabric_info_v3_py = GpuFabricInfo_v3() + gpu_fabric_info = (gpu_fabric_info_v3_py._get_ptr()) + with nogil: + gpu_fabric_info.version = NVML_VERSION_STRUCT(sizeof(nvmlGpuFabricInfo_v3_t), 3) + __status__ = nvmlDeviceGetGpuFabricInfoV(device, gpu_fabric_info) + check_status(__status__) + return gpu_fabric_info_v3_py + + else: + gpu_fabric_info_v2_py = GpuFabricInfo_v2() + gpu_fabric_info = (gpu_fabric_info_v2_py._get_ptr()) + with nogil: + gpu_fabric_info.version = NVML_VERSION_STRUCT(sizeof(nvmlGpuFabricInfo_v2_t), 2) + __status__ = nvmlDeviceGetGpuFabricInfoV(device, gpu_fabric_info) + check_status(__status__) + return gpu_fabric_info_v2_py + + +cpdef object device_get_platform_info(intptr_t device): + """Get platform information of this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlPlatformInfo_v2_t: Pointer to the caller-provided structure of nvmlPlatformInfo_t. + + .. seealso:: `nvmlDeviceGetPlatformInfo` + """ + cdef PlatformInfo_v1 platform_info_v1_py + cdef PlatformInfo_v2 platform_info_v2_py + cdef nvmlPlatformInfo_t *platform_info + + if CUDA_VERSION >= 13000: + platform_info_v2_py = PlatformInfo_v2() + platform_info = (platform_info_v2_py._get_ptr()) + with nogil: + platform_info.version = NVML_VERSION_STRUCT(sizeof(nvmlPlatformInfo_v2_t), 2) + __status__ = nvmlDeviceGetPlatformInfo(device, platform_info) + check_status(__status__) + return platform_info_v2_py + + else: + platform_info_v1_py = PlatformInfo_v1() + platform_info = (platform_info_v1_py._get_ptr()) + with nogil: + platform_info.version = NVML_VERSION_STRUCT(sizeof(nvmlPlatformInfo_v1_t), 1) + __status__ = nvmlDeviceGetPlatformInfo(device, platform_info) + check_status(__status__) + return platform_info_v1_py + + +cpdef object device_get_nvlink_info(intptr_t device): + """Query NVLINK information associated with this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvLinkInfo_v2_t: Reference to ``nvmlNvLinkInfo_t``. + + .. seealso:: `nvmlDeviceGetNvLinkInfo` + """ + cdef NvLinkInfo_v1 info_v1_py + cdef NvLinkInfo_v2 info_v2_py + cdef nvmlNvLinkInfo_t *info + + if CUDA_VERSION >= 13000: + info_v2_py = NvLinkInfo_v2() + info = (info_v2_py._get_ptr()) + with nogil: + info.version = NVML_VERSION_STRUCT(sizeof(nvmlNvLinkInfo_v2_t), 2) + __status__ = nvmlDeviceGetNvLinkInfo(device, info) + check_status(__status__) + return info_v2_py + + else: + info_v1_py = NvLinkInfo_v1() + info = (info_v1_py._get_ptr()) + with nogil: + info.version = NVML_VERSION_STRUCT(sizeof(nvmlNvLinkInfo_v1_t), 1) + __status__ = nvmlDeviceGetNvLinkInfo(device, info) + check_status(__status__) + return info_v1_py + + +cpdef intptr_t system_event_set_create(): + """Create an empty set of system events. Event set should be freed by ``nvmlSystemEventSetFree``.""" + cdef nvmlSystemEventSetCreateRequest_v1_t[1] request + with nogil: + request[0].version = NVML_VERSION_STRUCT(sizeof(nvmlSystemEventSetCreateRequest_v1_t), 1) + __status__ = nvmlSystemEventSetCreate(request) + check_status(__status__) + return (request[0].set) + + +cpdef system_event_set_free(intptr_t event_set): + """Frees an event set.""" + cdef nvmlSystemEventSetFreeRequest_v1_t[1] request + request[0].set = event_set + with nogil: + request[0].version = NVML_VERSION_STRUCT(sizeof(nvmlSystemEventSetFreeRequest_v1_t), 1) + __status__ = nvmlSystemEventSetFree(request) + check_status(__status__) + + +cpdef system_register_events(unsigned long long event_types, intptr_t event_set): + """Starts recording of events on system and add the events to specified ``nvmlSystemEventSet_t``. + + Args: + event_types (unsigned long long): Bitmask of nvmlSystemEventType_t values representing the events to register. + event_set (intptr_t): The system event set handle. + """ + cdef nvmlSystemRegisterEventRequest_v1_t[1] request + with nogil: + request[0].version = NVML_VERSION_STRUCT(sizeof(nvmlSystemRegisterEventRequest_v1_t), 1) + request[0].set = event_set + request[0].eventTypes = event_types + __status__ = nvmlSystemRegisterEvents(request) + check_status(__status__) + + +cpdef object system_event_set_wait(intptr_t event_set, unsigned int timeout_ms, unsigned int buffer_size): + """Waits for events to occur on the system event set. + + Args: + event_set (intptr_t): The system event set handle. + timeout_ms (unsigned int): The maximum amount of time in milliseconds to wait for an event. + buffer_size (unsigned int): The size of the event buffer. + + Returns: + SystemEvent: The system event that occurred. + """ + cdef nvmlSystemEventSetWaitRequest_v1_t[1] request + cdef SystemEventData_v1 event_data = SystemEventData_v1(buffer_size) + request[0].data = (event_data._get_ptr()) + with nogil: + request[0].version = NVML_VERSION_STRUCT(sizeof(nvmlSystemEventSetWaitRequest_v1_t), 1) + request[0].timeoutms = timeout_ms + request[0].set = event_set + request[0].dataSize = buffer_size + __status__ = nvmlSystemEventSetWait(request) + check_status(__status__) + event_data._data.resize((request[0].numEvent,)) + return event_data + + +cpdef unsigned int device_get_fan_speed_rpm(intptr_t device, unsigned int fan): + """Retrieves the intended operating speed in rotations per minute (RPM) of the device's specified fan. + + Args: + device (intptr_t): The identifier of the target device. + fan (unsigned int): The index of the fan to query. + + Returns: + rpm (unsigned int): The fan speed in RPM. + + .. seealso:: `nvmlDeviceGetFanSpeedRPM` + """ + cdef nvmlFanSpeedInfo_v1_t[1] fan_speed + with nogil: + fan_speed[0].version = NVML_VERSION_STRUCT(sizeof(nvmlFanSpeedInfo_v1_t), 1) + fan_speed[0].fan = fan + __status__ = nvmlDeviceGetFanSpeedRPM(device, fan_speed) + check_status(__status__) + return fan_speed[0].speed + + +cpdef int device_get_margin_temperature(intptr_t device): + """Retrieves the thermal margin temperature (distance to nearest slowdown threshold). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + margin_temperature (int): The margin temperature value. + + .. seealso:: `nvmlDeviceGetMarginTemperature` + """ + cdef nvmlMarginTemperature_v1_t[1] margin_temp_info + with nogil: + margin_temp_info[0].version = NVML_VERSION_STRUCT(sizeof(nvmlMarginTemperature_v1_t), 1) + __status__ = nvmlDeviceGetMarginTemperature(device, margin_temp_info) + check_status(__status__) + return margin_temp_info[0].marginTemperature + + +cpdef object device_get_clock_offsets(intptr_t device, nvmlClockType_t clock_type, nvmlPstates_t pstate): + """Retrieve min, max and current clock offset of some clock domain for a given PState. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlClockOffset_v1_t: Structure specifying the clock type (input) and the pstate (input) retrieved clock offset value (output), min clock offset (output) and max clock offset (output). + + .. seealso:: `nvmlDeviceGetClockOffsets` + """ + cdef ClockOffset_v1 info_py = ClockOffset_v1() + cdef nvmlClockOffset_v1_t *info = (info_py._get_ptr()) + with nogil: + info.version = NVML_VERSION_STRUCT(sizeof(nvmlClockOffset_v1_t), 1) + info.type = clock_type + info.pstate = pstate + __status__ = nvmlDeviceGetClockOffsets(device, info) + check_status(__status__) + return info_py + + +cpdef object device_get_vgpu_type_supported_placements(intptr_t device, unsigned int vgpu_type_id, unsigned int mode): + """Query the supported vGPU placement ID of the vGPU type. + + Args: + device (intptr_t): Identifier of the target device. + vgpu_type_id (unsigned int): Handle to vGPU type. The vGPU type ID. + mode (unsigned int): The placement mode. 0: Heterogeneous, 1: Homogeneous. + + Returns: + nvmlVgpuPlacementList_v2_t: Pointer to the vGPU placement structure ``nvmlVgpuPlacementList_t``. + + .. seealso:: `nvmlDeviceGetVgpuTypeSupportedPlacements` + """ + cdef VgpuPlacementList_v2 p_placement_list_py = VgpuPlacementList_v2() + cdef nvmlVgpuPlacementList_t *p_placement_list = (p_placement_list_py._get_ptr()) + with nogil: + p_placement_list.count = 0 + p_placement_list.placementIds = NULL + p_placement_list.version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuPlacementList_v2_t), 2) + __status__ = nvmlDeviceGetVgpuTypeSupportedPlacements(device, vgpu_type_id, p_placement_list) + check_status_size(__status__) + + if p_placement_list.count == 0: + return p_placement_list_py + + cdef view.array placement_ids = view.array(shape=(p_placement_list.count,), itemsize=sizeof(unsigned int), format="I", mode="c") + p_placement_list_py.placement_ids = placement_ids + + with nogil: + __status__ = nvmlDeviceGetVgpuTypeSupportedPlacements(device, vgpu_type_id, p_placement_list) + check_status(__status__) + + return p_placement_list_py + + +cpdef unsigned int vgpu_instance_get_placement_id(unsigned int vgpu_instance): + """Query the placement ID of active vGPU instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU instance. + + Returns: + unsigned int: The placement ID + + .. seealso:: `nvmlVgpuInstanceGetPlacementId` + """ + cdef nvmlVgpuPlacementId_t[1] p_placement + with nogil: + p_placement[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuPlacementId_v1_t), 1) + __status__ = nvmlVgpuInstanceGetPlacementId(vgpu_instance, p_placement) + check_status(__status__) + return p_placement[0].placementId + + +cpdef object device_get_capabilities(intptr_t device): + """Get device capabilities. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlDeviceCapabilities_v1_t: Returns GPU's capabilities. + + .. seealso:: `nvmlDeviceGetCapabilities` + """ + cdef nvmlDeviceCapabilities_t[1] caps + with nogil: + caps[0].version = NVML_VERSION_STRUCT(sizeof(nvmlDeviceCapabilities_v1_t), 1) + __status__ = nvmlDeviceGetCapabilities(device, caps) + check_status(__status__) + return caps[0].capMask + + +cpdef object device_get_conf_compute_gpu_attestation_report(intptr_t device, char[32] nonce): + """Get Conf Computing GPU attestation report. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlConfComputeGpuAttestationReport_t: Reference in which to return the gpu attestation report. + + .. seealso:: `nvmlDeviceGetConfComputeGpuAttestationReport` + """ + cdef ConfComputeGpuAttestationReport gpu_atst_report_py = ConfComputeGpuAttestationReport() + cdef nvmlConfComputeGpuAttestationReport_t *gpu_atst_report = (gpu_atst_report_py._get_ptr()) + with nogil: + memcpy(gpu_atst_report.nonce, nonce, 32) + __status__ = nvmlDeviceGetConfComputeGpuAttestationReport(device, gpu_atst_report) + check_status(__status__) + return gpu_atst_report_py + + +cpdef tuple device_get_dram_encryption_mode(intptr_t device): + """Retrieves the current and pending DRAM Encryption modes for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + A 2-tuple containing: + + - nvmlEnableState_t: Reference in which to return the current DRAM Encryption mode. + - nvmlEnableState_t: Reference in which to return the pending DRAM Encryption mode. + + .. seealso:: `nvmlDeviceGetDramEncryptionMode` + """ + cdef nvmlDramEncryptionInfo_t current + cdef nvmlDramEncryptionInfo_t pending + with nogil: + current.version = pending.version = NVML_VERSION_STRUCT(sizeof(nvmlDramEncryptionInfo_t), 1) + __status__ = nvmlDeviceGetDramEncryptionMode(device, ¤t, &pending) + check_status(__status__) + return (current.encryptionState, pending.encryptionState) + + +cpdef device_set_dram_encryption_mode(intptr_t device, int dram_encryption): + """Set the DRAM Encryption mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + dram_encryption (nvmlEnableState_t): The target DRAM Encryption mode. + + .. seealso:: `nvmlDeviceSetDramEncryptionMode` + """ + cdef nvmlDramEncryptionInfo_t[1] encryption + with nogil: + encryption[0].version = NVML_VERSION_STRUCT(sizeof(nvmlDramEncryptionInfo_t), 1) + encryption[0].encryptionState = dram_encryption + __status__ = nvmlDeviceSetDramEncryptionMode(device, encryption) + check_status(__status__) + + +cpdef object device_get_gpu_instance_profile_info_by_id_v(intptr_t device, unsigned int profile_id): + """GPU instance profile query function that accepts profile ID, instead of profile name. It accepts a versioned ``nvmlGpuInstanceProfileInfo_v3_t`` or later output structure. + + Args: + device (intptr_t): The identifier of the target device. + profile_id (unsigned int): One of the profile IDs. + + Returns: + nvmlGpuInstanceProfileInfo_v3_t: Returns detailed profile information. + + .. seealso:: `nvmlDeviceGetGpuInstanceProfileInfoByIdV` + """ + cdef GpuInstanceProfileInfo_v3 info_py = GpuInstanceProfileInfo_v3() + cdef nvmlGpuInstanceProfileInfo_v3_t *info = (info_py._get_ptr()) + with nogil: + info.version = NVML_VERSION_STRUCT(sizeof(nvmlGpuInstanceProfileInfo_v3_t), 3) + __status__ = nvmlDeviceGetGpuInstanceProfileInfoByIdV(device, profile_id, info) + check_status(__status__) + return info_py + + +cpdef object device_get_gpu_instance_profile_info_v(intptr_t device, unsigned int profile): + """Versioned wrapper around ``nvmlDeviceGetGpuInstanceProfileInfo`` that accepts a versioned ``nvmlGpuInstanceProfileInfo_v3_t`` or later output structure. + + Args: + device (intptr_t): The identifier of the target device. + profile (unsigned int): One of the NVML_GPU_INSTANCE_PROFILE_*. + + Returns: + nvmlGpuInstanceProfileInfo_v3_t: Returns detailed profile information. + + .. seealso:: `nvmlDeviceGetGpuInstanceProfileInfoV` + """ + cdef GpuInstanceProfileInfo_v3 info_py = GpuInstanceProfileInfo_v3() + cdef nvmlGpuInstanceProfileInfo_v3_t *info = (info_py._get_ptr()) + with nogil: + info.version = NVML_VERSION_STRUCT(sizeof(nvmlGpuInstanceProfileInfo_v3_t), 3) + __status__ = nvmlDeviceGetGpuInstanceProfileInfoV(device, profile, info) + check_status(__status__) + return info_py + + +cpdef intptr_t device_get_handle_by_uuidv(int type, bytes uuid) except? 0: + """Acquire the handle for a particular device, based on its globally unique immutable UUID (in either ASCII or binary format) associated with each device. See ``nvmlUUID_v1_t`` for more information on the UUID struct. The caller must set the appropriate version prior to calling this API. + + Args: + type (UUIDType): The format of the UUID being provided (ASCII or binary). + uuid (intptr_t): The UUID of the target GPU or MIG instance. + + Returns: + intptr_t: Reference in which to return the device handle or MIG device handle. + + .. seealso:: `nvmlDeviceGetHandleByUUIDV` + """ + cdef Device device + cdef nvmlUUID_t[1] uuid_struct + cdef int NVML_DEVICE_UUID_ASCII_LEN = 41 + cdef int NVML_DEVICE_UUID_BINARY_LEN = 16 + cdef char *uuid_ptr = cpython.PyBytes_AsString(uuid) + + if type == UUIDType.ASCII: + if len(uuid) != NVML_DEVICE_UUID_ASCII_LEN - 1: + raise ValueError(f"UUID ASCII string must be {NVML_DEVICE_UUID_ASCII_LEN - 1} bytes long") + memcpy((uuid_struct[0].value.str), uuid_ptr, NVML_DEVICE_UUID_ASCII_LEN) + elif type == UUIDType.BINARY: + if len(uuid) != NVML_DEVICE_UUID_BINARY_LEN - 1: + raise ValueError(f"UUID binary string must be {NVML_DEVICE_UUID_BINARY_LEN - 1} bytes long") + memcpy((uuid_struct[0].value.bytes), uuid_ptr, NVML_DEVICE_UUID_BINARY_LEN) + else: + raise ValueError("Invalid UUID format specified") + + with nogil: + uuid_struct[0].version = NVML_VERSION_STRUCT(sizeof(nvmlUUID_v1_t), 1) + uuid_struct[0].type = type + __status__ = nvmlDeviceGetHandleByUUIDV(uuid_struct, &device) + check_status(__status__) + return device + + +cpdef unsigned long long device_get_pdi(intptr_t device): + """Retrieves the Per Device Identifier (PDI) associated with this device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned long long: The GPU PDI. + + .. seealso:: `nvmlDeviceGetPdi` + """ + cdef nvmlPdi_v1_t[1] pdi + with nogil: + pdi[0].version = NVML_VERSION_STRUCT(sizeof(nvmlPdi_v1_t), 1) + __status__ = nvmlDeviceGetPdi(device, pdi) + check_status(__status__) + return pdi[0].value + + +cpdef str device_get_performance_modes(intptr_t device): + """Retrieves a performance mode string with all the performance modes defined for this device along with their associated GPU Clock and Memory Clock values. Not all tokens will be reported on all GPUs, and additional tokens may be added in the future. For backwards compatibility we still provide nvclock and memclock; those are the same as nvclockmin and memclockmin. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + str: The performance level string. + + .. seealso:: `nvmlDeviceGetPerformanceModes` + """ + cdef nvmlDevicePerfModes_t[1] perf_modes + with nogil: + perf_modes[0].version = NVML_VERSION_STRUCT(sizeof(nvmlDevicePerfModes_v1_t), 1) + __status__ = nvmlDeviceGetPerformanceModes(device, perf_modes) + check_status(__status__) + return cpython.PyUnicode_FromString(perf_modes[0].str) + + +cpdef unsigned int device_get_unrepairable_memory_flag_v1(intptr_t device): + """Get the unrepairable memory flag for a given GPU. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: unrepairable memory status + + .. seealso:: `nvmlDeviceGetUnrepairableMemoryFlag_v1` + """ + cdef nvmlUnrepairableMemoryStatus_v1_t[1] unrepairable_memory_status + with nogil: + __status__ = nvmlDeviceGetUnrepairableMemoryFlag_v1(device, unrepairable_memory_status) + check_status(__status__) + return unrepairable_memory_status.bUnrepairableMemory + + +cpdef unsigned int device_get_vgpu_heterogeneous_mode(intptr_t device): + """Get the vGPU heterogeneous mode for the device. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + unsigned int: The mode + + .. seealso:: `nvmlDeviceGetVgpuHeterogeneousMode` + """ + cdef nvmlVgpuHeterogeneousMode_t[1] heterogeneous_mode + with nogil: + heterogeneous_mode[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuHeterogeneousMode_v1_t), 1) + __status__ = nvmlDeviceGetVgpuHeterogeneousMode(device, heterogeneous_mode) + check_status(__status__) + return heterogeneous_mode[0].mode + + +cpdef device_set_vgpu_heterogeneous_mode(intptr_t device, int mode): + """Enable or disable vGPU heterogeneous mode for the device. + + Args: + device (intptr_t): Identifier of the target device. + heterogeneous_mode (unsigned int): mode + + .. seealso:: `nvmlDeviceSetVgpuHeterogeneousMode` + """ + cdef nvmlVgpuHeterogeneousMode_t[1] heterogeneous_mode + with nogil: + heterogeneous_mode[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuHeterogeneousMode_v1_t), 1) + heterogeneous_mode[0].mode = mode + __status__ = nvmlDeviceSetVgpuHeterogeneousMode(device, heterogeneous_mode) + check_status(__status__) + + +cpdef object gpu_instance_get_vgpu_heterogeneous_mode(intptr_t gpu_instance): + """Get the vGPU heterogeneous mode for the GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + unsigned int: the mode + + .. seealso:: `nvmlGpuInstanceGetVgpuHeterogeneousMode` + """ + cdef nvmlVgpuHeterogeneousMode_t[1] heterogeneous_mode + with nogil: + heterogeneous_mode[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuHeterogeneousMode_v1_t), 1) + __status__ = nvmlGpuInstanceGetVgpuHeterogeneousMode(gpu_instance, heterogeneous_mode) + check_status(__status__) + return heterogeneous_mode[0].mode + + +cpdef gpu_instance_set_vgpu_heterogeneous_mode(intptr_t gpu_instance, unsigned int mode): + """Enable or disable vGPU heterogeneous mode for the GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + mode (unsigned int): The mode + + .. seealso:: `nvmlGpuInstanceSetVgpuHeterogeneousMode` + """ + cdef nvmlVgpuHeterogeneousMode_t[1] heterogeneous_mode + with nogil: + heterogeneous_mode[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuHeterogeneousMode_v1_t), 1) + heterogeneous_mode[0].mode = mode + __status__ = nvmlGpuInstanceSetVgpuHeterogeneousMode(gpu_instance, heterogeneous_mode) + check_status(__status__) + + +cpdef tuple device_get_vgpu_utilization(intptr_t device, unsigned long long last_seen_time_stamp): + """Retrieves current utilization for vGPUs on a physical GPU (device). + + Args: + device (intptr_t): The identifier for the target device. + last_seen_time_stamp (unsigned long long): Return only samples with timestamp greater than last_seen_time_stamp. + + Returns: + A 2-tuple containing: + + - samples: Returned sample values. + - utilizationSamples: Utilization samples. + + .. seealso:: `nvmlDeviceGetVgpuUtilization` + """ + cdef unsigned int vgpu_instance_samples_count + with nogil: + __status__ = nvmlDeviceGetVgpuUtilization( + device, + last_seen_time_stamp, + NULL, + &vgpu_instance_samples_count, + NULL + ) + check_status_size(__status__) + + if vgpu_instance_samples_count == 0: + return ( + view.array(shape=(1,), itemsize=sizeof(int), format="I", mode="c")[:0], + VgpuInstanceUtilizationSample(0) + ) + + cdef view.array arr = view.array(shape=(vgpu_instance_samples_count,), itemsize=sizeof(int), format="I", mode="c") + cdef VgpuInstanceUtilizationSample utilization_samples_py = VgpuInstanceUtilizationSample(vgpu_instance_samples_count) + cdef nvmlVgpuInstanceUtilizationSample_t *ptr = utilization_samples_py._get_ptr() + + with nogil: + __status__ = nvmlDeviceGetVgpuUtilization( + device, + last_seen_time_stamp, + arr.data, + &vgpu_instance_samples_count, + ptr + ) + check_status(__status__) + + return (arr, utilization_samples_py) + + +cpdef object device_read_prm_counters_v1(intptr_t device, PRMCounter_v1 counters): + """Read a list of GPU PRM Counters. + + Args: + device (intptr_t): Identifer of target GPU device. + counters (PRMCounter_v1): Array holding the input parameters as well as the retrieved counter values. + + .. seealso:: `nvmlDeviceReadPRMCounters_v1` + """ + # Unlike in the raw C API, counter_list here is an PRMCounter_v1 + # AUTO_LOWPP_ARRAY, and we need to wrap it in a nvmlPRMCounterList_v1_t. + + cdef nvmlPRMCounterList_v1_t[1] counter_list + counter_list[0].numCounters = len(counters) + counter_list[0].counters = counters._get_ptr() + + with nogil: + __status__ = nvmlDeviceReadPRMCounters_v1(device, counter_list) + check_status(__status__) + + return counters + + +ctypedef union __nvmlPRMTLV_v1_value_t: + char[496] inData + char[496] outData + + +ctypedef struct __nvmlPRMTLV_v1_t: + unsigned dataSize + unsigned status + __nvmlPRMTLV_v1_value_t value + + +cpdef tuple device_read_write_prm_v1(intptr_t device, bytes in_data): + """Read or write a GPU PRM register. The input is assumed to be in TLV format in network byte order. + + Args: + device (intptr_t): Identifer of target GPU device. + in_data (bytes): The input data for the PRM register. + + Returns: + A 2-tuple containing: + + - unsigned int: Status of the PRM operation. + - bytes: Output data in TLV format. + + .. seealso:: `nvmlDeviceReadWritePRM_v1` + """ + cdef int NVML_PRM_DATA_MAX_SIZE = 496 + cdef __nvmlPRMTLV_v1_t buffer + cdef int in_data_size = len(in_data) + + if in_data_size > NVML_PRM_DATA_MAX_SIZE - 1: + raise ValueError(f"Input data size exceeds maximum allowed size of {NVML_PRM_DATA_MAX_SIZE - 1} bytes") + + cdef char *in_data_ptr = cpython.PyBytes_AsString(in_data) + + with nogil: + memcpy((buffer.value.inData), in_data_ptr, in_data_size) + buffer.dataSize = in_data_size + __status__ = nvmlDeviceReadWritePRM_v1(device, &buffer) + check_status(__status__) + + cdef bytes out_data = cpython.PyBytes_FromStringAndSize(buffer.value.outData, buffer.dataSize) + cdef unsigned int status = buffer.status + + return (status, out_data) + + +cpdef device_set_nvlink_device_low_power_threshold(intptr_t device, unsigned int threshold): + """Set NvLink Low Power Threshold for device. + + Args: + device (intptr_t): The identifier of the target device. + threshold (unsigned int): + + .. seealso:: `nvmlDeviceSetNvLinkDeviceLowPowerThreshold` + """ + cdef nvmlNvLinkPowerThres_t[1] info + + with nogil: + info[0].lowPwrThreshold + __status__ = nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, info) + check_status(__status__) + + +cpdef device_set_power_management_limit_v2(intptr_t device, int power_scope, unsigned int power_value_mw): + """Set new power limit of this device. + + Args: + device (intptr_t): The identifier of the target device. + power_scope (PowerScope): Device type + power_value_mw (unsigned int): Power value to retrieve or set in milliwatts + + .. seealso:: `nvmlDeviceSetPowerManagementLimit_v2` + """ + cdef nvmlPowerValue_v2_t[1] power_value + + with nogil: + power_value[0].version = NVML_VERSION_STRUCT(sizeof(nvmlPowerValue_v2_t), 2) + power_value[0].powerScope = power_scope + power_value[0].powerValueMw = power_value_mw + __status__ = nvmlDeviceSetPowerManagementLimit_v2(device, power_value) + check_status(__status__) + + +cpdef device_set_rusd_settings_v1(intptr_t device, unsigned long long poll_mask): + """Set Read-only user shared data (RUSD) settings for GPU. Requires root/admin permissions. + + Args: + device (intptr_t): The identifier of the target device. + poll_mask (unsigned long long): Bitmask of polling data. 0 value means the GPU's RUSD polling mask is cleared + + .. seealso:: `nvmlDeviceSetRusdSettings_v1` + """ + cdef nvmlRusdSettings_v1_t[1] settings + with nogil: + settings[0].version = NVML_VERSION_STRUCT(sizeof(nvmlRusdSettings_v1_t), 1) + settings[0].pollMask = poll_mask + __status__ = nvmlDeviceSetRusdSettings_v1(device, settings) + check_status(__status__) + + +cpdef device_set_temperature_threshold(intptr_t device, int threshold_type, int temp): + """Sets the temperature threshold for the GPU with the specified threshold type in degrees C. + + Args: + device (intptr_t): The identifier of the target device. + threshold_type (TemperatureThresholds): The type of threshold value to be set. + temp (int): The value to be set. + + .. seealso:: `nvmlDeviceSetTemperatureThreshold` + """ + with nogil: + __status__ = nvmlDeviceSetTemperatureThreshold(device, <_TemperatureThresholds>threshold_type, &temp) + check_status(__status__) + + +cpdef unsigned long long system_get_conf_compute_key_rotation_threshold_info(): + """Get Conf Computing key rotation threshold detail. + + Returns: + unsigned long long: The key rotation threshold data. + + .. seealso:: `nvmlSystemGetConfComputeKeyRotationThresholdInfo` + """ + cdef nvmlConfComputeGetKeyRotationThresholdInfo_t[1] key_rotation_thr_info + with nogil: + key_rotation_thr_info[0].version = NVML_VERSION_STRUCT(sizeof(nvmlConfComputeGetKeyRotationThresholdInfo_v1_t), 1) + __status__ = nvmlSystemGetConfComputeKeyRotationThresholdInfo(key_rotation_thr_info) + check_status(__status__) + return key_rotation_thr_info[0].attackerAdvantage + + +cpdef system_set_conf_compute_key_rotation_threshold_info(unsigned long long max_attacker_advantage): + """Set Conf Computing key rotation threshold. + + Args: + max_attacker_advantage (unsigned long long): The key rotation threshold data. + + .. seealso:: `nvmlSystemSetConfComputeKeyRotationThresholdInfo` + """ + cdef nvmlConfComputeSetKeyRotationThresholdInfo_t[1] key_rotation_thr_info + with nogil: + key_rotation_thr_info[0].version = NVML_VERSION_STRUCT(sizeof(nvmlConfComputeSetKeyRotationThresholdInfo_v1_t), 1) + key_rotation_thr_info[0].maxAttackerAdvantage = max_attacker_advantage + __status__ = nvmlSystemSetConfComputeKeyRotationThresholdInfo(key_rotation_thr_info) + check_status(__status__) + + +cpdef unsigned long long vgpu_instance_get_runtime_state_size(unsigned int vgpu_instance): + """Retrieve the currently used runtime state size of the vGPU instance. + + Args: + vgpu_instance (unsigned int): Identifier of the target vGPU instance. + + Returns: + unsigned long long: Runtime state size of the vGPU instance. + + .. seealso:: `nvmlVgpuInstanceGetRuntimeStateSize` + """ + cdef nvmlVgpuRuntimeState_t[1] p_state + with nogil: + p_state[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuRuntimeState_v1_t), 1) + __status__ = nvmlVgpuInstanceGetRuntimeStateSize(vgpu_instance, p_state) + check_status(__status__) + return p_state[0].size + + +cpdef unsigned int vgpu_type_get_max_instances_per_gpu_instance(unsigned int vgpu_type_id): + """Retrieve the maximum number of vGPU instances per GPU instance for given vGPU type. + + Args: + vgpu_type_id (VgpuTypeId): Handle to vGPU type. + + Returns: + unsigned int: Maximum number of vGPU instances per GPU instance + + .. seealso:: `nvmlVgpuTypeGetMaxInstancesPerGpuInstance` + """ + cdef nvmlVgpuTypeMaxInstance_t[1] max_instance + with nogil: + max_instance[0].version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuTypeMaxInstance_v1_t), 1) + max_instance[0].vgpuTypeId = vgpu_type_id + __status__ = nvmlVgpuTypeGetMaxInstancesPerGpuInstance(max_instance) + check_status(__status__) + return max_instance[0].maxInstancePerGI + + +cpdef str device_get_current_clock_freqs(intptr_t device): + """Retrieves a string with the associated current GPU Clock and Memory Clock values. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + str: The current clock frequency string. + + .. seealso:: `nvmlDeviceGetCurrentClockFreqs` + """ + cdef nvmlDeviceCurrentClockFreqs_t[1] current_clock_freqs + with nogil: + current_clock_freqs[0].version = NVML_VERSION_STRUCT(sizeof(nvmlDeviceCurrentClockFreqs_v1_t), 1) + __status__ = nvmlDeviceGetCurrentClockFreqs(device, current_clock_freqs) + check_status(__status__) + return cpython.PyUnicode_FromString(current_clock_freqs[0].str) + + +cpdef str vgpu_type_get_name(unsigned int vgpu_type_id): + """Retrieve the vGPU type name. + + Args: + vgpu_type_id (unsigned int): Handle to vGPU type. + + .. seealso:: `nvmlVgpuTypeGetName` + """ + cdef unsigned int[1] size = [64] + cdef char[64] vgpu_type_name + with nogil: + __status__ = nvmlVgpuTypeGetName(vgpu_type_id, vgpu_type_name, size) + check_status(__status__) + return cpython.PyUnicode_FromStringAndSize(vgpu_type_name, size[0]) + + +del _cyb_FastEnum diff --git a/cuda_bindings_12/cuda/bindings/nvrtc.pxd b/cuda_bindings_12/cuda/bindings/nvrtc.pxd new file mode 100644 index 00000000000..948e6cb3d24 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvrtc.pxd @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ac973884786458b1e5df96532862991c5f4bdf2e9c448f656ab63c297ff61372 +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 diff --git a/cuda_bindings_12/cuda/bindings/nvrtc.pyx b/cuda_bindings_12/cuda/bindings/nvrtc.pyx new file mode 100644 index 00000000000..9b2c08bf58b --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvrtc.pyx @@ -0,0 +1,984 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=53ee2eeb0abbc877e74f5719a2ab9682b901d53be29f7651e8daae7205680ad3 +from typing import Any, Optional +import cython +import ctypes +from libc.stdlib cimport calloc, malloc, free +from libc cimport string +from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t, uintptr_t +from libc.stddef cimport wchar_t +from libc.limits cimport CHAR_MIN +from libcpp.vector cimport vector +from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS +from cpython.bytes cimport PyBytes_FromStringAndSize +from ._internal._fast_enum import FastEnum as _FastEnum + +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ +include "_lib/utils.pxi" + +ctypedef unsigned long long signed_char_ptr +ctypedef unsigned long long unsigned_char_ptr +ctypedef unsigned long long char_ptr +ctypedef unsigned long long short_ptr +ctypedef unsigned long long unsigned_short_ptr +ctypedef unsigned long long int_ptr +ctypedef unsigned long long long_int_ptr +ctypedef unsigned long long long_long_int_ptr +ctypedef unsigned long long unsigned_int_ptr +ctypedef unsigned long long unsigned_long_int_ptr +ctypedef unsigned long long unsigned_long_long_int_ptr +ctypedef unsigned long long uint32_t_ptr +ctypedef unsigned long long uint64_t_ptr +ctypedef unsigned long long int32_t_ptr +ctypedef unsigned long long int64_t_ptr +ctypedef unsigned long long unsigned_ptr +ctypedef unsigned long long unsigned_long_long_ptr +ctypedef unsigned long long long_long_ptr +ctypedef unsigned long long size_t_ptr +ctypedef unsigned long long long_ptr +ctypedef unsigned long long float_ptr +ctypedef unsigned long long double_ptr +ctypedef unsigned long long void_ptr + +class nvrtcResult(_FastEnum): + """ + The enumerated type :py:obj:`~.nvrtcResult` defines API call result + codes. NVRTC API functions return :py:obj:`~.nvrtcResult` to + indicate the call result. + """ + + 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 + + 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 + +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. + + 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 + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, nvrtcProgram): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + +@cython.embedsignature(True) +def nvrtcGetErrorString(result not None : nvrtcResult): + """ 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 + ---------- + result : :py:obj:`~.nvrtcResult` + CUDA Runtime Compilation API result code. + + Returns + ------- + nvrtcResult.NVRTC_SUCCESS + nvrtcResult.NVRTC_SUCCESS + bytes + Message string for the given :py:obj:`~.nvrtcResult` code. + """ + cdef cynvrtc.nvrtcResult cyresult = int(result) + with nogil: + err = cynvrtc.nvrtcGetErrorString(cyresult) + return (nvrtcResult.NVRTC_SUCCESS, err) + +@cython.embedsignature(True) +def nvrtcVersion(): + """ nvrtcVersion sets the output parameters `major` and `minor` with the CUDA Runtime Compilation version number. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + major : int + CUDA Runtime Compilation major version number. + minor : int + CUDA Runtime Compilation minor version number. + """ + cdef int major = 0 + cdef int minor = 0 + with nogil: + err = cynvrtc.nvrtcVersion(&major, &minor) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None, None) + return (_nvrtcResult_SUCCESS, major, minor) + +@cython.embedsignature(True) +def nvrtcGetNumSupportedArchs(): + """ nvrtcGetNumSupportedArchs sets the output parameter `numArchs` with the number of architectures supported by NVRTC. This can then be used to pass an array to :py:obj:`~.nvrtcGetSupportedArchs` to get the supported architectures. + + see :py:obj:`~.nvrtcGetSupportedArchs` + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + numArchs : int + number of supported architectures. + """ + cdef int numArchs = 0 + with nogil: + err = cynvrtc.nvrtcGetNumSupportedArchs(&numArchs) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, numArchs) + +@cython.embedsignature(True) +def nvrtcGetSupportedArchs(): + """ nvrtcGetSupportedArchs populates the array passed via the output parameter `supportedArchs` with the architectures supported by NVRTC. The array is sorted in the ascending order. The size of the array to be passed can be determined using :py:obj:`~.nvrtcGetNumSupportedArchs`. + + see :py:obj:`~.nvrtcGetNumSupportedArchs` + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + supportedArchs : list[int] + sorted array of supported architectures. + """ + cdef vector[int] supportedArchs + _, s = nvrtcGetNumSupportedArchs() + supportedArchs.resize(s) + + with nogil: + err = cynvrtc.nvrtcGetSupportedArchs(supportedArchs.data()) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, supportedArchs) + +@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 :py:obj:`~.nvrtcProgram` with the given input parameters, and sets the output parameter `prog` with it. + + Parameters + ---------- + src : bytes + CUDA program source. + name : bytes + CUDA program name. `name` can be `NULL`; `"default_program"` is + used when `name` is `NULL` or "". + numHeaders : int + Number of headers used. `numHeaders` must be greater than or equal + to 0. + headers : list[bytes] + Sources of the headers. `headers` can be `NULL` when `numHeaders` + is 0. + includeNames : list[bytes] + Name of each header by which they can be included in the CUDA + program source. `includeNames` can be `NULL` when `numHeaders` is + 0. These headers must be included with the exact names specified + here. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_OUT_OF_MEMORY` + - :py:obj:`~.NVRTC_ERROR_PROGRAM_CREATION_FAILURE` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + See Also + -------- + :py:obj:`~.nvrtcDestroyProgram` + """ + includeNames = [] if includeNames is None else includeNames + if not all(isinstance(_x, (bytes)) for _x in includeNames): + raise TypeError("Argument 'includeNames' is not instance of type (expected tuple[bytes] or list[bytes]") + headers = [] if headers is None else headers + if not all(isinstance(_x, (bytes)) for _x in headers): + raise TypeError("Argument 'headers' is not instance of type (expected tuple[bytes] or list[bytes]") + cdef nvrtcProgram prog = nvrtcProgram() + if numHeaders > len(headers): raise RuntimeError("List is too small: " + str(len(headers)) + " < " + str(numHeaders)) + if numHeaders > len(includeNames): raise RuntimeError("List is too small: " + str(len(includeNames)) + " < " + str(numHeaders)) + cdef vector[const char*] cyheaders = headers + cdef vector[const char*] cyincludeNames = includeNames + with nogil: + err = cynvrtc.nvrtcCreateProgram(prog._pvt_ptr, src, name, numHeaders, cyheaders.data(), cyincludeNames.data()) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, prog) + +@cython.embedsignature(True) +def nvrtcDestroyProgram(prog): + """ nvrtcDestroyProgram destroys the given program. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcCreateProgram` + """ + cdef cynvrtc.nvrtcProgram *cyprog + if prog is None: + cyprog = NULL + elif isinstance(prog, (nvrtcProgram,)): + pprog = prog.getPtr() + cyprog = pprog + elif isinstance(prog, (int)): + cyprog = prog + else: + raise TypeError("Argument 'prog' is not instance of type (expected , found " + str(type(prog))) + with nogil: + err = cynvrtc.nvrtcDestroyProgram(cyprog) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | list[bytes]]): + """ nvrtcCompileProgram compiles the given program. + + It supports compile options listed in :py:obj:`~.Supported Compile + Options`. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + numOptions : int + Number of compiler options passed. + options : list[bytes] + Compiler options in the form of C string array. `options` can be + `NULL` when `numOptions` is 0. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_OUT_OF_MEMORY` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + - :py:obj:`~.NVRTC_ERROR_INVALID_OPTION` + - :py:obj:`~.NVRTC_ERROR_COMPILATION` + - :py:obj:`~.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE` + - :py:obj:`~.NVRTC_ERROR_TIME_FILE_WRITE_FAILED` + - :py:obj:`~.NVRTC_ERROR_CANCELLED` + """ + options = [] if options is None else options + if not all(isinstance(_x, (bytes)) for _x in options): + raise TypeError("Argument 'options' is not instance of type (expected tuple[bytes] or list[bytes]") + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) + cdef vector[const char*] cyoptions = options + with nogil: + err = cynvrtc.nvrtcCompileProgram(cyprog, numOptions, cyoptions.data()) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetPTXSize(prog): + """ nvrtcGetPTXSize sets the value of `ptxSizeRet` with the size of the PTX generated by the previous compilation of `prog` (including the trailing `NULL`). + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + ptxSizeRet : int + Size of the generated PTX (including the trailing `NULL`). + + See Also + -------- + :py:obj:`~.nvrtcGetPTX` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t ptxSizeRet = 0 + with nogil: + err = cynvrtc.nvrtcGetPTXSize(cyprog, &ptxSizeRet) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, ptxSizeRet) + +@cython.embedsignature(True) +def nvrtcGetPTX(prog, char* ptx): + """ nvrtcGetPTX stores the PTX generated by the previous compilation of `prog` in the memory pointed by `ptx`. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + ptx : bytes + Compiled result. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcGetPTXSize` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetPTX(cyprog, ptx) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetCUBINSize(prog): + """ nvrtcGetCUBINSize sets the value of `cubinSizeRet` with the size of the cubin generated by the previous compilation of `prog`. The value of cubinSizeRet is set to 0 if the value specified to `-arch` is a virtual architecture instead of an actual architecture. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + cubinSizeRet : int + Size of the generated cubin. + + See Also + -------- + :py:obj:`~.nvrtcGetCUBIN` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t cubinSizeRet = 0 + with nogil: + err = cynvrtc.nvrtcGetCUBINSize(cyprog, &cubinSizeRet) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, cubinSizeRet) + +@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. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + cubin : bytes + Compiled and assembled result. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcGetCUBINSize` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetCUBIN(cyprog, cubin) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetLTOIRSize(prog): + """ nvrtcGetLTOIRSize sets the value of `LTOIRSizeRet` with the size of the LTO IR generated by the previous compilation of `prog`. The value of LTOIRSizeRet is set to 0 if the program was not compiled with `-dlto`. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + LTOIRSizeRet : int + Size of the generated LTO IR. + + See Also + -------- + :py:obj:`~.nvrtcGetLTOIR` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t LTOIRSizeRet = 0 + with nogil: + err = cynvrtc.nvrtcGetLTOIRSize(cyprog, <OIRSizeRet) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, LTOIRSizeRet) + +@cython.embedsignature(True) +def nvrtcGetLTOIR(prog, char* LTOIR): + """ nvrtcGetLTOIR stores the LTO IR generated by the previous compilation of `prog` in the memory pointed by `LTOIR`. No LTO IR is available if the program was compiled without `-dlto`. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + LTOIR : bytes + Compiled result. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcGetLTOIRSize` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetLTOIR(cyprog, LTOIR) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetOptiXIRSize(prog): + """ nvrtcGetOptiXIRSize sets the value of `optixirSizeRet` with the size of the OptiX IR generated by the previous compilation of `prog`. The value of nvrtcGetOptiXIRSize is set to 0 if the program was compiled with options incompatible with OptiX IR generation. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + optixirSizeRet : int + Size of the generated LTO IR. + + See Also + -------- + :py:obj:`~.nvrtcGetOptiXIR` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t optixirSizeRet = 0 + with nogil: + err = cynvrtc.nvrtcGetOptiXIRSize(cyprog, &optixirSizeRet) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, optixirSizeRet) + +@cython.embedsignature(True) +def nvrtcGetOptiXIR(prog, char* optixir): + """ nvrtcGetOptiXIR stores the OptiX IR generated by the previous compilation of `prog` in the memory pointed by `optixir`. No OptiX IR is available if the program was compiled with options incompatible with OptiX IR generation. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + optixir : bytes + Optix IR Compiled result. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcGetOptiXIRSize` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetOptiXIR(cyprog, optixir) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetProgramLogSize(prog): + """ nvrtcGetProgramLogSize sets `logSizeRet` with the size of the log generated by the previous compilation of `prog` (including the trailing `NULL`). + + Note that compilation log may be generated with warnings and + informative messages, even when the compilation of `prog` succeeds. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + logSizeRet : int + Size of the compilation log (including the trailing `NULL`). + + See Also + -------- + :py:obj:`~.nvrtcGetProgramLog` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t logSizeRet = 0 + with nogil: + err = cynvrtc.nvrtcGetProgramLogSize(cyprog, &logSizeRet) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, logSizeRet) + +@cython.embedsignature(True) +def nvrtcGetProgramLog(prog, char* log): + """ nvrtcGetProgramLog stores the log generated by the previous compilation of `prog` in the memory pointed by `log`. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + log : bytes + Compilation log. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + + See Also + -------- + :py:obj:`~.nvrtcGetProgramLogSize` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetProgramLog(cyprog, log) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcAddNameExpression(prog, char* name_expression): + """ nvrtcAddNameExpression notes the given name expression denoting the address of a global function or device/__constant__ variable. + + The identical name expression string must be provided on a subsequent + call to nvrtcGetLoweredName to extract the lowered name. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + name_expression : bytes + constant expression denoting the address of a global function or + device/__constant__ variable. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION` + + See Also + -------- + :py:obj:`~.nvrtcGetLoweredName` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcAddNameExpression(cyprog, name_expression) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetLoweredName(prog, char* name_expression): + """ nvrtcGetLoweredName extracts the lowered (mangled) name for a global function or device/__constant__ variable, and updates lowered_name to point to it. The memory containing the name is released when the NVRTC program is destroyed by nvrtcDestroyProgram. The identical name expression must have been previously provided to nvrtcAddNameExpression. + + Parameters + ---------- + prog : nvrtcProgram + CUDA Runtime Compilation program. + name_expression : bytes + constant expression denoting the address of a global function or + device/__constant__ variable. + + Returns + ------- + nvrtcResult + NVRTC_SUCCESS + NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION + NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID + lowered_name : bytes + initialized by the function to point to a C string containing the + lowered (mangled) name corresponding to the provided name + expression. + + See Also + -------- + nvrtcAddNameExpression + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef const char* lowered_name = NULL + with nogil: + err = cynvrtc.nvrtcGetLoweredName(cyprog, name_expression, &lowered_name) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, lowered_name if lowered_name != NULL else None) + +@cython.embedsignature(True) +def nvrtcGetPCHHeapSize(): + """ retrieve the current size of the PCH Heap. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + ret : int + pointer to location where the size of the PCH Heap will be stored + """ + cdef size_t ret = 0 + with nogil: + err = cynvrtc.nvrtcGetPCHHeapSize(&ret) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, ret) + +@cython.embedsignature(True) +def nvrtcSetPCHHeapSize(size_t size): + """ set the size of the PCH Heap. + + The requested size may be rounded up to a platform dependent alignment + (e.g. page size). If the PCH Heap has already been allocated, the heap + memory will be freed and a new PCH Heap will be allocated. + + Parameters + ---------- + size : size_t + requested size of the PCH Heap, in bytes + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + """ + with nogil: + err = cynvrtc.nvrtcSetPCHHeapSize(size) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetPCHCreateStatus(prog): + """ returns the PCH creation status. + + NVRTC_SUCCESS indicates that the PCH was successfully created. + NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED indicates that no PCH creation was + attempted, either because PCH functionality was not requested during + the preceding nvrtcCompileProgram call, or automatic PCH processing was + requested, and compiler chose not to create a PCH file. + NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED indicates that a PCH file could + potentially have been created, but the compiler ran out space in the + PCH heap. In this scenario, the + :py:obj:`~.nvrtcGetPCHHeapSizeRequired()` can be used to query the + required heap size, the heap can be reallocated for this size with + :py:obj:`~.nvrtcSetPCHHeapSize()` and PCH creation may be reattempted + again invoking :py:obj:`~.nvrtcCompileProgram()` with a new NVRTC + program instance. NVRTC_ERROR_PCH_CREATE indicates that an error + condition prevented the PCH file from being created. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED` + - :py:obj:`~.NVRTC_ERROR_PCH_CREATE` + - :py:obj:`~.NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + with nogil: + err = cynvrtc.nvrtcGetPCHCreateStatus(cyprog) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def nvrtcGetPCHHeapSizeRequired(prog): + """ retrieve the required size of the PCH heap required to compile the given program. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` The size retrieved using this function is only valid if :py:obj:`~.nvrtcGetPCHCreateStatus()` returned NVRTC_SUCCESS or NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED + size : int + pointer to location where the required size of the PCH Heap will be + stored + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef size_t size = 0 + with nogil: + err = cynvrtc.nvrtcGetPCHHeapSizeRequired(cyprog, &size) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, size) + +@cython.embedsignature(True) +def nvrtcSetFlowCallback(prog, callback, payload): + """ nvrtcSetFlowCallback registers a callback function that the compiler will invoke at different points during a call to nvrtcCompileProgram, and the callback function can decide whether to cancel compilation by returning specific values. + + The callback function must satisfy the following constraints: + + (1) Its signature should be: + + **View CUDA Toolkit Documentation for a C++ code example** + + When invoking the callback, the compiler will always pass `payload` to + param1 so that the callback may make decisions based on `payload` . + It'll always pass NULL to param2 for now which is reserved for future + extensions. + + (2) It must return 1 to cancel compilation or 0 to continue. Other + return values are reserved for future use. + + (3) It must return consistent values. Once it returns 1 at one point, + it must return 1 in all following invocations during the current + nvrtcCompileProgram call in progress. + + (4) It must be thread-safe. + + (5) It must not invoke any nvrtc/libnvvm/ptx APIs. + + Parameters + ---------- + prog : :py:obj:`~.nvrtcProgram` + CUDA Runtime Compilation program. + callback : Any + the callback that issues cancellation signal. + payload : Any + to be passed as a parameter when invoking the callback. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + """ + cdef cynvrtc.nvrtcProgram cyprog + if prog is None: + pprog = 0 + elif isinstance(prog, (nvrtcProgram,)): + pprog = int(prog) + else: + pprog = int(nvrtcProgram(prog)) + cyprog = pprog + cdef _HelperInputVoidPtrStruct cycallbackHelper + cdef void* cycallback = _helper_input_void_ptr(callback, &cycallbackHelper) + cdef _HelperInputVoidPtrStruct cypayloadHelper + cdef void* cypayload = _helper_input_void_ptr(payload, &cypayloadHelper) + with nogil: + err = cynvrtc.nvrtcSetFlowCallback(cyprog, cycallback, cypayload) + _helper_input_void_ptr_free(&cycallbackHelper) + _helper_input_void_ptr_free(&cypayloadHelper) + return (_nvrtcResult(err),) + +@cython.embedsignature(True) +def sizeof(objType): + """ Returns the size of provided CUDA Python structure in bytes + + Parameters + ---------- + objType : Any + CUDA Python object + + Returns + ------- + lowered_name : int + The size of `objType` in bytes + """ + + if objType == nvrtcProgram: + return sizeof(cynvrtc.nvrtcProgram) + raise TypeError("Unknown type: " + str(objType)) diff --git a/cuda_bindings_12/cuda/bindings/nvvm.pxd b/cuda_bindings_12/cuda/bindings/nvvm.pxd new file mode 100644 index 00000000000..ddff245c4ae --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvvm.pxd @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=8fba6eefce0839acab8433ec432e9759b576665fc20b6d977953041f18c0e1d2 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + +from .cynvvm cimport * + + +############################################################################### +# Types +############################################################################### + +ctypedef nvvmProgram Program + + +############################################################################### +# Enum +############################################################################### + +ctypedef nvvmResult _Result + + +############################################################################### +# Functions +############################################################################### + +cpdef str get_error_string(int result) +cpdef tuple version() +cpdef tuple ir_version() +cpdef intptr_t create_program() except? 0 +cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name) +cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name) +cpdef compile_program(intptr_t prog, int num_options, options) +cpdef verify_program(intptr_t prog, int num_options, options) +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_12/cuda/bindings/nvvm.pyx b/cuda_bindings_12/cuda/bindings/nvvm.pyx new file mode 100644 index 00000000000..b6e8a13f1cb --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/nvvm.pyx @@ -0,0 +1,373 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# 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=a82258bb2654bea18f6bce657324bdbbee8b8b0b30d2a0021e792ba5f95fa9a4 + + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +from libc.stdint cimport intptr_t + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +cdef intptr_t _cyb_get_buffer_pointer(buf, Py_ssize_t size, readonly=True) except?-1: + cdef intptr_t ptr + cdef int flags = _cyb_cpython.PyBUF_ANY_CONTIGUOUS + if not readonly: + flags |= _cyb_cpython.PyBUF_WRITABLE + cdef int status = -1 + cdef _cyb_cpython.Py_buffer view + if isinstance(buf, int): + ptr = buf + else: + try: + status = _cyb_cpython.PyObject_GetBuffer(buf, &view, flags) + if size != -1: + assert view.len == size + assert view.ndim == 1 + except Exception as e: + adj = "writable " if not readonly else "" + raise ValueError( + "buf must be either a Python int representing the pointer " + f"address to a valid buffer, or a 1D contiguous {adj}" + f"buffer, of size {size}" + ) from e + else: + ptr = view.buf + finally: + if status == 0: + _cyb_cpython.PyBuffer_Release(&view) + return ptr + + +# <<<< END OF PREAMBLE CONTENT >>>> + +cimport cython # NOQA + +from ._internal.utils cimport (get_nested_resource_ptr, + nested_resource) + + +############################################################################### +# Enum +############################################################################### + +class Result(_cyb_FastEnum): + """ + NVVM API call result code. + + See `nvvmResult`. + """ + SUCCESS = NVVM_SUCCESS + ERROR_OUT_OF_MEMORY = NVVM_ERROR_OUT_OF_MEMORY + ERROR_PROGRAM_CREATION_FAILURE = NVVM_ERROR_PROGRAM_CREATION_FAILURE + ERROR_IR_VERSION_MISMATCH = NVVM_ERROR_IR_VERSION_MISMATCH + ERROR_INVALID_INPUT = NVVM_ERROR_INVALID_INPUT + ERROR_INVALID_PROGRAM = NVVM_ERROR_INVALID_PROGRAM + ERROR_INVALID_IR = NVVM_ERROR_INVALID_IR + ERROR_INVALID_OPTION = NVVM_ERROR_INVALID_OPTION + ERROR_NO_MODULE_IN_PROGRAM = NVVM_ERROR_NO_MODULE_IN_PROGRAM + ERROR_COMPILATION = NVVM_ERROR_COMPILATION + ERROR_CANCELLED = NVVM_ERROR_CANCELLED + + +############################################################################### +# Error handling +############################################################################### + +class nvvmError(Exception): + + def __init__(self, status): + self.status = status + s = Result(status) + cdef str err = f"{s.name} ({s.value})" + super(nvvmError, self).__init__(err) + + def __reduce__(self): + return (type(self), (self.status,)) + + +@cython.profile(False) +cdef int check_status(int status) except 1 nogil: + if status != 0: + with gil: + raise nvvmError(status) + return status + + +############################################################################### +# Wrapper functions +############################################################################### + +cpdef destroy_program(intptr_t prog): + """Destroy a program. + + Args: + prog (intptr_t): nvvm prog. + + .. seealso:: `nvvmDestroyProgram` + """ + cdef Program p = prog + with nogil: + status = nvvmDestroyProgram(&p) + check_status(status) + + +cpdef str get_error_string(int result): + """Get the message string for the given ``nvvmResult`` code. + + Args: + result (Result): NVVM API result code. + + .. seealso:: `nvvmGetErrorString` + """ + cdef const char *_output_cstr_ + cdef bytes _output_ + with nogil: + _output_cstr_ = nvvmGetErrorString(<_Result>result) + _output_ = _output_cstr_ + return _output_.decode() + + +cpdef tuple version(): + """Get the NVVM version. + + Returns: + A 2-tuple containing: + + - int: NVVM major version number. + - int: NVVM minor version number. + + .. seealso:: `nvvmVersion` + """ + cdef int major + cdef int minor + with nogil: + __status__ = nvvmVersion(&major, &minor) + check_status(__status__) + return (major, minor) + + +cpdef tuple ir_version(): + """Get the NVVM IR version. + + Returns: + A 4-tuple containing: + + - int: NVVM IR major version number. + - int: NVVM IR minor version number. + - int: NVVM IR debug metadata major version number. + - int: NVVM IR debug metadata minor version number. + + .. seealso:: `nvvmIRVersion` + """ + cdef int major_ir + cdef int minor_ir + cdef int major_dbg + cdef int minor_dbg + with nogil: + __status__ = nvvmIRVersion(&major_ir, &minor_ir, &major_dbg, &minor_dbg) + check_status(__status__) + return (major_ir, minor_ir, major_dbg, minor_dbg) + + +cpdef intptr_t create_program() except? 0: + """Create a program, and set the value of its handle to ``*prog``. + + Returns: + intptr_t: NVVM program. + + .. seealso:: `nvvmCreateProgram` + """ + cdef Program prog + with nogil: + __status__ = nvvmCreateProgram(&prog) + check_status(__status__) + return prog + + +cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name): + """Add a module level NVVM IR to a program. + + Args: + prog (intptr_t): NVVM program. + buffer (bytes): NVVM IR module in the bitcode or text + representation. + size (size_t): Size of the NVVM IR module. + name (str): Name of the NVVM IR module. If NULL, "" + is used as the name. + + .. seealso:: `nvvmAddModuleToProgram` + """ + cdef void* _buffer_ = _cyb_get_buffer_pointer(buffer, size, readonly=True) + if not isinstance(name, str): + raise TypeError("name must be a Python str") + cdef bytes _temp_name_ = (name).encode() + cdef char* _name_ = _temp_name_ + with nogil: + __status__ = nvvmAddModuleToProgram(prog, _buffer_, size, _name_) + check_status(__status__) + + +cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): + """Add a module level NVVM IR to a program. + + Args: + prog (intptr_t): NVVM program. + buffer (bytes): NVVM IR module in the bitcode representation. + size (size_t): Size of the NVVM IR module. + name (str): Name of the NVVM IR module. If NULL, "" + is used as the name. + + .. seealso:: `nvvmLazyAddModuleToProgram` + """ + cdef void* _buffer_ = _cyb_get_buffer_pointer(buffer, size, readonly=True) + if not isinstance(name, str): + raise TypeError("name must be a Python str") + cdef bytes _temp_name_ = (name).encode() + cdef char* _name_ = _temp_name_ + with nogil: + __status__ = nvvmLazyAddModuleToProgram(prog, _buffer_, size, _name_) + check_status(__status__) + + +cpdef compile_program(intptr_t prog, int num_options, options): + """Compile the NVVM program. + + Args: + prog (intptr_t): NVVM program. + num_options (int): Number of compiler ``options`` passed. + options (object): Compiler options in the form of C string + array. It can be: + + - an :class:`int` as the pointer address to the nested sequence, or + - a Python sequence of :class:`int`\s, each of which is a pointer address + to a valid sequence of 'char', or + - a nested Python sequence of ``str``. + + + .. seealso:: `nvvmCompileProgram` + """ + cdef nested_resource[ char ] _options_ + get_nested_resource_ptr[char](_options_, options, NULL) + with nogil: + __status__ = nvvmCompileProgram(prog, num_options, (_options_.ptrs.data())) + check_status(__status__) + + +cpdef verify_program(intptr_t prog, int num_options, options): + """Verify the NVVM program. + + Args: + prog (intptr_t): NVVM program. + num_options (int): Number of compiler ``options`` passed. + options (object): Compiler options in the form of C string + array. It can be: + + - an :class:`int` as the pointer address to the nested sequence, or + - a Python sequence of :class:`int`\s, each of which is a pointer address + to a valid sequence of 'char', or + - a nested Python sequence of ``str``. + + + .. seealso:: `nvvmVerifyProgram` + """ + cdef nested_resource[ char ] _options_ + get_nested_resource_ptr[char](_options_, options, NULL) + with nogil: + __status__ = nvvmVerifyProgram(prog, num_options, (_options_.ptrs.data())) + check_status(__status__) + + +cpdef size_t get_compiled_result_size(intptr_t prog) except? 0: + """Get the size of the compiled result. + + Args: + prog (intptr_t): NVVM program. + + Returns: + size_t: Size of the compiled result (including the trailing + NULL). + + .. seealso:: `nvvmGetCompiledResultSize` + """ + cdef size_t buffer_size_ret + with nogil: + __status__ = nvvmGetCompiledResultSize(prog, &buffer_size_ret) + check_status(__status__) + return buffer_size_ret + + +cpdef get_compiled_result(intptr_t prog, buffer): + """Get the compiled result. + + Args: + prog (intptr_t): NVVM program. + buffer (bytes): Compiled result. + + .. seealso:: `nvvmGetCompiledResult` + """ + cdef void* _buffer_ = _cyb_get_buffer_pointer(buffer, -1, readonly=False) + with nogil: + __status__ = nvvmGetCompiledResult(prog, _buffer_) + check_status(__status__) + + +cpdef size_t get_program_log_size(intptr_t prog) except? 0: + """Get the Size of Compiler/Verifier Message. + + Args: + prog (intptr_t): NVVM program. + + Returns: + size_t: Size of the compilation/verification log (including + the trailing NULL). + + .. seealso:: `nvvmGetProgramLogSize` + """ + cdef size_t buffer_size_ret + with nogil: + __status__ = nvvmGetProgramLogSize(prog, &buffer_size_ret) + check_status(__status__) + return buffer_size_ret + + +cpdef get_program_log(intptr_t prog, buffer): + """Get the Compiler/Verifier Message. + + Args: + prog (intptr_t): NVVM program. + buffer (bytes): Compilation/Verification log. + + .. seealso:: `nvvmGetProgramLog` + """ + cdef void* _buffer_ = _cyb_get_buffer_pointer(buffer, -1, readonly=False) + 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_12/cuda/bindings/runtime.pxd.in b/cuda_bindings_12/cuda/bindings/runtime.pxd.in new file mode 100644 index 00000000000..29c9a2472a3 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/runtime.pxd.in @@ -0,0 +1,5129 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fa9703419c5938342fe7ed6612dc66da6924bcdb308a2c975c3c476268a9757a +cimport cuda.bindings.cyruntime as cyruntime + +include "_lib/utils.pxd" +cimport cuda.bindings.driver as driver + +{{if 'cudaArray_t' in found_types}} + +cdef class cudaArray_t: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaArray_t _pvt_val + cdef cyruntime.cudaArray_t* _pvt_ptr +{{endif}} + +{{if 'cudaArray_const_t' in found_types}} + +cdef class cudaArray_const_t: + """ + + CUDA array (as source copy argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaArray_const_t _pvt_val + cdef cyruntime.cudaArray_const_t* _pvt_ptr +{{endif}} + +{{if 'cudaMipmappedArray_t' in found_types}} + +cdef class cudaMipmappedArray_t: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaMipmappedArray_t _pvt_val + cdef cyruntime.cudaMipmappedArray_t* _pvt_ptr +{{endif}} + +{{if 'cudaMipmappedArray_const_t' in found_types}} + +cdef class cudaMipmappedArray_const_t: + """ + + CUDA mipmapped array (as source argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaMipmappedArray_const_t _pvt_val + cdef cyruntime.cudaMipmappedArray_const_t* _pvt_ptr +{{endif}} + +{{if 'cudaGraphicsResource_t' in found_types}} + +cdef class cudaGraphicsResource_t: + """ + + CUDA graphics resource types + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphicsResource_t _pvt_val + cdef cyruntime.cudaGraphicsResource_t* _pvt_ptr +{{endif}} + +{{if 'cudaExternalMemory_t' in found_types}} + +cdef class cudaExternalMemory_t: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaExternalMemory_t _pvt_val + cdef cyruntime.cudaExternalMemory_t* _pvt_ptr +{{endif}} + +{{if 'cudaExternalSemaphore_t' in found_types}} + +cdef class cudaExternalSemaphore_t: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaExternalSemaphore_t _pvt_val + cdef cyruntime.cudaExternalSemaphore_t* _pvt_ptr +{{endif}} + +{{if 'cudaKernel_t' in found_types}} + +cdef class cudaKernel_t: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaKernel_t _pvt_val + cdef cyruntime.cudaKernel_t* _pvt_ptr +{{endif}} + +{{if 'cudaLibrary_t' in found_types}} + +cdef class cudaLibrary_t: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaLibrary_t _pvt_val + cdef cyruntime.cudaLibrary_t* _pvt_ptr +{{endif}} + +{{if 'cudaGraphDeviceNode_t' in found_types}} + +cdef class cudaGraphDeviceNode_t: + """ + + CUDA device node handle for device-side node update + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphDeviceNode_t _pvt_val + cdef cyruntime.cudaGraphDeviceNode_t* _pvt_ptr +{{endif}} + +{{if 'cudaAsyncCallbackHandle_t' in found_types}} + +cdef class cudaAsyncCallbackHandle_t: + """ + + CUDA async callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaAsyncCallbackHandle_t _pvt_val + cdef cyruntime.cudaAsyncCallbackHandle_t* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLImageKHR _pvt_val + cdef cyruntime.EGLImageKHR* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLStreamKHR _pvt_val + cdef cyruntime.EGLStreamKHR* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLSyncKHR _pvt_val + cdef cyruntime.EGLSyncKHR* _pvt_ptr +{{endif}} + +{{if 'cudaHostFn_t' in found_types}} + +cdef class cudaHostFn_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaHostFn_t _pvt_val + cdef cyruntime.cudaHostFn_t* _pvt_ptr +{{endif}} + +{{if 'cudaAsyncCallback' in found_types}} + +cdef class cudaAsyncCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaAsyncCallback _pvt_val + cdef cyruntime.cudaAsyncCallback* _pvt_ptr +{{endif}} + +{{if 'cudaStreamCallback_t' in found_types}} + +cdef class cudaStreamCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaStreamCallback_t _pvt_val + cdef cyruntime.cudaStreamCallback_t* _pvt_ptr +{{endif}} + +{{if 'dim3' in found_struct}} + +cdef class dim3: + """ + Attributes + ---------- + {{if 'dim3.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'dim3.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'dim3.z' in found_struct}} + z : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.dim3 _pvt_val + cdef cyruntime.dim3* _pvt_ptr +{{endif}} +{{if 'cudaChannelFormatDesc' in found_struct}} + +cdef class cudaChannelFormatDesc: + """ + CUDA Channel format descriptor + + Attributes + ---------- + {{if 'cudaChannelFormatDesc.x' in found_struct}} + x : int + x + {{endif}} + {{if 'cudaChannelFormatDesc.y' in found_struct}} + y : int + y + {{endif}} + {{if 'cudaChannelFormatDesc.z' in found_struct}} + z : int + z + {{endif}} + {{if 'cudaChannelFormatDesc.w' in found_struct}} + w : int + w + {{endif}} + {{if 'cudaChannelFormatDesc.f' in found_struct}} + f : cudaChannelFormatKind + Channel format kind + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaChannelFormatDesc _pvt_val + cdef cyruntime.cudaChannelFormatDesc* _pvt_ptr +{{endif}} +{{if 'cudaArraySparseProperties.tileExtent' in found_struct}} + +cdef class anon_struct0: + """ + Attributes + ---------- + {{if 'cudaArraySparseProperties.tileExtent.width' in found_struct}} + width : unsigned int + + {{endif}} + {{if 'cudaArraySparseProperties.tileExtent.height' in found_struct}} + height : unsigned int + + {{endif}} + {{if 'cudaArraySparseProperties.tileExtent.depth' in found_struct}} + depth : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArraySparseProperties* _pvt_ptr +{{endif}} +{{if 'cudaArraySparseProperties' in found_struct}} + +cdef class cudaArraySparseProperties: + """ + Sparse CUDA array and CUDA mipmapped array properties + + Attributes + ---------- + {{if 'cudaArraySparseProperties.tileExtent' in found_struct}} + tileExtent : anon_struct0 + + {{endif}} + {{if 'cudaArraySparseProperties.miptailFirstLevel' in found_struct}} + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins + {{endif}} + {{if 'cudaArraySparseProperties.miptailSize' in found_struct}} + miptailSize : unsigned long long + Total size of the mip tail. + {{endif}} + {{if 'cudaArraySparseProperties.flags' in found_struct}} + flags : unsigned int + Flags will either be zero or cudaArraySparsePropertiesSingleMipTail + {{endif}} + {{if 'cudaArraySparseProperties.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArraySparseProperties _pvt_val + cdef cyruntime.cudaArraySparseProperties* _pvt_ptr + {{if 'cudaArraySparseProperties.tileExtent' in found_struct}} + cdef anon_struct0 _tileExtent + {{endif}} +{{endif}} +{{if 'cudaArrayMemoryRequirements' in found_struct}} + +cdef class cudaArrayMemoryRequirements: + """ + CUDA array and CUDA mipmapped array memory requirements + + Attributes + ---------- + {{if 'cudaArrayMemoryRequirements.size' in found_struct}} + size : size_t + Total size of the array. + {{endif}} + {{if 'cudaArrayMemoryRequirements.alignment' in found_struct}} + alignment : size_t + Alignment necessary for mapping the array. + {{endif}} + {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaArrayMemoryRequirements _pvt_val + cdef cyruntime.cudaArrayMemoryRequirements* _pvt_ptr +{{endif}} +{{if 'cudaPitchedPtr' in found_struct}} + +cdef class cudaPitchedPtr: + """ + CUDA Pitched memory pointer make_cudaPitchedPtr + + Attributes + ---------- + {{if 'cudaPitchedPtr.ptr' in found_struct}} + ptr : Any + Pointer to allocated memory + {{endif}} + {{if 'cudaPitchedPtr.pitch' in found_struct}} + pitch : size_t + Pitch of allocated memory in bytes + {{endif}} + {{if 'cudaPitchedPtr.xsize' in found_struct}} + xsize : size_t + Logical width of allocation in elements + {{endif}} + {{if 'cudaPitchedPtr.ysize' in found_struct}} + ysize : size_t + Logical height of allocation in elements + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPitchedPtr _pvt_val + cdef cyruntime.cudaPitchedPtr* _pvt_ptr + {{if 'cudaPitchedPtr.ptr' in found_struct}} + cdef _HelperInputVoidPtr _cyptr + {{endif}} +{{endif}} +{{if 'cudaExtent' in found_struct}} + +cdef class cudaExtent: + """ + CUDA extent make_cudaExtent + + Attributes + ---------- + {{if 'cudaExtent.width' in found_struct}} + width : size_t + Width in elements when referring to array memory, in bytes when + referring to linear memory + {{endif}} + {{if 'cudaExtent.height' in found_struct}} + height : size_t + Height in elements + {{endif}} + {{if 'cudaExtent.depth' in found_struct}} + depth : size_t + Depth in elements + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExtent _pvt_val + cdef cyruntime.cudaExtent* _pvt_ptr +{{endif}} +{{if 'cudaPos' in found_struct}} + +cdef class cudaPos: + """ + CUDA 3D position make_cudaPos + + Attributes + ---------- + {{if 'cudaPos.x' in found_struct}} + x : size_t + x + {{endif}} + {{if 'cudaPos.y' in found_struct}} + y : size_t + y + {{endif}} + {{if 'cudaPos.z' in found_struct}} + z : size_t + z + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPos _pvt_val + cdef cyruntime.cudaPos* _pvt_ptr +{{endif}} +{{if 'cudaMemcpy3DParms' in found_struct}} + +cdef class cudaMemcpy3DParms: + """ + CUDA 3D memory copying parameters + + Attributes + ---------- + {{if 'cudaMemcpy3DParms.srcArray' in found_struct}} + srcArray : cudaArray_t + Source memory address + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + srcPos : cudaPos + Source position offset + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + srcPtr : cudaPitchedPtr + Pitched source memory address + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + dstArray : cudaArray_t + Destination memory address + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + dstPos : cudaPos + Destination position offset + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + dstPtr : cudaPitchedPtr + Pitched destination memory address + {{endif}} + {{if 'cudaMemcpy3DParms.extent' in found_struct}} + extent : cudaExtent + Requested memory copy size + {{endif}} + {{if 'cudaMemcpy3DParms.kind' in found_struct}} + kind : cudaMemcpyKind + Type of transfer + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DParms _pvt_val + cdef cyruntime.cudaMemcpy3DParms* _pvt_ptr + {{if 'cudaMemcpy3DParms.srcArray' in found_struct}} + cdef cudaArray_t _srcArray + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + cdef cudaPos _srcPos + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + cdef cudaPitchedPtr _srcPtr + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + cdef cudaArray_t _dstArray + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + cdef cudaPos _dstPos + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + cdef cudaPitchedPtr _dstPtr + {{endif}} + {{if 'cudaMemcpy3DParms.extent' in found_struct}} + cdef cudaExtent _extent + {{endif}} +{{endif}} +{{if 'cudaMemcpyNodeParams' in found_struct}} + +cdef class cudaMemcpyNodeParams: + """ + Memcpy node parameters + + Attributes + ---------- + {{if 'cudaMemcpyNodeParams.flags' in found_struct}} + flags : int + Must be zero + {{endif}} + {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} + reserved : list[int] + Must be zero + {{endif}} + {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} + copyParams : cudaMemcpy3DParms + Parameters for the memory copy + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpyNodeParams _pvt_val + cdef cyruntime.cudaMemcpyNodeParams* _pvt_ptr + {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} + cdef cudaMemcpy3DParms _copyParams + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DPeerParms' in found_struct}} + +cdef class cudaMemcpy3DPeerParms: + """ + CUDA 3D cross-device memory copying parameters + + Attributes + ---------- + {{if 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + srcArray : cudaArray_t + Source memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + srcPos : cudaPos + Source position offset + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + srcPtr : cudaPitchedPtr + Pitched source memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcDevice' in found_struct}} + srcDevice : int + Source device + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + dstArray : cudaArray_t + Destination memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + dstPos : cudaPos + Destination position offset + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + dstPtr : cudaPitchedPtr + Pitched destination memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstDevice' in found_struct}} + dstDevice : int + Destination device + {{endif}} + {{if 'cudaMemcpy3DPeerParms.extent' in found_struct}} + extent : cudaExtent + Requested memory copy size + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DPeerParms _pvt_val + cdef cyruntime.cudaMemcpy3DPeerParms* _pvt_ptr + {{if 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + cdef cudaArray_t _srcArray + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + cdef cudaPos _srcPos + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + cdef cudaPitchedPtr _srcPtr + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + cdef cudaArray_t _dstArray + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + cdef cudaPos _dstPos + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + cdef cudaPitchedPtr _dstPtr + {{endif}} + {{if 'cudaMemcpy3DPeerParms.extent' in found_struct}} + cdef cudaExtent _extent + {{endif}} +{{endif}} +{{if 'cudaMemsetParams' in found_struct}} + +cdef class cudaMemsetParams: + """ + CUDA Memset node parameters + + Attributes + ---------- + {{if 'cudaMemsetParams.dst' in found_struct}} + dst : Any + Destination device pointer + {{endif}} + {{if 'cudaMemsetParams.pitch' in found_struct}} + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + {{endif}} + {{if 'cudaMemsetParams.value' in found_struct}} + value : unsigned int + Value to be set + {{endif}} + {{if 'cudaMemsetParams.elementSize' in found_struct}} + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + {{endif}} + {{if 'cudaMemsetParams.width' in found_struct}} + width : size_t + Width of the row in elements + {{endif}} + {{if 'cudaMemsetParams.height' in found_struct}} + height : size_t + Number of rows + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemsetParams _pvt_val + cdef cyruntime.cudaMemsetParams* _pvt_ptr + {{if 'cudaMemsetParams.dst' in found_struct}} + cdef _HelperInputVoidPtr _cydst + {{endif}} +{{endif}} +{{if 'cudaMemsetParamsV2' in found_struct}} + +cdef class cudaMemsetParamsV2: + """ + CUDA Memset node parameters + + Attributes + ---------- + {{if 'cudaMemsetParamsV2.dst' in found_struct}} + dst : Any + Destination device pointer + {{endif}} + {{if 'cudaMemsetParamsV2.pitch' in found_struct}} + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + {{endif}} + {{if 'cudaMemsetParamsV2.value' in found_struct}} + value : unsigned int + Value to be set + {{endif}} + {{if 'cudaMemsetParamsV2.elementSize' in found_struct}} + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + {{endif}} + {{if 'cudaMemsetParamsV2.width' in found_struct}} + width : size_t + Width of the row in elements + {{endif}} + {{if 'cudaMemsetParamsV2.height' in found_struct}} + height : size_t + Number of rows + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemsetParamsV2 _pvt_val + cdef cyruntime.cudaMemsetParamsV2* _pvt_ptr + {{if 'cudaMemsetParamsV2.dst' in found_struct}} + cdef _HelperInputVoidPtr _cydst + {{endif}} +{{endif}} +{{if 'cudaAccessPolicyWindow' in found_struct}} + +cdef class cudaAccessPolicyWindow: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + Partition into many segments and assign segments such that. sum of + "hit segments" / window == approx. ratio. sum of "miss segments" / + window == approx 1-ratio. Segments and ratio specifications are + fitted to the capabilities of the architecture. Accesses in a hit + segment apply the hitProp access policy. Accesses in a miss segment + apply the missProp access policy. + + Attributes + ---------- + {{if 'cudaAccessPolicyWindow.base_ptr' in found_struct}} + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + {{endif}} + {{if 'cudaAccessPolicyWindow.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 'cudaAccessPolicyWindow.hitRatio' in found_struct}} + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + {{endif}} + {{if 'cudaAccessPolicyWindow.hitProp' in found_struct}} + hitProp : cudaAccessProperty + ::CUaccessProperty set for hit. + {{endif}} + {{if 'cudaAccessPolicyWindow.missProp' in found_struct}} + missProp : cudaAccessProperty + ::CUaccessProperty set for miss. Must be either NORMAL or + STREAMING. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAccessPolicyWindow _pvt_val + cdef cyruntime.cudaAccessPolicyWindow* _pvt_ptr + {{if 'cudaAccessPolicyWindow.base_ptr' in found_struct}} + cdef _HelperInputVoidPtr _cybase_ptr + {{endif}} +{{endif}} +{{if 'cudaHostNodeParams' in found_struct}} + +cdef class cudaHostNodeParams: + """ + CUDA host node parameters + + Attributes + ---------- + {{if 'cudaHostNodeParams.fn' in found_struct}} + fn : cudaHostFn_t + The function to call when the node executes + {{endif}} + {{if 'cudaHostNodeParams.userData' in found_struct}} + userData : Any + Argument to pass to the function + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaHostNodeParams _pvt_val + cdef cyruntime.cudaHostNodeParams* _pvt_ptr + {{if 'cudaHostNodeParams.fn' in found_struct}} + cdef cudaHostFn_t _fn + {{endif}} + {{if 'cudaHostNodeParams.userData' in found_struct}} + cdef _HelperInputVoidPtr _cyuserData + {{endif}} +{{endif}} +{{if 'cudaHostNodeParamsV2' in found_struct}} + +cdef class cudaHostNodeParamsV2: + """ + CUDA host node parameters + + Attributes + ---------- + {{if 'cudaHostNodeParamsV2.fn' in found_struct}} + fn : cudaHostFn_t + The function to call when the node executes + {{endif}} + {{if 'cudaHostNodeParamsV2.userData' in found_struct}} + userData : Any + Argument to pass to the function + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaHostNodeParamsV2 _pvt_val + cdef cyruntime.cudaHostNodeParamsV2* _pvt_ptr + {{if 'cudaHostNodeParamsV2.fn' in found_struct}} + cdef cudaHostFn_t _fn + {{endif}} + {{if 'cudaHostNodeParamsV2.userData' in found_struct}} + cdef _HelperInputVoidPtr _cyuserData + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.array' in found_struct}} + +cdef class anon_struct1: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.array.array' in found_struct}} + array : cudaArray_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res.array.array' in found_struct}} + cdef cudaArray_t _array + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.mipmap' in found_struct}} + +cdef class anon_struct2: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + mipmap : cudaMipmappedArray_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + cdef cudaMipmappedArray_t _mipmap + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.linear' in found_struct}} + +cdef class anon_struct3: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.linear.devPtr' in found_struct}} + devPtr : Any + + {{endif}} + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + desc : cudaChannelFormatDesc + + {{endif}} + {{if 'cudaResourceDesc.res.linear.sizeInBytes' in found_struct}} + sizeInBytes : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res.linear.devPtr' in found_struct}} + cdef _HelperInputVoidPtr _cydevPtr + {{endif}} + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + cdef cudaChannelFormatDesc _desc + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + +cdef class anon_struct4: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.pitch2D.devPtr' in found_struct}} + devPtr : Any + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + desc : cudaChannelFormatDesc + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.width' in found_struct}} + width : size_t + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.height' in found_struct}} + height : size_t + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.pitchInBytes' in found_struct}} + pitchInBytes : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res.pitch2D.devPtr' in found_struct}} + cdef _HelperInputVoidPtr _cydevPtr + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + cdef cudaChannelFormatDesc _desc + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res' in found_struct}} + +cdef class anon_union0: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.array' in found_struct}} + array : anon_struct1 + + {{endif}} + {{if 'cudaResourceDesc.res.mipmap' in found_struct}} + mipmap : anon_struct2 + + {{endif}} + {{if 'cudaResourceDesc.res.linear' in found_struct}} + linear : anon_struct3 + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + pitch2D : anon_struct4 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res.array' in found_struct}} + cdef anon_struct1 _array + {{endif}} + {{if 'cudaResourceDesc.res.mipmap' in found_struct}} + cdef anon_struct2 _mipmap + {{endif}} + {{if 'cudaResourceDesc.res.linear' in found_struct}} + cdef anon_struct3 _linear + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + cdef anon_struct4 _pitch2D + {{endif}} +{{endif}} +{{if 'cudaResourceDesc' in found_struct}} + +cdef class cudaResourceDesc: + """ + CUDA resource descriptor + + Attributes + ---------- + {{if 'cudaResourceDesc.resType' in found_struct}} + resType : cudaResourceType + Resource type + {{endif}} + {{if 'cudaResourceDesc.res' in found_struct}} + res : anon_union0 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceDesc* _val_ptr + cdef cyruntime.cudaResourceDesc* _pvt_ptr + {{if 'cudaResourceDesc.res' in found_struct}} + cdef anon_union0 _res + {{endif}} +{{endif}} +{{if 'cudaResourceViewDesc' in found_struct}} + +cdef class cudaResourceViewDesc: + """ + CUDA resource view descriptor + + Attributes + ---------- + {{if 'cudaResourceViewDesc.format' in found_struct}} + format : cudaResourceViewFormat + Resource view format + {{endif}} + {{if 'cudaResourceViewDesc.width' in found_struct}} + width : size_t + Width of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.height' in found_struct}} + height : size_t + Height of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.depth' in found_struct}} + depth : size_t + Depth of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.firstMipmapLevel' in found_struct}} + firstMipmapLevel : unsigned int + First defined mipmap level + {{endif}} + {{if 'cudaResourceViewDesc.lastMipmapLevel' in found_struct}} + lastMipmapLevel : unsigned int + Last defined mipmap level + {{endif}} + {{if 'cudaResourceViewDesc.firstLayer' in found_struct}} + firstLayer : unsigned int + First layer index + {{endif}} + {{if 'cudaResourceViewDesc.lastLayer' in found_struct}} + lastLayer : unsigned int + Last layer index + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaResourceViewDesc _pvt_val + cdef cyruntime.cudaResourceViewDesc* _pvt_ptr +{{endif}} +{{if 'cudaPointerAttributes' in found_struct}} + +cdef class cudaPointerAttributes: + """ + CUDA pointer attributes + + Attributes + ---------- + {{if 'cudaPointerAttributes.type' in found_struct}} + type : cudaMemoryType + The type of memory - cudaMemoryTypeUnregistered, + cudaMemoryTypeHost, cudaMemoryTypeDevice or cudaMemoryTypeManaged. + {{endif}} + {{if 'cudaPointerAttributes.device' in found_struct}} + device : int + The device against which the memory was allocated or registered. If + the memory type is cudaMemoryTypeDevice then this identifies the + device on which the memory referred physically resides. If the + memory type is cudaMemoryTypeHost or::cudaMemoryTypeManaged then + this identifies the device which was current when the memory was + allocated or registered (and if that device is deinitialized then + this allocation will vanish with that device's state). + {{endif}} + {{if 'cudaPointerAttributes.devicePointer' in found_struct}} + devicePointer : Any + The address which may be dereferenced on the current device to + access the memory or NULL if no such address exists. + {{endif}} + {{if 'cudaPointerAttributes.hostPointer' in found_struct}} + hostPointer : Any + The address which may be dereferenced on the host to access the + memory or NULL if no such address exists. CUDA doesn't check if + unregistered memory is allocated so this field may contain invalid + pointer if an invalid pointer has been passed to CUDA. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaPointerAttributes _pvt_val + cdef cyruntime.cudaPointerAttributes* _pvt_ptr + {{if 'cudaPointerAttributes.devicePointer' in found_struct}} + cdef _HelperInputVoidPtr _cydevicePointer + {{endif}} + {{if 'cudaPointerAttributes.hostPointer' in found_struct}} + cdef _HelperInputVoidPtr _cyhostPointer + {{endif}} +{{endif}} +{{if 'cudaFuncAttributes' in found_struct}} + +cdef class cudaFuncAttributes: + """ + CUDA function attributes + + Attributes + ---------- + {{if 'cudaFuncAttributes.sharedSizeBytes' in found_struct}} + sharedSizeBytes : size_t + The size in bytes of statically-allocated shared memory per block + required by this function. This does not include dynamically- + allocated shared memory requested by the user at runtime. + {{endif}} + {{if 'cudaFuncAttributes.constSizeBytes' in found_struct}} + constSizeBytes : size_t + The size in bytes of user-allocated constant memory required by + this function. + {{endif}} + {{if 'cudaFuncAttributes.localSizeBytes' in found_struct}} + localSizeBytes : size_t + The size in bytes of local memory used by each thread of this + function. + {{endif}} + {{if 'cudaFuncAttributes.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int + The maximum number of threads per block, beyond which a launch of + the function would fail. This number depends on both the function + and the device on which the function is currently loaded. + {{endif}} + {{if 'cudaFuncAttributes.numRegs' in found_struct}} + numRegs : int + The number of registers used by each thread of this function. + {{endif}} + {{if 'cudaFuncAttributes.ptxVersion' in found_struct}} + ptxVersion : int + 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. + {{endif}} + {{if 'cudaFuncAttributes.binaryVersion' in found_struct}} + binaryVersion : int + 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. + {{endif}} + {{if 'cudaFuncAttributes.cacheModeCA' in found_struct}} + cacheModeCA : int + The attribute to indicate whether the function has been compiled + with user specified option "-Xptxas --dlcm=ca" set. + {{endif}} + {{if 'cudaFuncAttributes.maxDynamicSharedSizeBytes' in found_struct}} + maxDynamicSharedSizeBytes : int + The maximum size in bytes of dynamic shared memory per block for + this function. Any launch must have a dynamic shared memory size + smaller than this value. + {{endif}} + {{if 'cudaFuncAttributes.preferredShmemCarveout' in found_struct}} + preferredShmemCarveout : int + On devices where the L1 cache and shared memory use the same + hardware resources, this sets the shared memory carveout + preference, in percent of the maximum shared memory. Refer to + cudaDevAttrMaxSharedMemoryPerMultiprocessor. This is only a hint, + and the driver can choose a different ratio if required to execute + the function. See cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.clusterDimMustBeSet' in found_struct}} + clusterDimMustBeSet : int + If this attribute is set, the kernel must launch with a valid + cluster dimension specified. + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterWidth' in found_struct}} + requiredClusterWidth : int + The required cluster width/height/depth in blocks. The values must + either all be 0 or all be positive. The validity of the cluster + dimensions is otherwise checked at launch time. If the value is + set during compile time, it cannot be set at runtime. Setting it at + runtime should return cudaErrorNotPermitted. See + cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterHeight' in found_struct}} + requiredClusterHeight : int + + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterDepth' in found_struct}} + requiredClusterDepth : int + + {{endif}} + {{if 'cudaFuncAttributes.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : int + The block scheduling policy of a function. See cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.nonPortableClusterSizeAllowed' in found_struct}} + nonPortableClusterSizeAllowed : int + Whether the function can be launched with non-portable cluster + size. 1 is allowed, 0 is disallowed. A non-portable cluster size + may only function on the specific SKUs the program is tested on. + The launch might fail if the program is run on a different hardware + platform. CUDA API provides cudaOccupancyMaxActiveClusters to + assist with checking whether the desired size can be launched on + the current device. Portable Cluster Size A portable cluster size + is guaranteed to be functional on all compute capabilities higher + than the target compute capability. The portable cluster size for + sm_90 is 8 blocks per cluster. This value may increase for future + compute capabilities. The specific hardware unit may support + higher cluster sizes that’s not guaranteed to be portable. See + cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.reserved' in found_struct}} + reserved : list[int] + Reserved for future use. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaFuncAttributes _pvt_val + cdef cyruntime.cudaFuncAttributes* _pvt_ptr +{{endif}} +{{if 'cudaMemLocation' in found_struct}} + +cdef class cudaMemLocation: + """ + Specifies a memory location. To specify a gpu, set type = + cudaMemLocationTypeDevice and set id = the gpu's device ordinal. To + specify a cpu NUMA node, set type = cudaMemLocationTypeHostNuma and + set id = host NUMA node id. + + Attributes + ---------- + {{if 'cudaMemLocation.type' in found_struct}} + type : cudaMemLocationType + Specifies the location type, which modifies the meaning of id. + {{endif}} + {{if 'cudaMemLocation.id' in found_struct}} + id : int + identifier for a given this location's ::CUmemLocationType. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemLocation _pvt_val + cdef cyruntime.cudaMemLocation* _pvt_ptr +{{endif}} +{{if 'cudaMemAccessDesc' in found_struct}} + +cdef class cudaMemAccessDesc: + """ + Memory access descriptor + + Attributes + ---------- + {{if 'cudaMemAccessDesc.location' in found_struct}} + location : cudaMemLocation + Location on which the request is to change it's accessibility + {{endif}} + {{if 'cudaMemAccessDesc.flags' in found_struct}} + flags : cudaMemAccessFlags + ::CUmemProt accessibility flags to set on the request + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAccessDesc _pvt_val + cdef cyruntime.cudaMemAccessDesc* _pvt_ptr + {{if 'cudaMemAccessDesc.location' in found_struct}} + cdef cudaMemLocation _location + {{endif}} +{{endif}} +{{if 'cudaMemPoolProps' in found_struct}} + +cdef class cudaMemPoolProps: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + {{if 'cudaMemPoolProps.allocType' in found_struct}} + allocType : cudaMemAllocationType + Allocation type. Currently must be specified as + cudaMemAllocationTypePinned + {{endif}} + {{if 'cudaMemPoolProps.handleTypes' in found_struct}} + handleTypes : cudaMemAllocationHandleType + Handle types that will be supported by allocations from the pool. + {{endif}} + {{if 'cudaMemPoolProps.location' in found_struct}} + location : cudaMemLocation + Location allocations should reside. + {{endif}} + {{if 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + cudaMemHandleTypeWin32 is specified. This security attribute + defines the scope of which exported allocations may be tranferred + to other processes. In all other cases, this field is required to + be zero. + {{endif}} + {{if 'cudaMemPoolProps.maxSize' in found_struct}} + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + {{endif}} + {{if 'cudaMemPoolProps.usage' in found_struct}} + usage : unsigned short + Bitmask indicating intended usage for the pool. + {{endif}} + {{if 'cudaMemPoolProps.reserved' in found_struct}} + reserved : bytes + reserved for future use, must be 0 + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemPoolProps _pvt_val + cdef cyruntime.cudaMemPoolProps* _pvt_ptr + {{if 'cudaMemPoolProps.location' in found_struct}} + cdef cudaMemLocation _location + {{endif}} + {{if 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} + cdef _HelperInputVoidPtr _cywin32SecurityAttributes + {{endif}} +{{endif}} +{{if 'cudaMemPoolPtrExportData' in found_struct}} + +cdef class cudaMemPoolPtrExportData: + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + {{if 'cudaMemPoolPtrExportData.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemPoolPtrExportData _pvt_val + cdef cyruntime.cudaMemPoolPtrExportData* _pvt_ptr +{{endif}} +{{if 'cudaMemAllocNodeParams' in found_struct}} + +cdef class cudaMemAllocNodeParams: + """ + Memory allocation node parameters + + Attributes + ---------- + {{if 'cudaMemAllocNodeParams.poolProps' in found_struct}} + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescCount' in found_struct}} + accessDescCount : size_t + in: Number of `accessDescs`s + {{endif}} + {{if 'cudaMemAllocNodeParams.bytesize' in found_struct}} + bytesize : size_t + in: size in bytes of the requested allocation + {{endif}} + {{if 'cudaMemAllocNodeParams.dptr' in found_struct}} + dptr : Any + out: address of the allocation returned by CUDA + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAllocNodeParams _pvt_val + cdef cyruntime.cudaMemAllocNodeParams* _pvt_ptr + {{if 'cudaMemAllocNodeParams.poolProps' in found_struct}} + cdef cudaMemPoolProps _poolProps + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} + cdef size_t _accessDescs_length + cdef cyruntime.cudaMemAccessDesc* _accessDescs + {{endif}} + {{if 'cudaMemAllocNodeParams.dptr' in found_struct}} + cdef _HelperInputVoidPtr _cydptr + {{endif}} +{{endif}} +{{if 'cudaMemAllocNodeParamsV2' in found_struct}} + +cdef class cudaMemAllocNodeParamsV2: + """ + Memory allocation node parameters + + Attributes + ---------- + {{if 'cudaMemAllocNodeParamsV2.poolProps' in found_struct}} + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescCount' in found_struct}} + accessDescCount : size_t + in: Number of `accessDescs`s + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.bytesize' in found_struct}} + bytesize : size_t + in: size in bytes of the requested allocation + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.dptr' in found_struct}} + dptr : Any + out: address of the allocation returned by CUDA + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemAllocNodeParamsV2 _pvt_val + cdef cyruntime.cudaMemAllocNodeParamsV2* _pvt_ptr + {{if 'cudaMemAllocNodeParamsV2.poolProps' in found_struct}} + cdef cudaMemPoolProps _poolProps + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} + cdef size_t _accessDescs_length + cdef cyruntime.cudaMemAccessDesc* _accessDescs + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.dptr' in found_struct}} + cdef _HelperInputVoidPtr _cydptr + {{endif}} +{{endif}} +{{if 'cudaMemFreeNodeParams' in found_struct}} + +cdef class cudaMemFreeNodeParams: + """ + Memory free node parameters + + Attributes + ---------- + {{if 'cudaMemFreeNodeParams.dptr' in found_struct}} + dptr : Any + in: the pointer to free + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemFreeNodeParams _pvt_val + cdef cyruntime.cudaMemFreeNodeParams* _pvt_ptr + {{if 'cudaMemFreeNodeParams.dptr' in found_struct}} + cdef _HelperInputVoidPtr _cydptr + {{endif}} +{{endif}} +{{if 'cudaMemcpyAttributes' in found_struct}} + +cdef class cudaMemcpyAttributes: + """ + Attributes specific to copies within a batch. For more details on + usage see cudaMemcpyBatchAsync. + + Attributes + ---------- + {{if 'cudaMemcpyAttributes.srcAccessOrder' in found_struct}} + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + {{endif}} + {{if 'cudaMemcpyAttributes.srcLocHint' in found_struct}} + srcLocHint : cudaMemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + {{endif}} + {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} + dstLocHint : cudaMemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + {{endif}} + {{if 'cudaMemcpyAttributes.flags' in found_struct}} + flags : unsigned int + Additional flags for copies with this attribute. See + cudaMemcpyFlags. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpyAttributes _pvt_val + cdef cyruntime.cudaMemcpyAttributes* _pvt_ptr + {{if 'cudaMemcpyAttributes.srcLocHint' in found_struct}} + cdef cudaMemLocation _srcLocHint + {{endif}} + {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} + cdef cudaMemLocation _dstLocHint + {{endif}} +{{endif}} +{{if 'cudaOffset3D' in found_struct}} + +cdef class cudaOffset3D: + """ + Struct representing offset into a cudaArray_t in elements + + Attributes + ---------- + {{if 'cudaOffset3D.x' in found_struct}} + x : size_t + + {{endif}} + {{if 'cudaOffset3D.y' in found_struct}} + y : size_t + + {{endif}} + {{if 'cudaOffset3D.z' in found_struct}} + z : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaOffset3D _pvt_val + cdef cyruntime.cudaOffset3D* _pvt_ptr +{{endif}} +{{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + +cdef class anon_struct5: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.ptr.ptr' in found_struct}} + ptr : Any + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.rowLength' in found_struct}} + rowLength : size_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.layerHeight' in found_struct}} + layerHeight : size_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.locHint' in found_struct}} + locHint : cudaMemLocation + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + {{if 'cudaMemcpy3DOperand.op.ptr.ptr' in found_struct}} + cdef _HelperInputVoidPtr _cyptr + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.locHint' in found_struct}} + cdef cudaMemLocation _locHint + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + +cdef class anon_struct6: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + array : cudaArray_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array.offset' in found_struct}} + offset : cudaOffset3D + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + {{if 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + cdef cudaArray_t _array + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array.offset' in found_struct}} + cdef cudaOffset3D _offset + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand.op' in found_struct}} + +cdef class anon_union1: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + ptr : anon_struct5 + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + array : anon_struct6 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + cdef anon_struct5 _ptr + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + cdef anon_struct6 _array + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand' in found_struct}} + +cdef class cudaMemcpy3DOperand: + """ + Struct representing an operand for copy with cudaMemcpy3DBatchAsync + + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.type' in found_struct}} + type : cudaMemcpy3DOperandType + + {{endif}} + {{if 'cudaMemcpy3DOperand.op' in found_struct}} + op : anon_union1 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DOperand* _val_ptr + cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr + {{if 'cudaMemcpy3DOperand.op' in found_struct}} + cdef anon_union1 _op + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DBatchOp' in found_struct}} + +cdef class cudaMemcpy3DBatchOp: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DBatchOp.src' in found_struct}} + src : cudaMemcpy3DOperand + Source memcpy operand. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} + dst : cudaMemcpy3DOperand + Destination memcpy operand. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} + extent : cudaExtent + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.flags' in found_struct}} + flags : unsigned int + Additional flags for copy from src to dst. See cudaMemcpyFlags. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemcpy3DBatchOp _pvt_val + cdef cyruntime.cudaMemcpy3DBatchOp* _pvt_ptr + {{if 'cudaMemcpy3DBatchOp.src' in found_struct}} + cdef cudaMemcpy3DOperand _src + {{endif}} + {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} + cdef cudaMemcpy3DOperand _dst + {{endif}} + {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} + cdef cudaExtent _extent + {{endif}} +{{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 + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.CUuuid_st _pvt_val + cdef cyruntime.CUuuid_st* _pvt_ptr +{{endif}} +{{if 'cudaDeviceProp' in found_struct}} + +cdef class cudaDeviceProp: + """ + CUDA device properties + + Attributes + ---------- + {{if 'cudaDeviceProp.name' in found_struct}} + name : bytes + ASCII string identifying device + {{endif}} + {{if 'cudaDeviceProp.uuid' in found_struct}} + uuid : cudaUUID_t + 16-byte unique identifier + {{endif}} + {{if 'cudaDeviceProp.luid' in found_struct}} + luid : bytes + 8-byte locally unique identifier. Value is undefined on TCC and + non-Windows platforms + {{endif}} + {{if 'cudaDeviceProp.luidDeviceNodeMask' in found_struct}} + luidDeviceNodeMask : unsigned int + LUID device node mask. Value is undefined on TCC and non-Windows + platforms + {{endif}} + {{if 'cudaDeviceProp.totalGlobalMem' in found_struct}} + totalGlobalMem : size_t + Global memory available on device in bytes + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlock' in found_struct}} + sharedMemPerBlock : size_t + Shared memory available per block in bytes + {{endif}} + {{if 'cudaDeviceProp.regsPerBlock' in found_struct}} + regsPerBlock : int + 32-bit registers available per block + {{endif}} + {{if 'cudaDeviceProp.warpSize' in found_struct}} + warpSize : int + Warp size in threads + {{endif}} + {{if 'cudaDeviceProp.memPitch' in found_struct}} + memPitch : size_t + Maximum pitch in bytes allowed by memory copies + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int + Maximum number of threads per block + {{endif}} + {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} + maxThreadsDim : list[int] + Maximum size of each dimension of a block + {{endif}} + {{if 'cudaDeviceProp.maxGridSize' in found_struct}} + maxGridSize : list[int] + Maximum size of each dimension of a grid + {{endif}} + {{if 'cudaDeviceProp.clockRate' in found_struct}} + clockRate : int + Deprecated, Clock frequency in kilohertz + {{endif}} + {{if 'cudaDeviceProp.totalConstMem' in found_struct}} + totalConstMem : size_t + Constant memory available on device in bytes + {{endif}} + {{if 'cudaDeviceProp.major' in found_struct}} + major : int + Major compute capability + {{endif}} + {{if 'cudaDeviceProp.minor' in found_struct}} + minor : int + Minor compute capability + {{endif}} + {{if 'cudaDeviceProp.textureAlignment' in found_struct}} + textureAlignment : size_t + Alignment requirement for textures + {{endif}} + {{if 'cudaDeviceProp.texturePitchAlignment' in found_struct}} + texturePitchAlignment : size_t + Pitch alignment requirement for texture references bound to pitched + memory + {{endif}} + {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} + deviceOverlap : int + Device can concurrently copy memory and execute a kernel. + Deprecated. Use instead asyncEngineCount. + {{endif}} + {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} + multiProcessorCount : int + Number of multiprocessors on device + {{endif}} + {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} + kernelExecTimeoutEnabled : int + Deprecated, Specified whether there is a run time limit on kernels + {{endif}} + {{if 'cudaDeviceProp.integrated' in found_struct}} + integrated : int + Device is integrated as opposed to discrete + {{endif}} + {{if 'cudaDeviceProp.canMapHostMemory' in found_struct}} + canMapHostMemory : int + Device can map host memory with + cudaHostAlloc/cudaHostGetDevicePointer + {{endif}} + {{if 'cudaDeviceProp.computeMode' in found_struct}} + computeMode : int + Deprecated, Compute mode (See cudaComputeMode) + {{endif}} + {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} + maxTexture1D : int + Maximum 1D texture size + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DMipmap' in found_struct}} + maxTexture1DMipmap : int + Maximum 1D mipmapped texture size + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} + maxTexture1DLinear : int + Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() + or cuDeviceGetTexture1DLinearMaxWidth() instead. + {{endif}} + {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} + maxTexture2D : list[int] + Maximum 2D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} + maxTexture2DMipmap : list[int] + Maximum 2D mipmapped texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} + maxTexture2DLinear : list[int] + Maximum dimensions (width, height, pitch) for 2D textures bound to + pitched memory + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} + maxTexture2DGather : list[int] + Maximum 2D texture dimensions if texture gather operations have to + be performed + {{endif}} + {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} + maxTexture3D : list[int] + Maximum 3D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} + maxTexture3DAlt : list[int] + Maximum alternate 3D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} + maxTextureCubemap : int + Maximum Cubemap texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} + maxTexture1DLayered : list[int] + Maximum 1D layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} + maxTexture2DLayered : list[int] + Maximum 2D layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} + maxTextureCubemapLayered : list[int] + Maximum Cubemap layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} + maxSurface1D : int + Maximum 1D surface size + {{endif}} + {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} + maxSurface2D : list[int] + Maximum 2D surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} + maxSurface3D : list[int] + Maximum 3D surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} + maxSurface1DLayered : list[int] + Maximum 1D layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} + maxSurface2DLayered : list[int] + Maximum 2D layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} + maxSurfaceCubemap : int + Maximum Cubemap surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} + maxSurfaceCubemapLayered : list[int] + Maximum Cubemap layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} + surfaceAlignment : size_t + Alignment requirements for surfaces + {{endif}} + {{if 'cudaDeviceProp.concurrentKernels' in found_struct}} + concurrentKernels : int + Device can possibly execute multiple kernels concurrently + {{endif}} + {{if 'cudaDeviceProp.ECCEnabled' in found_struct}} + ECCEnabled : int + Device has ECC support enabled + {{endif}} + {{if 'cudaDeviceProp.pciBusID' in found_struct}} + pciBusID : int + PCI bus ID of the device + {{endif}} + {{if 'cudaDeviceProp.pciDeviceID' in found_struct}} + pciDeviceID : int + PCI device ID of the device + {{endif}} + {{if 'cudaDeviceProp.pciDomainID' in found_struct}} + pciDomainID : int + PCI domain ID of the device + {{endif}} + {{if 'cudaDeviceProp.tccDriver' in found_struct}} + tccDriver : int + 1 if device is a Tesla device using TCC driver, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.asyncEngineCount' in found_struct}} + asyncEngineCount : int + Number of asynchronous engines + {{endif}} + {{if 'cudaDeviceProp.unifiedAddressing' in found_struct}} + unifiedAddressing : int + Device shares a unified address space with the host + {{endif}} + {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} + memoryClockRate : int + Deprecated, Peak memory clock frequency in kilohertz + {{endif}} + {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} + memoryBusWidth : int + Global memory bus width in bits + {{endif}} + {{if 'cudaDeviceProp.l2CacheSize' in found_struct}} + l2CacheSize : int + Size of L2 cache in bytes + {{endif}} + {{if 'cudaDeviceProp.persistingL2CacheMaxSize' in found_struct}} + persistingL2CacheMaxSize : int + Device's maximum l2 persisting lines capacity setting in bytes + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerMultiProcessor' in found_struct}} + maxThreadsPerMultiProcessor : int + Maximum resident threads per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.streamPrioritiesSupported' in found_struct}} + streamPrioritiesSupported : int + Device supports stream priorities + {{endif}} + {{if 'cudaDeviceProp.globalL1CacheSupported' in found_struct}} + globalL1CacheSupported : int + Device supports caching globals in L1 + {{endif}} + {{if 'cudaDeviceProp.localL1CacheSupported' in found_struct}} + localL1CacheSupported : int + Device supports caching locals in L1 + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerMultiprocessor' in found_struct}} + sharedMemPerMultiprocessor : size_t + Shared memory available per multiprocessor in bytes + {{endif}} + {{if 'cudaDeviceProp.regsPerMultiprocessor' in found_struct}} + regsPerMultiprocessor : int + 32-bit registers available per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.managedMemory' in found_struct}} + managedMemory : int + Device supports allocating managed memory on this system + {{endif}} + {{if 'cudaDeviceProp.isMultiGpuBoard' in found_struct}} + isMultiGpuBoard : int + Device is on a multi-GPU board + {{endif}} + {{if 'cudaDeviceProp.multiGpuBoardGroupID' in found_struct}} + multiGpuBoardGroupID : int + Unique identifier for a group of devices on the same multi-GPU + board + {{endif}} + {{if 'cudaDeviceProp.hostNativeAtomicSupported' in found_struct}} + hostNativeAtomicSupported : int + Link between the device and the host supports native atomic + operations + {{endif}} + {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} + singleToDoublePrecisionPerfRatio : int + Deprecated, Ratio of single precision performance (in floating- + point operations per second) to double precision performance + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} + pageableMemoryAccess : int + Device supports coherently accessing pageable memory without + calling cudaHostRegister on it + {{endif}} + {{if 'cudaDeviceProp.concurrentManagedAccess' in found_struct}} + concurrentManagedAccess : int + Device can coherently access managed memory concurrently with the + CPU + {{endif}} + {{if 'cudaDeviceProp.computePreemptionSupported' in found_struct}} + computePreemptionSupported : int + Device supports Compute Preemption + {{endif}} + {{if 'cudaDeviceProp.canUseHostPointerForRegisteredMem' in found_struct}} + canUseHostPointerForRegisteredMem : int + Device can access host registered memory at the same virtual + address as the CPU + {{endif}} + {{if 'cudaDeviceProp.cooperativeLaunch' in found_struct}} + cooperativeLaunch : int + Device supports launching cooperative kernels via + cudaLaunchCooperativeKernel + {{endif}} + {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} + cooperativeMultiDeviceLaunch : int + Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} + sharedMemPerBlockOptin : size_t + Per device maximum shared memory per block usable by special opt in + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccessUsesHostPageTables' in found_struct}} + pageableMemoryAccessUsesHostPageTables : int + Device accesses pageable memory via the host's page tables + {{endif}} + {{if 'cudaDeviceProp.directManagedMemAccessFromHost' in found_struct}} + directManagedMemAccessFromHost : int + Host can directly access managed memory on the device without + migration. + {{endif}} + {{if 'cudaDeviceProp.maxBlocksPerMultiProcessor' in found_struct}} + maxBlocksPerMultiProcessor : int + Maximum number of resident blocks per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.accessPolicyMaxWindowSize' in found_struct}} + accessPolicyMaxWindowSize : int + The maximum value of cudaAccessPolicyWindow::num_bytes. + {{endif}} + {{if 'cudaDeviceProp.reservedSharedMemPerBlock' in found_struct}} + reservedSharedMemPerBlock : size_t + Shared memory reserved by CUDA driver per block in bytes + {{endif}} + {{if 'cudaDeviceProp.hostRegisterSupported' in found_struct}} + hostRegisterSupported : int + Device supports host memory registration via cudaHostRegister. + {{endif}} + {{if 'cudaDeviceProp.sparseCudaArraySupported' in found_struct}} + sparseCudaArraySupported : int + 1 if the device supports sparse CUDA arrays and sparse CUDA + mipmapped arrays, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.hostRegisterReadOnlySupported' in found_struct}} + hostRegisterReadOnlySupported : int + Device supports using the cudaHostRegister flag + cudaHostRegisterReadOnly to register memory that must be mapped as + read-only to the GPU + {{endif}} + {{if 'cudaDeviceProp.timelineSemaphoreInteropSupported' in found_struct}} + timelineSemaphoreInteropSupported : int + External timeline semaphore interop is supported on the device + {{endif}} + {{if 'cudaDeviceProp.memoryPoolsSupported' in found_struct}} + memoryPoolsSupported : int + 1 if the device supports using the cudaMallocAsync and cudaMemPool + family of APIs, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMASupported' in found_struct}} + gpuDirectRDMASupported : int + 1 if the device supports GPUDirect RDMA APIs, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAFlushWritesOptions' in found_struct}} + gpuDirectRDMAFlushWritesOptions : unsigned int + Bitmask to be interpreted according to the + cudaFlushGPUDirectRDMAWritesOptions enum + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAWritesOrdering' in found_struct}} + gpuDirectRDMAWritesOrdering : int + See the cudaGPUDirectRDMAWritesOrdering enum for numerical values + {{endif}} + {{if 'cudaDeviceProp.memoryPoolSupportedHandleTypes' in found_struct}} + memoryPoolSupportedHandleTypes : unsigned int + Bitmask of handle types supported with mempool-based IPC + {{endif}} + {{if 'cudaDeviceProp.deferredMappingCudaArraySupported' in found_struct}} + deferredMappingCudaArraySupported : int + 1 if the device supports deferred mapping CUDA arrays and CUDA + mipmapped arrays + {{endif}} + {{if 'cudaDeviceProp.ipcEventSupported' in found_struct}} + ipcEventSupported : int + Device supports IPC Events. + {{endif}} + {{if 'cudaDeviceProp.clusterLaunch' in found_struct}} + clusterLaunch : int + Indicates device supports cluster launch + {{endif}} + {{if 'cudaDeviceProp.unifiedFunctionPointers' in found_struct}} + unifiedFunctionPointers : int + Indicates device supports unified pointers + {{endif}} + {{if 'cudaDeviceProp.reserved' in found_struct}} + reserved : list[int] + Reserved for future use + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaDeviceProp _pvt_val + cdef cyruntime.cudaDeviceProp* _pvt_ptr + {{if 'cudaDeviceProp.uuid' in found_struct}} + cdef cudaUUID_t _uuid + {{endif}} +{{endif}} +{{if 'cudaIpcEventHandle_st' in found_struct}} + +cdef class cudaIpcEventHandle_st: + """ + CUDA IPC event handle + + Attributes + ---------- + {{if 'cudaIpcEventHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaIpcEventHandle_st _pvt_val + cdef cyruntime.cudaIpcEventHandle_st* _pvt_ptr +{{endif}} +{{if 'cudaIpcMemHandle_st' in found_struct}} + +cdef class cudaIpcMemHandle_st: + """ + CUDA IPC memory handle + + Attributes + ---------- + {{if 'cudaIpcMemHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaIpcMemHandle_st _pvt_val + cdef cyruntime.cudaIpcMemHandle_st* _pvt_ptr +{{endif}} +{{if 'cudaMemFabricHandle_st' in found_struct}} + +cdef class cudaMemFabricHandle_st: + """ + Attributes + ---------- + {{if 'cudaMemFabricHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaMemFabricHandle_st _pvt_val + cdef cyruntime.cudaMemFabricHandle_st* _pvt_ptr +{{endif}} +{{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + +cdef class anon_struct7: + """ + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.handle.win32.handle' in found_struct}} + handle : Any + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} + name : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + {{if 'cudaExternalMemoryHandleDesc.handle.win32.handle' in found_struct}} + cdef _HelperInputVoidPtr _cyhandle + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} + cdef _HelperInputVoidPtr _cyname + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + +cdef class anon_union2: + """ + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.handle.fd' in found_struct}} + fd : int + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + win32 : anon_struct7 + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} + nvSciBufObject : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + cdef anon_struct7 _win32 + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} + cdef _HelperInputVoidPtr _cynvSciBufObject + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryHandleDesc' in found_struct}} + +cdef class cudaExternalMemoryHandleDesc: + """ + External memory handle descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.type' in found_struct}} + type : cudaExternalMemoryHandleType + Type of the handle + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + handle : anon_union2 + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.size' in found_struct}} + size : unsigned long long + Size of the memory allocation + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.flags' in found_struct}} + flags : unsigned int + Flags must either be zero or cudaExternalMemoryDedicated + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryHandleDesc* _val_ptr + cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr + {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + cdef anon_union2 _handle + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryBufferDesc' in found_struct}} + +cdef class cudaExternalMemoryBufferDesc: + """ + External memory buffer descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryBufferDesc.offset' in found_struct}} + offset : unsigned long long + Offset into the memory object where the buffer's base is + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.size' in found_struct}} + size : unsigned long long + Size of the buffer + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.flags' in found_struct}} + flags : unsigned int + Flags reserved for future use. Must be zero. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryBufferDesc _pvt_val + cdef cyruntime.cudaExternalMemoryBufferDesc* _pvt_ptr +{{endif}} +{{if 'cudaExternalMemoryMipmappedArrayDesc' in found_struct}} + +cdef class cudaExternalMemoryMipmappedArrayDesc: + """ + External memory mipmap descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryMipmappedArrayDesc.offset' in found_struct}} + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + formatDesc : cudaChannelFormatDesc + Format of base level of the mipmap chain + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} + extent : cudaExtent + Dimensions of base level of the mipmap chain + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.flags' in found_struct}} + flags : unsigned int + Flags associated with CUDA mipmapped arrays. See + cudaMallocMipmappedArray + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.numLevels' in found_struct}} + numLevels : unsigned int + Total number of levels in the mipmap chain + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc _pvt_val + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* _pvt_ptr + {{if 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + cdef cudaChannelFormatDesc _formatDesc + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} + cdef cudaExtent _extent + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + +cdef class anon_struct8: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.handle' in found_struct}} + handle : Any + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} + name : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.handle' in found_struct}} + cdef _HelperInputVoidPtr _cyhandle + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} + cdef _HelperInputVoidPtr _cyname + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + +cdef class anon_union3: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.handle.fd' in found_struct}} + fd : int + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + win32 : anon_struct8 + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} + nvSciSyncObj : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + cdef anon_struct8 _win32 + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} + cdef _HelperInputVoidPtr _cynvSciSyncObj + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc' in found_struct}} + +cdef class cudaExternalSemaphoreHandleDesc: + """ + External semaphore handle descriptor + + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.type' in found_struct}} + type : cudaExternalSemaphoreHandleType + Type of the handle + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + handle : anon_union3 + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.flags' in found_struct}} + flags : unsigned int + Flags reserved for the future. Must be zero. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _val_ptr + cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr + {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + cdef anon_union3 _handle + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + +cdef class anon_struct15: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.fence.value' in found_struct}} + value : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr +{{endif}} +{{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + +cdef class anon_union6: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.fence' in found_struct}} + fence : Any + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.reserved' in found_struct}} + reserved : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.fence' in found_struct}} + cdef _HelperInputVoidPtr _cyfence + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + +cdef class anon_struct16: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex.key' in found_struct}} + key : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr +{{endif}} +{{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + +cdef class anon_struct17: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + fence : anon_struct15 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + nvSciSync : anon_union6 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + keyedMutex : anon_struct16 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + cdef anon_struct15 _fence + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + cdef anon_union6 _nvSciSync + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + cdef anon_struct16 _keyedMutex + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreSignalParams' in found_struct}} + +cdef class cudaExternalSemaphoreSignalParams: + """ + External semaphore signal parameters, compatible with driver type + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + params : anon_struct17 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while signaling the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr + {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + cdef anon_struct17 _params + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + +cdef class anon_struct18: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.fence.value' in found_struct}} + value : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr +{{endif}} +{{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + +cdef class anon_union7: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.fence' in found_struct}} + fence : Any + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.reserved' in found_struct}} + reserved : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.fence' in found_struct}} + cdef _HelperInputVoidPtr _cyfence + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + +cdef class anon_struct19: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex.key' in found_struct}} + key : unsigned long long + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex.timeoutMs' in found_struct}} + timeoutMs : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr +{{endif}} +{{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + +cdef class anon_struct20: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + fence : anon_struct18 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + nvSciSync : anon_union7 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + keyedMutex : anon_struct19 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + cdef anon_struct18 _fence + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + cdef anon_union7 _nvSciSync + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + cdef anon_struct19 _keyedMutex + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreWaitParams' in found_struct}} + +cdef class cudaExternalSemaphoreWaitParams: + """ + External semaphore wait parameters, compatible with driver type + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + params : anon_struct20 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while waiting for the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr + {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + cdef anon_struct20 _params + {{endif}} +{{endif}} +{{if 'cudalibraryHostUniversalFunctionAndDataTable' in found_struct}} + +cdef class cudalibraryHostUniversalFunctionAndDataTable: + """ + Attributes + ---------- + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionTable' in found_struct}} + functionTable : Any + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionWindowSize' in found_struct}} + functionWindowSize : size_t + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataTable' in found_struct}} + dataTable : Any + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataWindowSize' in found_struct}} + dataWindowSize : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudalibraryHostUniversalFunctionAndDataTable _pvt_val + cdef cyruntime.cudalibraryHostUniversalFunctionAndDataTable* _pvt_ptr + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionTable' in found_struct}} + cdef _HelperInputVoidPtr _cyfunctionTable + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataTable' in found_struct}} + cdef _HelperInputVoidPtr _cydataTable + {{endif}} +{{endif}} +{{if 'cudaKernelNodeParams' in found_struct}} + +cdef class cudaKernelNodeParams: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + {{if 'cudaKernelNodeParams.func' in found_struct}} + func : Any + Kernel to launch + {{endif}} + {{if 'cudaKernelNodeParams.gridDim' in found_struct}} + gridDim : dim3 + Grid dimensions + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + blockDim : dim3 + Block dimensions + {{endif}} + {{if 'cudaKernelNodeParams.sharedMemBytes' in found_struct}} + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + {{endif}} + {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} + kernelParams : Any + Array of pointers to individual kernel arguments + {{endif}} + {{if 'cudaKernelNodeParams.extra' in found_struct}} + extra : Any + Pointer to kernel arguments in the "extra" format + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaKernelNodeParams _pvt_val + cdef cyruntime.cudaKernelNodeParams* _pvt_ptr + {{if 'cudaKernelNodeParams.func' in found_struct}} + cdef _HelperInputVoidPtr _cyfunc + {{endif}} + {{if 'cudaKernelNodeParams.gridDim' in found_struct}} + cdef dim3 _gridDim + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + cdef dim3 _blockDim + {{endif}} + {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} + cdef _HelperKernelParams _cykernelParams + {{endif}} +{{endif}} +{{if 'cudaKernelNodeParamsV2' in found_struct}} + +cdef class cudaKernelNodeParamsV2: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + {{if 'cudaKernelNodeParamsV2.func' in found_struct}} + func : Any + Kernel to launch + {{endif}} + {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + gridDim : dim3 + Grid dimensions + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + blockDim : dim3 + Block dimensions + {{endif}} + {{if 'cudaKernelNodeParamsV2.sharedMemBytes' in found_struct}} + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + {{endif}} + {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} + kernelParams : Any + Array of pointers to individual kernel arguments + {{endif}} + {{if 'cudaKernelNodeParamsV2.extra' in found_struct}} + extra : Any + Pointer to kernel arguments in the "extra" format + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaKernelNodeParamsV2 _pvt_val + cdef cyruntime.cudaKernelNodeParamsV2* _pvt_ptr + {{if 'cudaKernelNodeParamsV2.func' in found_struct}} + cdef _HelperInputVoidPtr _cyfunc + {{endif}} + {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + cdef dim3 _gridDim + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + cdef dim3 _blockDim + {{endif}} + {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} + cdef _HelperKernelParams _cykernelParams + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreSignalNodeParams' in found_struct}} + +cdef class cudaExternalSemaphoreSignalNodeParams: + """ + External semaphore signal node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* _pvt_ptr + {{if 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreSignalNodeParamsV2' in found_struct}} + +cdef class cudaExternalSemaphoreSignalNodeParamsV2: + """ + External semaphore signal node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreSignalNodeParamsV2 _pvt_val + cdef cyruntime.cudaExternalSemaphoreSignalNodeParamsV2* _pvt_ptr + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreWaitNodeParams' in found_struct}} + +cdef class cudaExternalSemaphoreWaitNodeParams: + """ + External semaphore wait node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* _pvt_ptr + {{if 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreWaitNodeParamsV2' in found_struct}} + +cdef class cudaExternalSemaphoreWaitNodeParamsV2: + """ + External semaphore wait node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaExternalSemaphoreWaitNodeParamsV2 _pvt_val + cdef cyruntime.cudaExternalSemaphoreWaitNodeParamsV2* _pvt_ptr + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} + cdef size_t _extSemArray_length + cdef cyruntime.cudaExternalSemaphore_t* _extSemArray + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} + cdef size_t _paramsArray_length + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray + {{endif}} +{{endif}} +{{if 'cudaConditionalNodeParams' in found_struct}} + +cdef class cudaConditionalNodeParams: + """ + CUDA conditional node parameters + + Attributes + ---------- + {{if 'cudaConditionalNodeParams.handle' in found_struct}} + handle : cudaGraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cudaGraphConditionalHandleCreate. + {{endif}} + {{if 'cudaConditionalNodeParams.type' in found_struct}} + type : cudaGraphConditionalNodeType + Type of conditional node. + {{endif}} + {{if 'cudaConditionalNodeParams.size' in found_struct}} + size : unsigned int + Size of graph output array. Allowed values are 1 for + cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeWhile, or any + value greater than zero for cudaGraphCondTypeSwitch. + {{endif}} + {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} + phGraph_out : cudaGraph_t + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cudaStreamBeginCaptureToGraph. cudaGraphCondTypeIf: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + cudaGraphCondTypeWhile: phGraph_out[0] is executed as long as the + condition is non-zero. cudaGraphCondTypeSwitch: phGraph_out[n] is + executed when the condition is equal to n. If the condition >= + `size`, no body graph is executed. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaConditionalNodeParams _pvt_val + cdef cyruntime.cudaConditionalNodeParams* _pvt_ptr + {{if 'cudaConditionalNodeParams.handle' in found_struct}} + cdef cudaGraphConditionalHandle _handle + {{endif}} + {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} + cdef size_t _phGraph_out_length + cdef cyruntime.cudaGraph_t* _phGraph_out + {{endif}} +{{endif}} +{{if 'cudaChildGraphNodeParams' in found_struct}} + +cdef class cudaChildGraphNodeParams: + """ + Child graph node parameters + + Attributes + ---------- + {{if 'cudaChildGraphNodeParams.graph' in found_struct}} + graph : cudaGraph_t + 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 'cudaChildGraphNodeParams.ownership' in found_struct}} + ownership : cudaGraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaChildGraphNodeParams _pvt_val + cdef cyruntime.cudaChildGraphNodeParams* _pvt_ptr + {{if 'cudaChildGraphNodeParams.graph' in found_struct}} + cdef cudaGraph_t _graph + {{endif}} +{{endif}} +{{if 'cudaEventRecordNodeParams' in found_struct}} + +cdef class cudaEventRecordNodeParams: + """ + Event record node parameters + + Attributes + ---------- + {{if 'cudaEventRecordNodeParams.event' in found_struct}} + event : cudaEvent_t + The event to record when the node executes + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEventRecordNodeParams _pvt_val + cdef cyruntime.cudaEventRecordNodeParams* _pvt_ptr + {{if 'cudaEventRecordNodeParams.event' in found_struct}} + cdef cudaEvent_t _event + {{endif}} +{{endif}} +{{if 'cudaEventWaitNodeParams' in found_struct}} + +cdef class cudaEventWaitNodeParams: + """ + Event wait node parameters + + Attributes + ---------- + {{if 'cudaEventWaitNodeParams.event' in found_struct}} + event : cudaEvent_t + The event to wait on from the node + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEventWaitNodeParams _pvt_val + cdef cyruntime.cudaEventWaitNodeParams* _pvt_ptr + {{if 'cudaEventWaitNodeParams.event' in found_struct}} + cdef cudaEvent_t _event + {{endif}} +{{endif}} +{{if 'cudaGraphNodeParams' in found_struct}} + +cdef class cudaGraphNodeParams: + """ + Graph node parameters. See cudaGraphAddNode. + + Attributes + ---------- + {{if 'cudaGraphNodeParams.type' in found_struct}} + type : cudaGraphNodeType + Type of the node + {{endif}} + {{if 'cudaGraphNodeParams.reserved0' in found_struct}} + reserved0 : list[int] + Reserved. Must be zero. + {{endif}} + {{if 'cudaGraphNodeParams.reserved1' in found_struct}} + reserved1 : list[long long] + Padding. Unused bytes must be zero. + {{endif}} + {{if 'cudaGraphNodeParams.kernel' in found_struct}} + kernel : cudaKernelNodeParamsV2 + Kernel node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.memcpy' in found_struct}} + memcpy : cudaMemcpyNodeParams + Memcpy node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.memset' in found_struct}} + memset : cudaMemsetParamsV2 + Memset node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.host' in found_struct}} + host : cudaHostNodeParamsV2 + Host node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.graph' in found_struct}} + graph : cudaChildGraphNodeParams + Child graph node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.eventWait' in found_struct}} + eventWait : cudaEventWaitNodeParams + Event wait node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} + eventRecord : cudaEventRecordNodeParams + Event record node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} + extSemSignal : cudaExternalSemaphoreSignalNodeParamsV2 + External semaphore signal node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} + extSemWait : cudaExternalSemaphoreWaitNodeParamsV2 + External semaphore wait node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.alloc' in found_struct}} + alloc : cudaMemAllocNodeParamsV2 + Memory allocation node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.free' in found_struct}} + free : cudaMemFreeNodeParams + Memory free node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.conditional' in found_struct}} + conditional : cudaConditionalNodeParams + Conditional node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.reserved2' in found_struct}} + reserved2 : long long + Reserved bytes. Must be zero. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphNodeParams* _val_ptr + cdef cyruntime.cudaGraphNodeParams* _pvt_ptr + {{if 'cudaGraphNodeParams.kernel' in found_struct}} + cdef cudaKernelNodeParamsV2 _kernel + {{endif}} + {{if 'cudaGraphNodeParams.memcpy' in found_struct}} + cdef cudaMemcpyNodeParams _memcpy + {{endif}} + {{if 'cudaGraphNodeParams.memset' in found_struct}} + cdef cudaMemsetParamsV2 _memset + {{endif}} + {{if 'cudaGraphNodeParams.host' in found_struct}} + cdef cudaHostNodeParamsV2 _host + {{endif}} + {{if 'cudaGraphNodeParams.graph' in found_struct}} + cdef cudaChildGraphNodeParams _graph + {{endif}} + {{if 'cudaGraphNodeParams.eventWait' in found_struct}} + cdef cudaEventWaitNodeParams _eventWait + {{endif}} + {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} + cdef cudaEventRecordNodeParams _eventRecord + {{endif}} + {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} + cdef cudaExternalSemaphoreSignalNodeParamsV2 _extSemSignal + {{endif}} + {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} + cdef cudaExternalSemaphoreWaitNodeParamsV2 _extSemWait + {{endif}} + {{if 'cudaGraphNodeParams.alloc' in found_struct}} + cdef cudaMemAllocNodeParamsV2 _alloc + {{endif}} + {{if 'cudaGraphNodeParams.free' in found_struct}} + cdef cudaMemFreeNodeParams _free + {{endif}} + {{if 'cudaGraphNodeParams.conditional' in found_struct}} + cdef cudaConditionalNodeParams _conditional + {{endif}} +{{endif}} +{{if 'cudaGraphEdgeData_st' in found_struct}} + +cdef class cudaGraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + {{if 'cudaGraphEdgeData_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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + cudaGraphKernelNodePortDefault, + cudaGraphKernelNodePortProgrammatic, or + cudaGraphKernelNodePortLaunchCompletion. + {{endif}} + {{if 'cudaGraphEdgeData_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`). + The meaning is specific to the node type. A value of 0 in all cases + 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 '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. + {{endif}} + {{if 'cudaGraphEdgeData_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 + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphEdgeData_st _pvt_val + cdef cyruntime.cudaGraphEdgeData_st* _pvt_ptr +{{endif}} +{{if 'cudaGraphInstantiateParams_st' in found_struct}} + +cdef class cudaGraphInstantiateParams_st: + """ + Graph instantiation parameters + + Attributes + ---------- + {{if 'cudaGraphInstantiateParams_st.flags' in found_struct}} + flags : unsigned long long + Instantiation flags + {{endif}} + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + uploadStream : cudaStream_t + Upload stream + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + errNode_out : cudaGraphNode_t + The node which caused instantiation to fail, if any + {{endif}} + {{if 'cudaGraphInstantiateParams_st.result_out' in found_struct}} + result_out : cudaGraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphInstantiateParams_st _pvt_val + cdef cyruntime.cudaGraphInstantiateParams_st* _pvt_ptr + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + cdef cudaStream_t _uploadStream + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + cdef cudaGraphNode_t _errNode_out + {{endif}} +{{endif}} +{{if 'cudaGraphExecUpdateResultInfo_st' in found_struct}} + +cdef class cudaGraphExecUpdateResultInfo_st: + """ + Result information returned by cudaGraphExecUpdate + + Attributes + ---------- + {{if 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} + result : cudaGraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + errorNode : cudaGraphNode_t + 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 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + errorFromNode : cudaGraphNode_t + The from node of error edge when the topologies do not match. + Otherwise NULL. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphExecUpdateResultInfo_st _pvt_val + cdef cyruntime.cudaGraphExecUpdateResultInfo_st* _pvt_ptr + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + cdef cudaGraphNode_t _errorNode + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + cdef cudaGraphNode_t _errorFromNode + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + +cdef class anon_struct21: + """ + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.updateData.param.pValue' in found_struct}} + pValue : Any + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} + offset : size_t + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.size' in found_struct}} + size : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + {{if 'cudaGraphKernelNodeUpdate.updateData.param.pValue' in found_struct}} + cdef _HelperInputVoidPtr _cypValue + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + +cdef class anon_union9: + """ + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + gridDim : dim3 + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + param : anon_struct21 + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} + isEnabled : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + cdef dim3 _gridDim + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + cdef anon_struct21 _param + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate' in found_struct}} + +cdef class cudaGraphKernelNodeUpdate: + """ + Struct to specify a single node update to pass as part of a larger + array to ::cudaGraphKernelNodeUpdatesApply + + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + node : cudaGraphDeviceNode_t + Node to update + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.field' in found_struct}} + field : cudaGraphKernelNodeField + Which type of update to apply. Determines how updateData is + interpreted + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + updateData : anon_union9 + Update data to apply. Which field is used depends on field's value + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphKernelNodeUpdate* _val_ptr + cdef cyruntime.cudaGraphKernelNodeUpdate* _pvt_ptr + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + cdef cudaGraphDeviceNode_t _node + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + cdef anon_union9 _updateData + {{endif}} +{{endif}} +{{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} + +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 + cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available + through cudaDevAttrMemSyncDomainCount. + + Attributes + ---------- + {{if 'cudaLaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes + The default domain ID to use for designated kernels + {{endif}} + {{if 'cudaLaunchMemSyncDomainMap_st.remote' in found_struct}} + remote : bytes + The remote domain ID to use for designated kernels + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchMemSyncDomainMap_st _pvt_val + cdef cyruntime.cudaLaunchMemSyncDomainMap_st* _pvt_ptr +{{endif}} +{{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + +cdef class anon_struct22: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.clusterDim.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim.z' in found_struct}} + z : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr +{{endif}} +{{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + +cdef class anon_struct23: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + event : cudaEvent_t + + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent.flags' in found_struct}} + flags : int + + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent.triggerAtBlockStart' in found_struct}} + triggerAtBlockStart : int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + {{if 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + cdef cudaEvent_t _event + {{endif}} +{{endif}} +{{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + +cdef class anon_struct24: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.preferredClusterDim.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim.z' in found_struct}} + z : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr +{{endif}} +{{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + +cdef class anon_struct25: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + event : cudaEvent_t + + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.flags' in found_struct}} + flags : int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + cdef cudaEvent_t _event + {{endif}} +{{endif}} +{{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + +cdef class anon_struct26: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + deviceUpdatable : int + + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode' in found_struct}} + devNode : cudaGraphDeviceNode_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode' in found_struct}} + cdef cudaGraphDeviceNode_t _devNode + {{endif}} +{{endif}} +{{if 'cudaLaunchAttributeValue' in found_struct}} + +cdef class cudaLaunchAttributeValue: + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.pad' in found_struct}} + pad : bytes + + {{endif}} + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + {{endif}} + {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + {{endif}} + {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + clusterDim : anon_struct22 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `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 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticStreamSerializationAllowed' in found_struct}} + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + programmaticEvent : anon_struct23 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + {{endif}} + {{if 'cudaLaunchAttributeValue.priority' in found_struct}} + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + preferredClusterDim : anon_struct24 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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. + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + launchCompletionEvent : anon_struct25 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + deviceUpdatableKernelNode : anon_struct26 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + {{endif}} + {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttributeValue _pvt_val + cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + cdef cudaAccessPolicyWindow _accessPolicyWindow + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + cdef anon_struct22 _clusterDim + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + cdef anon_struct23 _programmaticEvent + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + cdef cudaLaunchMemSyncDomainMap _memSyncDomainMap + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + cdef anon_struct24 _preferredClusterDim + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + cdef anon_struct25 _launchCompletionEvent + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + cdef anon_struct26 _deviceUpdatableKernelNode + {{endif}} +{{endif}} +{{if 'cudaLaunchAttribute_st' in found_struct}} + +cdef class cudaLaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + {{if 'cudaLaunchAttribute_st.id' in found_struct}} + id : cudaLaunchAttributeID + Attribute to set + {{endif}} + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + val : cudaLaunchAttributeValue + Value of the attribute + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaLaunchAttribute_st _pvt_val + cdef cyruntime.cudaLaunchAttribute_st* _pvt_ptr + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + cdef cudaLaunchAttributeValue _val + {{endif}} +{{endif}} +{{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + +cdef class anon_struct27: + """ + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.info.overBudget.bytesOverBudget' in found_struct}} + bytesOverBudget : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr +{{endif}} +{{if 'cudaAsyncNotificationInfo.info' in found_struct}} + +cdef class anon_union10: + """ + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + overBudget : anon_struct27 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr + {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + cdef anon_struct27 _overBudget + {{endif}} +{{endif}} +{{if 'cudaAsyncNotificationInfo' in found_struct}} + +cdef class cudaAsyncNotificationInfo: + """ + Information describing an async notification event + + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.type' in found_struct}} + type : cudaAsyncNotificationType + The type of notification being sent + {{endif}} + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + info : anon_union10 + Information about the notification. `typename` must be checked in + order to interpret this field. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaAsyncNotificationInfo* _val_ptr + cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + cdef anon_union10 _info + {{endif}} +{{endif}} +{{if 'cudaTextureDesc' in found_struct}} + +cdef class cudaTextureDesc: + """ + CUDA texture descriptor + + Attributes + ---------- + {{if 'cudaTextureDesc.addressMode' in found_struct}} + addressMode : list[cudaTextureAddressMode] + Texture address mode for up to 3 dimensions + {{endif}} + {{if 'cudaTextureDesc.filterMode' in found_struct}} + filterMode : cudaTextureFilterMode + Texture filter mode + {{endif}} + {{if 'cudaTextureDesc.readMode' in found_struct}} + readMode : cudaTextureReadMode + Texture read mode + {{endif}} + {{if 'cudaTextureDesc.sRGB' in found_struct}} + sRGB : int + Perform sRGB->linear conversion during texture read + {{endif}} + {{if 'cudaTextureDesc.borderColor' in found_struct}} + borderColor : list[float] + Texture Border Color + {{endif}} + {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} + normalizedCoords : int + Indicates whether texture reads are normalized or not + {{endif}} + {{if 'cudaTextureDesc.maxAnisotropy' in found_struct}} + maxAnisotropy : unsigned int + Limit to the anisotropy ratio + {{endif}} + {{if 'cudaTextureDesc.mipmapFilterMode' in found_struct}} + mipmapFilterMode : cudaTextureFilterMode + Mipmap filter mode + {{endif}} + {{if 'cudaTextureDesc.mipmapLevelBias' in found_struct}} + mipmapLevelBias : float + Offset applied to the supplied mipmap level + {{endif}} + {{if 'cudaTextureDesc.minMipmapLevelClamp' in found_struct}} + minMipmapLevelClamp : float + Lower end of the mipmap level range to clamp access to + {{endif}} + {{if 'cudaTextureDesc.maxMipmapLevelClamp' in found_struct}} + maxMipmapLevelClamp : float + Upper end of the mipmap level range to clamp access to + {{endif}} + {{if 'cudaTextureDesc.disableTrilinearOptimization' in found_struct}} + disableTrilinearOptimization : int + Disable any trilinear filtering optimizations. + {{endif}} + {{if 'cudaTextureDesc.seamlessCubemap' in found_struct}} + seamlessCubemap : int + Enable seamless cube map filtering. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaTextureDesc _pvt_val + cdef cyruntime.cudaTextureDesc* _pvt_ptr +{{endif}} +{{if True}} + +cdef class cudaEglPlaneDesc_st: + """ + CUDA EGL Plane Descriptor - structure defining each plane of a CUDA + EGLFrame + + Attributes + ---------- + {{if True}} + width : unsigned int + Width of plane + {{endif}} + {{if True}} + height : unsigned int + Height of plane + {{endif}} + {{if True}} + depth : unsigned int + Depth of plane + {{endif}} + {{if True}} + pitch : unsigned int + Pitch of plane + {{endif}} + {{if True}} + numChannels : unsigned int + Number of channels for the plane + {{endif}} + {{if True}} + channelDesc : cudaChannelFormatDesc + Channel Format Descriptor + {{endif}} + {{if True}} + reserved : list[unsigned int] + Reserved for future use + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglPlaneDesc_st _pvt_val + cdef cyruntime.cudaEglPlaneDesc_st* _pvt_ptr + {{if True}} + cdef cudaChannelFormatDesc _channelDesc + {{endif}} +{{endif}} +{{if True}} + +cdef class anon_union11: + """ + Attributes + ---------- + {{if True}} + pArray : list[cudaArray_t] + + {{endif}} + {{if True}} + pPitch : list[cudaPitchedPtr] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglFrame_st* _pvt_ptr +{{endif}} +{{if True}} + +cdef class cudaEglFrame_st: + """ + CUDA EGLFrame Descriptor - structure defining one frame of EGL. + Each frame may contain one or more planes depending on whether the + surface is Multiplanar or not. Each plane of EGLFrame is + represented by cudaEglPlaneDesc which is defined as: + typedefstructcudaEglPlaneDesc_st unsignedintwidth; + unsignedintheight; unsignedintdepth; unsignedintpitch; + unsignedintnumChannels; structcudaChannelFormatDescchannelDesc; + unsignedintreserved[4]; cudaEglPlaneDesc; + + Attributes + ---------- + {{if True}} + frame : anon_union11 + + {{endif}} + {{if True}} + planeDesc : list[cudaEglPlaneDesc] + CUDA EGL Plane Descriptor cudaEglPlaneDesc + {{endif}} + {{if True}} + planeCount : unsigned int + Number of planes + {{endif}} + {{if True}} + frameType : cudaEglFrameType + Array or Pitch + {{endif}} + {{if True}} + eglColorFormat : cudaEglColorFormat + CUDA EGL Color Format + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaEglFrame_st* _val_ptr + cdef cyruntime.cudaEglFrame_st* _pvt_ptr + {{if True}} + cdef anon_union11 _frame + {{endif}} +{{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 + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaUUID_t' in found_types}} + +cdef class cudaUUID_t(CUuuid_st): + """ + Attributes + ---------- + {{if 'CUuuid_st.bytes' in found_struct}} + bytes : bytes + < CUDA definition of UUID + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaIpcEventHandle_t' in found_types}} + +cdef class cudaIpcEventHandle_t(cudaIpcEventHandle_st): + """ + CUDA IPC event handle + + Attributes + ---------- + {{if 'cudaIpcEventHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaIpcMemHandle_t' in found_types}} + +cdef class cudaIpcMemHandle_t(cudaIpcMemHandle_st): + """ + CUDA IPC memory handle + + Attributes + ---------- + {{if 'cudaIpcMemHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaMemFabricHandle_t' in found_types}} + +cdef class cudaMemFabricHandle_t(cudaMemFabricHandle_st): + """ + Attributes + ---------- + {{if 'cudaMemFabricHandle_st.reserved' in found_struct}} + reserved : bytes + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaGraphEdgeData' in found_types}} + +cdef class cudaGraphEdgeData(cudaGraphEdgeData_st): + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + {{if 'cudaGraphEdgeData_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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + cudaGraphKernelNodePortDefault, + cudaGraphKernelNodePortProgrammatic, or + cudaGraphKernelNodePortLaunchCompletion. + {{endif}} + {{if 'cudaGraphEdgeData_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`). + The meaning is specific to the node type. A value of 0 in all cases + 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 '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. + {{endif}} + {{if 'cudaGraphEdgeData_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 + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaGraphInstantiateParams' in found_types}} + +cdef class cudaGraphInstantiateParams(cudaGraphInstantiateParams_st): + """ + Graph instantiation parameters + + Attributes + ---------- + {{if 'cudaGraphInstantiateParams_st.flags' in found_struct}} + flags : unsigned long long + Instantiation flags + {{endif}} + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + uploadStream : cudaStream_t + Upload stream + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + errNode_out : cudaGraphNode_t + The node which caused instantiation to fail, if any + {{endif}} + {{if 'cudaGraphInstantiateParams_st.result_out' in found_struct}} + result_out : cudaGraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaGraphExecUpdateResultInfo' in found_types}} + +cdef class cudaGraphExecUpdateResultInfo(cudaGraphExecUpdateResultInfo_st): + """ + Result information returned by cudaGraphExecUpdate + + Attributes + ---------- + {{if 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} + result : cudaGraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + errorNode : cudaGraphNode_t + 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 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + errorFromNode : cudaGraphNode_t + The from node of error edge when the topologies do not match. + Otherwise NULL. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaLaunchMemSyncDomainMap' in found_types}} + +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 + cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available + through cudaDevAttrMemSyncDomainCount. + + Attributes + ---------- + {{if 'cudaLaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes + The default domain ID to use for designated kernels + {{endif}} + {{if 'cudaLaunchMemSyncDomainMap_st.remote' in found_struct}} + remote : bytes + The remote domain ID to use for designated kernels + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaLaunchAttribute' in found_types}} + +cdef class cudaLaunchAttribute(cudaLaunchAttribute_st): + """ + Launch attribute + + Attributes + ---------- + {{if 'cudaLaunchAttribute_st.id' in found_struct}} + id : cudaLaunchAttributeID + Attribute to set + {{endif}} + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + val : cudaLaunchAttributeValue + Value of the attribute + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaAsyncNotificationInfo_t' in found_types}} + +cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): + """ + Information describing an async notification event + + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.type' in found_struct}} + type : cudaAsyncNotificationType + The type of notification being sent + {{endif}} + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + info : anon_union10 + Information about the notification. `typename` must be checked in + order to interpret this field. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if True}} + +cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.pad' in found_struct}} + pad : bytes + + {{endif}} + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + {{endif}} + {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + {{endif}} + {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + clusterDim : anon_struct22 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `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 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticStreamSerializationAllowed' in found_struct}} + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + programmaticEvent : anon_struct23 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + {{endif}} + {{if 'cudaLaunchAttributeValue.priority' in found_struct}} + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + preferredClusterDim : anon_struct24 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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. + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + launchCompletionEvent : anon_struct25 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + deviceUpdatableKernelNode : anon_struct26 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + {{endif}} + {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if True}} + +cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.pad' in found_struct}} + pad : bytes + + {{endif}} + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + {{endif}} + {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + {{endif}} + {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + clusterDim : anon_struct22 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `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 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticStreamSerializationAllowed' in found_struct}} + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + programmaticEvent : anon_struct23 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + {{endif}} + {{if 'cudaLaunchAttributeValue.priority' in found_struct}} + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + preferredClusterDim : anon_struct24 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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. + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + launchCompletionEvent : anon_struct25 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + deviceUpdatableKernelNode : anon_struct26 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + {{endif}} + {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if True}} + +cdef class cudaEglPlaneDesc(cudaEglPlaneDesc_st): + """ + CUDA EGL Plane Descriptor - structure defining each plane of a CUDA + EGLFrame + + Attributes + ---------- + {{if True}} + width : unsigned int + Width of plane + {{endif}} + {{if True}} + height : unsigned int + Height of plane + {{endif}} + {{if True}} + depth : unsigned int + Depth of plane + {{endif}} + {{if True}} + pitch : unsigned int + Pitch of plane + {{endif}} + {{if True}} + numChannels : unsigned int + Number of channels for the plane + {{endif}} + {{if True}} + channelDesc : cudaChannelFormatDesc + Channel Format Descriptor + {{endif}} + {{if True}} + reserved : list[unsigned int] + Reserved for future use + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if True}} + +cdef class cudaEglFrame(cudaEglFrame_st): + """ + CUDA EGLFrame Descriptor - structure defining one frame of EGL. + Each frame may contain one or more planes depending on whether the + surface is Multiplanar or not. Each plane of EGLFrame is + represented by cudaEglPlaneDesc which is defined as: + typedefstructcudaEglPlaneDesc_st unsignedintwidth; + unsignedintheight; unsignedintdepth; unsignedintpitch; + unsignedintnumChannels; structcudaChannelFormatDescchannelDesc; + unsignedintreserved[4]; cudaEglPlaneDesc; + + Attributes + ---------- + {{if True}} + frame : anon_union11 + + {{endif}} + {{if True}} + planeDesc : list[cudaEglPlaneDesc] + CUDA EGL Plane Descriptor cudaEglPlaneDesc + {{endif}} + {{if True}} + planeCount : unsigned int + Number of planes + {{endif}} + {{if True}} + frameType : cudaEglFrameType + Array or Pitch + {{endif}} + {{if True}} + eglColorFormat : cudaEglColorFormat + CUDA EGL Color Format + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass +{{endif}} +{{if 'cudaStream_t' in found_types}} + +cdef class cudaStream_t(driver.CUstream): + """ + + CUDA stream + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaEvent_t' in found_types}} + +cdef class cudaEvent_t(driver.CUevent): + """ + + CUDA event types + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaGraph_t' in found_types}} + +cdef class cudaGraph_t(driver.CUgraph): + """ + + CUDA graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaGraphNode_t' in found_types}} + +cdef class cudaGraphNode_t(driver.CUgraphNode): + """ + + CUDA graph node. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaUserObject_t' in found_types}} + +cdef class cudaUserObject_t(driver.CUuserObject): + """ + + CUDA user object for graphs + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaFunction_t' in found_types}} + +cdef class cudaFunction_t(driver.CUfunction): + """ + + CUDA function + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaMemPool_t' in found_types}} + +cdef class cudaMemPool_t(driver.CUmemoryPool): + """ + + CUDA memory pool + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaGraphExec_t' in found_types}} + +cdef class cudaGraphExec_t(driver.CUgraphExec): + """ + + CUDA executable (launchable) graph + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if True}} + +cdef class cudaEglStreamConnection(driver.CUeglStreamConnection): + """ + + CUDA EGLSream Connection + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + pass +{{endif}} + +{{if 'cudaGraphConditionalHandle' in found_types}} + +cdef class cudaGraphConditionalHandle: + """ + + CUDA handle for conditional graph nodes + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphConditionalHandle _pvt_val + cdef cyruntime.cudaGraphConditionalHandle* _pvt_ptr +{{endif}} + +{{if 'cudaSurfaceObject_t' in found_types}} + +cdef class cudaSurfaceObject_t: + """ + + An opaque value that represents a CUDA Surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaSurfaceObject_t _pvt_val + cdef cyruntime.cudaSurfaceObject_t* _pvt_ptr +{{endif}} + +{{if 'cudaTextureObject_t' in found_types}} + +cdef class cudaTextureObject_t: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaTextureObject_t _pvt_val + cdef cyruntime.cudaTextureObject_t* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.GLenum _pvt_val + cdef cyruntime.GLenum* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.GLuint _pvt_val + cdef cyruntime.GLuint* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.EGLint _pvt_val + cdef cyruntime.EGLint* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpDevice: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpDevice _pvt_val + cdef cyruntime.VdpDevice* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpGetProcAddress _pvt_val + cdef cyruntime.VdpGetProcAddress* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpVideoSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpVideoSurface _pvt_val + cdef cyruntime.VdpVideoSurface* _pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpOutputSurface: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.VdpOutputSurface _pvt_val + cdef cyruntime.VdpOutputSurface* _pvt_ptr +{{endif}} diff --git a/cuda_bindings_12/cuda/bindings/runtime.pyx.in b/cuda_bindings_12/cuda/bindings/runtime.pyx.in new file mode 100644 index 00000000000..649cc824910 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/runtime.pyx.in @@ -0,0 +1,39664 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 12.9.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d6df3522c27bd5c4ff1ecf1bf0167f902aab2b381d9db0c473658a2922f5b6cd +from typing import Any, Optional +import cython +import ctypes +from libc.stdlib cimport calloc, malloc, free +from libc cimport string +from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t, uintptr_t +from libc.stddef cimport wchar_t +from libc.limits cimport CHAR_MIN +from libcpp.vector cimport vector +from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS +from cpython.bytes cimport PyBytes_FromStringAndSize +from ._internal._fast_enum import FastEnum as _FastEnum +import cuda.bindings.driver +from libcpp.map cimport map + +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ +include "_lib/utils.pxi" + +ctypedef unsigned long long signed_char_ptr +ctypedef unsigned long long unsigned_char_ptr +ctypedef unsigned long long char_ptr +ctypedef unsigned long long short_ptr +ctypedef unsigned long long unsigned_short_ptr +ctypedef unsigned long long int_ptr +ctypedef unsigned long long long_int_ptr +ctypedef unsigned long long long_long_int_ptr +ctypedef unsigned long long unsigned_int_ptr +ctypedef unsigned long long unsigned_long_int_ptr +ctypedef unsigned long long unsigned_long_long_int_ptr +ctypedef unsigned long long uint32_t_ptr +ctypedef unsigned long long uint64_t_ptr +ctypedef unsigned long long int32_t_ptr +ctypedef unsigned long long int64_t_ptr +ctypedef unsigned long long unsigned_ptr +ctypedef unsigned long long unsigned_long_long_ptr +ctypedef unsigned long long long_long_ptr +ctypedef unsigned long long size_t_ptr +ctypedef unsigned long long long_ptr +ctypedef unsigned long long float_ptr +ctypedef unsigned long long double_ptr +ctypedef unsigned long long void_ptr + +#: Default page-locked allocation flag +cudaHostAllocDefault = cyruntime.cudaHostAllocDefault + +#: Pinned memory accessible by all CUDA contexts +cudaHostAllocPortable = cyruntime.cudaHostAllocPortable + +#: Map allocation into device space +cudaHostAllocMapped = cyruntime.cudaHostAllocMapped + +#: Write-combined memory +cudaHostAllocWriteCombined = cyruntime.cudaHostAllocWriteCombined + +#: Default host memory registration flag +cudaHostRegisterDefault = cyruntime.cudaHostRegisterDefault + +#: Pinned memory accessible by all CUDA contexts +cudaHostRegisterPortable = cyruntime.cudaHostRegisterPortable + +#: Map registered memory into device space +cudaHostRegisterMapped = cyruntime.cudaHostRegisterMapped + +#: Memory-mapped I/O space +cudaHostRegisterIoMemory = cyruntime.cudaHostRegisterIoMemory + +#: Memory-mapped read-only +cudaHostRegisterReadOnly = cyruntime.cudaHostRegisterReadOnly + +#: Default peer addressing enable flag +cudaPeerAccessDefault = cyruntime.cudaPeerAccessDefault + +#: Default stream flag +cudaStreamDefault = cyruntime.cudaStreamDefault + +#: Stream does not synchronize with stream 0 (the NULL stream) +cudaStreamNonBlocking = cyruntime.cudaStreamNonBlocking + +#: Legacy stream handle +#: +#: 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 :py:obj:`~.cudaStream_t` to use an +#: implicit stream with per-thread synchronization behavior. +#: +#: See details of the \link_sync_behavior +cudaStreamPerThread = cyruntime.cudaStreamPerThread + +#: Default event flag +cudaEventDefault = cyruntime.cudaEventDefault + +#: Event uses blocking synchronization +cudaEventBlockingSync = cyruntime.cudaEventBlockingSync + +#: Event will not record timing data +cudaEventDisableTiming = cyruntime.cudaEventDisableTiming + +#: Event is suitable for interprocess use. cudaEventDisableTiming must be +#: set +cudaEventInterprocess = cyruntime.cudaEventInterprocess + +#: Default event record flag +cudaEventRecordDefault = cyruntime.cudaEventRecordDefault + +#: Event is captured in the graph as an external event node when performing +#: stream capture +cudaEventRecordExternal = cyruntime.cudaEventRecordExternal + +#: Default event wait flag +cudaEventWaitDefault = cyruntime.cudaEventWaitDefault + +#: Event is captured in the graph as an external event node when performing +#: stream capture +cudaEventWaitExternal = cyruntime.cudaEventWaitExternal + +#: Device flag - Automatic scheduling +cudaDeviceScheduleAuto = cyruntime.cudaDeviceScheduleAuto + +#: Device flag - Spin default scheduling +cudaDeviceScheduleSpin = cyruntime.cudaDeviceScheduleSpin + +#: Device flag - Yield default scheduling +cudaDeviceScheduleYield = cyruntime.cudaDeviceScheduleYield + +#: Device flag - Use blocking synchronization +cudaDeviceScheduleBlockingSync = cyruntime.cudaDeviceScheduleBlockingSync + +#: Device flag - Use blocking synchronization +#: [Deprecated] +cudaDeviceBlockingSync = cyruntime.cudaDeviceBlockingSync + +#: Device schedule flags mask +cudaDeviceScheduleMask = cyruntime.cudaDeviceScheduleMask + +#: Device flag - Support mapped pinned allocations +cudaDeviceMapHost = cyruntime.cudaDeviceMapHost + +#: Device flag - Keep local memory allocation after launch +cudaDeviceLmemResizeToMax = cyruntime.cudaDeviceLmemResizeToMax + +#: Device flag - Ensure synchronous memory operations on this context will +#: synchronize +cudaDeviceSyncMemops = cyruntime.cudaDeviceSyncMemops + +#: Device flags mask +cudaDeviceMask = cyruntime.cudaDeviceMask + +#: Default CUDA array allocation flag +cudaArrayDefault = cyruntime.cudaArrayDefault + +#: Must be set in cudaMalloc3DArray to create a layered CUDA array +cudaArrayLayered = cyruntime.cudaArrayLayered + +#: Must be set in cudaMallocArray or cudaMalloc3DArray in order to bind +#: surfaces to the CUDA array +cudaArraySurfaceLoadStore = cyruntime.cudaArraySurfaceLoadStore + +#: Must be set in cudaMalloc3DArray to create a cubemap CUDA array +cudaArrayCubemap = cyruntime.cudaArrayCubemap + +#: Must be set in cudaMallocArray or cudaMalloc3DArray in order to perform +#: texture gather operations on the CUDA array +cudaArrayTextureGather = cyruntime.cudaArrayTextureGather + +#: Must be set in cudaExternalMemoryGetMappedMipmappedArray if the +#: mipmapped array is used as a color target in a graphics API +cudaArrayColorAttachment = cyruntime.cudaArrayColorAttachment + +#: Must be set in cudaMallocArray, cudaMalloc3DArray or +#: cudaMallocMipmappedArray in order to create a sparse CUDA array or CUDA +#: mipmapped array +cudaArraySparse = cyruntime.cudaArraySparse + +#: Must be set in cudaMallocArray, cudaMalloc3DArray or +#: cudaMallocMipmappedArray in order to create a deferred mapping CUDA +#: array or CUDA mipmapped array +cudaArrayDeferredMapping = cyruntime.cudaArrayDeferredMapping + +#: Automatically enable peer access between remote devices as needed +cudaIpcMemLazyEnablePeerAccess = cyruntime.cudaIpcMemLazyEnablePeerAccess + +#: Memory can be accessed by any stream on any device +cudaMemAttachGlobal = cyruntime.cudaMemAttachGlobal + +#: Memory cannot be accessed by any stream on any device +cudaMemAttachHost = cyruntime.cudaMemAttachHost + +#: Memory can only be accessed by a single stream on the associated device +cudaMemAttachSingle = cyruntime.cudaMemAttachSingle + +#: Default behavior +cudaOccupancyDefault = cyruntime.cudaOccupancyDefault + +#: Assume global caching is enabled and cannot be automatically turned off +cudaOccupancyDisableCachingOverride = cyruntime.cudaOccupancyDisableCachingOverride + +#: Device id that represents the CPU +cudaCpuDeviceId = cyruntime.cudaCpuDeviceId + +#: Device id that represents an invalid device +cudaInvalidDeviceId = cyruntime.cudaInvalidDeviceId + +#: Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice +#: call +cudaInitDeviceFlagsAreValid = cyruntime.cudaInitDeviceFlagsAreValid + +#: If set, each kernel launched as part of +#: :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior +#: work in the stream corresponding to that GPU to complete before the +#: kernel begins execution. +cudaCooperativeLaunchMultiDeviceNoPreSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPreSync + +#: If set, any subsequent work pushed in a stream that participated in a +#: call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only +#: wait for the kernel launched on the GPU corresponding to that stream to +#: complete before it begins execution. +cudaCooperativeLaunchMultiDeviceNoPostSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPostSync + +#: Indicates that the layered sparse CUDA array or CUDA mipmapped array has +#: a single mip tail region for all layers +cudaArraySparsePropertiesSingleMipTail = cyruntime.cudaArraySparsePropertiesSingleMipTail + +#: This flag, if set, indicates that the memory will be used as a buffer +#: for hardware accelerated decompression. +cudaMemPoolCreateUsageHwDecompress = cyruntime.cudaMemPoolCreateUsageHwDecompress + +#: CUDA IPC Handle Size +CUDA_IPC_HANDLE_SIZE = cyruntime.CUDA_IPC_HANDLE_SIZE + +#: Indicates that the external memory object is a dedicated resource +cudaExternalMemoryDedicated = cyruntime.cudaExternalMemoryDedicated + +#: 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. +cudaExternalSemaphoreSignalSkipNvSciBufMemSync = cyruntime.cudaExternalSemaphoreSignalSkipNvSciBufMemSync + +#: 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. +cudaExternalSemaphoreWaitSkipNvSciBufMemSync = cyruntime.cudaExternalSemaphoreWaitSkipNvSciBufMemSync + +#: 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`. +cudaNvSciSyncAttrSignal = cyruntime.cudaNvSciSyncAttrSignal + +#: 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`. +cudaNvSciSyncAttrWait = cyruntime.cudaNvSciSyncAttrWait + +#: This port activates when the kernel has finished executing. +cudaGraphKernelNodePortDefault = cyruntime.cudaGraphKernelNodePortDefault + +#: 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`. +cudaGraphKernelNodePortProgrammatic = cyruntime.cudaGraphKernelNodePortProgrammatic + +#: This port activates when all blocks of the kernel have begun execution. +#: See also :py:obj:`~.cudaLaunchAttributeLaunchCompletionEvent`. +cudaGraphKernelNodePortLaunchCompletion = cyruntime.cudaGraphKernelNodePortLaunchCompletion + +cudaStreamAttributeAccessPolicyWindow = cyruntime.cudaStreamAttributeAccessPolicyWindow + +cudaStreamAttributeSynchronizationPolicy = cyruntime.cudaStreamAttributeSynchronizationPolicy + +cudaStreamAttributeMemSyncDomainMap = cyruntime.cudaStreamAttributeMemSyncDomainMap + +cudaStreamAttributeMemSyncDomain = cyruntime.cudaStreamAttributeMemSyncDomain + +cudaStreamAttributePriority = cyruntime.cudaStreamAttributePriority + +cudaKernelNodeAttributeAccessPolicyWindow = cyruntime.cudaKernelNodeAttributeAccessPolicyWindow + +cudaKernelNodeAttributeCooperative = cyruntime.cudaKernelNodeAttributeCooperative + +cudaKernelNodeAttributePriority = cyruntime.cudaKernelNodeAttributePriority + +cudaKernelNodeAttributeClusterDimension = cyruntime.cudaKernelNodeAttributeClusterDimension + +cudaKernelNodeAttributeClusterSchedulingPolicyPreference = cyruntime.cudaKernelNodeAttributeClusterSchedulingPolicyPreference + +cudaKernelNodeAttributeMemSyncDomainMap = cyruntime.cudaKernelNodeAttributeMemSyncDomainMap + +cudaKernelNodeAttributeMemSyncDomain = cyruntime.cudaKernelNodeAttributeMemSyncDomain + +cudaKernelNodeAttributePreferredSharedMemoryCarveout = cyruntime.cudaKernelNodeAttributePreferredSharedMemoryCarveout + +cudaKernelNodeAttributeDeviceUpdatableKernelNode = cyruntime.cudaKernelNodeAttributeDeviceUpdatableKernelNode + +cudaSurfaceType1D = cyruntime.cudaSurfaceType1D + +cudaSurfaceType2D = cyruntime.cudaSurfaceType2D + +cudaSurfaceType3D = cyruntime.cudaSurfaceType3D + +cudaSurfaceTypeCubemap = cyruntime.cudaSurfaceTypeCubemap + +cudaSurfaceType1DLayered = cyruntime.cudaSurfaceType1DLayered + +cudaSurfaceType2DLayered = cyruntime.cudaSurfaceType2DLayered + +cudaSurfaceTypeCubemapLayered = cyruntime.cudaSurfaceTypeCubemapLayered + +cudaTextureType1D = cyruntime.cudaTextureType1D + +cudaTextureType2D = cyruntime.cudaTextureType2D + +cudaTextureType3D = cyruntime.cudaTextureType3D + +cudaTextureTypeCubemap = cyruntime.cudaTextureTypeCubemap + +cudaTextureType1DLayered = cyruntime.cudaTextureType1DLayered + +cudaTextureType2DLayered = cyruntime.cudaTextureType2DLayered + +cudaTextureTypeCubemapLayered = cyruntime.cudaTextureTypeCubemapLayered + +#: CUDA Runtime API Version +CUDART_VERSION = cyruntime.CUDART_VERSION + +__CUDART_API_VERSION = cyruntime.__CUDART_API_VERSION + +#: Maximum number of planes per frame +CUDA_EGL_MAX_PLANES = cyruntime.CUDA_EGL_MAX_PLANES + +{{if 'cudaError' in found_types}} + +class cudaError_t(_FastEnum): + """ + impl_private CUDA error types + """ + {{if 'cudaSuccess' in found_values}} + + cudaSuccess = ( + cyruntime.cudaError.cudaSuccess, + '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:`~.cudaEventQuery()` and :py:obj:`~.cudaStreamQuery()`).\n' + ){{endif}} + {{if 'cudaErrorInvalidValue' in found_values}} + + cudaErrorInvalidValue = ( + cyruntime.cudaError.cudaErrorInvalidValue, + '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 'cudaErrorMemoryAllocation' in found_values}} + + cudaErrorMemoryAllocation = ( + cyruntime.cudaError.cudaErrorMemoryAllocation, + 'The API call failed because it was unable to allocate enough memory or\n' + 'other resources to perform the requested operation.\n' + ){{endif}} + {{if 'cudaErrorInitializationError' in found_values}} + + cudaErrorInitializationError = ( + cyruntime.cudaError.cudaErrorInitializationError, + 'The API call failed because the CUDA driver and runtime could not be\n' + 'initialized.\n' + ){{endif}} + {{if 'cudaErrorCudartUnloading' in found_values}} + + cudaErrorCudartUnloading = ( + cyruntime.cudaError.cudaErrorCudartUnloading, + 'This indicates that a CUDA Runtime API call cannot be executed because it\n' + 'is being called during process shut down, at a point in time after CUDA\n' + 'driver has been unloaded.\n' + ){{endif}} + {{if 'cudaErrorProfilerDisabled' in found_values}} + + cudaErrorProfilerDisabled = ( + cyruntime.cudaError.cudaErrorProfilerDisabled, + '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 'cudaErrorProfilerNotInitialized' in found_values}} + + cudaErrorProfilerNotInitialized = ( + cyruntime.cudaError.cudaErrorProfilerNotInitialized, + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorProfilerAlreadyStarted' in found_values}} + + cudaErrorProfilerAlreadyStarted = ( + cyruntime.cudaError.cudaErrorProfilerAlreadyStarted, + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorProfilerAlreadyStopped' in found_values}} + + cudaErrorProfilerAlreadyStopped = ( + cyruntime.cudaError.cudaErrorProfilerAlreadyStopped, + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorInvalidConfiguration' in found_values}} + + cudaErrorInvalidConfiguration = ( + cyruntime.cudaError.cudaErrorInvalidConfiguration, + 'This indicates that a kernel launch is requesting resources that can never\n' + 'be satisfied by the current device. Requesting more shared memory per block\n' + 'than the device supports will trigger this error, as will requesting too\n' + 'many threads or blocks. See :py:obj:`~.cudaDeviceProp` for more device\n' + 'limitations.\n' + ){{endif}} + {{if 'cudaErrorInvalidPitchValue' in found_values}} + + cudaErrorInvalidPitchValue = ( + cyruntime.cudaError.cudaErrorInvalidPitchValue, + 'This indicates that one or more of the pitch-related parameters passed to\n' + 'the API call is not within the acceptable range for pitch.\n' + ){{endif}} + {{if 'cudaErrorInvalidSymbol' in found_values}} + + cudaErrorInvalidSymbol = ( + cyruntime.cudaError.cudaErrorInvalidSymbol, + 'This indicates that the symbol name/identifier passed to the API call is\n' + 'not a valid name or identifier.\n' + ){{endif}} + {{if 'cudaErrorInvalidHostPointer' in found_values}} + + cudaErrorInvalidHostPointer = ( + cyruntime.cudaError.cudaErrorInvalidHostPointer, + 'This indicates that at least one host pointer passed to the API call is not\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.\n' + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorInvalidTexture' in found_values}} + + cudaErrorInvalidTexture = ( + cyruntime.cudaError.cudaErrorInvalidTexture, + 'This indicates that the texture passed to the API call is not a valid\n' + 'texture.\n' + ){{endif}} + {{if 'cudaErrorInvalidTextureBinding' in found_values}} + + cudaErrorInvalidTextureBinding = ( + cyruntime.cudaError.cudaErrorInvalidTextureBinding, + 'This indicates that the texture binding is not valid. This occurs if you\n' + 'call :py:obj:`~.cudaGetTextureAlignmentOffset()` with an unbound texture.\n' + ){{endif}} + {{if 'cudaErrorInvalidChannelDescriptor' in found_values}} + + cudaErrorInvalidChannelDescriptor = ( + cyruntime.cudaError.cudaErrorInvalidChannelDescriptor, + 'This indicates that the channel descriptor passed to the API call is not\n' + 'valid. This occurs if the format is not one of the formats specified by\n' + ':py:obj:`~.cudaChannelFormatKind`, or if one of the dimensions is invalid.\n' + ){{endif}} + {{if 'cudaErrorInvalidMemcpyDirection' in found_values}} + + cudaErrorInvalidMemcpyDirection = ( + cyruntime.cudaError.cudaErrorInvalidMemcpyDirection, + 'This indicates that the direction of the memcpy passed to the API call is\n' + 'not one of the types specified by :py:obj:`~.cudaMemcpyKind`.\n' + ){{endif}} + {{if 'cudaErrorAddressOfConstant' in found_values}} + + 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.\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.\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.\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.\n' + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorInvalidFilterSetting' in found_values}} + + cudaErrorInvalidFilterSetting = ( + cyruntime.cudaError.cudaErrorInvalidFilterSetting, + 'This indicates that a non-float texture was being accessed with linear\n' + 'filtering. This is not supported by CUDA.\n' + ){{endif}} + {{if 'cudaErrorInvalidNormSetting' in found_values}} + + cudaErrorInvalidNormSetting = ( + cyruntime.cudaError.cudaErrorInvalidNormSetting, + 'This indicates that an attempt was made to read an unsupported data type as\n' + 'a normalized float. This is not supported by CUDA.\n' + ){{endif}} + {{if 'cudaErrorMixedDeviceExecution' in found_values}} + + cudaErrorMixedDeviceExecution = ( + cyruntime.cudaError.cudaErrorMixedDeviceExecution, + '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.\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.\n' + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorStubLibrary' in found_values}} + + cudaErrorStubLibrary = ( + cyruntime.cudaError.cudaErrorStubLibrary, + '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 'cudaErrorInsufficientDriver' in found_values}} + + cudaErrorInsufficientDriver = ( + cyruntime.cudaError.cudaErrorInsufficientDriver, + 'This indicates that the installed NVIDIA CUDA driver is older than the CUDA\n' + 'runtime library. This is not a supported configuration. Users should\n' + 'install an updated NVIDIA display driver to allow the application to run.\n' + ){{endif}} + {{if 'cudaErrorCallRequiresNewerDriver' in found_values}} + + cudaErrorCallRequiresNewerDriver = ( + cyruntime.cudaError.cudaErrorCallRequiresNewerDriver, + '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 'cudaErrorInvalidSurface' in found_values}} + + cudaErrorInvalidSurface = ( + cyruntime.cudaError.cudaErrorInvalidSurface, + 'This indicates that the surface passed to the API call is not a valid\n' + 'surface.\n' + ){{endif}} + {{if 'cudaErrorDuplicateVariableName' in found_values}} + + cudaErrorDuplicateVariableName = ( + cyruntime.cudaError.cudaErrorDuplicateVariableName, + 'This indicates that multiple global or constant variables (across separate\n' + 'CUDA source files in the application) share the same string name.\n' + ){{endif}} + {{if 'cudaErrorDuplicateTextureName' in found_values}} + + cudaErrorDuplicateTextureName = ( + cyruntime.cudaError.cudaErrorDuplicateTextureName, + 'This indicates that multiple textures (across separate CUDA source files in\n' + 'the application) share the same string name.\n' + ){{endif}} + {{if 'cudaErrorDuplicateSurfaceName' in found_values}} + + cudaErrorDuplicateSurfaceName = ( + cyruntime.cudaError.cudaErrorDuplicateSurfaceName, + 'This indicates that multiple surfaces (across separate CUDA source files in\n' + 'the application) share the same string name.\n' + ){{endif}} + {{if 'cudaErrorDevicesUnavailable' in found_values}} + + cudaErrorDevicesUnavailable = ( + cyruntime.cudaError.cudaErrorDevicesUnavailable, + 'This indicates that all CUDA devices are busy or unavailable at the current\n' + 'time. Devices are often busy/unavailable due to use of\n' + ':py:obj:`~.cudaComputeModeProhibited`,\n' + ':py:obj:`~.cudaComputeModeExclusiveProcess`, or when long running CUDA\n' + 'kernels have filled up the GPU and are blocking new work from starting.\n' + 'They can also be unavailable due to memory constraints on a device that\n' + 'already has active CUDA work being performed.\n' + ){{endif}} + {{if 'cudaErrorIncompatibleDriverContext' in found_values}} + + cudaErrorIncompatibleDriverContext = ( + cyruntime.cudaError.cudaErrorIncompatibleDriverContext, + 'This indicates that the current context is not compatible with this the\n' + 'CUDA Runtime. This can only occur if you are using CUDA Runtime/Driver\n' + 'interoperability and have created an existing Driver context using the\n' + 'driver API. The Driver context may be incompatible either because the\n' + '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' + ){{endif}} + {{if 'cudaErrorMissingConfiguration' in found_values}} + + cudaErrorMissingConfiguration = ( + cyruntime.cudaError.cudaErrorMissingConfiguration, + 'The device function being invoked (usually via\n' + ':py:obj:`~.cudaLaunchKernel()`) was not previously configured via the\n' + ':py:obj:`~.cudaConfigureCall()` function.\n' + ){{endif}} + {{if 'cudaErrorPriorLaunchFailure' in found_values}} + + cudaErrorPriorLaunchFailure = ( + cyruntime.cudaError.cudaErrorPriorLaunchFailure, + 'This indicated that a previous kernel launch failed. This was previously\n' + 'used for device emulation of kernel launches.\n' + '[Deprecated]\n' + ){{endif}} + {{if 'cudaErrorLaunchMaxDepthExceeded' in found_values}} + + cudaErrorLaunchMaxDepthExceeded = ( + cyruntime.cudaError.cudaErrorLaunchMaxDepthExceeded, + 'This error indicates that a device runtime grid launch did not occur\n' + 'because the depth of the child grid would exceed the maximum supported\n' + 'number of nested grid launches.\n' + ){{endif}} + {{if 'cudaErrorLaunchFileScopedTex' in found_values}} + + cudaErrorLaunchFileScopedTex = ( + cyruntime.cudaError.cudaErrorLaunchFileScopedTex, + 'This error indicates that a grid launch did not occur because the kernel\n' + 'uses file-scoped textures which are unsupported by the device runtime.\n' + 'Kernels launched via the device runtime only support textures created with\n' + "the Texture Object API's.\n" + ){{endif}} + {{if 'cudaErrorLaunchFileScopedSurf' in found_values}} + + cudaErrorLaunchFileScopedSurf = ( + cyruntime.cudaError.cudaErrorLaunchFileScopedSurf, + 'This error indicates that a grid launch did not occur because the kernel\n' + 'uses file-scoped surfaces which are unsupported by the device runtime.\n' + 'Kernels launched via the device runtime only support surfaces created with\n' + "the Surface Object API's.\n" + ){{endif}} + {{if 'cudaErrorSyncDepthExceeded' in found_values}} + + cudaErrorSyncDepthExceeded = ( + cyruntime.cudaError.cudaErrorSyncDepthExceeded, + 'This error indicates that a call to :py:obj:`~.cudaDeviceSynchronize` made\n' + 'from the device runtime failed because the call was made at grid depth\n' + 'greater than than either the default (2 levels of grids) or user specified\n' + 'device limit :py:obj:`~.cudaLimitDevRuntimeSyncDepth`. To be able to\n' + 'synchronize on launched grids at a greater depth successfully, the maximum\n' + 'nested depth at which :py:obj:`~.cudaDeviceSynchronize` will be called must\n' + 'be specified with the :py:obj:`~.cudaLimitDevRuntimeSyncDepth` limit to the\n' + ':py:obj:`~.cudaDeviceSetLimit` api before the host-side launch of a kernel\n' + 'using the device runtime. Keep in mind that additional levels of sync depth\n' + 'require the runtime to reserve large amounts of device memory that cannot\n' + 'be used for user allocations. Note that :py:obj:`~.cudaDeviceSynchronize`\n' + 'made from device runtime is only supported on devices of compute capability\n' + '< 9.0.\n' + ){{endif}} + {{if 'cudaErrorLaunchPendingCountExceeded' in found_values}} + + cudaErrorLaunchPendingCountExceeded = ( + cyruntime.cudaError.cudaErrorLaunchPendingCountExceeded, + 'This error indicates that a device runtime grid launch failed because the\n' + 'launch would exceed the limit\n' + ':py:obj:`~.cudaLimitDevRuntimePendingLaunchCount`. For this launch to\n' + 'proceed successfully, :py:obj:`~.cudaDeviceSetLimit` must be called to set\n' + 'the :py:obj:`~.cudaLimitDevRuntimePendingLaunchCount` to be higher than the\n' + 'upper bound of outstanding launches that can be issued to the device\n' + 'runtime. Keep in mind that raising the limit of pending device runtime\n' + 'launches will require the runtime to reserve device memory that cannot be\n' + 'used for user allocations.\n' + ){{endif}} + {{if 'cudaErrorInvalidDeviceFunction' in found_values}} + + cudaErrorInvalidDeviceFunction = ( + cyruntime.cudaError.cudaErrorInvalidDeviceFunction, + 'The requested device function does not exist or is not compiled for the\n' + 'proper device architecture.\n' + ){{endif}} + {{if 'cudaErrorNoDevice' in found_values}} + + cudaErrorNoDevice = ( + cyruntime.cudaError.cudaErrorNoDevice, + 'This indicates that no CUDA-capable devices were detected by the installed\n' + 'CUDA driver.\n' + ){{endif}} + {{if 'cudaErrorInvalidDevice' in found_values}} + + cudaErrorInvalidDevice = ( + cyruntime.cudaError.cudaErrorInvalidDevice, + '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 'cudaErrorDeviceNotLicensed' in found_values}} + + cudaErrorDeviceNotLicensed = ( + cyruntime.cudaError.cudaErrorDeviceNotLicensed, + "This indicates that the device doesn't have a valid Grid License.\n" + ){{endif}} + {{if 'cudaErrorSoftwareValidityNotEstablished' in found_values}} + + cudaErrorSoftwareValidityNotEstablished = ( + cyruntime.cudaError.cudaErrorSoftwareValidityNotEstablished, + 'By default, the CUDA runtime may perform a minimal set of self-tests, as\n' + 'well as CUDA driver tests, to establish the validity of both. Introduced in\n' + 'CUDA 11.2, this error return indicates that at least one of these tests has\n' + 'failed and the validity of either the runtime or the driver could not be\n' + 'established.\n' + ){{endif}} + {{if 'cudaErrorStartupFailure' in found_values}} + + cudaErrorStartupFailure = ( + cyruntime.cudaError.cudaErrorStartupFailure, + 'This indicates an internal startup failure in the CUDA runtime.\n' + ){{endif}} + {{if 'cudaErrorInvalidKernelImage' in found_values}} + + cudaErrorInvalidKernelImage = ( + cyruntime.cudaError.cudaErrorInvalidKernelImage, + 'This indicates that the device kernel image is invalid.\n' + ){{endif}} + {{if 'cudaErrorDeviceUninitialized' in found_values}} + + cudaErrorDeviceUninitialized = ( + cyruntime.cudaError.cudaErrorDeviceUninitialized, + 'This most frequently indicates that there is no context bound to the\n' + 'current thread. This can also be returned if the context passed to an API\n' + 'call is not a valid handle (such as a context that has had\n' + ':py:obj:`~.cuCtxDestroy()` invoked on it). This can also be returned if a\n' + 'user mixes different API versions (i.e. 3010 context with 3020 API calls).\n' + 'See :py:obj:`~.cuCtxGetApiVersion()` for more details.\n' + ){{endif}} + {{if 'cudaErrorMapBufferObjectFailed' in found_values}} + + cudaErrorMapBufferObjectFailed = ( + cyruntime.cudaError.cudaErrorMapBufferObjectFailed, + 'This indicates that the buffer object could not be mapped.\n' + ){{endif}} + {{if 'cudaErrorUnmapBufferObjectFailed' in found_values}} + + cudaErrorUnmapBufferObjectFailed = ( + cyruntime.cudaError.cudaErrorUnmapBufferObjectFailed, + 'This indicates that the buffer object could not be unmapped.\n' + ){{endif}} + {{if 'cudaErrorArrayIsMapped' in found_values}} + + cudaErrorArrayIsMapped = ( + cyruntime.cudaError.cudaErrorArrayIsMapped, + 'This indicates that the specified array is currently mapped and thus cannot\n' + 'be destroyed.\n' + ){{endif}} + {{if 'cudaErrorAlreadyMapped' in found_values}} + + cudaErrorAlreadyMapped = ( + cyruntime.cudaError.cudaErrorAlreadyMapped, + 'This indicates that the resource is already mapped.\n' + ){{endif}} + {{if 'cudaErrorNoKernelImageForDevice' in found_values}} + + cudaErrorNoKernelImageForDevice = ( + cyruntime.cudaError.cudaErrorNoKernelImageForDevice, + 'This indicates that there is no kernel image available that is suitable for\n' + '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 'cudaErrorAlreadyAcquired' in found_values}} + + cudaErrorAlreadyAcquired = ( + cyruntime.cudaError.cudaErrorAlreadyAcquired, + 'This indicates that a resource has already been acquired.\n' + ){{endif}} + {{if 'cudaErrorNotMapped' in found_values}} + + cudaErrorNotMapped = ( + cyruntime.cudaError.cudaErrorNotMapped, + 'This indicates that a resource is not mapped.\n' + ){{endif}} + {{if 'cudaErrorNotMappedAsArray' in found_values}} + + cudaErrorNotMappedAsArray = ( + cyruntime.cudaError.cudaErrorNotMappedAsArray, + 'This indicates that a mapped resource is not available for access as an\n' + 'array.\n' + ){{endif}} + {{if 'cudaErrorNotMappedAsPointer' in found_values}} + + cudaErrorNotMappedAsPointer = ( + cyruntime.cudaError.cudaErrorNotMappedAsPointer, + 'This indicates that a mapped resource is not available for access as a\n' + 'pointer.\n' + ){{endif}} + {{if 'cudaErrorECCUncorrectable' in found_values}} + + cudaErrorECCUncorrectable = ( + cyruntime.cudaError.cudaErrorECCUncorrectable, + 'This indicates that an uncorrectable ECC error was detected during\n' + 'execution.\n' + ){{endif}} + {{if 'cudaErrorUnsupportedLimit' in found_values}} + + cudaErrorUnsupportedLimit = ( + cyruntime.cudaError.cudaErrorUnsupportedLimit, + 'This indicates that the :py:obj:`~.cudaLimit` passed to the API call is not\n' + 'supported by the active device.\n' + ){{endif}} + {{if 'cudaErrorDeviceAlreadyInUse' in found_values}} + + cudaErrorDeviceAlreadyInUse = ( + cyruntime.cudaError.cudaErrorDeviceAlreadyInUse, + 'This indicates that a call tried to access an exclusive-thread device that\n' + 'is already in use by a different thread.\n' + ){{endif}} + {{if 'cudaErrorPeerAccessUnsupported' in found_values}} + + cudaErrorPeerAccessUnsupported = ( + cyruntime.cudaError.cudaErrorPeerAccessUnsupported, + 'This error indicates that P2P access is not supported across the given\n' + 'devices.\n' + ){{endif}} + {{if 'cudaErrorInvalidPtx' in found_values}} + + cudaErrorInvalidPtx = ( + cyruntime.cudaError.cudaErrorInvalidPtx, + 'A PTX compilation failed. The runtime may fall back to compiling PTX if an\n' + 'application does not contain a suitable binary for the current device.\n' + ){{endif}} + {{if 'cudaErrorInvalidGraphicsContext' in found_values}} + + cudaErrorInvalidGraphicsContext = ( + cyruntime.cudaError.cudaErrorInvalidGraphicsContext, + 'This indicates an error with the OpenGL or DirectX context.\n' + ){{endif}} + {{if 'cudaErrorNvlinkUncorrectable' in found_values}} + + cudaErrorNvlinkUncorrectable = ( + cyruntime.cudaError.cudaErrorNvlinkUncorrectable, + 'This indicates that an uncorrectable NVLink error was detected during the\n' + 'execution.\n' + ){{endif}} + {{if 'cudaErrorJitCompilerNotFound' in found_values}} + + cudaErrorJitCompilerNotFound = ( + cyruntime.cudaError.cudaErrorJitCompilerNotFound, + 'This indicates that the PTX JIT compiler library was not found. The JIT\n' + 'Compiler library is used for PTX compilation. The runtime may fall back to\n' + 'compiling PTX if an application does not contain a suitable binary for the\n' + 'current device.\n' + ){{endif}} + {{if 'cudaErrorUnsupportedPtxVersion' in found_values}} + + cudaErrorUnsupportedPtxVersion = ( + cyruntime.cudaError.cudaErrorUnsupportedPtxVersion, + 'This indicates that the provided PTX was compiled with an unsupported\n' + 'toolchain. The most common reason for this, is the PTX was generated by a\n' + 'compiler newer than what is supported by the CUDA driver and PTX JIT\n' + 'compiler.\n' + ){{endif}} + {{if 'cudaErrorJitCompilationDisabled' in found_values}} + + cudaErrorJitCompilationDisabled = ( + cyruntime.cudaError.cudaErrorJitCompilationDisabled, + 'This indicates that the JIT compilation was disabled. The JIT compilation\n' + 'compiles PTX. The runtime may fall back to compiling PTX if an application\n' + 'does not contain a suitable binary for the current device.\n' + ){{endif}} + {{if 'cudaErrorUnsupportedExecAffinity' in found_values}} + + cudaErrorUnsupportedExecAffinity = ( + cyruntime.cudaError.cudaErrorUnsupportedExecAffinity, + 'This indicates that the provided execution affinity is not supported by the\n' + 'device.\n' + ){{endif}} + {{if 'cudaErrorUnsupportedDevSideSync' in found_values}} + + cudaErrorUnsupportedDevSideSync = ( + cyruntime.cudaError.cudaErrorUnsupportedDevSideSync, + 'This indicates that the code to be compiled by the PTX JIT contains\n' + 'unsupported call to cudaDeviceSynchronize.\n' + ){{endif}} + {{if 'cudaErrorContained' in found_values}} + + cudaErrorContained = ( + cyruntime.cudaError.cudaErrorContained, + 'This indicates that an exception occurred on the device that is now\n' + "contained by the GPU's error containment capability. Common causes are - a.\n" + 'Certain types of invalid accesses of peer GPU memory over nvlink b. Certain\n' + '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 'cudaErrorInvalidSource' in found_values}} + + cudaErrorInvalidSource = ( + cyruntime.cudaError.cudaErrorInvalidSource, + 'This indicates that the device kernel source is invalid.\n' + ){{endif}} + {{if 'cudaErrorFileNotFound' in found_values}} + + cudaErrorFileNotFound = ( + cyruntime.cudaError.cudaErrorFileNotFound, + 'This indicates that the file specified was not found.\n' + ){{endif}} + {{if 'cudaErrorSharedObjectSymbolNotFound' in found_values}} + + cudaErrorSharedObjectSymbolNotFound = ( + cyruntime.cudaError.cudaErrorSharedObjectSymbolNotFound, + 'This indicates that a link to a shared object failed to resolve.\n' + ){{endif}} + {{if 'cudaErrorSharedObjectInitFailed' in found_values}} + + cudaErrorSharedObjectInitFailed = ( + cyruntime.cudaError.cudaErrorSharedObjectInitFailed, + 'This indicates that initialization of a shared object failed.\n' + ){{endif}} + {{if 'cudaErrorOperatingSystem' in found_values}} + + cudaErrorOperatingSystem = ( + cyruntime.cudaError.cudaErrorOperatingSystem, + 'This error indicates that an OS call failed.\n' + ){{endif}} + {{if 'cudaErrorInvalidResourceHandle' in found_values}} + + cudaErrorInvalidResourceHandle = ( + cyruntime.cudaError.cudaErrorInvalidResourceHandle, + 'This indicates that a resource handle passed to the API call was not valid.\n' + 'Resource handles are opaque types like :py:obj:`~.cudaStream_t` and\n' + ':py:obj:`~.cudaEvent_t`.\n' + ){{endif}} + {{if 'cudaErrorIllegalState' in found_values}} + + cudaErrorIllegalState = ( + cyruntime.cudaError.cudaErrorIllegalState, + '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 'cudaErrorLossyQuery' in found_values}} + + cudaErrorLossyQuery = ( + cyruntime.cudaError.cudaErrorLossyQuery, + 'This indicates an attempt was made to introspect an object in a way that\n' + '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 'cudaErrorSymbolNotFound' in found_values}} + + cudaErrorSymbolNotFound = ( + cyruntime.cudaError.cudaErrorSymbolNotFound, + '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 'cudaErrorNotReady' in found_values}} + + cudaErrorNotReady = ( + cyruntime.cudaError.cudaErrorNotReady, + 'This indicates that asynchronous operations issued previously have not\n' + 'completed yet. This result is not actually an error, but must be indicated\n' + 'differently than :py:obj:`~.cudaSuccess` (which indicates completion).\n' + 'Calls that may return this value include :py:obj:`~.cudaEventQuery()` and\n' + ':py:obj:`~.cudaStreamQuery()`.\n' + ){{endif}} + {{if 'cudaErrorIllegalAddress' in found_values}} + + cudaErrorIllegalAddress = ( + cyruntime.cudaError.cudaErrorIllegalAddress, + 'The device encountered a load or store instruction on an invalid memory\n' + 'address. 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 'cudaErrorLaunchOutOfResources' in found_values}} + + cudaErrorLaunchOutOfResources = ( + cyruntime.cudaError.cudaErrorLaunchOutOfResources, + 'This indicates that a launch did not occur because it did not have\n' + 'appropriate resources. Although this error is similar to\n' + ':py:obj:`~.cudaErrorInvalidConfiguration`, this error usually indicates\n' + 'that the user has attempted to pass too many arguments to the device\n' + "kernel, or the kernel launch specifies too many threads for the kernel's\n" + 'register count.\n' + ){{endif}} + {{if 'cudaErrorLaunchTimeout' in found_values}} + + cudaErrorLaunchTimeout = ( + cyruntime.cudaError.cudaErrorLaunchTimeout, + 'This indicates that the device kernel took too long to execute. This can\n' + 'only occur if timeouts are enabled - see the device property\n' + ':py:obj:`~.kernelExecTimeoutEnabled` for more information. This leaves the\n' + '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 'cudaErrorLaunchIncompatibleTexturing' in found_values}} + + cudaErrorLaunchIncompatibleTexturing = ( + cyruntime.cudaError.cudaErrorLaunchIncompatibleTexturing, + 'This error indicates a kernel launch that uses an incompatible texturing\n' + 'mode.\n' + ){{endif}} + {{if 'cudaErrorPeerAccessAlreadyEnabled' in found_values}} + + cudaErrorPeerAccessAlreadyEnabled = ( + cyruntime.cudaError.cudaErrorPeerAccessAlreadyEnabled, + 'This error indicates that a call to\n' + ':py:obj:`~.cudaDeviceEnablePeerAccess()` is trying to re-enable peer\n' + 'addressing on from a context which has already had peer addressing enabled.\n' + ){{endif}} + {{if 'cudaErrorPeerAccessNotEnabled' in found_values}} + + cudaErrorPeerAccessNotEnabled = ( + cyruntime.cudaError.cudaErrorPeerAccessNotEnabled, + 'This error indicates that :py:obj:`~.cudaDeviceDisablePeerAccess()` is\n' + 'trying to disable peer addressing which has not been enabled yet via\n' + ':py:obj:`~.cudaDeviceEnablePeerAccess()`.\n' + ){{endif}} + {{if 'cudaErrorSetOnActiveProcess' in found_values}} + + cudaErrorSetOnActiveProcess = ( + cyruntime.cudaError.cudaErrorSetOnActiveProcess, + 'This indicates that the user has called :py:obj:`~.cudaSetValidDevices()`,\n' + ':py:obj:`~.cudaSetDeviceFlags()`, :py:obj:`~.cudaD3D9SetDirect3DDevice()`,\n' + ':py:obj:`~.cudaD3D10SetDirect3DDevice`,\n' + ':py:obj:`~.cudaD3D11SetDirect3DDevice()`, or\n' + ':py:obj:`~.cudaVDPAUSetVDPAUDevice()` after initializing the CUDA runtime\n' + 'by calling non-device management operations (allocating memory and\n' + 'launching kernels are examples of non-device management operations). This\n' + 'error can also be returned if using runtime/driver interoperability and\n' + 'there is an existing :py:obj:`~.CUcontext` active on the host thread.\n' + ){{endif}} + {{if 'cudaErrorContextIsDestroyed' in found_values}} + + cudaErrorContextIsDestroyed = ( + cyruntime.cudaError.cudaErrorContextIsDestroyed, + '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 'cudaErrorAssert' in found_values}} + + cudaErrorAssert = ( + cyruntime.cudaError.cudaErrorAssert, + 'An assert triggered in device code during kernel execution. The device\n' + 'cannot be used again. All existing allocations are invalid. To continue\n' + 'using CUDA, the process must be terminated and relaunched.\n' + ){{endif}} + {{if 'cudaErrorTooManyPeers' in found_values}} + + cudaErrorTooManyPeers = ( + cyruntime.cudaError.cudaErrorTooManyPeers, + '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:`~.cudaEnablePeerAccess()`.\n' + ){{endif}} + {{if 'cudaErrorHostMemoryAlreadyRegistered' in found_values}} + + cudaErrorHostMemoryAlreadyRegistered = ( + cyruntime.cudaError.cudaErrorHostMemoryAlreadyRegistered, + 'This error indicates that the memory range passed to\n' + ':py:obj:`~.cudaHostRegister()` has already been registered.\n' + ){{endif}} + {{if 'cudaErrorHostMemoryNotRegistered' in found_values}} + + cudaErrorHostMemoryNotRegistered = ( + cyruntime.cudaError.cudaErrorHostMemoryNotRegistered, + 'This error indicates that the pointer passed to\n' + ':py:obj:`~.cudaHostUnregister()` does not correspond to any currently\n' + 'registered memory region.\n' + ){{endif}} + {{if 'cudaErrorHardwareStackError' in found_values}} + + cudaErrorHardwareStackError = ( + cyruntime.cudaError.cudaErrorHardwareStackError, + 'Device encountered an error in the call stack during kernel execution,\n' + 'possibly due to stack corruption or exceeding the stack size limit. This\n' + '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 'cudaErrorIllegalInstruction' in found_values}} + + cudaErrorIllegalInstruction = ( + cyruntime.cudaError.cudaErrorIllegalInstruction, + 'The device encountered an illegal instruction during kernel execution This\n' + '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 'cudaErrorMisalignedAddress' in found_values}} + + cudaErrorMisalignedAddress = ( + cyruntime.cudaError.cudaErrorMisalignedAddress, + 'The device encountered a load or store instruction on a memory address\n' + 'which is not aligned. This leaves the process in an inconsistent state and\n' + 'any further CUDA work will return the same error. To continue using CUDA,\n' + 'the process must be terminated and relaunched.\n' + ){{endif}} + {{if 'cudaErrorInvalidAddressSpace' in found_values}} + + cudaErrorInvalidAddressSpace = ( + cyruntime.cudaError.cudaErrorInvalidAddressSpace, + 'While executing a kernel, the device encountered an instruction which can\n' + 'only operate on memory locations in certain address spaces (global, shared,\n' + 'or local), but was supplied a memory address not belonging to an allowed\n' + '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 'cudaErrorInvalidPc' in found_values}} + + cudaErrorInvalidPc = ( + cyruntime.cudaError.cudaErrorInvalidPc, + 'The device encountered an invalid program counter. This leaves the process\n' + 'in an inconsistent state and any further CUDA work will return the same\n' + 'error. To continue using CUDA, the process must be terminated and\n' + 'relaunched.\n' + ){{endif}} + {{if 'cudaErrorLaunchFailure' in found_values}} + + cudaErrorLaunchFailure = ( + cyruntime.cudaError.cudaErrorLaunchFailure, + 'An exception occurred on the device while executing a kernel. Common causes\n' + 'include dereferencing an invalid device pointer and accessing out of bounds\n' + 'shared memory. Less common cases can be system specific - more information\n' + 'about these cases can be found in the system specific user guide. This\n' + '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 'cudaErrorCooperativeLaunchTooLarge' in found_values}} + + cudaErrorCooperativeLaunchTooLarge = ( + cyruntime.cudaError.cudaErrorCooperativeLaunchTooLarge, + 'This error indicates that the number of blocks launched per grid for a\n' + 'kernel that was launched via either :py:obj:`~.cudaLaunchCooperativeKernel`\n' + 'or :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` exceeds the maximum\n' + 'number of blocks as allowed by\n' + ':py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` or\n' + ':py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times\n' + 'the number of multiprocessors as specified by the device attribute\n' + ':py:obj:`~.cudaDevAttrMultiProcessorCount`.\n' + ){{endif}} + {{if 'cudaErrorTensorMemoryLeak' in found_values}} + + cudaErrorTensorMemoryLeak = ( + cyruntime.cudaError.cudaErrorTensorMemoryLeak, + 'An exception occurred on the device while exiting a kernel using tensor\n' + 'memory: the tensor memory was not completely deallocated. This leaves the\n' + '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 'cudaErrorNotPermitted' in found_values}} + + cudaErrorNotPermitted = ( + cyruntime.cudaError.cudaErrorNotPermitted, + 'This error indicates the attempted operation is not permitted.\n' + ){{endif}} + {{if 'cudaErrorNotSupported' in found_values}} + + cudaErrorNotSupported = ( + cyruntime.cudaError.cudaErrorNotSupported, + 'This error indicates the attempted operation is not supported on the\n' + 'current system or device.\n' + ){{endif}} + {{if 'cudaErrorSystemNotReady' in found_values}} + + cudaErrorSystemNotReady = ( + cyruntime.cudaError.cudaErrorSystemNotReady, + 'This error indicates that the system is not yet ready to start any CUDA\n' + 'work. To continue using CUDA, verify the system configuration is in a valid\n' + '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 'cudaErrorSystemDriverMismatch' in found_values}} + + cudaErrorSystemDriverMismatch = ( + cyruntime.cudaError.cudaErrorSystemDriverMismatch, + '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 'cudaErrorCompatNotSupportedOnDevice' in found_values}} + + cudaErrorCompatNotSupportedOnDevice = ( + cyruntime.cudaError.cudaErrorCompatNotSupportedOnDevice, + 'This error indicates that the system was upgraded to run with forward\n' + 'compatibility but the visible hardware detected by CUDA does not support\n' + '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 'cudaErrorMpsConnectionFailed' in found_values}} + + cudaErrorMpsConnectionFailed = ( + cyruntime.cudaError.cudaErrorMpsConnectionFailed, + 'This error indicates that the MPS client failed to connect to the MPS\n' + 'control daemon or the MPS server.\n' + ){{endif}} + {{if 'cudaErrorMpsRpcFailure' in found_values}} + + cudaErrorMpsRpcFailure = ( + cyruntime.cudaError.cudaErrorMpsRpcFailure, + 'This error indicates that the remote procedural call between the MPS server\n' + 'and the MPS client failed.\n' + ){{endif}} + {{if 'cudaErrorMpsServerNotReady' in found_values}} + + cudaErrorMpsServerNotReady = ( + cyruntime.cudaError.cudaErrorMpsServerNotReady, + '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 'cudaErrorMpsMaxClientsReached' in found_values}} + + cudaErrorMpsMaxClientsReached = ( + cyruntime.cudaError.cudaErrorMpsMaxClientsReached, + 'This error indicates that the hardware resources required to create MPS\n' + 'client have been exhausted.\n' + ){{endif}} + {{if 'cudaErrorMpsMaxConnectionsReached' in found_values}} + + cudaErrorMpsMaxConnectionsReached = ( + cyruntime.cudaError.cudaErrorMpsMaxConnectionsReached, + 'This error indicates the the hardware resources required to device\n' + 'connections have been exhausted.\n' + ){{endif}} + {{if 'cudaErrorMpsClientTerminated' in found_values}} + + cudaErrorMpsClientTerminated = ( + cyruntime.cudaError.cudaErrorMpsClientTerminated, + '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 'cudaErrorCdpNotSupported' in found_values}} + + cudaErrorCdpNotSupported = ( + cyruntime.cudaError.cudaErrorCdpNotSupported, + 'This error indicates, that the program is using CUDA Dynamic Parallelism,\n' + 'but the current configuration, like MPS, does not support it.\n' + ){{endif}} + {{if 'cudaErrorCdpVersionMismatch' in found_values}} + + cudaErrorCdpVersionMismatch = ( + cyruntime.cudaError.cudaErrorCdpVersionMismatch, + 'This error indicates, that the program contains an unsupported interaction\n' + 'between different versions of CUDA Dynamic Parallelism.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureUnsupported' in found_values}} + + cudaErrorStreamCaptureUnsupported = ( + cyruntime.cudaError.cudaErrorStreamCaptureUnsupported, + 'The operation is not permitted when the stream is capturing.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureInvalidated' in found_values}} + + cudaErrorStreamCaptureInvalidated = ( + cyruntime.cudaError.cudaErrorStreamCaptureInvalidated, + 'The current capture sequence on the stream has been invalidated due to a\n' + 'previous error.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureMerge' in found_values}} + + cudaErrorStreamCaptureMerge = ( + cyruntime.cudaError.cudaErrorStreamCaptureMerge, + 'The operation would have resulted in a merge of two independent capture\n' + 'sequences.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureUnmatched' in found_values}} + + cudaErrorStreamCaptureUnmatched = ( + cyruntime.cudaError.cudaErrorStreamCaptureUnmatched, + 'The capture was not initiated in this stream.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureUnjoined' in found_values}} + + cudaErrorStreamCaptureUnjoined = ( + cyruntime.cudaError.cudaErrorStreamCaptureUnjoined, + 'The capture sequence contains a fork that was not joined to the primary\n' + 'stream.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureIsolation' in found_values}} + + cudaErrorStreamCaptureIsolation = ( + cyruntime.cudaError.cudaErrorStreamCaptureIsolation, + 'A dependency would have been created which crosses the capture sequence\n' + 'boundary. Only implicit in-stream ordering dependencies are allowed to\n' + 'cross the boundary.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureImplicit' in found_values}} + + cudaErrorStreamCaptureImplicit = ( + cyruntime.cudaError.cudaErrorStreamCaptureImplicit, + 'The operation would have resulted in a disallowed implicit dependency on a\n' + 'current capture sequence from cudaStreamLegacy.\n' + ){{endif}} + {{if 'cudaErrorCapturedEvent' in found_values}} + + cudaErrorCapturedEvent = ( + cyruntime.cudaError.cudaErrorCapturedEvent, + 'The operation is not permitted on an event which was last recorded in a\n' + 'capturing stream.\n' + ){{endif}} + {{if 'cudaErrorStreamCaptureWrongThread' in found_values}} + + cudaErrorStreamCaptureWrongThread = ( + cyruntime.cudaError.cudaErrorStreamCaptureWrongThread, + 'A stream capture sequence not initiated with the\n' + ':py:obj:`~.cudaStreamCaptureModeRelaxed` argument to\n' + ':py:obj:`~.cudaStreamBeginCapture` was passed to\n' + ':py:obj:`~.cudaStreamEndCapture` in a different thread.\n' + ){{endif}} + {{if 'cudaErrorTimeout' in found_values}} + + cudaErrorTimeout = ( + cyruntime.cudaError.cudaErrorTimeout, + 'This indicates that the wait operation has timed out.\n' + ){{endif}} + {{if 'cudaErrorGraphExecUpdateFailure' in found_values}} + + cudaErrorGraphExecUpdateFailure = ( + cyruntime.cudaError.cudaErrorGraphExecUpdateFailure, + '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 'cudaErrorExternalDevice' in found_values}} + + cudaErrorExternalDevice = ( + cyruntime.cudaError.cudaErrorExternalDevice, + 'This indicates that an async error has occurred in a device outside of\n' + "CUDA. If CUDA was waiting for an external device's signal before consuming\n" + 'shared data, the external device signaled an error indicating that the data\n' + 'is not valid for consumption. This leaves the process in an inconsistent\n' + 'state and any further CUDA work will return the same error. To continue\n' + 'using CUDA, the process must be terminated and relaunched.\n' + ){{endif}} + {{if 'cudaErrorInvalidClusterSize' in found_values}} + + cudaErrorInvalidClusterSize = ( + cyruntime.cudaError.cudaErrorInvalidClusterSize, + 'This indicates that a kernel launch error has occurred due to cluster\n' + 'misconfiguration.\n' + ){{endif}} + {{if 'cudaErrorFunctionNotLoaded' in found_values}} + + cudaErrorFunctionNotLoaded = ( + cyruntime.cudaError.cudaErrorFunctionNotLoaded, + 'Indiciates a function handle is not loaded when calling an API that\n' + 'requires a loaded function.\n' + ){{endif}} + {{if 'cudaErrorInvalidResourceType' in found_values}} + + cudaErrorInvalidResourceType = ( + cyruntime.cudaError.cudaErrorInvalidResourceType, + 'This error indicates one or more resources passed in are not valid resource\n' + 'types for the operation.\n' + ){{endif}} + {{if 'cudaErrorInvalidResourceConfiguration' in found_values}} + + cudaErrorInvalidResourceConfiguration = ( + cyruntime.cudaError.cudaErrorInvalidResourceConfiguration, + 'This error indicates one or more resources are insufficient or non-\n' + 'applicable for the operation.\n' + ){{endif}} + {{if 'cudaErrorUnknown' in found_values}} + + cudaErrorUnknown = ( + cyruntime.cudaError.cudaErrorUnknown, + 'This indicates that an unknown internal error has occurred.\n' + ){{endif}} + {{if 'cudaErrorApiFailureBase' in found_values}} + cudaErrorApiFailureBase = cyruntime.cudaError.cudaErrorApiFailureBase{{endif}} + +{{endif}} +{{if 'cudaGraphDependencyType_enum' in found_types}} + +class cudaGraphDependencyType(_FastEnum): + """ + Type annotations that can be applied to graph edges as part of + :py:obj:`~.cudaGraphEdgeData`. + """ + {{if 'cudaGraphDependencyTypeDefault' in found_values}} + + cudaGraphDependencyTypeDefault = ( + cyruntime.cudaGraphDependencyType_enum.cudaGraphDependencyTypeDefault, + 'This is an ordinary dependency.\n' + ){{endif}} + {{if 'cudaGraphDependencyTypeProgrammatic' in found_values}} + + cudaGraphDependencyTypeProgrammatic = ( + cyruntime.cudaGraphDependencyType_enum.cudaGraphDependencyTypeProgrammatic, + 'This dependency type allows the downstream node to use\n' + '`cudaGridDependencySynchronize()`. It may only be used between kernel\n' + 'nodes, and must be used with either the\n' + ':py:obj:`~.cudaGraphKernelNodePortProgrammatic` or\n' + ':py:obj:`~.cudaGraphKernelNodePortLaunchCompletion` outgoing port.\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphInstantiateResult' in found_types}} + +class cudaGraphInstantiateResult(_FastEnum): + """ + Graph instantiation results + """ + {{if 'cudaGraphInstantiateSuccess' in found_values}} + + cudaGraphInstantiateSuccess = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateSuccess, + 'Instantiation succeeded\n' + ){{endif}} + {{if 'cudaGraphInstantiateError' in found_values}} + + cudaGraphInstantiateError = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateError, + 'Instantiation failed for an unexpected reason which is described in the\n' + 'return value of the function\n' + ){{endif}} + {{if 'cudaGraphInstantiateInvalidStructure' in found_values}} + + cudaGraphInstantiateInvalidStructure = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure, + 'Instantiation failed due to invalid structure, such as cycles\n' + ){{endif}} + {{if 'cudaGraphInstantiateNodeOperationNotSupported' in found_values}} + + cudaGraphInstantiateNodeOperationNotSupported = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported, + 'Instantiation for device launch failed because the graph contained an\n' + 'unsupported operation\n' + ){{endif}} + {{if 'cudaGraphInstantiateMultipleDevicesNotSupported' in found_values}} + + cudaGraphInstantiateMultipleDevicesNotSupported = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported, + 'Instantiation for device launch failed due to the nodes belonging to\n' + 'different contexts\n' + ){{endif}} + {{if 'cudaGraphInstantiateConditionalHandleUnused' in found_values}} + + cudaGraphInstantiateConditionalHandleUnused = ( + cyruntime.cudaGraphInstantiateResult.cudaGraphInstantiateConditionalHandleUnused, + 'One or more conditional handles are not associated with conditional nodes\n' + ){{endif}} + +{{endif}} +{{if 'cudaLaunchMemSyncDomain' in found_types}} + +class cudaLaunchMemSyncDomain(_FastEnum): + """ + Memory Synchronization Domain A kernel can be launched in a + specified memory synchronization domain that affects all memory + operations issued by that kernel. A memory barrier issued in one + domain will only order memory operations in that domain, thus + eliminating latency increase from memory barriers ordering + unrelated traffic. By default, kernels are launched in domain 0. + Kernel launched with :py:obj:`~.cudaLaunchMemSyncDomainRemote` will + have a different domain ID. User may also alter the domain ID with + :py:obj:`~.cudaLaunchMemSyncDomainMap` for a specific stream / + graph node / kernel launch. See + :py:obj:`~.cudaLaunchAttributeMemSyncDomain`, + :py:obj:`~.cudaStreamSetAttribute`, :py:obj:`~.cudaLaunchKernelEx`, + :py:obj:`~.cudaGraphKernelNodeSetAttribute`. Memory operations + done in kernels launched in different domains are considered + system-scope distanced. In other words, a GPU scoped memory + synchronization is not sufficient for memory order to be observed + by kernels in another memory synchronization domain even if they + are on the same GPU. + """ + {{if 'cudaLaunchMemSyncDomainDefault' in found_values}} + + cudaLaunchMemSyncDomainDefault = ( + cyruntime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault, + 'Launch kernels in the default domain\n' + ){{endif}} + {{if 'cudaLaunchMemSyncDomainRemote' in found_values}} + + cudaLaunchMemSyncDomainRemote = ( + cyruntime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote, + 'Launch kernels in the remote domain\n' + ){{endif}} + +{{endif}} +{{if 'cudaLaunchAttributeID' in found_types}} + +class cudaLaunchAttributeID(_FastEnum): + """ + Launch attributes enum; used as id field of + :py:obj:`~.cudaLaunchAttribute` + """ + {{if 'cudaLaunchAttributeIgnore' in found_values}} + + cudaLaunchAttributeIgnore = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore, + 'Ignored entry, for convenient composition\n' + ){{endif}} + {{if 'cudaLaunchAttributeAccessPolicyWindow' in found_values}} + + cudaLaunchAttributeAccessPolicyWindow = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeCooperative' in found_values}} + + cudaLaunchAttributeCooperative = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeCooperative, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.cooperative`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeSynchronizationPolicy' in found_values}} + + cudaLaunchAttributeSynchronizationPolicy = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy, + 'Valid for streams. See :py:obj:`~.cudaLaunchAttributeValue.syncPolicy`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterDimension' in found_values}} + + cudaLaunchAttributeClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterDim`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterSchedulingPolicyPreference' in found_values}} + + cudaLaunchAttributeClusterSchedulingPolicyPreference = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeProgrammaticStreamSerialization' in found_values}} + + cudaLaunchAttributeProgrammaticStreamSerialization = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization, + 'Valid for launches. Setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 'cudaLaunchAttributeProgrammaticEvent' in found_values}} + + cudaLaunchAttributeProgrammaticEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 programmatically in a future CUDA release. A trigger can\n' + "also be inserted at the beginning of each block's execution if\n" + 'triggerAtBlockStart is set to non-0. The dependent launches can choose to\n' + 'wait on the dependency using the programmatic sync\n' + '(cudaGridDependencySynchronize() or equivalent PTX instructions). Note that\n' + 'dependents (including the CPU thread calling\n' + ':py:obj:`~.cudaEventSynchronize()`) are not guaranteed to observe the\n' + 'release precisely when it is released. For example,\n' + ':py:obj:`~.cudaEventSynchronize()` 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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributePriority' in found_values}} + + cudaLaunchAttributePriority = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePriority, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.priority`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomainMap' in found_values}} + + cudaLaunchAttributeMemSyncDomainMap = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomain' in found_values}} + + cudaLaunchAttributeMemSyncDomain = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`.\n' + ){{endif}} + {{if 'cudaLaunchAttributePreferredClusterDimension' in found_values}} + + cudaLaunchAttributePreferredClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension, + 'Valid for graph nodes and launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.preferredClusterDim` to allow the\n' + 'kernel launch to specify a preferred substitute cluster dimension. Blocks\n' + 'may be grouped according to either the dimensions specified with this\n' + 'attribute (grouped into a "preferred substitute cluster"), or the one\n' + 'specified with :py:obj:`~.cudaLaunchAttributeClusterDimension` attribute\n' + '(grouped into a "regular cluster"). The cluster dimensions of a "preferred\n' + 'substitute cluster" shall be an integer multiple greater than zero of the\n' + 'regular cluster dimensions. The device will attempt - on a best-effort\n' + 'basis - to group thread blocks into preferred clusters over grouping them\n' + 'into regular clusters. When it deems necessary (primarily when the device\n' + 'temporarily runs out of physical resources to launch the larger preferred\n' + 'clusters), the device may switch to launch the regular clusters instead to\n' + 'attempt to 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 'cudaLaunchAttributeLaunchCompletionEvent' in found_values}} + + cudaLaunchAttributeLaunchCompletionEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributeDeviceUpdatableKernelNode' in found_values}} + + cudaLaunchAttributeDeviceUpdatableKernelNode = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, + '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' + ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' + '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' + '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:`~.cudaGraphDestroyNode`. 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:`~.cudaGraphKernelNodeCopyAttributes`.\n' + 'Graphs containing one or more device-updatable nodes also do not allow\n' + 'multiple instantiation, and neither the graph nor its instantiated version\n' + 'can be passed to :py:obj:`~.cudaGraphExecUpdate`.\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 'cudaLaunchAttributePreferredSharedMemoryCarveout' in found_values}} + + cudaLaunchAttributePreferredSharedMemoryCarveout = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout, + 'Valid for launches. On devices where the L1 cache and shared memory use the\n' + 'same hardware resources, setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.sharedMemCarveout` to a percentage\n' + 'between 0-100 signals sets the shared memory carveout preference in percent\n' + 'of the total shared memory for that kernel launch. This attribute takes\n' + 'precedence over :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout`.\n' + 'This is only a hint, and the driver can choose a different configuration if\n' + 'required for the launch.\n' + ){{endif}} + +{{endif}} +{{if 'cudaAsyncNotificationType_enum' in found_types}} + +class cudaAsyncNotificationType(_FastEnum): + """ + Types of async notification that can occur + """ + {{if 'cudaAsyncNotificationTypeOverBudget' in found_values}} + + cudaAsyncNotificationTypeOverBudget = ( + cyruntime.cudaAsyncNotificationType_enum.cudaAsyncNotificationTypeOverBudget, + 'Sent when the process has exceeded its device memory budget\n' + ){{endif}} + +{{endif}} +{{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}} + CUDA_R_64F = cyruntime.cudaDataType_t.CUDA_R_64F{{endif}} + {{if 'CUDA_R_16F' in found_values}} + CUDA_R_16F = cyruntime.cudaDataType_t.CUDA_R_16F{{endif}} + {{if 'CUDA_R_8I' in found_values}} + CUDA_R_8I = cyruntime.cudaDataType_t.CUDA_R_8I{{endif}} + {{if 'CUDA_C_32F' in found_values}} + CUDA_C_32F = cyruntime.cudaDataType_t.CUDA_C_32F{{endif}} + {{if 'CUDA_C_64F' in found_values}} + CUDA_C_64F = cyruntime.cudaDataType_t.CUDA_C_64F{{endif}} + {{if 'CUDA_C_16F' in found_values}} + CUDA_C_16F = cyruntime.cudaDataType_t.CUDA_C_16F{{endif}} + {{if 'CUDA_C_8I' in found_values}} + CUDA_C_8I = cyruntime.cudaDataType_t.CUDA_C_8I{{endif}} + {{if 'CUDA_R_8U' in found_values}} + CUDA_R_8U = cyruntime.cudaDataType_t.CUDA_R_8U{{endif}} + {{if 'CUDA_C_8U' in found_values}} + CUDA_C_8U = cyruntime.cudaDataType_t.CUDA_C_8U{{endif}} + {{if 'CUDA_R_32I' in found_values}} + CUDA_R_32I = cyruntime.cudaDataType_t.CUDA_R_32I{{endif}} + {{if 'CUDA_C_32I' in found_values}} + CUDA_C_32I = cyruntime.cudaDataType_t.CUDA_C_32I{{endif}} + {{if 'CUDA_R_32U' in found_values}} + CUDA_R_32U = cyruntime.cudaDataType_t.CUDA_R_32U{{endif}} + {{if 'CUDA_C_32U' in found_values}} + CUDA_C_32U = cyruntime.cudaDataType_t.CUDA_C_32U{{endif}} + {{if 'CUDA_R_16BF' in found_values}} + CUDA_R_16BF = cyruntime.cudaDataType_t.CUDA_R_16BF{{endif}} + {{if 'CUDA_C_16BF' in found_values}} + CUDA_C_16BF = cyruntime.cudaDataType_t.CUDA_C_16BF{{endif}} + {{if 'CUDA_R_4I' in found_values}} + CUDA_R_4I = cyruntime.cudaDataType_t.CUDA_R_4I{{endif}} + {{if 'CUDA_C_4I' in found_values}} + CUDA_C_4I = cyruntime.cudaDataType_t.CUDA_C_4I{{endif}} + {{if 'CUDA_R_4U' in found_values}} + CUDA_R_4U = cyruntime.cudaDataType_t.CUDA_R_4U{{endif}} + {{if 'CUDA_C_4U' in found_values}} + CUDA_C_4U = cyruntime.cudaDataType_t.CUDA_C_4U{{endif}} + {{if 'CUDA_R_16I' in found_values}} + CUDA_R_16I = cyruntime.cudaDataType_t.CUDA_R_16I{{endif}} + {{if 'CUDA_C_16I' in found_values}} + CUDA_C_16I = cyruntime.cudaDataType_t.CUDA_C_16I{{endif}} + {{if 'CUDA_R_16U' in found_values}} + CUDA_R_16U = cyruntime.cudaDataType_t.CUDA_R_16U{{endif}} + {{if 'CUDA_C_16U' in found_values}} + CUDA_C_16U = cyruntime.cudaDataType_t.CUDA_C_16U{{endif}} + {{if 'CUDA_R_64I' in found_values}} + CUDA_R_64I = cyruntime.cudaDataType_t.CUDA_R_64I{{endif}} + {{if 'CUDA_C_64I' in found_values}} + CUDA_C_64I = cyruntime.cudaDataType_t.CUDA_C_64I{{endif}} + {{if 'CUDA_R_64U' in found_values}} + CUDA_R_64U = cyruntime.cudaDataType_t.CUDA_R_64U{{endif}} + {{if 'CUDA_C_64U' in found_values}} + CUDA_C_64U = cyruntime.cudaDataType_t.CUDA_C_64U{{endif}} + {{if 'CUDA_R_8F_E4M3' in found_values}} + CUDA_R_8F_E4M3 = cyruntime.cudaDataType_t.CUDA_R_8F_E4M3{{endif}} + {{if 'CUDA_R_8F_UE4M3' in found_values}} + CUDA_R_8F_UE4M3 = cyruntime.cudaDataType_t.CUDA_R_8F_UE4M3{{endif}} + {{if 'CUDA_R_8F_E5M2' in found_values}} + CUDA_R_8F_E5M2 = cyruntime.cudaDataType_t.CUDA_R_8F_E5M2{{endif}} + {{if 'CUDA_R_8F_UE8M0' in found_values}} + CUDA_R_8F_UE8M0 = cyruntime.cudaDataType_t.CUDA_R_8F_UE8M0{{endif}} + {{if 'CUDA_R_6F_E2M3' in found_values}} + CUDA_R_6F_E2M3 = cyruntime.cudaDataType_t.CUDA_R_6F_E2M3{{endif}} + {{if 'CUDA_R_6F_E3M2' in found_values}} + CUDA_R_6F_E3M2 = cyruntime.cudaDataType_t.CUDA_R_6F_E3M2{{endif}} + {{if 'CUDA_R_4F_E2M1' in found_values}} + CUDA_R_4F_E2M1 = cyruntime.cudaDataType_t.CUDA_R_4F_E2M1{{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}} + MINOR_VERSION = cyruntime.libraryPropertyType_t.MINOR_VERSION{{endif}} + {{if 'PATCH_LEVEL' in found_values}} + PATCH_LEVEL = cyruntime.libraryPropertyType_t.PATCH_LEVEL{{endif}} + +{{endif}} +{{if True}} + +class cudaEglFrameType(_FastEnum): + """ + CUDA EglFrame type - array or pointer + """ + {{if True}} + + cudaEglFrameTypeArray = ( + cyruntime.cudaEglFrameType_enum.cudaEglFrameTypeArray, + 'Frame type CUDA array\n' + ){{endif}} + {{if True}} + + cudaEglFrameTypePitch = ( + cyruntime.cudaEglFrameType_enum.cudaEglFrameTypePitch, + 'Frame type CUDA pointer\n' + ){{endif}} + +{{endif}} +{{if True}} + +class cudaEglResourceLocationFlags(_FastEnum): + """ + Resource location flags- sysmem or vidmem For CUDA context on + iGPU, since video and system memory are equivalent - these flags + will not have an effect on the execution. For CUDA context on + dGPU, applications can use the flag + :py:obj:`~.cudaEglResourceLocationFlags` to give a hint about the + desired location. :py:obj:`~.cudaEglResourceLocationSysmem` - the + frame data is made resident on the system memory to be accessed by + CUDA. :py:obj:`~.cudaEglResourceLocationVidmem` - the frame data + is made resident on the dedicated video memory to be accessed 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}} + + cudaEglResourceLocationSysmem = ( + cyruntime.cudaEglResourceLocationFlags_enum.cudaEglResourceLocationSysmem, + 'Resource location sysmem\n' + ){{endif}} + {{if True}} + + cudaEglResourceLocationVidmem = ( + cyruntime.cudaEglResourceLocationFlags_enum.cudaEglResourceLocationVidmem, + 'Resource location vidmem\n' + ){{endif}} + +{{endif}} +{{if True}} + +class cudaEglColorFormat(_FastEnum): + """ + CUDA EGL Color Format - The different planar and multiplanar + formats currently supported for CUDA_EGL interops. + """ + {{if True}} + + cudaEglColorFormatYUV420Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420Planar, + '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}} + + cudaEglColorFormatYUV420SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420SemiPlanar, + 'Y, UV in two surfaces (UV as one surface) with VU byte ordering, width,\n' + 'height ratio same as YUV420Planar.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUV422Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV422Planar, + '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}} + + cudaEglColorFormatYUV422SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV422SemiPlanar, + 'Y, UV in two surfaces with VU byte ordering, width, height ratio same as\n' + 'YUV422Planar.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatARGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatARGB, + 'R/G/B/A four channels in one surface with BGRA byte ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatRGBA = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatRGBA, + 'R/G/B/A four channels in one surface with ABGR byte ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatL = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatL, + 'single luminance channel in one surface.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatR, + 'single color channel in one surface.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUV444Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV444Planar, + '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}} + + cudaEglColorFormatYUV444SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV444SemiPlanar, + 'Y, UV in two surfaces (UV as one surface) with VU byte ordering, width,\n' + 'height ratio same as YUV444Planar.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUYV422 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUYV422, + 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatUYVY422 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY422, + 'Y, U, V in one surface, interleaved as YUYV in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatABGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatABGR, + 'R/G/B/A four channels in one surface with RGBA byte ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBGRA = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBGRA, + 'R/G/B/A four channels in one surface with ARGB byte ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatA = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatA, + 'Alpha color format - one channel in one surface.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatRG, + 'R/G color format - two channels in one surface with GR byte ordering\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatAYUV = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatAYUV, + 'Y, U, V, A four channels in one surface, interleaved as VUYA.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYVU444SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU444SemiPlanar, + '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}} + + cudaEglColorFormatYVU422SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU422SemiPlanar, + '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}} + + cudaEglColorFormatYVU420SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420SemiPlanar, + '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}} + + cudaEglColorFormatY10V10U10_444SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_444SemiPlanar, + '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}} + + cudaEglColorFormatY10V10U10_420SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_420SemiPlanar, + '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}} + + cudaEglColorFormatY12V12U12_444SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_444SemiPlanar, + '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}} + + cudaEglColorFormatY12V12U12_420SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_420SemiPlanar, + '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}} + + cudaEglColorFormatVYUY_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatVYUY_ER, + 'Extended Range Y, U, V in one surface, interleaved as YVYU in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatUYVY_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY_ER, + 'Extended Range Y, U, V in one surface, interleaved as YUYV in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUYV_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUYV_ER, + 'Extended Range Y, U, V in one surface, interleaved as UYVY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYVYU_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVYU_ER, + 'Extended Range Y, U, V in one surface, interleaved as VYUY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUVA_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUVA_ER, + 'Extended Range Y, U, V, A four channels in one surface, interleaved as\n' + 'AVUY.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatAYUV_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatAYUV_ER, + 'Extended Range Y, U, V, A four channels in one surface, interleaved as\n' + 'VUYA.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUV444Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV444Planar_ER, + 'Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height =\n' + 'Y height.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUV422Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV422Planar_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}} + + cudaEglColorFormatYUV420Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420Planar_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}} + + cudaEglColorFormatYUV444SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV444SemiPlanar_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}} + + cudaEglColorFormatYUV422SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV422SemiPlanar_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}} + + cudaEglColorFormatYUV420SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420SemiPlanar_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}} + + cudaEglColorFormatYVU444Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU444Planar_ER, + 'Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height =\n' + 'Y height.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYVU422Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU422Planar_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}} + + cudaEglColorFormatYVU420Planar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420Planar_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}} + + cudaEglColorFormatYVU444SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU444SemiPlanar_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}} + + cudaEglColorFormatYVU422SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU422SemiPlanar_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}} + + cudaEglColorFormatYVU420SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420SemiPlanar_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}} + + cudaEglColorFormatBayerRGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerRGGB, + 'Bayer format - one channel in one surface with interleaved RGGB ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerBGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerBGGR, + 'Bayer format - one channel in one surface with interleaved BGGR ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerGRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerGRBG, + 'Bayer format - one channel in one surface with interleaved GRBG ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerGBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerGBRG, + 'Bayer format - one channel in one surface with interleaved GBRG ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayer10RGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer10RGGB, + '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}} + + cudaEglColorFormatBayer10BGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer10BGGR, + '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}} + + cudaEglColorFormatBayer10GRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer10GRBG, + '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}} + + cudaEglColorFormatBayer10GBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer10GBRG, + '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}} + + cudaEglColorFormatBayer12RGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12RGGB, + '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}} + + cudaEglColorFormatBayer12BGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12BGGR, + '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}} + + cudaEglColorFormatBayer12GRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12GRBG, + '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}} + + cudaEglColorFormatBayer12GBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12GBRG, + '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}} + + cudaEglColorFormatBayer14RGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer14RGGB, + '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}} + + cudaEglColorFormatBayer14BGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer14BGGR, + '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}} + + cudaEglColorFormatBayer14GRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer14GRBG, + '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}} + + cudaEglColorFormatBayer14GBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer14GBRG, + '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}} + + cudaEglColorFormatBayer20RGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer20RGGB, + '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}} + + cudaEglColorFormatBayer20BGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer20BGGR, + '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}} + + cudaEglColorFormatBayer20GRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer20GRBG, + '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}} + + cudaEglColorFormatBayer20GBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer20GBRG, + '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}} + + cudaEglColorFormatYVU444Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU444Planar, + '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}} + + cudaEglColorFormatYVU422Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU422Planar, + '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}} + + cudaEglColorFormatYVU420Planar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420Planar, + '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}} + + cudaEglColorFormatBayerIspRGGB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerIspRGGB, + '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}} + + cudaEglColorFormatBayerIspBGGR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerIspBGGR, + '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}} + + cudaEglColorFormatBayerIspGRBG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerIspGRBG, + '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}} + + cudaEglColorFormatBayerIspGBRG = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerIspGBRG, + '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}} + + cudaEglColorFormatBayerBCCR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerBCCR, + 'Bayer format - one channel in one surface with interleaved BCCR ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerRCCB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerRCCB, + 'Bayer format - one channel in one surface with interleaved RCCB ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerCRBC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerCRBC, + 'Bayer format - one channel in one surface with interleaved CRBC ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayerCBRC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayerCBRC, + 'Bayer format - one channel in one surface with interleaved CBRC ordering.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatBayer10CCCC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer10CCCC, + '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}} + + cudaEglColorFormatBayer12BCCR = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12BCCR, + '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}} + + cudaEglColorFormatBayer12RCCB = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12RCCB, + '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}} + + cudaEglColorFormatBayer12CRBC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12CRBC, + '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}} + + cudaEglColorFormatBayer12CBRC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12CBRC, + '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}} + + cudaEglColorFormatBayer12CCCC = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatBayer12CCCC, + '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}} + + cudaEglColorFormatY = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY, + 'Color format for single Y plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUV420SemiPlanar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420SemiPlanar_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}} + + cudaEglColorFormatYVU420SemiPlanar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420SemiPlanar_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}} + + cudaEglColorFormatYUV420Planar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420Planar_2020, + '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}} + + cudaEglColorFormatYVU420Planar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420Planar_2020, + '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}} + + cudaEglColorFormatYUV420SemiPlanar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420SemiPlanar_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}} + + cudaEglColorFormatYVU420SemiPlanar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420SemiPlanar_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}} + + cudaEglColorFormatYUV420Planar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUV420Planar_709, + '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}} + + cudaEglColorFormatYVU420Planar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVU420Planar_709, + '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}} + + cudaEglColorFormatY10V10U10_420SemiPlanar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_420SemiPlanar_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}} + + cudaEglColorFormatY10V10U10_420SemiPlanar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_420SemiPlanar_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}} + + cudaEglColorFormatY10V10U10_422SemiPlanar_2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_422SemiPlanar_2020, + 'Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width,\n' + 'U/V height = Y height.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY10V10U10_422SemiPlanar = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_422SemiPlanar, + 'Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width,\n' + 'U/V height = Y height.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY10V10U10_422SemiPlanar_709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_422SemiPlanar_709, + 'Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width,\n' + 'U/V height = Y height.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY_ER, + 'Extended Range Color format for single Y plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY_709_ER, + 'Extended Range Color format for single Y plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY10_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10_ER, + 'Extended Range Color format for single Y10 plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY10_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10_709_ER, + 'Extended Range Color format for single Y10 plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY12_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12_ER, + 'Extended Range Color format for single Y12 plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY12_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12_709_ER, + 'Extended Range Color format for single Y12 plane.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYUVA = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYUVA, + 'Y, U, V, A four channels in one surface, interleaved as AVUY.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatYVYU = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatYVYU, + 'Y, U, V in one surface, interleaved as YVYU in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatVYUY = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatVYUY, + 'Y, U, V in one surface, interleaved as VYUY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatY10V10U10_420SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_420SemiPlanar_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}} + + cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_420SemiPlanar_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}} + + cudaEglColorFormatY10V10U10_444SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_444SemiPlanar_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}} + + cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY10V10U10_444SemiPlanar_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}} + + cudaEglColorFormatY12V12U12_420SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_420SemiPlanar_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}} + + cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_420SemiPlanar_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}} + + cudaEglColorFormatY12V12U12_444SemiPlanar_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_444SemiPlanar_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}} + + cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatY12V12U12_444SemiPlanar_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}} + + cudaEglColorFormatUYVY709 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY709, + 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatUYVY709_ER = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY709_ER, + 'Extended Range Y, U, V in one surface, interleaved as UYVY in one channel.\n' + ){{endif}} + {{if True}} + + cudaEglColorFormatUYVY2020 = ( + cyruntime.cudaEglColorFormat_enum.cudaEglColorFormatUYVY2020, + 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' + ){{endif}} + +{{endif}} +{{if 'cudaChannelFormatKind' in found_types}} + +class cudaChannelFormatKind(_FastEnum): + """ + Channel format kind + """ + {{if 'cudaChannelFormatKindSigned' in found_values}} + + cudaChannelFormatKindSigned = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSigned, + 'Signed channel format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned' in found_values}} + + cudaChannelFormatKindUnsigned = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned, + 'Unsigned channel format\n' + ){{endif}} + {{if 'cudaChannelFormatKindFloat' in found_values}} + + cudaChannelFormatKindFloat = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindFloat, + 'Float channel format\n' + ){{endif}} + {{if 'cudaChannelFormatKindNone' in found_values}} + + cudaChannelFormatKindNone = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindNone, + 'No channel format\n' + ){{endif}} + {{if 'cudaChannelFormatKindNV12' in found_values}} + + cudaChannelFormatKindNV12 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindNV12, + 'Unsigned 8-bit integers, planar 4:2:0 YUV format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized8X1' in found_values}} + + cudaChannelFormatKindUnsignedNormalized8X1 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1, + '1 channel unsigned 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized8X2' in found_values}} + + cudaChannelFormatKindUnsignedNormalized8X2 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2, + '2 channel unsigned 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized8X4' in found_values}} + + cudaChannelFormatKindUnsignedNormalized8X4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4, + '4 channel unsigned 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized16X1' in found_values}} + + cudaChannelFormatKindUnsignedNormalized16X1 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1, + '1 channel unsigned 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized16X2' in found_values}} + + cudaChannelFormatKindUnsignedNormalized16X2 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2, + '2 channel unsigned 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized16X4' in found_values}} + + cudaChannelFormatKindUnsignedNormalized16X4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4, + '4 channel unsigned 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized8X1' in found_values}} + + cudaChannelFormatKindSignedNormalized8X1 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1, + '1 channel signed 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized8X2' in found_values}} + + cudaChannelFormatKindSignedNormalized8X2 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2, + '2 channel signed 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized8X4' in found_values}} + + cudaChannelFormatKindSignedNormalized8X4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4, + '4 channel signed 8-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized16X1' in found_values}} + + cudaChannelFormatKindSignedNormalized16X1 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1, + '1 channel signed 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized16X2' in found_values}} + + cudaChannelFormatKindSignedNormalized16X2 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2, + '2 channel signed 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedNormalized16X4' in found_values}} + + cudaChannelFormatKindSignedNormalized16X4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4, + '4 channel signed 16-bit normalized integer\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed1' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed1 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1, + '4 channel unsigned normalized block-compressed (BC1 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed1SRGB' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed1SRGB = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB, + '4 channel unsigned normalized block-compressed (BC1 compression) format\n' + 'with sRGB encoding\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed2' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed2 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2, + '4 channel unsigned normalized block-compressed (BC2 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed2SRGB' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed2SRGB = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB, + '4 channel unsigned normalized block-compressed (BC2 compression) format\n' + 'with sRGB encoding\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed3' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed3 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3, + '4 channel unsigned normalized block-compressed (BC3 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed3SRGB' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed3SRGB = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB, + '4 channel unsigned normalized block-compressed (BC3 compression) format\n' + 'with sRGB encoding\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed4' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4, + '1 channel unsigned normalized block-compressed (BC4 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedBlockCompressed4' in found_values}} + + cudaChannelFormatKindSignedBlockCompressed4 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4, + '1 channel signed normalized block-compressed (BC4 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed5' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed5 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5, + '2 channel unsigned normalized block-compressed (BC5 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedBlockCompressed5' in found_values}} + + cudaChannelFormatKindSignedBlockCompressed5 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5, + '2 channel signed normalized block-compressed (BC5 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed6H' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed6H = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, + '3 channel unsigned half-float block-compressed (BC6H compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindSignedBlockCompressed6H' in found_values}} + + cudaChannelFormatKindSignedBlockCompressed6H = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H, + '3 channel signed half-float block-compressed (BC6H compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed7' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed7 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7, + '4 channel unsigned normalized block-compressed (BC7 compression) format\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedBlockCompressed7SRGB' in found_values}} + + cudaChannelFormatKindUnsignedBlockCompressed7SRGB = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB, + '4 channel unsigned normalized block-compressed (BC7 compression) format\n' + 'with sRGB encoding\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsignedNormalized1010102' in found_values}} + + cudaChannelFormatKindUnsignedNormalized1010102 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102, + '4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemoryType' in found_types}} + +class cudaMemoryType(_FastEnum): + """ + CUDA memory types + """ + {{if 'cudaMemoryTypeUnregistered' in found_values}} + + cudaMemoryTypeUnregistered = ( + cyruntime.cudaMemoryType.cudaMemoryTypeUnregistered, + 'Unregistered memory\n' + ){{endif}} + {{if 'cudaMemoryTypeHost' in found_values}} + + cudaMemoryTypeHost = ( + cyruntime.cudaMemoryType.cudaMemoryTypeHost, + 'Host memory\n' + ){{endif}} + {{if 'cudaMemoryTypeDevice' in found_values}} + + cudaMemoryTypeDevice = ( + cyruntime.cudaMemoryType.cudaMemoryTypeDevice, + 'Device memory\n' + ){{endif}} + {{if 'cudaMemoryTypeManaged' in found_values}} + + cudaMemoryTypeManaged = ( + cyruntime.cudaMemoryType.cudaMemoryTypeManaged, + 'Managed memory\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemcpyKind' in found_types}} + +class cudaMemcpyKind(_FastEnum): + """ + CUDA memory copy types + """ + {{if 'cudaMemcpyHostToHost' in found_values}} + + cudaMemcpyHostToHost = ( + cyruntime.cudaMemcpyKind.cudaMemcpyHostToHost, + 'Host -> Host\n' + ){{endif}} + {{if 'cudaMemcpyHostToDevice' in found_values}} + + cudaMemcpyHostToDevice = ( + cyruntime.cudaMemcpyKind.cudaMemcpyHostToDevice, + 'Host -> Device\n' + ){{endif}} + {{if 'cudaMemcpyDeviceToHost' in found_values}} + + cudaMemcpyDeviceToHost = ( + cyruntime.cudaMemcpyKind.cudaMemcpyDeviceToHost, + 'Device -> Host\n' + ){{endif}} + {{if 'cudaMemcpyDeviceToDevice' in found_values}} + + cudaMemcpyDeviceToDevice = ( + cyruntime.cudaMemcpyKind.cudaMemcpyDeviceToDevice, + 'Device -> Device\n' + ){{endif}} + {{if 'cudaMemcpyDefault' in found_values}} + + cudaMemcpyDefault = ( + cyruntime.cudaMemcpyKind.cudaMemcpyDefault, + 'Direction of the transfer is inferred from the pointer values. Requires\n' + 'unified virtual addressing\n' + ){{endif}} + +{{endif}} +{{if 'cudaAccessProperty' in found_types}} + +class cudaAccessProperty(_FastEnum): + """ + Specifies performance hint with :py:obj:`~.cudaAccessPolicyWindow` + for hitProp and missProp members. + """ + {{if 'cudaAccessPropertyNormal' in found_values}} + + cudaAccessPropertyNormal = ( + cyruntime.cudaAccessProperty.cudaAccessPropertyNormal, + 'Normal cache persistence.\n' + ){{endif}} + {{if 'cudaAccessPropertyStreaming' in found_values}} + + cudaAccessPropertyStreaming = ( + cyruntime.cudaAccessProperty.cudaAccessPropertyStreaming, + 'Streaming access is less likely to persit from cache.\n' + ){{endif}} + {{if 'cudaAccessPropertyPersisting' in found_values}} + + cudaAccessPropertyPersisting = ( + cyruntime.cudaAccessProperty.cudaAccessPropertyPersisting, + 'Persisting access is more likely to persist in cache.\n' + ){{endif}} + +{{endif}} +{{if 'cudaStreamCaptureStatus' in found_types}} + +class cudaStreamCaptureStatus(_FastEnum): + """ + Possible stream capture statuses returned by + :py:obj:`~.cudaStreamIsCapturing` + """ + {{if 'cudaStreamCaptureStatusNone' in found_values}} + + cudaStreamCaptureStatusNone = ( + cyruntime.cudaStreamCaptureStatus.cudaStreamCaptureStatusNone, + 'Stream is not capturing\n' + ){{endif}} + {{if 'cudaStreamCaptureStatusActive' in found_values}} + + cudaStreamCaptureStatusActive = ( + cyruntime.cudaStreamCaptureStatus.cudaStreamCaptureStatusActive, + 'Stream is actively capturing\n' + ){{endif}} + {{if 'cudaStreamCaptureStatusInvalidated' in found_values}} + + cudaStreamCaptureStatusInvalidated = ( + cyruntime.cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated, + 'Stream is part of a capture sequence that has been invalidated, but not\n' + 'terminated\n' + ){{endif}} + +{{endif}} +{{if 'cudaStreamCaptureMode' in found_types}} + +class cudaStreamCaptureMode(_FastEnum): + """ + Possible modes for stream capture thread interactions. For more + details see :py:obj:`~.cudaStreamBeginCapture` and + :py:obj:`~.cudaThreadExchangeStreamCaptureMode` + """ + {{if 'cudaStreamCaptureModeGlobal' in found_values}} + cudaStreamCaptureModeGlobal = cyruntime.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal{{endif}} + {{if 'cudaStreamCaptureModeThreadLocal' in found_values}} + cudaStreamCaptureModeThreadLocal = cyruntime.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal{{endif}} + {{if 'cudaStreamCaptureModeRelaxed' in found_values}} + cudaStreamCaptureModeRelaxed = cyruntime.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed{{endif}} + +{{endif}} +{{if 'cudaSynchronizationPolicy' in found_types}} + +class cudaSynchronizationPolicy(_FastEnum): + """ + + """ + {{if 'cudaSyncPolicyAuto' in found_values}} + cudaSyncPolicyAuto = cyruntime.cudaSynchronizationPolicy.cudaSyncPolicyAuto{{endif}} + {{if 'cudaSyncPolicySpin' in found_values}} + cudaSyncPolicySpin = cyruntime.cudaSynchronizationPolicy.cudaSyncPolicySpin{{endif}} + {{if 'cudaSyncPolicyYield' in found_values}} + cudaSyncPolicyYield = cyruntime.cudaSynchronizationPolicy.cudaSyncPolicyYield{{endif}} + {{if 'cudaSyncPolicyBlockingSync' in found_values}} + cudaSyncPolicyBlockingSync = cyruntime.cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync{{endif}} + +{{endif}} +{{if 'cudaClusterSchedulingPolicy' in found_types}} + +class cudaClusterSchedulingPolicy(_FastEnum): + """ + Cluster scheduling policies. These may be passed to + :py:obj:`~.cudaFuncSetAttribute` + """ + {{if 'cudaClusterSchedulingPolicyDefault' in found_values}} + + cudaClusterSchedulingPolicyDefault = ( + cyruntime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault, + 'the default policy\n' + ){{endif}} + {{if 'cudaClusterSchedulingPolicySpread' in found_values}} + + cudaClusterSchedulingPolicySpread = ( + cyruntime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread, + 'spread the blocks within a cluster to the SMs\n' + ){{endif}} + {{if 'cudaClusterSchedulingPolicyLoadBalancing' in found_values}} + + cudaClusterSchedulingPolicyLoadBalancing = ( + cyruntime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing, + 'allow the hardware to load-balance the blocks in a cluster to the SMs\n' + ){{endif}} + +{{endif}} +{{if 'cudaStreamUpdateCaptureDependenciesFlags' in found_types}} + +class cudaStreamUpdateCaptureDependenciesFlags(_FastEnum): + """ + Flags for :py:obj:`~.cudaStreamUpdateCaptureDependencies` + """ + {{if 'cudaStreamAddCaptureDependencies' in found_values}} + + cudaStreamAddCaptureDependencies = ( + cyruntime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies, + 'Add new nodes to the dependency set\n' + ){{endif}} + {{if 'cudaStreamSetCaptureDependencies' in found_values}} + + cudaStreamSetCaptureDependencies = ( + cyruntime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies, + 'Replace the dependency set with the new nodes\n' + ){{endif}} + +{{endif}} +{{if 'cudaUserObjectFlags' in found_types}} + +class cudaUserObjectFlags(_FastEnum): + """ + Flags for user objects for graphs + """ + {{if 'cudaUserObjectNoDestructorSync' in found_values}} + + cudaUserObjectNoDestructorSync = ( + cyruntime.cudaUserObjectFlags.cudaUserObjectNoDestructorSync, + 'Indicates the destructor execution is not synchronized by any CUDA handle.\n' + ){{endif}} + +{{endif}} +{{if 'cudaUserObjectRetainFlags' in found_types}} + +class cudaUserObjectRetainFlags(_FastEnum): + """ + Flags for retaining user object references for graphs + """ + {{if 'cudaGraphUserObjectMove' in found_values}} + + cudaGraphUserObjectMove = ( + cyruntime.cudaUserObjectRetainFlags.cudaGraphUserObjectMove, + 'Transfer references from the caller rather than creating new references.\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphicsRegisterFlags' in found_types}} + +class cudaGraphicsRegisterFlags(_FastEnum): + """ + CUDA graphics interop register flags + """ + {{if 'cudaGraphicsRegisterFlagsNone' in found_values}} + + cudaGraphicsRegisterFlagsNone = ( + cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone, + 'Default\n' + ){{endif}} + {{if 'cudaGraphicsRegisterFlagsReadOnly' in found_values}} + + cudaGraphicsRegisterFlagsReadOnly = ( + cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly, + 'CUDA will not write to this resource\n' + ){{endif}} + {{if 'cudaGraphicsRegisterFlagsWriteDiscard' in found_values}} + + cudaGraphicsRegisterFlagsWriteDiscard = ( + cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard, + 'CUDA will only write to and will not read from this resource\n' + ){{endif}} + {{if 'cudaGraphicsRegisterFlagsSurfaceLoadStore' in found_values}} + + cudaGraphicsRegisterFlagsSurfaceLoadStore = ( + cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore, + 'CUDA will bind this resource to a surface reference\n' + ){{endif}} + {{if 'cudaGraphicsRegisterFlagsTextureGather' in found_values}} + + cudaGraphicsRegisterFlagsTextureGather = ( + cyruntime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather, + 'CUDA will perform texture gather operations on this resource\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphicsMapFlags' in found_types}} + +class cudaGraphicsMapFlags(_FastEnum): + """ + CUDA graphics interop map flags + """ + {{if 'cudaGraphicsMapFlagsNone' in found_values}} + + cudaGraphicsMapFlagsNone = ( + cyruntime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone, + 'Default; Assume resource can be read/written\n' + ){{endif}} + {{if 'cudaGraphicsMapFlagsReadOnly' in found_values}} + + cudaGraphicsMapFlagsReadOnly = ( + cyruntime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly, + 'CUDA will not write to this resource\n' + ){{endif}} + {{if 'cudaGraphicsMapFlagsWriteDiscard' in found_values}} + + cudaGraphicsMapFlagsWriteDiscard = ( + cyruntime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard, + 'CUDA will only write to and will not read from this resource\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphicsCubeFace' in found_types}} + +class cudaGraphicsCubeFace(_FastEnum): + """ + CUDA graphics interop array indices for cube maps + """ + {{if 'cudaGraphicsCubeFacePositiveX' in found_values}} + + cudaGraphicsCubeFacePositiveX = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX, + 'Positive X face of cubemap\n' + ){{endif}} + {{if 'cudaGraphicsCubeFaceNegativeX' in found_values}} + + cudaGraphicsCubeFaceNegativeX = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX, + 'Negative X face of cubemap\n' + ){{endif}} + {{if 'cudaGraphicsCubeFacePositiveY' in found_values}} + + cudaGraphicsCubeFacePositiveY = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY, + 'Positive Y face of cubemap\n' + ){{endif}} + {{if 'cudaGraphicsCubeFaceNegativeY' in found_values}} + + cudaGraphicsCubeFaceNegativeY = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY, + 'Negative Y face of cubemap\n' + ){{endif}} + {{if 'cudaGraphicsCubeFacePositiveZ' in found_values}} + + cudaGraphicsCubeFacePositiveZ = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ, + 'Positive Z face of cubemap\n' + ){{endif}} + {{if 'cudaGraphicsCubeFaceNegativeZ' in found_values}} + + cudaGraphicsCubeFaceNegativeZ = ( + cyruntime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ, + 'Negative Z face of cubemap\n' + ){{endif}} + +{{endif}} +{{if 'cudaResourceType' in found_types}} + +class cudaResourceType(_FastEnum): + """ + CUDA resource types + """ + {{if 'cudaResourceTypeArray' in found_values}} + + cudaResourceTypeArray = ( + cyruntime.cudaResourceType.cudaResourceTypeArray, + 'Array resource\n' + ){{endif}} + {{if 'cudaResourceTypeMipmappedArray' in found_values}} + + cudaResourceTypeMipmappedArray = ( + cyruntime.cudaResourceType.cudaResourceTypeMipmappedArray, + 'Mipmapped array resource\n' + ){{endif}} + {{if 'cudaResourceTypeLinear' in found_values}} + + cudaResourceTypeLinear = ( + cyruntime.cudaResourceType.cudaResourceTypeLinear, + 'Linear resource\n' + ){{endif}} + {{if 'cudaResourceTypePitch2D' in found_values}} + + cudaResourceTypePitch2D = ( + cyruntime.cudaResourceType.cudaResourceTypePitch2D, + 'Pitch 2D resource\n' + ){{endif}} + +{{endif}} +{{if 'cudaResourceViewFormat' in found_types}} + +class cudaResourceViewFormat(_FastEnum): + """ + CUDA texture resource view formats + """ + {{if 'cudaResViewFormatNone' in found_values}} + + cudaResViewFormatNone = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatNone, + 'No resource view format (use underlying resource format)\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedChar1' in found_values}} + + cudaResViewFormatUnsignedChar1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar1, + '1 channel unsigned 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedChar2' in found_values}} + + cudaResViewFormatUnsignedChar2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar2, + '2 channel unsigned 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedChar4' in found_values}} + + cudaResViewFormatUnsignedChar4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar4, + '4 channel unsigned 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedChar1' in found_values}} + + cudaResViewFormatSignedChar1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedChar1, + '1 channel signed 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedChar2' in found_values}} + + cudaResViewFormatSignedChar2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedChar2, + '2 channel signed 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedChar4' in found_values}} + + cudaResViewFormatSignedChar4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedChar4, + '4 channel signed 8-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedShort1' in found_values}} + + cudaResViewFormatUnsignedShort1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort1, + '1 channel unsigned 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedShort2' in found_values}} + + cudaResViewFormatUnsignedShort2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort2, + '2 channel unsigned 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedShort4' in found_values}} + + cudaResViewFormatUnsignedShort4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort4, + '4 channel unsigned 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedShort1' in found_values}} + + cudaResViewFormatSignedShort1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedShort1, + '1 channel signed 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedShort2' in found_values}} + + cudaResViewFormatSignedShort2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedShort2, + '2 channel signed 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedShort4' in found_values}} + + cudaResViewFormatSignedShort4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedShort4, + '4 channel signed 16-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedInt1' in found_values}} + + cudaResViewFormatUnsignedInt1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt1, + '1 channel unsigned 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedInt2' in found_values}} + + cudaResViewFormatUnsignedInt2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt2, + '2 channel unsigned 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedInt4' in found_values}} + + cudaResViewFormatUnsignedInt4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt4, + '4 channel unsigned 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedInt1' in found_values}} + + cudaResViewFormatSignedInt1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedInt1, + '1 channel signed 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedInt2' in found_values}} + + cudaResViewFormatSignedInt2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedInt2, + '2 channel signed 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatSignedInt4' in found_values}} + + cudaResViewFormatSignedInt4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedInt4, + '4 channel signed 32-bit integers\n' + ){{endif}} + {{if 'cudaResViewFormatHalf1' in found_values}} + + cudaResViewFormatHalf1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatHalf1, + '1 channel 16-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatHalf2' in found_values}} + + cudaResViewFormatHalf2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatHalf2, + '2 channel 16-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatHalf4' in found_values}} + + cudaResViewFormatHalf4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatHalf4, + '4 channel 16-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatFloat1' in found_values}} + + cudaResViewFormatFloat1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatFloat1, + '1 channel 32-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatFloat2' in found_values}} + + cudaResViewFormatFloat2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatFloat2, + '2 channel 32-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatFloat4' in found_values}} + + cudaResViewFormatFloat4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatFloat4, + '4 channel 32-bit floating point\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed1' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed1 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1, + 'Block compressed 1\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed2' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed2 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2, + 'Block compressed 2\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed3' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed3 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3, + 'Block compressed 3\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed4' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4, + 'Block compressed 4 unsigned\n' + ){{endif}} + {{if 'cudaResViewFormatSignedBlockCompressed4' in found_values}} + + cudaResViewFormatSignedBlockCompressed4 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4, + 'Block compressed 4 signed\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed5' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed5 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5, + 'Block compressed 5 unsigned\n' + ){{endif}} + {{if 'cudaResViewFormatSignedBlockCompressed5' in found_values}} + + cudaResViewFormatSignedBlockCompressed5 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5, + 'Block compressed 5 signed\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed6H' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed6H = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H, + 'Block compressed 6 unsigned half-float\n' + ){{endif}} + {{if 'cudaResViewFormatSignedBlockCompressed6H' in found_values}} + + cudaResViewFormatSignedBlockCompressed6H = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H, + 'Block compressed 6 signed half-float\n' + ){{endif}} + {{if 'cudaResViewFormatUnsignedBlockCompressed7' in found_values}} + + cudaResViewFormatUnsignedBlockCompressed7 = ( + cyruntime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7, + 'Block compressed 7\n' + ){{endif}} + +{{endif}} +{{if 'cudaFuncAttribute' in found_types}} + +class cudaFuncAttribute(_FastEnum): + """ + CUDA function attributes that can be set using + :py:obj:`~.cudaFuncSetAttribute` + """ + {{if 'cudaFuncAttributeMaxDynamicSharedMemorySize' in found_values}} + + cudaFuncAttributeMaxDynamicSharedMemorySize = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize, + 'Maximum dynamic shared memory size\n' + ){{endif}} + {{if 'cudaFuncAttributePreferredSharedMemoryCarveout' in found_values}} + + cudaFuncAttributePreferredSharedMemoryCarveout = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout, + 'Preferred shared memory-L1 cache split\n' + ){{endif}} + {{if 'cudaFuncAttributeClusterDimMustBeSet' in found_values}} + + cudaFuncAttributeClusterDimMustBeSet = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet, + 'Indicator to enforce valid cluster dimension specification on kernel launch\n' + ){{endif}} + {{if 'cudaFuncAttributeRequiredClusterWidth' in found_values}} + + cudaFuncAttributeRequiredClusterWidth = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth, + 'Required cluster width\n' + ){{endif}} + {{if 'cudaFuncAttributeRequiredClusterHeight' in found_values}} + + cudaFuncAttributeRequiredClusterHeight = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight, + 'Required cluster height\n' + ){{endif}} + {{if 'cudaFuncAttributeRequiredClusterDepth' in found_values}} + + cudaFuncAttributeRequiredClusterDepth = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth, + 'Required cluster depth\n' + ){{endif}} + {{if 'cudaFuncAttributeNonPortableClusterSizeAllowed' in found_values}} + + cudaFuncAttributeNonPortableClusterSizeAllowed = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed, + 'Whether non-portable cluster scheduling policy is supported\n' + ){{endif}} + {{if 'cudaFuncAttributeClusterSchedulingPolicyPreference' in found_values}} + + cudaFuncAttributeClusterSchedulingPolicyPreference = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference, + 'Required cluster scheduling policy preference\n' + ){{endif}} + {{if 'cudaFuncAttributeMax' in found_values}} + cudaFuncAttributeMax = cyruntime.cudaFuncAttribute.cudaFuncAttributeMax{{endif}} + +{{endif}} +{{if 'cudaFuncCache' in found_types}} + +class cudaFuncCache(_FastEnum): + """ + CUDA function cache configurations + """ + {{if 'cudaFuncCachePreferNone' in found_values}} + + cudaFuncCachePreferNone = ( + cyruntime.cudaFuncCache.cudaFuncCachePreferNone, + 'Default function cache configuration, no preference\n' + ){{endif}} + {{if 'cudaFuncCachePreferShared' in found_values}} + + cudaFuncCachePreferShared = ( + cyruntime.cudaFuncCache.cudaFuncCachePreferShared, + 'Prefer larger shared memory and smaller L1 cache\n' + ){{endif}} + {{if 'cudaFuncCachePreferL1' in found_values}} + + cudaFuncCachePreferL1 = ( + cyruntime.cudaFuncCache.cudaFuncCachePreferL1, + 'Prefer larger L1 cache and smaller shared memory\n' + ){{endif}} + {{if 'cudaFuncCachePreferEqual' in found_values}} + + cudaFuncCachePreferEqual = ( + cyruntime.cudaFuncCache.cudaFuncCachePreferEqual, + 'Prefer equal size L1 cache and shared memory\n' + ){{endif}} + +{{endif}} +{{if 'cudaSharedMemConfig' in found_types}} + +class cudaSharedMemConfig(_FastEnum): + """ + CUDA shared memory configuration [Deprecated] + """ + {{if 'cudaSharedMemBankSizeDefault' in found_values}} + cudaSharedMemBankSizeDefault = cyruntime.cudaSharedMemConfig.cudaSharedMemBankSizeDefault{{endif}} + {{if 'cudaSharedMemBankSizeFourByte' in found_values}} + cudaSharedMemBankSizeFourByte = cyruntime.cudaSharedMemConfig.cudaSharedMemBankSizeFourByte{{endif}} + {{if 'cudaSharedMemBankSizeEightByte' in found_values}} + cudaSharedMemBankSizeEightByte = cyruntime.cudaSharedMemConfig.cudaSharedMemBankSizeEightByte{{endif}} + +{{endif}} +{{if 'cudaSharedCarveout' in found_types}} + +class cudaSharedCarveout(_FastEnum): + """ + Shared memory carveout configurations. These may be passed to + cudaFuncSetAttribute + """ + {{if 'cudaSharedmemCarveoutDefault' in found_values}} + + cudaSharedmemCarveoutDefault = ( + cyruntime.cudaSharedCarveout.cudaSharedmemCarveoutDefault, + 'No preference for shared memory or L1 (default)\n' + ){{endif}} + {{if 'cudaSharedmemCarveoutMaxL1' in found_values}} + + cudaSharedmemCarveoutMaxL1 = ( + cyruntime.cudaSharedCarveout.cudaSharedmemCarveoutMaxL1, + 'Prefer maximum available L1 cache, minimum shared memory\n' + ){{endif}} + {{if 'cudaSharedmemCarveoutMaxShared' in found_values}} + + cudaSharedmemCarveoutMaxShared = ( + cyruntime.cudaSharedCarveout.cudaSharedmemCarveoutMaxShared, + 'Prefer maximum available shared memory, minimum L1 cache\n' + ){{endif}} + +{{endif}} +{{if 'cudaComputeMode' in found_types}} + +class cudaComputeMode(_FastEnum): + """ + CUDA device compute modes + """ + {{if 'cudaComputeModeDefault' in found_values}} + + cudaComputeModeDefault = ( + cyruntime.cudaComputeMode.cudaComputeModeDefault, + 'Default compute mode (Multiple threads can use :py:obj:`~.cudaSetDevice()`\n' + 'with this device)\n' + ){{endif}} + {{if 'cudaComputeModeExclusive' in found_values}} + + cudaComputeModeExclusive = ( + cyruntime.cudaComputeMode.cudaComputeModeExclusive, + 'Compute-exclusive-thread mode (Only one thread in one process will be able\n' + 'to use :py:obj:`~.cudaSetDevice()` with this device)\n' + ){{endif}} + {{if 'cudaComputeModeProhibited' in found_values}} + + cudaComputeModeProhibited = ( + cyruntime.cudaComputeMode.cudaComputeModeProhibited, + 'Compute-prohibited mode (No threads can use :py:obj:`~.cudaSetDevice()`\n' + 'with this device)\n' + ){{endif}} + {{if 'cudaComputeModeExclusiveProcess' in found_values}} + + cudaComputeModeExclusiveProcess = ( + cyruntime.cudaComputeMode.cudaComputeModeExclusiveProcess, + 'Compute-exclusive-process mode (Many threads in one process will be able to\n' + 'use :py:obj:`~.cudaSetDevice()` with this device)\n' + ){{endif}} + +{{endif}} +{{if 'cudaLimit' in found_types}} + +class cudaLimit(_FastEnum): + """ + CUDA Limits + """ + {{if 'cudaLimitStackSize' in found_values}} + + cudaLimitStackSize = ( + cyruntime.cudaLimit.cudaLimitStackSize, + 'GPU thread stack size\n' + ){{endif}} + {{if 'cudaLimitPrintfFifoSize' in found_values}} + + cudaLimitPrintfFifoSize = ( + cyruntime.cudaLimit.cudaLimitPrintfFifoSize, + 'GPU printf FIFO size\n' + ){{endif}} + {{if 'cudaLimitMallocHeapSize' in found_values}} + + cudaLimitMallocHeapSize = ( + cyruntime.cudaLimit.cudaLimitMallocHeapSize, + 'GPU malloc heap size\n' + ){{endif}} + {{if 'cudaLimitDevRuntimeSyncDepth' in found_values}} + + cudaLimitDevRuntimeSyncDepth = ( + cyruntime.cudaLimit.cudaLimitDevRuntimeSyncDepth, + 'GPU device runtime synchronize depth\n' + ){{endif}} + {{if 'cudaLimitDevRuntimePendingLaunchCount' in found_values}} + + cudaLimitDevRuntimePendingLaunchCount = ( + cyruntime.cudaLimit.cudaLimitDevRuntimePendingLaunchCount, + 'GPU device runtime pending launch count\n' + ){{endif}} + {{if 'cudaLimitMaxL2FetchGranularity' in found_values}} + + cudaLimitMaxL2FetchGranularity = ( + cyruntime.cudaLimit.cudaLimitMaxL2FetchGranularity, + 'A value between 0 and 128 that indicates the maximum fetch granularity of\n' + 'L2 (in Bytes). This is a hint\n' + ){{endif}} + {{if 'cudaLimitPersistingL2CacheSize' in found_values}} + + cudaLimitPersistingL2CacheSize = ( + cyruntime.cudaLimit.cudaLimitPersistingL2CacheSize, + 'A size in bytes for L2 persisting lines cache size\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemoryAdvise' in found_types}} + +class cudaMemoryAdvise(_FastEnum): + """ + CUDA Memory Advise values + """ + {{if 'cudaMemAdviseSetReadMostly' in found_values}} + + cudaMemAdviseSetReadMostly = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseSetReadMostly, + 'Data will mostly be read and only occassionally be written to\n' + ){{endif}} + {{if 'cudaMemAdviseUnsetReadMostly' in found_values}} + + cudaMemAdviseUnsetReadMostly = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly, + 'Undo the effect of :py:obj:`~.cudaMemAdviseSetReadMostly`\n' + ){{endif}} + {{if 'cudaMemAdviseSetPreferredLocation' in found_values}} + + cudaMemAdviseSetPreferredLocation = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation, + 'Set the preferred location for the data as the specified device\n' + ){{endif}} + {{if 'cudaMemAdviseUnsetPreferredLocation' in found_values}} + + cudaMemAdviseUnsetPreferredLocation = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation, + 'Clear the preferred location for the data\n' + ){{endif}} + {{if 'cudaMemAdviseSetAccessedBy' in found_values}} + + cudaMemAdviseSetAccessedBy = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseSetAccessedBy, + 'Data will be accessed by the specified device, so prevent page faults as\n' + 'much as possible\n' + ){{endif}} + {{if 'cudaMemAdviseUnsetAccessedBy' in found_values}} + + cudaMemAdviseUnsetAccessedBy = ( + cyruntime.cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy, + 'Let the Unified Memory subsystem decide on the page faulting policy for the\n' + 'specified device\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemRangeAttribute' in found_types}} + +class cudaMemRangeAttribute(_FastEnum): + """ + CUDA range attributes + """ + {{if 'cudaMemRangeAttributeReadMostly' in found_values}} + + cudaMemRangeAttributeReadMostly = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly, + 'Whether the range will mostly be read and only occassionally be written to\n' + ){{endif}} + {{if 'cudaMemRangeAttributePreferredLocation' in found_values}} + + cudaMemRangeAttributePreferredLocation = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation, + 'The preferred location of the range\n' + ){{endif}} + {{if 'cudaMemRangeAttributeAccessedBy' in found_values}} + + cudaMemRangeAttributeAccessedBy = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy, + 'Memory range has :py:obj:`~.cudaMemAdviseSetAccessedBy` set for specified\n' + 'device\n' + ){{endif}} + {{if 'cudaMemRangeAttributeLastPrefetchLocation' in found_values}} + + cudaMemRangeAttributeLastPrefetchLocation = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation, + 'The last location to which the range was prefetched\n' + ){{endif}} + {{if 'cudaMemRangeAttributePreferredLocationType' in found_values}} + + cudaMemRangeAttributePreferredLocationType = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType, + 'The preferred location type of the range\n' + ){{endif}} + {{if 'cudaMemRangeAttributePreferredLocationId' in found_values}} + + cudaMemRangeAttributePreferredLocationId = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId, + 'The preferred location id of the range\n' + ){{endif}} + {{if 'cudaMemRangeAttributeLastPrefetchLocationType' in found_values}} + + cudaMemRangeAttributeLastPrefetchLocationType = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType, + 'The last location type to which the range was prefetched\n' + ){{endif}} + {{if 'cudaMemRangeAttributeLastPrefetchLocationId' in found_values}} + + cudaMemRangeAttributeLastPrefetchLocationId = ( + cyruntime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId, + 'The last location id to which the range was prefetched\n' + ){{endif}} + +{{endif}} +{{if 'cudaFlushGPUDirectRDMAWritesOptions' in found_types}} + +class cudaFlushGPUDirectRDMAWritesOptions(_FastEnum): + """ + CUDA GPUDirect RDMA flush writes APIs supported on the device + """ + {{if 'cudaFlushGPUDirectRDMAWritesOptionHost' in found_values}} + + cudaFlushGPUDirectRDMAWritesOptionHost = ( + cyruntime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost, + ':py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` and its CUDA Driver API\n' + 'counterpart are supported on the device.\n' + ){{endif}} + {{if 'cudaFlushGPUDirectRDMAWritesOptionMemOps' in found_values}} + + cudaFlushGPUDirectRDMAWritesOptionMemOps = ( + cyruntime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps, + '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' + 'CUDA device.\n' + ){{endif}} + +{{endif}} +{{if 'cudaGPUDirectRDMAWritesOrdering' in found_types}} + +class cudaGPUDirectRDMAWritesOrdering(_FastEnum): + """ + CUDA GPUDirect RDMA flush writes ordering features of the device + """ + {{if 'cudaGPUDirectRDMAWritesOrderingNone' in found_values}} + + cudaGPUDirectRDMAWritesOrderingNone = ( + cyruntime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone, + 'The device does not natively support ordering of GPUDirect RDMA writes.\n' + ':py:obj:`~.cudaFlushGPUDirectRDMAWrites()` can be leveraged if supported.\n' + ){{endif}} + {{if 'cudaGPUDirectRDMAWritesOrderingOwner' in found_values}} + + cudaGPUDirectRDMAWritesOrderingOwner = ( + cyruntime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner, + 'Natively, the device can consistently consume GPUDirect RDMA writes,\n' + 'although other CUDA devices may not.\n' + ){{endif}} + {{if 'cudaGPUDirectRDMAWritesOrderingAllDevices' in found_values}} + + cudaGPUDirectRDMAWritesOrderingAllDevices = ( + cyruntime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices, + 'Any CUDA device in the system can consistently consume GPUDirect RDMA\n' + 'writes to this device.\n' + ){{endif}} + +{{endif}} +{{if 'cudaFlushGPUDirectRDMAWritesScope' in found_types}} + +class cudaFlushGPUDirectRDMAWritesScope(_FastEnum): + """ + CUDA GPUDirect RDMA flush writes scopes + """ + {{if 'cudaFlushGPUDirectRDMAWritesToOwner' in found_values}} + + cudaFlushGPUDirectRDMAWritesToOwner = ( + cyruntime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner, + 'Blocks until remote writes are visible to the CUDA device context owning\n' + 'the data.\n' + ){{endif}} + {{if 'cudaFlushGPUDirectRDMAWritesToAllDevices' in found_values}} + + cudaFlushGPUDirectRDMAWritesToAllDevices = ( + cyruntime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices, + 'Blocks until remote writes are visible to all CUDA device contexts.\n' + ){{endif}} + +{{endif}} +{{if 'cudaFlushGPUDirectRDMAWritesTarget' in found_types}} + +class cudaFlushGPUDirectRDMAWritesTarget(_FastEnum): + """ + CUDA GPUDirect RDMA flush writes targets + """ + {{if 'cudaFlushGPUDirectRDMAWritesTargetCurrentDevice' in found_values}} + + cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = ( + cyruntime.cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice, + 'Sets the target for :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` to the\n' + 'currently active CUDA device context.\n' + ){{endif}} + +{{endif}} +{{if 'cudaDeviceAttr' in found_types}} + +class cudaDeviceAttr(_FastEnum): + """ + CUDA device attributes + """ + {{if 'cudaDevAttrMaxThreadsPerBlock' in found_values}} + + cudaDevAttrMaxThreadsPerBlock = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock, + 'Maximum number of threads per block\n' + ){{endif}} + {{if 'cudaDevAttrMaxBlockDimX' in found_values}} + + cudaDevAttrMaxBlockDimX = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxBlockDimX, + 'Maximum block dimension X\n' + ){{endif}} + {{if 'cudaDevAttrMaxBlockDimY' in found_values}} + + cudaDevAttrMaxBlockDimY = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxBlockDimY, + 'Maximum block dimension Y\n' + ){{endif}} + {{if 'cudaDevAttrMaxBlockDimZ' in found_values}} + + cudaDevAttrMaxBlockDimZ = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxBlockDimZ, + 'Maximum block dimension Z\n' + ){{endif}} + {{if 'cudaDevAttrMaxGridDimX' in found_values}} + + cudaDevAttrMaxGridDimX = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxGridDimX, + 'Maximum grid dimension X\n' + ){{endif}} + {{if 'cudaDevAttrMaxGridDimY' in found_values}} + + cudaDevAttrMaxGridDimY = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxGridDimY, + 'Maximum grid dimension Y\n' + ){{endif}} + {{if 'cudaDevAttrMaxGridDimZ' in found_values}} + + cudaDevAttrMaxGridDimZ = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxGridDimZ, + 'Maximum grid dimension Z\n' + ){{endif}} + {{if 'cudaDevAttrMaxSharedMemoryPerBlock' in found_values}} + + cudaDevAttrMaxSharedMemoryPerBlock = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock, + 'Maximum shared memory available per block in bytes\n' + ){{endif}} + {{if 'cudaDevAttrTotalConstantMemory' in found_values}} + + cudaDevAttrTotalConstantMemory = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTotalConstantMemory, + 'Memory available on device for constant variables in a CUDA C kernel in\n' + 'bytes\n' + ){{endif}} + {{if 'cudaDevAttrWarpSize' in found_values}} + + cudaDevAttrWarpSize = ( + cyruntime.cudaDeviceAttr.cudaDevAttrWarpSize, + 'Warp size in threads\n' + ){{endif}} + {{if 'cudaDevAttrMaxPitch' in found_values}} + + cudaDevAttrMaxPitch = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxPitch, + 'Maximum pitch in bytes allowed by memory copies\n' + ){{endif}} + {{if 'cudaDevAttrMaxRegistersPerBlock' in found_values}} + + cudaDevAttrMaxRegistersPerBlock = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock, + 'Maximum number of 32-bit registers available per block\n' + ){{endif}} + {{if 'cudaDevAttrClockRate' in found_values}} + + cudaDevAttrClockRate = ( + cyruntime.cudaDeviceAttr.cudaDevAttrClockRate, + 'Peak clock frequency in kilohertz\n' + ){{endif}} + {{if 'cudaDevAttrTextureAlignment' in found_values}} + + cudaDevAttrTextureAlignment = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTextureAlignment, + 'Alignment requirement for textures\n' + ){{endif}} + {{if 'cudaDevAttrGpuOverlap' in found_values}} + + cudaDevAttrGpuOverlap = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGpuOverlap, + 'Device can possibly copy memory and execute a kernel concurrently\n' + ){{endif}} + {{if 'cudaDevAttrMultiProcessorCount' in found_values}} + + cudaDevAttrMultiProcessorCount = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMultiProcessorCount, + 'Number of multiprocessors on device\n' + ){{endif}} + {{if 'cudaDevAttrKernelExecTimeout' in found_values}} + + cudaDevAttrKernelExecTimeout = ( + cyruntime.cudaDeviceAttr.cudaDevAttrKernelExecTimeout, + 'Specifies whether there is a run time limit on kernels\n' + ){{endif}} + {{if 'cudaDevAttrIntegrated' in found_values}} + + cudaDevAttrIntegrated = ( + cyruntime.cudaDeviceAttr.cudaDevAttrIntegrated, + 'Device is integrated with host memory\n' + ){{endif}} + {{if 'cudaDevAttrCanMapHostMemory' in found_values}} + + cudaDevAttrCanMapHostMemory = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCanMapHostMemory, + 'Device can map host memory into CUDA address space\n' + ){{endif}} + {{if 'cudaDevAttrComputeMode' in found_values}} + + cudaDevAttrComputeMode = ( + cyruntime.cudaDeviceAttr.cudaDevAttrComputeMode, + 'Compute mode (See :py:obj:`~.cudaComputeMode` for details)\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture1DWidth' in found_values}} + + cudaDevAttrMaxTexture1DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth, + 'Maximum 1D texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DWidth' in found_values}} + + cudaDevAttrMaxTexture2DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth, + 'Maximum 2D texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DHeight' in found_values}} + + cudaDevAttrMaxTexture2DHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight, + 'Maximum 2D texture height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DWidth' in found_values}} + + cudaDevAttrMaxTexture3DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth, + 'Maximum 3D texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DHeight' in found_values}} + + cudaDevAttrMaxTexture3DHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight, + 'Maximum 3D texture height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DDepth' in found_values}} + + cudaDevAttrMaxTexture3DDepth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth, + 'Maximum 3D texture depth\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLayeredWidth' in found_values}} + + cudaDevAttrMaxTexture2DLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth, + 'Maximum 2D layered texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLayeredHeight' in found_values}} + + cudaDevAttrMaxTexture2DLayeredHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight, + 'Maximum 2D layered texture height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLayeredLayers' in found_values}} + + cudaDevAttrMaxTexture2DLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers, + 'Maximum layers in a 2D layered texture\n' + ){{endif}} + {{if 'cudaDevAttrSurfaceAlignment' in found_values}} + + cudaDevAttrSurfaceAlignment = ( + cyruntime.cudaDeviceAttr.cudaDevAttrSurfaceAlignment, + 'Alignment requirement for surfaces\n' + ){{endif}} + {{if 'cudaDevAttrConcurrentKernels' in found_values}} + + cudaDevAttrConcurrentKernels = ( + cyruntime.cudaDeviceAttr.cudaDevAttrConcurrentKernels, + 'Device can possibly execute multiple kernels concurrently\n' + ){{endif}} + {{if 'cudaDevAttrEccEnabled' in found_values}} + + cudaDevAttrEccEnabled = ( + cyruntime.cudaDeviceAttr.cudaDevAttrEccEnabled, + 'Device has ECC support enabled\n' + ){{endif}} + {{if 'cudaDevAttrPciBusId' in found_values}} + + cudaDevAttrPciBusId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrPciBusId, + 'PCI bus ID of the device\n' + ){{endif}} + {{if 'cudaDevAttrPciDeviceId' in found_values}} + + cudaDevAttrPciDeviceId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrPciDeviceId, + 'PCI device ID of the device\n' + ){{endif}} + {{if 'cudaDevAttrTccDriver' in found_values}} + + cudaDevAttrTccDriver = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTccDriver, + 'Device is using TCC driver model\n' + ){{endif}} + {{if 'cudaDevAttrMemoryClockRate' in found_values}} + + cudaDevAttrMemoryClockRate = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMemoryClockRate, + 'Peak memory clock frequency in kilohertz\n' + ){{endif}} + {{if 'cudaDevAttrGlobalMemoryBusWidth' in found_values}} + + cudaDevAttrGlobalMemoryBusWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth, + 'Global memory bus width in bits\n' + ){{endif}} + {{if 'cudaDevAttrL2CacheSize' in found_values}} + + cudaDevAttrL2CacheSize = ( + cyruntime.cudaDeviceAttr.cudaDevAttrL2CacheSize, + 'Size of L2 cache in bytes\n' + ){{endif}} + {{if 'cudaDevAttrMaxThreadsPerMultiProcessor' in found_values}} + + cudaDevAttrMaxThreadsPerMultiProcessor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor, + 'Maximum resident threads per multiprocessor\n' + ){{endif}} + {{if 'cudaDevAttrAsyncEngineCount' in found_values}} + + cudaDevAttrAsyncEngineCount = ( + cyruntime.cudaDeviceAttr.cudaDevAttrAsyncEngineCount, + 'Number of asynchronous engines\n' + ){{endif}} + {{if 'cudaDevAttrUnifiedAddressing' in found_values}} + + cudaDevAttrUnifiedAddressing = ( + cyruntime.cudaDeviceAttr.cudaDevAttrUnifiedAddressing, + 'Device shares a unified address space with the host\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture1DLayeredWidth' in found_values}} + + cudaDevAttrMaxTexture1DLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth, + 'Maximum 1D layered texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture1DLayeredLayers' in found_values}} + + cudaDevAttrMaxTexture1DLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers, + 'Maximum layers in a 1D layered texture\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DGatherWidth' in found_values}} + + cudaDevAttrMaxTexture2DGatherWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth, + 'Maximum 2D texture width if cudaArrayTextureGather is set\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DGatherHeight' in found_values}} + + cudaDevAttrMaxTexture2DGatherHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight, + 'Maximum 2D texture height if cudaArrayTextureGather is set\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DWidthAlt' in found_values}} + + cudaDevAttrMaxTexture3DWidthAlt = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt, + 'Alternate maximum 3D texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DHeightAlt' in found_values}} + + cudaDevAttrMaxTexture3DHeightAlt = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt, + 'Alternate maximum 3D texture height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture3DDepthAlt' in found_values}} + + cudaDevAttrMaxTexture3DDepthAlt = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt, + 'Alternate maximum 3D texture depth\n' + ){{endif}} + {{if 'cudaDevAttrPciDomainId' in found_values}} + + cudaDevAttrPciDomainId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrPciDomainId, + 'PCI domain ID of the device\n' + ){{endif}} + {{if 'cudaDevAttrTexturePitchAlignment' in found_values}} + + cudaDevAttrTexturePitchAlignment = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTexturePitchAlignment, + 'Pitch alignment requirement for textures\n' + ){{endif}} + {{if 'cudaDevAttrMaxTextureCubemapWidth' in found_values}} + + cudaDevAttrMaxTextureCubemapWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth, + 'Maximum cubemap texture width/height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTextureCubemapLayeredWidth' in found_values}} + + cudaDevAttrMaxTextureCubemapLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth, + 'Maximum cubemap layered texture width/height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTextureCubemapLayeredLayers' in found_values}} + + cudaDevAttrMaxTextureCubemapLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers, + 'Maximum layers in a cubemap layered texture\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface1DWidth' in found_values}} + + cudaDevAttrMaxSurface1DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth, + 'Maximum 1D surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface2DWidth' in found_values}} + + cudaDevAttrMaxSurface2DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth, + 'Maximum 2D surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface2DHeight' in found_values}} + + cudaDevAttrMaxSurface2DHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight, + 'Maximum 2D surface height\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface3DWidth' in found_values}} + + cudaDevAttrMaxSurface3DWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth, + 'Maximum 3D surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface3DHeight' in found_values}} + + cudaDevAttrMaxSurface3DHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight, + 'Maximum 3D surface height\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface3DDepth' in found_values}} + + cudaDevAttrMaxSurface3DDepth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth, + 'Maximum 3D surface depth\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface1DLayeredWidth' in found_values}} + + cudaDevAttrMaxSurface1DLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth, + 'Maximum 1D layered surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface1DLayeredLayers' in found_values}} + + cudaDevAttrMaxSurface1DLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers, + 'Maximum layers in a 1D layered surface\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface2DLayeredWidth' in found_values}} + + cudaDevAttrMaxSurface2DLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth, + 'Maximum 2D layered surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface2DLayeredHeight' in found_values}} + + cudaDevAttrMaxSurface2DLayeredHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight, + 'Maximum 2D layered surface height\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurface2DLayeredLayers' in found_values}} + + cudaDevAttrMaxSurface2DLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers, + 'Maximum layers in a 2D layered surface\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurfaceCubemapWidth' in found_values}} + + cudaDevAttrMaxSurfaceCubemapWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth, + 'Maximum cubemap surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurfaceCubemapLayeredWidth' in found_values}} + + cudaDevAttrMaxSurfaceCubemapLayeredWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth, + 'Maximum cubemap layered surface width\n' + ){{endif}} + {{if 'cudaDevAttrMaxSurfaceCubemapLayeredLayers' in found_values}} + + cudaDevAttrMaxSurfaceCubemapLayeredLayers = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers, + 'Maximum layers in a cubemap layered surface\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture1DLinearWidth' in found_values}} + + cudaDevAttrMaxTexture1DLinearWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth, + 'Maximum 1D linear texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLinearWidth' in found_values}} + + cudaDevAttrMaxTexture2DLinearWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth, + 'Maximum 2D linear texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLinearHeight' in found_values}} + + cudaDevAttrMaxTexture2DLinearHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight, + 'Maximum 2D linear texture height\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DLinearPitch' in found_values}} + + cudaDevAttrMaxTexture2DLinearPitch = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch, + 'Maximum 2D linear texture pitch in bytes\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DMipmappedWidth' in found_values}} + + cudaDevAttrMaxTexture2DMipmappedWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth, + 'Maximum mipmapped 2D texture width\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture2DMipmappedHeight' in found_values}} + + cudaDevAttrMaxTexture2DMipmappedHeight = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight, + 'Maximum mipmapped 2D texture height\n' + ){{endif}} + {{if 'cudaDevAttrComputeCapabilityMajor' in found_values}} + + cudaDevAttrComputeCapabilityMajor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, + 'Major compute capability version number\n' + ){{endif}} + {{if 'cudaDevAttrComputeCapabilityMinor' in found_values}} + + cudaDevAttrComputeCapabilityMinor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, + 'Minor compute capability version number\n' + ){{endif}} + {{if 'cudaDevAttrMaxTexture1DMipmappedWidth' in found_values}} + + cudaDevAttrMaxTexture1DMipmappedWidth = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth, + 'Maximum mipmapped 1D texture width\n' + ){{endif}} + {{if 'cudaDevAttrStreamPrioritiesSupported' in found_values}} + + cudaDevAttrStreamPrioritiesSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported, + 'Device supports stream priorities\n' + ){{endif}} + {{if 'cudaDevAttrGlobalL1CacheSupported' in found_values}} + + cudaDevAttrGlobalL1CacheSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported, + 'Device supports caching globals in L1\n' + ){{endif}} + {{if 'cudaDevAttrLocalL1CacheSupported' in found_values}} + + cudaDevAttrLocalL1CacheSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported, + 'Device supports caching locals in L1\n' + ){{endif}} + {{if 'cudaDevAttrMaxSharedMemoryPerMultiprocessor' in found_values}} + + cudaDevAttrMaxSharedMemoryPerMultiprocessor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor, + 'Maximum shared memory available per multiprocessor in bytes\n' + ){{endif}} + {{if 'cudaDevAttrMaxRegistersPerMultiprocessor' in found_values}} + + cudaDevAttrMaxRegistersPerMultiprocessor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor, + 'Maximum number of 32-bit registers available per multiprocessor\n' + ){{endif}} + {{if 'cudaDevAttrManagedMemory' in found_values}} + + cudaDevAttrManagedMemory = ( + cyruntime.cudaDeviceAttr.cudaDevAttrManagedMemory, + 'Device can allocate managed memory on this system\n' + ){{endif}} + {{if 'cudaDevAttrIsMultiGpuBoard' in found_values}} + + cudaDevAttrIsMultiGpuBoard = ( + cyruntime.cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard, + 'Device is on a multi-GPU board\n' + ){{endif}} + {{if 'cudaDevAttrMultiGpuBoardGroupID' in found_values}} + + cudaDevAttrMultiGpuBoardGroupID = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID, + 'Unique identifier for a group of devices on the same multi-GPU board\n' + ){{endif}} + {{if 'cudaDevAttrHostNativeAtomicSupported' in found_values}} + + cudaDevAttrHostNativeAtomicSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported, + 'Link between the device and the host supports native atomic operations\n' + ){{endif}} + {{if 'cudaDevAttrSingleToDoublePrecisionPerfRatio' in found_values}} + + cudaDevAttrSingleToDoublePrecisionPerfRatio = ( + cyruntime.cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio, + 'Ratio of single precision performance (in floating-point operations per\n' + 'second) to double precision performance\n' + ){{endif}} + {{if 'cudaDevAttrPageableMemoryAccess' in found_values}} + + cudaDevAttrPageableMemoryAccess = ( + cyruntime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccess, + 'Device supports coherently accessing pageable memory without calling\n' + 'cudaHostRegister on it\n' + ){{endif}} + {{if 'cudaDevAttrConcurrentManagedAccess' in found_values}} + + cudaDevAttrConcurrentManagedAccess = ( + cyruntime.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess, + 'Device can coherently access managed memory concurrently with the CPU\n' + ){{endif}} + {{if 'cudaDevAttrComputePreemptionSupported' in found_values}} + + cudaDevAttrComputePreemptionSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrComputePreemptionSupported, + 'Device supports Compute Preemption\n' + ){{endif}} + {{if 'cudaDevAttrCanUseHostPointerForRegisteredMem' in found_values}} + + cudaDevAttrCanUseHostPointerForRegisteredMem = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem, + 'Device can access host registered memory at the same virtual address as the\n' + 'CPU\n' + ){{endif}} + {{if 'cudaDevAttrReserved92' in found_values}} + cudaDevAttrReserved92 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved92{{endif}} + {{if 'cudaDevAttrReserved93' in found_values}} + cudaDevAttrReserved93 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved93{{endif}} + {{if 'cudaDevAttrReserved94' in found_values}} + cudaDevAttrReserved94 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved94{{endif}} + {{if 'cudaDevAttrCooperativeLaunch' in found_values}} + + cudaDevAttrCooperativeLaunch = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCooperativeLaunch, + 'Device supports launching cooperative kernels via\n' + ':py:obj:`~.cudaLaunchCooperativeKernel`\n' + ){{endif}} + {{if 'cudaDevAttrCooperativeMultiDeviceLaunch' in found_values}} + + cudaDevAttrCooperativeMultiDeviceLaunch = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch, + 'Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated.\n' + ){{endif}} + {{if 'cudaDevAttrMaxSharedMemoryPerBlockOptin' in found_values}} + + cudaDevAttrMaxSharedMemoryPerBlockOptin = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin, + 'The maximum optin shared memory per block. This value may vary by chip. See\n' + ':py:obj:`~.cudaFuncSetAttribute`\n' + ){{endif}} + {{if 'cudaDevAttrCanFlushRemoteWrites' in found_values}} + + cudaDevAttrCanFlushRemoteWrites = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites, + 'Device supports flushing of outstanding remote writes.\n' + ){{endif}} + {{if 'cudaDevAttrHostRegisterSupported' in found_values}} + + cudaDevAttrHostRegisterSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostRegisterSupported, + 'Device supports host memory registration via :py:obj:`~.cudaHostRegister`.\n' + ){{endif}} + {{if 'cudaDevAttrPageableMemoryAccessUsesHostPageTables' in found_values}} + + cudaDevAttrPageableMemoryAccessUsesHostPageTables = ( + cyruntime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables, + "Device accesses pageable memory via the host's page tables.\n" + ){{endif}} + {{if 'cudaDevAttrDirectManagedMemAccessFromHost' in found_values}} + + cudaDevAttrDirectManagedMemAccessFromHost = ( + cyruntime.cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost, + 'Host can directly access managed memory on the device without migration.\n' + ){{endif}} + {{if 'cudaDevAttrMaxBlocksPerMultiprocessor' in found_values}} + + cudaDevAttrMaxBlocksPerMultiprocessor = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor, + 'Maximum number of blocks per multiprocessor\n' + ){{endif}} + {{if 'cudaDevAttrMaxPersistingL2CacheSize' in found_values}} + + cudaDevAttrMaxPersistingL2CacheSize = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize, + 'Maximum L2 persisting lines capacity setting in bytes.\n' + ){{endif}} + {{if 'cudaDevAttrMaxAccessPolicyWindowSize' in found_values}} + + cudaDevAttrMaxAccessPolicyWindowSize = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize, + 'Maximum value of :py:obj:`~.cudaAccessPolicyWindow.num_bytes`.\n' + ){{endif}} + {{if 'cudaDevAttrReservedSharedMemoryPerBlock' in found_values}} + + cudaDevAttrReservedSharedMemoryPerBlock = ( + cyruntime.cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock, + 'Shared memory reserved by CUDA driver per block in bytes\n' + ){{endif}} + {{if 'cudaDevAttrSparseCudaArraySupported' in found_values}} + + cudaDevAttrSparseCudaArraySupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported, + 'Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays\n' + ){{endif}} + {{if 'cudaDevAttrHostRegisterReadOnlySupported' in found_values}} + + cudaDevAttrHostRegisterReadOnlySupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported, + 'Device supports using the :py:obj:`~.cudaHostRegister` flag\n' + 'cudaHostRegisterReadOnly to register memory that must be mapped as read-\n' + 'only to the GPU\n' + ){{endif}} + {{if 'cudaDevAttrTimelineSemaphoreInteropSupported' in found_values}} + + cudaDevAttrTimelineSemaphoreInteropSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported, + 'External timeline semaphore interop is supported on the device\n' + ){{endif}} + {{if 'cudaDevAttrMaxTimelineSemaphoreInteropSupported' in found_values}} + + cudaDevAttrMaxTimelineSemaphoreInteropSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported, + 'Deprecated, External timeline semaphore interop is supported on the device\n' + ){{endif}} + {{if 'cudaDevAttrMemoryPoolsSupported' in found_values}} + + cudaDevAttrMemoryPoolsSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported, + 'Device supports using the :py:obj:`~.cudaMallocAsync` and\n' + ':py:obj:`~.cudaMemPool` family of APIs\n' + ){{endif}} + {{if 'cudaDevAttrGPUDirectRDMASupported' in found_values}} + + cudaDevAttrGPUDirectRDMASupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported, + '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 'cudaDevAttrGPUDirectRDMAFlushWritesOptions' in found_values}} + + cudaDevAttrGPUDirectRDMAFlushWritesOptions = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions, + 'The returned attribute shall be interpreted as a bitmask, where the\n' + 'individual bits are listed in the\n' + ':py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum\n' + ){{endif}} + {{if 'cudaDevAttrGPUDirectRDMAWritesOrdering' in found_values}} + + cudaDevAttrGPUDirectRDMAWritesOrdering = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering, + 'GPUDirect RDMA writes to the device do not need to be flushed for consumers\n' + 'within the scope indicated by the returned attribute. See\n' + ':py:obj:`~.cudaGPUDirectRDMAWritesOrdering` for the numerical values\n' + 'returned here.\n' + ){{endif}} + {{if 'cudaDevAttrMemoryPoolSupportedHandleTypes' in found_values}} + + cudaDevAttrMemoryPoolSupportedHandleTypes = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes, + 'Handle types supported with mempool based IPC\n' + ){{endif}} + {{if 'cudaDevAttrClusterLaunch' in found_values}} + + cudaDevAttrClusterLaunch = ( + cyruntime.cudaDeviceAttr.cudaDevAttrClusterLaunch, + 'Indicates device supports cluster launch\n' + ){{endif}} + {{if 'cudaDevAttrDeferredMappingCudaArraySupported' in found_values}} + + cudaDevAttrDeferredMappingCudaArraySupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported, + 'Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays\n' + ){{endif}} + {{if 'cudaDevAttrReserved122' in found_values}} + cudaDevAttrReserved122 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved122{{endif}} + {{if 'cudaDevAttrReserved123' in found_values}} + cudaDevAttrReserved123 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved123{{endif}} + {{if 'cudaDevAttrReserved124' in found_values}} + cudaDevAttrReserved124 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved124{{endif}} + {{if 'cudaDevAttrIpcEventSupport' in found_values}} + + cudaDevAttrIpcEventSupport = ( + cyruntime.cudaDeviceAttr.cudaDevAttrIpcEventSupport, + 'Device supports IPC Events.\n' + ){{endif}} + {{if 'cudaDevAttrMemSyncDomainCount' in found_values}} + + cudaDevAttrMemSyncDomainCount = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMemSyncDomainCount, + 'Number of memory synchronization domains the device supports.\n' + ){{endif}} + {{if 'cudaDevAttrReserved127' in found_values}} + cudaDevAttrReserved127 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved127{{endif}} + {{if 'cudaDevAttrReserved128' in found_values}} + cudaDevAttrReserved128 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved128{{endif}} + {{if 'cudaDevAttrReserved129' in found_values}} + cudaDevAttrReserved129 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved129{{endif}} + {{if 'cudaDevAttrNumaConfig' in found_values}} + + cudaDevAttrNumaConfig = ( + cyruntime.cudaDeviceAttr.cudaDevAttrNumaConfig, + 'NUMA configuration of a device: value is of type\n' + ':py:obj:`~.cudaDeviceNumaConfig` enum\n' + ){{endif}} + {{if 'cudaDevAttrNumaId' in found_values}} + + cudaDevAttrNumaId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrNumaId, + 'NUMA node ID of the GPU memory\n' + ){{endif}} + {{if 'cudaDevAttrReserved132' in found_values}} + cudaDevAttrReserved132 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved132{{endif}} + {{if 'cudaDevAttrMpsEnabled' in found_values}} + + cudaDevAttrMpsEnabled = ( + cyruntime.cudaDeviceAttr.cudaDevAttrMpsEnabled, + 'Contexts created on this device will be shared via MPS\n' + ){{endif}} + {{if 'cudaDevAttrHostNumaId' in found_values}} + + cudaDevAttrHostNumaId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostNumaId, + 'NUMA ID of the host node closest to the device or -1 when system does not\n' + 'support NUMA\n' + ){{endif}} + {{if 'cudaDevAttrD3D12CigSupported' in found_values}} + + cudaDevAttrD3D12CigSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrD3D12CigSupported, + 'Device supports CIG with D3D12.\n' + ){{endif}} + {{if 'cudaDevAttrVulkanCigSupported' in found_values}} + + cudaDevAttrVulkanCigSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrVulkanCigSupported, + 'Device supports CIG with Vulkan.\n' + ){{endif}} + {{if 'cudaDevAttrGpuPciDeviceId' in found_values}} + + cudaDevAttrGpuPciDeviceId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGpuPciDeviceId, + 'The combined 16-bit PCI device ID and 16-bit PCI vendor ID.\n' + ){{endif}} + {{if 'cudaDevAttrGpuPciSubsystemId' in found_values}} + + cudaDevAttrGpuPciSubsystemId = ( + cyruntime.cudaDeviceAttr.cudaDevAttrGpuPciSubsystemId, + 'The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID.\n' + ){{endif}} + {{if 'cudaDevAttrReserved141' in found_values}} + cudaDevAttrReserved141 = cyruntime.cudaDeviceAttr.cudaDevAttrReserved141{{endif}} + {{if 'cudaDevAttrHostNumaMemoryPoolsSupported' in found_values}} + + cudaDevAttrHostNumaMemoryPoolsSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostNumaMemoryPoolsSupported, + 'Device supports HOST_NUMA location with the :py:obj:`~.cudaMallocAsync` and\n' + ':py:obj:`~.cudaMemPool` family of APIs\n' + ){{endif}} + {{if 'cudaDevAttrHostNumaMultinodeIpcSupported' in found_values}} + + cudaDevAttrHostNumaMultinodeIpcSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrHostNumaMultinodeIpcSupported, + 'Device supports HostNuma location IPC between nodes in a multi-node system.\n' + ){{endif}} + {{if 'cudaDevAttrMax' in found_values}} + cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax{{endif}} + +{{endif}} +{{if 'cudaMemPoolAttr' in found_types}} + +class cudaMemPoolAttr(_FastEnum): + """ + CUDA memory pool attributes + """ + {{if 'cudaMemPoolReuseFollowEventDependencies' in found_values}} + + cudaMemPoolReuseFollowEventDependencies = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies, + '(value type = int) Allow cuMemAllocAsync to use memory asynchronously freed\n' + 'in another streams as long as a stream ordering dependency of the\n' + '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 'cudaMemPoolReuseAllowOpportunistic' in found_values}} + + cudaMemPoolReuseAllowOpportunistic = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic, + '(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 'cudaMemPoolReuseAllowInternalDependencies' in found_values}} + + cudaMemPoolReuseAllowInternalDependencies = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies, + '(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 cuFreeAsync (default enabled).\n' + ){{endif}} + {{if 'cudaMemPoolAttrReleaseThreshold' in found_values}} + + cudaMemPoolAttrReleaseThreshold = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold, + '(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 'cudaMemPoolAttrReservedMemCurrent' in found_values}} + + cudaMemPoolAttrReservedMemCurrent = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent, + '(value type = cuuint64_t) Amount of backing memory currently allocated for\n' + 'the mempool.\n' + ){{endif}} + {{if 'cudaMemPoolAttrReservedMemHigh' in found_values}} + + cudaMemPoolAttrReservedMemHigh = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh, + '(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 'cudaMemPoolAttrUsedMemCurrent' in found_values}} + + cudaMemPoolAttrUsedMemCurrent = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent, + '(value type = cuuint64_t) Amount of memory from the pool that is currently\n' + 'in use by the application.\n' + ){{endif}} + {{if 'cudaMemPoolAttrUsedMemHigh' in found_values}} + + cudaMemPoolAttrUsedMemHigh = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh, + '(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}} + +{{endif}} +{{if 'cudaMemLocationType' in found_types}} + +class cudaMemLocationType(_FastEnum): + """ + Specifies the type of location + """ + {{if 'cudaMemLocationTypeInvalid' in found_values}} + cudaMemLocationTypeInvalid = cyruntime.cudaMemLocationType.cudaMemLocationTypeInvalid{{endif}} + {{if 'cudaMemLocationTypeDevice' in found_values}} + + cudaMemLocationTypeDevice = ( + cyruntime.cudaMemLocationType.cudaMemLocationTypeDevice, + 'Location is a device location, thus id is a device ordinal\n' + ){{endif}} + {{if 'cudaMemLocationTypeHost' in found_values}} + + cudaMemLocationTypeHost = ( + cyruntime.cudaMemLocationType.cudaMemLocationTypeHost, + 'Location is host, id is ignored\n' + ){{endif}} + {{if 'cudaMemLocationTypeHostNuma' in found_values}} + + cudaMemLocationTypeHostNuma = ( + cyruntime.cudaMemLocationType.cudaMemLocationTypeHostNuma, + 'Location is a host NUMA node, thus id is a host NUMA node id\n' + ){{endif}} + {{if 'cudaMemLocationTypeHostNumaCurrent' in found_values}} + + cudaMemLocationTypeHostNumaCurrent = ( + cyruntime.cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent, + "Location is the host NUMA node closest to the current thread's CPU, id is\n" + 'ignored\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemAccessFlags' in found_types}} + +class cudaMemAccessFlags(_FastEnum): + """ + Specifies the memory protection flags for mapping. + """ + {{if 'cudaMemAccessFlagsProtNone' in found_values}} + + cudaMemAccessFlagsProtNone = ( + cyruntime.cudaMemAccessFlags.cudaMemAccessFlagsProtNone, + 'Default, make the address range not accessible\n' + ){{endif}} + {{if 'cudaMemAccessFlagsProtRead' in found_values}} + + cudaMemAccessFlagsProtRead = ( + cyruntime.cudaMemAccessFlags.cudaMemAccessFlagsProtRead, + 'Make the address range read accessible\n' + ){{endif}} + {{if 'cudaMemAccessFlagsProtReadWrite' in found_values}} + + cudaMemAccessFlagsProtReadWrite = ( + cyruntime.cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite, + 'Make the address range read-write accessible\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemAllocationType' in found_types}} + +class cudaMemAllocationType(_FastEnum): + """ + Defines the allocation types available + """ + {{if 'cudaMemAllocationTypeInvalid' in found_values}} + cudaMemAllocationTypeInvalid = cyruntime.cudaMemAllocationType.cudaMemAllocationTypeInvalid{{endif}} + {{if 'cudaMemAllocationTypePinned' in found_values}} + + cudaMemAllocationTypePinned = ( + cyruntime.cudaMemAllocationType.cudaMemAllocationTypePinned, + "This allocation type is 'pinned', i.e. cannot migrate from its current\n" + 'location while the application is actively using it\n' + ){{endif}} + {{if 'cudaMemAllocationTypeMax' in found_values}} + cudaMemAllocationTypeMax = cyruntime.cudaMemAllocationType.cudaMemAllocationTypeMax{{endif}} + +{{endif}} +{{if 'cudaMemAllocationHandleType' in found_types}} + +class cudaMemAllocationHandleType(_FastEnum): + """ + Flags for specifying particular handle types + """ + {{if 'cudaMemHandleTypeNone' in found_values}} + + cudaMemHandleTypeNone = ( + cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeNone, + 'Does not allow any export mechanism. >\n' + ){{endif}} + {{if 'cudaMemHandleTypePosixFileDescriptor' in found_values}} + + cudaMemHandleTypePosixFileDescriptor = ( + cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor, + 'Allows a file descriptor to be used for exporting. Permitted only on POSIX\n' + 'systems. (int)\n' + ){{endif}} + {{if 'cudaMemHandleTypeWin32' in found_values}} + + cudaMemHandleTypeWin32 = ( + cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32, + 'Allows a Win32 NT handle to be used for exporting. (HANDLE)\n' + ){{endif}} + {{if 'cudaMemHandleTypeWin32Kmt' in found_values}} + + cudaMemHandleTypeWin32Kmt = ( + cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt, + 'Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE)\n' + ){{endif}} + {{if 'cudaMemHandleTypeFabric' in found_values}} + + cudaMemHandleTypeFabric = ( + cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric, + 'Allows a fabric handle to be used for exporting.\n' + '(:py:obj:`~.cudaMemFabricHandle_t`)\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphMemAttributeType' in found_types}} + +class cudaGraphMemAttributeType(_FastEnum): + """ + Graph memory attributes + """ + {{if 'cudaGraphMemAttrUsedMemCurrent' in found_values}} + + cudaGraphMemAttrUsedMemCurrent = ( + cyruntime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent, + '(value type = cuuint64_t) Amount of memory, in bytes, currently associated\n' + 'with graphs.\n' + ){{endif}} + {{if 'cudaGraphMemAttrUsedMemHigh' in found_values}} + + cudaGraphMemAttrUsedMemHigh = ( + cyruntime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh, + '(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 'cudaGraphMemAttrReservedMemCurrent' in found_values}} + + cudaGraphMemAttrReservedMemCurrent = ( + cyruntime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent, + '(value type = cuuint64_t) Amount of memory, in bytes, currently allocated\n' + 'for use by the CUDA graphs asynchronous allocator.\n' + ){{endif}} + {{if 'cudaGraphMemAttrReservedMemHigh' in found_values}} + + cudaGraphMemAttrReservedMemHigh = ( + cyruntime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh, + '(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 'cudaMemcpyFlags' in found_types}} + +class cudaMemcpyFlags(_FastEnum): + """ + Flags to specify for copies within a batch. For more details see + :py:obj:`~.cudaMemcpyBatchAsync`. + """ + {{if 'cudaMemcpyFlagDefault' in found_values}} + cudaMemcpyFlagDefault = cyruntime.cudaMemcpyFlags.cudaMemcpyFlagDefault{{endif}} + {{if 'cudaMemcpyFlagPreferOverlapWithCompute' in found_values}} + + cudaMemcpyFlagPreferOverlapWithCompute = ( + cyruntime.cudaMemcpyFlags.cudaMemcpyFlagPreferOverlapWithCompute, + 'Hint to the driver to try and overlap the copy with compute work on the\n' + 'SMs.\n' + ){{endif}} + +{{endif}} +{{if 'cudaMemcpySrcAccessOrder' in found_types}} + +class cudaMemcpySrcAccessOrder(_FastEnum): + """ + + """ + {{if 'cudaMemcpySrcAccessOrderInvalid' in found_values}} + + cudaMemcpySrcAccessOrderInvalid = ( + cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderInvalid, + 'Default invalid.\n' + ){{endif}} + {{if 'cudaMemcpySrcAccessOrderStream' in found_values}} + + cudaMemcpySrcAccessOrderStream = ( + cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderStream, + 'Indicates that access to the source pointer must be in stream order.\n' + ){{endif}} + {{if 'cudaMemcpySrcAccessOrderDuringApiCall' in found_values}} + + cudaMemcpySrcAccessOrderDuringApiCall = ( + cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderDuringApiCall, + 'Indicates that access to the source pointer can be out of stream order and\n' + 'all accesses must be complete before the API call returns. This flag is\n' + "suited for ephemeral sources (ex., stack variables) when it's known that no\n" + 'prior operations in the stream can be accessing the memory and also that\n' + 'the lifetime of the memory is limited to the scope that the source variable\n' + '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 'cudaMemcpySrcAccessOrderAny' in found_values}} + + cudaMemcpySrcAccessOrderAny = ( + cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderAny, + 'Indicates that access to the source pointer can be out of stream order and\n' + 'the accesses can happen even after the API call returns. This flag is\n' + "suited for host pointers allocated outside CUDA (ex., via malloc) when it's\n" + '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 'cudaMemcpySrcAccessOrderMax' in found_values}} + cudaMemcpySrcAccessOrderMax = cyruntime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderMax{{endif}} + +{{endif}} +{{if 'cudaMemcpy3DOperandType' in found_types}} + +class cudaMemcpy3DOperandType(_FastEnum): + """ + These flags allow applications to convey the operand type for + individual copies specified in :py:obj:`~.cudaMemcpy3DBatchAsync`. + """ + {{if 'cudaMemcpyOperandTypePointer' in found_values}} + + cudaMemcpyOperandTypePointer = ( + cyruntime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypePointer, + 'Memcpy operand is a valid pointer.\n' + ){{endif}} + {{if 'cudaMemcpyOperandTypeArray' in found_values}} + + cudaMemcpyOperandTypeArray = ( + cyruntime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeArray, + 'Memcpy operand is a CUarray.\n' + ){{endif}} + {{if 'cudaMemcpyOperandTypeMax' in found_values}} + cudaMemcpyOperandTypeMax = cyruntime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeMax{{endif}} + +{{endif}} +{{if 'cudaDeviceP2PAttr' in found_types}} + +class cudaDeviceP2PAttr(_FastEnum): + """ + CUDA device P2P attributes + """ + {{if 'cudaDevP2PAttrPerformanceRank' in found_values}} + + cudaDevP2PAttrPerformanceRank = ( + cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank, + 'A relative value indicating the performance of the link between two devices\n' + ){{endif}} + {{if 'cudaDevP2PAttrAccessSupported' in found_values}} + + cudaDevP2PAttrAccessSupported = ( + cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported, + 'Peer access is enabled\n' + ){{endif}} + {{if 'cudaDevP2PAttrNativeAtomicSupported' in found_values}} + + cudaDevP2PAttrNativeAtomicSupported = ( + cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported, + 'Native atomic operation over the link supported\n' + ){{endif}} + {{if 'cudaDevP2PAttrCudaArrayAccessSupported' in found_values}} + + cudaDevP2PAttrCudaArrayAccessSupported = ( + cyruntime.cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported, + 'Accessing CUDA arrays over the link supported\n' + ){{endif}} + +{{endif}} +{{if 'cudaExternalMemoryHandleType' in found_types}} + +class cudaExternalMemoryHandleType(_FastEnum): + """ + External memory handle types + """ + {{if 'cudaExternalMemoryHandleTypeOpaqueFd' in found_values}} + + cudaExternalMemoryHandleTypeOpaqueFd = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd, + 'Handle is an opaque file descriptor\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeOpaqueWin32' in found_values}} + + cudaExternalMemoryHandleTypeOpaqueWin32 = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32, + 'Handle is an opaque shared NT handle\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeOpaqueWin32Kmt' in found_values}} + + cudaExternalMemoryHandleTypeOpaqueWin32Kmt = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt, + 'Handle is an opaque, globally shared handle\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeD3D12Heap' in found_values}} + + cudaExternalMemoryHandleTypeD3D12Heap = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap, + 'Handle is a D3D12 heap object\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeD3D12Resource' in found_values}} + + cudaExternalMemoryHandleTypeD3D12Resource = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource, + 'Handle is a D3D12 committed resource\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeD3D11Resource' in found_values}} + + cudaExternalMemoryHandleTypeD3D11Resource = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource, + 'Handle is a shared NT handle to a D3D11 resource\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeD3D11ResourceKmt' in found_values}} + + cudaExternalMemoryHandleTypeD3D11ResourceKmt = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt, + 'Handle is a globally shared handle to a D3D11 resource\n' + ){{endif}} + {{if 'cudaExternalMemoryHandleTypeNvSciBuf' in found_values}} + + cudaExternalMemoryHandleTypeNvSciBuf = ( + cyruntime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf, + 'Handle is an NvSciBuf object\n' + ){{endif}} + +{{endif}} +{{if 'cudaExternalSemaphoreHandleType' in found_types}} + +class cudaExternalSemaphoreHandleType(_FastEnum): + """ + External semaphore handle types + """ + {{if 'cudaExternalSemaphoreHandleTypeOpaqueFd' in found_values}} + + cudaExternalSemaphoreHandleTypeOpaqueFd = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd, + 'Handle is an opaque file descriptor\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeOpaqueWin32' in found_values}} + + cudaExternalSemaphoreHandleTypeOpaqueWin32 = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32, + 'Handle is an opaque shared NT handle\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt' in found_values}} + + cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt, + 'Handle is an opaque, globally shared handle\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeD3D12Fence' in found_values}} + + cudaExternalSemaphoreHandleTypeD3D12Fence = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence, + 'Handle is a shared NT handle referencing a D3D12 fence object\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeD3D11Fence' in found_values}} + + cudaExternalSemaphoreHandleTypeD3D11Fence = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence, + 'Handle is a shared NT handle referencing a D3D11 fence object\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeNvSciSync' in found_values}} + + cudaExternalSemaphoreHandleTypeNvSciSync = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync, + 'Opaque handle to NvSciSync Object\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeKeyedMutex' in found_values}} + + cudaExternalSemaphoreHandleTypeKeyedMutex = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex, + 'Handle is a shared NT handle referencing a D3D11 keyed mutex object\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeKeyedMutexKmt' in found_values}} + + cudaExternalSemaphoreHandleTypeKeyedMutexKmt = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt, + 'Handle is a shared KMT handle referencing a D3D11 keyed mutex object\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd' in found_values}} + + cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd, + 'Handle is an opaque handle file descriptor referencing a timeline semaphore\n' + ){{endif}} + {{if 'cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32' in found_values}} + + cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = ( + cyruntime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32, + 'Handle is an opaque handle file descriptor referencing a timeline semaphore\n' + ){{endif}} + +{{endif}} +{{if 'cudaJitOption' in found_types}} + +class cudaJitOption(_FastEnum): + """ + Online compiler and linker options + """ + {{if 'cudaJitMaxRegisters' in found_values}} + + cudaJitMaxRegisters = ( + cyruntime.cudaJitOption.cudaJitMaxRegisters, + 'Max number of registers that a thread may use.\n' + 'Option type: unsigned int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitThreadsPerBlock' in found_values}} + + cudaJitThreadsPerBlock = ( + cyruntime.cudaJitOption.cudaJitThreadsPerBlock, + 'IN: Specifies minimum number of threads per block to target compilation for\n' + 'OUT: Returns the number of threads the compiler actually targeted. This\n' + 'restricts the resource utilization of the compiler (e.g. max registers)\n' + 'such that a block with the given number of threads should be able to launch\n' + 'based on register limitations. Note, this option does not currently take\n' + 'into account any other resource limitations, such as shared memory\n' + 'utilization.\n' + 'Option type: unsigned int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitWallTime' in found_values}} + + cudaJitWallTime = ( + cyruntime.cudaJitOption.cudaJitWallTime, + 'Overwrites the option value with the total wall clock time, in\n' + 'milliseconds, spent in the compiler and linker\n' + 'Option type: float\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitInfoLogBuffer' in found_values}} + + cudaJitInfoLogBuffer = ( + cyruntime.cudaJitOption.cudaJitInfoLogBuffer, + 'Pointer to a buffer in which to print any log messages that are\n' + 'informational in nature (the buffer size is specified via option\n' + ':py:obj:`~.cudaJitInfoLogBufferSizeBytes`)\n' + 'Option type: char *\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitInfoLogBufferSizeBytes' in found_values}} + + cudaJitInfoLogBufferSizeBytes = ( + cyruntime.cudaJitOption.cudaJitInfoLogBufferSizeBytes, + 'IN: Log buffer size in bytes. Log messages will be capped at this size\n' + '(including null terminator)\n' + 'OUT: Amount of log buffer filled with messages\n' + 'Option type: unsigned int\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitErrorLogBuffer' in found_values}} + + cudaJitErrorLogBuffer = ( + cyruntime.cudaJitOption.cudaJitErrorLogBuffer, + 'Pointer to a buffer in which to print any log messages that reflect errors\n' + '(the buffer size is specified via option\n' + ':py:obj:`~.cudaJitErrorLogBufferSizeBytes`)\n' + 'Option type: char *\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitErrorLogBufferSizeBytes' in found_values}} + + cudaJitErrorLogBufferSizeBytes = ( + cyruntime.cudaJitOption.cudaJitErrorLogBufferSizeBytes, + 'IN: Log buffer size in bytes. Log messages will be capped at this size\n' + '(including null terminator)\n' + 'OUT: Amount of log buffer filled with messages\n' + 'Option type: unsigned int\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitOptimizationLevel' in found_values}} + + cudaJitOptimizationLevel = ( + cyruntime.cudaJitOption.cudaJitOptimizationLevel, + 'Level of optimizations to apply to generated code (0 - 4), with 4 being the\n' + 'default and highest level of optimizations.\n' + 'Option type: unsigned int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitFallbackStrategy' in found_values}} + + cudaJitFallbackStrategy = ( + cyruntime.cudaJitOption.cudaJitFallbackStrategy, + 'Specifies choice of fallback strategy if matching cubin is not found.\n' + 'Choice is based on supplied :py:obj:`~.cudaJit_Fallback`. Option type:\n' + 'unsigned int for enumerated type :py:obj:`~.cudaJit_Fallback`\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitGenerateDebugInfo' in found_values}} + + cudaJitGenerateDebugInfo = ( + cyruntime.cudaJitOption.cudaJitGenerateDebugInfo, + 'Specifies whether to create debug information in output (-g) (0: false,\n' + 'default)\n' + 'Option type: int\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitLogVerbose' in found_values}} + + cudaJitLogVerbose = ( + cyruntime.cudaJitOption.cudaJitLogVerbose, + 'Generate verbose log messages (0: false, default)\n' + 'Option type: int\n' + 'Applies to: compiler and linker\n' + ){{endif}} + {{if 'cudaJitGenerateLineInfo' in found_values}} + + cudaJitGenerateLineInfo = ( + cyruntime.cudaJitOption.cudaJitGenerateLineInfo, + 'Generate line number information (-lineinfo) (0: false, default)\n' + 'Option type: int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitCacheMode' in found_values}} + + cudaJitCacheMode = ( + cyruntime.cudaJitOption.cudaJitCacheMode, + 'Specifies whether to enable caching explicitly (-dlcm)\n' + 'Choice is based on supplied :py:obj:`~.cudaJit_CacheMode`.\n' + 'Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_CacheMode`\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitPositionIndependentCode' in found_values}} + + cudaJitPositionIndependentCode = ( + cyruntime.cudaJitOption.cudaJitPositionIndependentCode, + 'Generate position independent code (0: false)\n' + 'Option type: int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitMinCtaPerSm' in found_values}} + + cudaJitMinCtaPerSm = ( + cyruntime.cudaJitOption.cudaJitMinCtaPerSm, + 'This option hints to the JIT compiler the minimum number of CTAs from the\n' + 'kernel’s grid to be mapped to a SM. This option is ignored when used\n' + 'together with :py:obj:`~.cudaJitMaxRegisters` or\n' + ':py:obj:`~.cudaJitThreadsPerBlock`. Optimizations based on this option need\n' + ':py:obj:`~.cudaJitMaxThreadsPerBlock` to be specified as well. For kernels\n' + 'already using PTX directive .minnctapersm, this option will be ignored by\n' + 'default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to let this option\n' + 'take precedence over the PTX directive. Option type: unsigned int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitMaxThreadsPerBlock' in found_values}} + + cudaJitMaxThreadsPerBlock = ( + cyruntime.cudaJitOption.cudaJitMaxThreadsPerBlock, + 'Maximum number threads in a thread block, computed as the product of the\n' + 'maximum extent specifed for each dimension of the block. This limit is\n' + 'guaranteed not to be exeeded in any invocation of the kernel. Exceeding the\n' + 'the maximum number of threads results in runtime error or kernel launch\n' + 'failure. For kernels already using PTX directive .maxntid, this option will\n' + 'be ignored by default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to\n' + 'let this option take precedence over the PTX directive. Option type: int\n' + 'Applies to: compiler only\n' + ){{endif}} + {{if 'cudaJitOverrideDirectiveValues' in found_values}} + + cudaJitOverrideDirectiveValues = ( + cyruntime.cudaJitOption.cudaJitOverrideDirectiveValues, + 'This option lets the values specified using\n' + ':py:obj:`~.cudaJitMaxRegisters`, :py:obj:`~.cudaJitThreadsPerBlock`,\n' + ':py:obj:`~.cudaJitMaxThreadsPerBlock` and :py:obj:`~.cudaJitMinCtaPerSm`\n' + 'take precedence over any PTX directives. (0: Disable, default; 1: Enable)\n' + 'Option type: int\n' + 'Applies to: compiler only\n' + ){{endif}} + +{{endif}} +{{if 'cudaLibraryOption' in found_types}} + +class cudaLibraryOption(_FastEnum): + """ + Library options to be specified with + :py:obj:`~.cudaLibraryLoadData()` or + :py:obj:`~.cudaLibraryLoadFromFile()` + """ + {{if 'cudaLibraryHostUniversalFunctionAndDataTable' in found_values}} + cudaLibraryHostUniversalFunctionAndDataTable = cyruntime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable{{endif}} + {{if 'cudaLibraryBinaryIsPreserved' in found_values}} + + cudaLibraryBinaryIsPreserved = ( + cyruntime.cudaLibraryOption.cudaLibraryBinaryIsPreserved, + 'Specifes that the argument `code` passed to\n' + ':py:obj:`~.cudaLibraryLoadData()` will be preserved. Specifying this option\n' + 'will let the driver know that `code` can be accessed at any point until\n' + ':py:obj:`~.cudaLibraryUnload()`. The default behavior is for the driver to\n' + 'allocate and maintain its own copy of `code`. Note that this is only a\n' + 'memory usage optimization hint and the driver can choose to ignore it if\n' + 'required. Specifying this option with :py:obj:`~.cudaLibraryLoadFromFile()`\n' + 'is invalid and will return :py:obj:`~.cudaErrorInvalidValue`.\n' + ){{endif}} + +{{endif}} +{{if 'cudaJit_CacheMode' in found_types}} + +class cudaJit_CacheMode(_FastEnum): + """ + Caching modes for dlcm + """ + {{if 'cudaJitCacheOptionNone' in found_values}} + + cudaJitCacheOptionNone = ( + cyruntime.cudaJit_CacheMode.cudaJitCacheOptionNone, + 'Compile with no -dlcm flag specified\n' + ){{endif}} + {{if 'cudaJitCacheOptionCG' in found_values}} + + cudaJitCacheOptionCG = ( + cyruntime.cudaJit_CacheMode.cudaJitCacheOptionCG, + 'Compile with L1 cache disabled\n' + ){{endif}} + {{if 'cudaJitCacheOptionCA' in found_values}} + + cudaJitCacheOptionCA = ( + cyruntime.cudaJit_CacheMode.cudaJitCacheOptionCA, + 'Compile with L1 cache enabled\n' + ){{endif}} + +{{endif}} +{{if 'cudaJit_Fallback' in found_types}} + +class cudaJit_Fallback(_FastEnum): + """ + Cubin matching fallback strategies + """ + {{if 'cudaPreferPtx' in found_values}} + + cudaPreferPtx = ( + cyruntime.cudaJit_Fallback.cudaPreferPtx, + 'Prefer to compile ptx if exact binary match not found\n' + ){{endif}} + {{if 'cudaPreferBinary' in found_values}} + + cudaPreferBinary = ( + cyruntime.cudaJit_Fallback.cudaPreferBinary, + 'Prefer to fall back to compatible binary code if exact match not found\n' + ){{endif}} + +{{endif}} +{{if 'cudaCGScope' in found_types}} + +class cudaCGScope(_FastEnum): + """ + CUDA cooperative group scope + """ + {{if 'cudaCGScopeInvalid' in found_values}} + + cudaCGScopeInvalid = ( + cyruntime.cudaCGScope.cudaCGScopeInvalid, + 'Invalid cooperative group scope\n' + ){{endif}} + {{if 'cudaCGScopeGrid' in found_values}} + + cudaCGScopeGrid = ( + cyruntime.cudaCGScope.cudaCGScopeGrid, + 'Scope represented by a grid_group\n' + ){{endif}} + {{if 'cudaCGScopeMultiGrid' in found_values}} + + cudaCGScopeMultiGrid = ( + cyruntime.cudaCGScope.cudaCGScopeMultiGrid, + 'Scope represented by a multi_grid_group\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphConditionalHandleFlags' in found_types}} + +class cudaGraphConditionalHandleFlags(_FastEnum): + """ + + """ + {{if 'cudaGraphCondAssignDefault' in found_values}} + + cudaGraphCondAssignDefault = ( + cyruntime.cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault, + 'Apply default handle value when graph is launched.\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphConditionalNodeType' in found_types}} + +class cudaGraphConditionalNodeType(_FastEnum): + """ + CUDA conditional node types + """ + {{if 'cudaGraphCondTypeIf' in found_values}} + + cudaGraphCondTypeIf = ( + cyruntime.cudaGraphConditionalNodeType.cudaGraphCondTypeIf, + "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 'cudaGraphCondTypeWhile' in found_values}} + + cudaGraphCondTypeWhile = ( + cyruntime.cudaGraphConditionalNodeType.cudaGraphCondTypeWhile, + "Conditional 'while' Node. Body executed repeatedly while condition value is\n" + 'non-zero.\n' + ){{endif}} + {{if 'cudaGraphCondTypeSwitch' in found_values}} + + cudaGraphCondTypeSwitch = ( + cyruntime.cudaGraphConditionalNodeType.cudaGraphCondTypeSwitch, + "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 'cudaGraphNodeType' in found_types}} + +class cudaGraphNodeType(_FastEnum): + """ + CUDA Graph node types + """ + {{if 'cudaGraphNodeTypeKernel' in found_values}} + + cudaGraphNodeTypeKernel = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeKernel, + 'GPU kernel node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeMemcpy' in found_values}} + + cudaGraphNodeTypeMemcpy = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeMemcpy, + 'Memcpy node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeMemset' in found_values}} + + cudaGraphNodeTypeMemset = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeMemset, + 'Memset node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeHost' in found_values}} + + cudaGraphNodeTypeHost = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeHost, + 'Host (executable) node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeGraph' in found_values}} + + cudaGraphNodeTypeGraph = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeGraph, + 'Node which executes an embedded graph\n' + ){{endif}} + {{if 'cudaGraphNodeTypeEmpty' in found_values}} + + cudaGraphNodeTypeEmpty = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeEmpty, + 'Empty (no-op) node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeWaitEvent' in found_values}} + + cudaGraphNodeTypeWaitEvent = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeWaitEvent, + 'External event wait node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeEventRecord' in found_values}} + + cudaGraphNodeTypeEventRecord = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeEventRecord, + 'External event record node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeExtSemaphoreSignal' in found_values}} + + cudaGraphNodeTypeExtSemaphoreSignal = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal, + 'External semaphore signal node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeExtSemaphoreWait' in found_values}} + + cudaGraphNodeTypeExtSemaphoreWait = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait, + 'External semaphore wait node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeMemAlloc' in found_values}} + + cudaGraphNodeTypeMemAlloc = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeMemAlloc, + 'Memory allocation node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeMemFree' in found_values}} + + cudaGraphNodeTypeMemFree = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeMemFree, + 'Memory free node\n' + ){{endif}} + {{if 'cudaGraphNodeTypeConditional' in found_values}} + + cudaGraphNodeTypeConditional = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeConditional, + 'Conditional node May be used to\n' + 'implement a conditional execution path or loop\n' + ' inside of a graph. The graph(s)\n' + 'contained within the body of the conditional node\n' + ' can be selectively executed or iterated\n' + 'upon based on the value of a conditional\n' + ' variable.\n' + ' Handles must be created in advance of\n' + 'creating the node\n' + ' using\n' + ':py:obj:`~.cudaGraphConditionalHandleCreate`.\n' + ' The following restrictions apply to\n' + 'graphs which contain conditional nodes:\n' + ' The graph cannot be used in a child\n' + 'node.\n' + ' Only one instantiation of the graph\n' + 'may exist at any point in time.\n' + ' The graph cannot be cloned.\n' + ' To set the control value, supply a\n' + 'default value when creating the handle and/or\n' + ' call :py:obj:`~.cudaGraphSetConditional`\n' + 'from device code.\n' + ){{endif}} + {{if 'cudaGraphNodeTypeCount' in found_values}} + cudaGraphNodeTypeCount = cyruntime.cudaGraphNodeType.cudaGraphNodeTypeCount{{endif}} + +{{endif}} +{{if 'cudaGraphChildGraphNodeOwnership' in found_types}} + +class cudaGraphChildGraphNodeOwnership(_FastEnum): + """ + Child graph node ownership + """ + {{if 'cudaGraphChildGraphOwnershipClone' in found_values}} + + cudaGraphChildGraphOwnershipClone = ( + cyruntime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipClone, + '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 'cudaGraphChildGraphOwnershipMove' in found_values}} + + cudaGraphChildGraphOwnershipMove = ( + cyruntime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipMove, + 'The child graph is moved to the parent. The handle to the child graph is\n' + 'owned by the parent and will be destroyed when the parent is destroyed.\n' + 'The following restrictions apply to child graphs after they have been\n' + 'moved: Cannot be independently instantiated or destroyed; Cannot be added\n' + 'as a child graph of a separate parent graph; Cannot be used as an argument\n' + 'to cudaGraphExecUpdate; Cannot have additional memory allocation or free\n' + 'nodes added.\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphExecUpdateResult' in found_types}} + +class cudaGraphExecUpdateResult(_FastEnum): + """ + CUDA Graph Update error types + """ + {{if 'cudaGraphExecUpdateSuccess' in found_values}} + + cudaGraphExecUpdateSuccess = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess, + 'The update succeeded\n' + ){{endif}} + {{if 'cudaGraphExecUpdateError' in found_values}} + + cudaGraphExecUpdateError = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateError, + 'The update failed for an unexpected reason which is described in the return\n' + 'value of the function\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorTopologyChanged' in found_values}} + + cudaGraphExecUpdateErrorTopologyChanged = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged, + 'The update failed because the topology changed\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorNodeTypeChanged' in found_values}} + + cudaGraphExecUpdateErrorNodeTypeChanged = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged, + 'The update failed because a node type changed\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorFunctionChanged' in found_values}} + + cudaGraphExecUpdateErrorFunctionChanged = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged, + 'The update failed because the function of a kernel node changed (CUDA\n' + 'driver < 11.2)\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorParametersChanged' in found_values}} + + cudaGraphExecUpdateErrorParametersChanged = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged, + 'The update failed because the parameters changed in a way that is not\n' + 'supported\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorNotSupported' in found_values}} + + cudaGraphExecUpdateErrorNotSupported = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported, + 'The update failed because something about the node is not supported\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorUnsupportedFunctionChange' in found_values}} + + cudaGraphExecUpdateErrorUnsupportedFunctionChange = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange, + 'The update failed because the function of a kernel node changed in an\n' + 'unsupported way\n' + ){{endif}} + {{if 'cudaGraphExecUpdateErrorAttributesChanged' in found_values}} + + cudaGraphExecUpdateErrorAttributesChanged = ( + cyruntime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged, + 'The update failed because the node attributes changed in a way that is not\n' + 'supported\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphKernelNodeField' in found_types}} + +class cudaGraphKernelNodeField(_FastEnum): + """ + Specifies the field to update when performing multiple node updates + from the device + """ + {{if 'cudaGraphKernelNodeFieldInvalid' in found_values}} + + cudaGraphKernelNodeFieldInvalid = ( + cyruntime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid, + 'Invalid field\n' + ){{endif}} + {{if 'cudaGraphKernelNodeFieldGridDim' in found_values}} + + cudaGraphKernelNodeFieldGridDim = ( + cyruntime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim, + 'Grid dimension update\n' + ){{endif}} + {{if 'cudaGraphKernelNodeFieldParam' in found_values}} + + cudaGraphKernelNodeFieldParam = ( + cyruntime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam, + 'Kernel parameter update\n' + ){{endif}} + {{if 'cudaGraphKernelNodeFieldEnabled' in found_values}} + + cudaGraphKernelNodeFieldEnabled = ( + cyruntime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled, + 'Node enable/disable\n' + ){{endif}} + +{{endif}} +{{if 'cudaGetDriverEntryPointFlags' in found_types}} + +class cudaGetDriverEntryPointFlags(_FastEnum): + """ + Flags to specify search options to be used with + :py:obj:`~.cudaGetDriverEntryPoint` For more details see + :py:obj:`~.cuGetProcAddress` + """ + {{if 'cudaEnableDefault' in found_values}} + + cudaEnableDefault = ( + cyruntime.cudaGetDriverEntryPointFlags.cudaEnableDefault, + 'Default search mode for driver symbols.\n' + ){{endif}} + {{if 'cudaEnableLegacyStream' in found_values}} + + cudaEnableLegacyStream = ( + cyruntime.cudaGetDriverEntryPointFlags.cudaEnableLegacyStream, + 'Search for legacy versions of driver symbols.\n' + ){{endif}} + {{if 'cudaEnablePerThreadDefaultStream' in found_values}} + + cudaEnablePerThreadDefaultStream = ( + cyruntime.cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream, + 'Search for per-thread versions of driver symbols.\n' + ){{endif}} + +{{endif}} +{{if 'cudaDriverEntryPointQueryResult' in found_types}} + +class cudaDriverEntryPointQueryResult(_FastEnum): + """ + Enum for status from obtaining driver entry points, used with + :py:obj:`~.cudaApiGetDriverEntryPoint` + """ + {{if 'cudaDriverEntryPointSuccess' in found_values}} + + cudaDriverEntryPointSuccess = ( + cyruntime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess, + 'Search for symbol found a match\n' + ){{endif}} + {{if 'cudaDriverEntryPointSymbolNotFound' in found_values}} + + cudaDriverEntryPointSymbolNotFound = ( + cyruntime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound, + 'Search for symbol was not found\n' + ){{endif}} + {{if 'cudaDriverEntryPointVersionNotSufficent' in found_values}} + + cudaDriverEntryPointVersionNotSufficent = ( + cyruntime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent, + "Search for symbol was found but version wasn't great enough\n" + ){{endif}} + +{{endif}} +{{if 'cudaGraphDebugDotFlags' in found_types}} + +class cudaGraphDebugDotFlags(_FastEnum): + """ + CUDA Graph debug write options + """ + {{if 'cudaGraphDebugDotFlagsVerbose' in found_values}} + + cudaGraphDebugDotFlagsVerbose = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose, + 'Output all debug data as if every debug flag is enabled\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsKernelNodeParams' in found_values}} + + cudaGraphDebugDotFlagsKernelNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams, + 'Adds :py:obj:`~.cudaKernelNodeParams` to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsMemcpyNodeParams' in found_values}} + + cudaGraphDebugDotFlagsMemcpyNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams, + 'Adds :py:obj:`~.cudaMemcpy3DParms` to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsMemsetNodeParams' in found_values}} + + cudaGraphDebugDotFlagsMemsetNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams, + 'Adds :py:obj:`~.cudaMemsetParams` to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsHostNodeParams' in found_values}} + + cudaGraphDebugDotFlagsHostNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams, + 'Adds :py:obj:`~.cudaHostNodeParams` to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsEventNodeParams' in found_values}} + + cudaGraphDebugDotFlagsEventNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams, + 'Adds :py:obj:`~.cudaEvent_t` handle from record and wait nodes to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsExtSemasSignalNodeParams' in found_values}} + + cudaGraphDebugDotFlagsExtSemasSignalNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams, + 'Adds :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` values to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsExtSemasWaitNodeParams' in found_values}} + + cudaGraphDebugDotFlagsExtSemasWaitNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams, + 'Adds :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsKernelNodeAttributes' in found_values}} + + cudaGraphDebugDotFlagsKernelNodeAttributes = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes, + 'Adds cudaKernelNodeAttrID values to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsHandles' in found_values}} + + cudaGraphDebugDotFlagsHandles = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles, + 'Adds node handles and every kernel function handle to output\n' + ){{endif}} + {{if 'cudaGraphDebugDotFlagsConditionalNodeParams' in found_values}} + + cudaGraphDebugDotFlagsConditionalNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams, + 'Adds :py:obj:`~.cudaConditionalNodeParams` to output\n' + ){{endif}} + +{{endif}} +{{if 'cudaGraphInstantiateFlags' in found_types}} + +class cudaGraphInstantiateFlags(_FastEnum): + """ + Flags for instantiating a graph + """ + {{if 'cudaGraphInstantiateFlagAutoFreeOnLaunch' in found_values}} + + cudaGraphInstantiateFlagAutoFreeOnLaunch = ( + cyruntime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch, + 'Automatically free memory allocated in a graph before relaunching.\n' + ){{endif}} + {{if 'cudaGraphInstantiateFlagUpload' in found_values}} + + cudaGraphInstantiateFlagUpload = ( + cyruntime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload, + 'Automatically upload the graph after instantiation. Only supported by\n' + ' :py:obj:`~.cudaGraphInstantiateWithParams`. The upload will be performed\n' + 'using the\n' + ' stream provided in `instantiateParams`.\n' + ){{endif}} + {{if 'cudaGraphInstantiateFlagDeviceLaunch' in found_values}} + + cudaGraphInstantiateFlagDeviceLaunch = ( + cyruntime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch, + '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 cudaGraphInstantiateFlagAutoFreeOnLaunch.\n' + ){{endif}} + {{if 'cudaGraphInstantiateFlagUseNodePriority' in found_values}} + + cudaGraphInstantiateFlagUseNodePriority = ( + cyruntime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority, + '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 'cudaDeviceNumaConfig' in found_types}} + +class cudaDeviceNumaConfig(_FastEnum): + """ + CUDA device NUMA config + """ + {{if 'cudaDeviceNumaConfigNone' in found_values}} + + cudaDeviceNumaConfigNone = ( + cyruntime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNone, + 'The GPU is not a NUMA node\n' + ){{endif}} + {{if 'cudaDeviceNumaConfigNumaNode' in found_values}} + + cudaDeviceNumaConfigNumaNode = ( + cyruntime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode, + 'The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID\n' + ){{endif}} + +{{endif}} +{{if 'cudaSurfaceBoundaryMode' in found_types}} + +class cudaSurfaceBoundaryMode(_FastEnum): + """ + CUDA Surface boundary modes + """ + {{if 'cudaBoundaryModeZero' in found_values}} + + cudaBoundaryModeZero = ( + cyruntime.cudaSurfaceBoundaryMode.cudaBoundaryModeZero, + 'Zero boundary mode\n' + ){{endif}} + {{if 'cudaBoundaryModeClamp' in found_values}} + + cudaBoundaryModeClamp = ( + cyruntime.cudaSurfaceBoundaryMode.cudaBoundaryModeClamp, + 'Clamp boundary mode\n' + ){{endif}} + {{if 'cudaBoundaryModeTrap' in found_values}} + + cudaBoundaryModeTrap = ( + cyruntime.cudaSurfaceBoundaryMode.cudaBoundaryModeTrap, + 'Trap boundary mode\n' + ){{endif}} + +{{endif}} +{{if 'cudaSurfaceFormatMode' in found_types}} + +class cudaSurfaceFormatMode(_FastEnum): + """ + CUDA Surface format modes + """ + {{if 'cudaFormatModeForced' in found_values}} + + cudaFormatModeForced = ( + cyruntime.cudaSurfaceFormatMode.cudaFormatModeForced, + 'Forced format mode\n' + ){{endif}} + {{if 'cudaFormatModeAuto' in found_values}} + + cudaFormatModeAuto = ( + cyruntime.cudaSurfaceFormatMode.cudaFormatModeAuto, + 'Auto format mode\n' + ){{endif}} + +{{endif}} +{{if 'cudaTextureAddressMode' in found_types}} + +class cudaTextureAddressMode(_FastEnum): + """ + CUDA texture address modes + """ + {{if 'cudaAddressModeWrap' in found_values}} + + cudaAddressModeWrap = ( + cyruntime.cudaTextureAddressMode.cudaAddressModeWrap, + 'Wrapping address mode\n' + ){{endif}} + {{if 'cudaAddressModeClamp' in found_values}} + + cudaAddressModeClamp = ( + cyruntime.cudaTextureAddressMode.cudaAddressModeClamp, + 'Clamp to edge address mode\n' + ){{endif}} + {{if 'cudaAddressModeMirror' in found_values}} + + cudaAddressModeMirror = ( + cyruntime.cudaTextureAddressMode.cudaAddressModeMirror, + 'Mirror address mode\n' + ){{endif}} + {{if 'cudaAddressModeBorder' in found_values}} + + cudaAddressModeBorder = ( + cyruntime.cudaTextureAddressMode.cudaAddressModeBorder, + 'Border address mode\n' + ){{endif}} + +{{endif}} +{{if 'cudaTextureFilterMode' in found_types}} + +class cudaTextureFilterMode(_FastEnum): + """ + CUDA texture filter modes + """ + {{if 'cudaFilterModePoint' in found_values}} + + cudaFilterModePoint = ( + cyruntime.cudaTextureFilterMode.cudaFilterModePoint, + 'Point filter mode\n' + ){{endif}} + {{if 'cudaFilterModeLinear' in found_values}} + + cudaFilterModeLinear = ( + cyruntime.cudaTextureFilterMode.cudaFilterModeLinear, + 'Linear filter mode\n' + ){{endif}} + +{{endif}} +{{if 'cudaTextureReadMode' in found_types}} + +class cudaTextureReadMode(_FastEnum): + """ + CUDA texture read modes + """ + {{if 'cudaReadModeElementType' in found_values}} + + cudaReadModeElementType = ( + cyruntime.cudaTextureReadMode.cudaReadModeElementType, + 'Read texture as specified element type\n' + ){{endif}} + {{if 'cudaReadModeNormalizedFloat' in found_values}} + + cudaReadModeNormalizedFloat = ( + cyruntime.cudaTextureReadMode.cudaReadModeNormalizedFloat, + 'Read texture as normalized float\n' + ){{endif}} + +{{endif}} +{{if 'cudaRoundMode' in found_types}} + +class cudaRoundMode(_FastEnum): + """ + + """ + {{if 'cudaRoundNearest' in found_values}} + cudaRoundNearest = cyruntime.cudaRoundMode.cudaRoundNearest{{endif}} + {{if 'cudaRoundZero' in found_values}} + cudaRoundZero = cyruntime.cudaRoundMode.cudaRoundZero{{endif}} + {{if 'cudaRoundPosInf' in found_values}} + cudaRoundPosInf = cyruntime.cudaRoundMode.cudaRoundPosInf{{endif}} + {{if 'cudaRoundMinInf' in found_values}} + cudaRoundMinInf = cyruntime.cudaRoundMode.cudaRoundMinInf{{endif}} + +{{endif}} +{{if True}} + +class cudaGLDeviceList(_FastEnum): + """ + CUDA devices corresponding to the current OpenGL context + """ + {{if True}} + + cudaGLDeviceListAll = ( + cyruntime.cudaGLDeviceList.cudaGLDeviceListAll, + 'The CUDA devices for all GPUs used by the current OpenGL context\n' + ){{endif}} + {{if True}} + + cudaGLDeviceListCurrentFrame = ( + cyruntime.cudaGLDeviceList.cudaGLDeviceListCurrentFrame, + 'The CUDA devices for the GPUs used by the current OpenGL context in its\n' + 'currently rendering frame\n' + ){{endif}} + {{if True}} + + cudaGLDeviceListNextFrame = ( + cyruntime.cudaGLDeviceList.cudaGLDeviceListNextFrame, + '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 cudaGLMapFlags(_FastEnum): + """ + CUDA GL Map Flags + """ + {{if True}} + + cudaGLMapFlagsNone = ( + cyruntime.cudaGLMapFlags.cudaGLMapFlagsNone, + 'Default; Assume resource can be read/written\n' + ){{endif}} + {{if True}} + + cudaGLMapFlagsReadOnly = ( + cyruntime.cudaGLMapFlags.cudaGLMapFlagsReadOnly, + 'CUDA kernels will not write to this resource\n' + ){{endif}} + {{if True}} + + cudaGLMapFlagsWriteDiscard = ( + cyruntime.cudaGLMapFlags.cudaGLMapFlagsWriteDiscard, + 'CUDA kernels will only write to and will not read from this resource\n' + ){{endif}} + +{{endif}} + +cdef object _cudaError_t = cudaError_t +cdef object _cudaError_t_SUCCESS = cudaError_t.cudaSuccess + + + +{{if 'cudaLaunchAttributeID' in found_types}} + +class cudaStreamAttrID(_FastEnum): + """ + Launch attributes enum; used as id field of + :py:obj:`~.cudaLaunchAttribute` + """ + {{if 'cudaLaunchAttributeIgnore' in found_values}} + + cudaLaunchAttributeIgnore = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore, + 'Ignored entry, for convenient composition\n' + ){{endif}} + {{if 'cudaLaunchAttributeAccessPolicyWindow' in found_values}} + + cudaLaunchAttributeAccessPolicyWindow = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeCooperative' in found_values}} + + cudaLaunchAttributeCooperative = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeCooperative, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.cooperative`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeSynchronizationPolicy' in found_values}} + + cudaLaunchAttributeSynchronizationPolicy = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy, + 'Valid for streams. See :py:obj:`~.cudaLaunchAttributeValue.syncPolicy`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterDimension' in found_values}} + + cudaLaunchAttributeClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterDim`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterSchedulingPolicyPreference' in found_values}} + + cudaLaunchAttributeClusterSchedulingPolicyPreference = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeProgrammaticStreamSerialization' in found_values}} + + cudaLaunchAttributeProgrammaticStreamSerialization = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization, + 'Valid for launches. Setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 'cudaLaunchAttributeProgrammaticEvent' in found_values}} + + cudaLaunchAttributeProgrammaticEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 programmatically in a future CUDA release. A trigger can\n' + "also be inserted at the beginning of each block's execution if\n" + 'triggerAtBlockStart is set to non-0. The dependent launches can choose to\n' + 'wait on the dependency using the programmatic sync\n' + '(cudaGridDependencySynchronize() or equivalent PTX instructions). Note that\n' + 'dependents (including the CPU thread calling\n' + ':py:obj:`~.cudaEventSynchronize()`) are not guaranteed to observe the\n' + 'release precisely when it is released. For example,\n' + ':py:obj:`~.cudaEventSynchronize()` 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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributePriority' in found_values}} + + cudaLaunchAttributePriority = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePriority, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.priority`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomainMap' in found_values}} + + cudaLaunchAttributeMemSyncDomainMap = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomain' in found_values}} + + cudaLaunchAttributeMemSyncDomain = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`.\n' + ){{endif}} + {{if 'cudaLaunchAttributePreferredClusterDimension' in found_values}} + + cudaLaunchAttributePreferredClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension, + 'Valid for graph nodes and launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.preferredClusterDim` to allow the\n' + 'kernel launch to specify a preferred substitute cluster dimension. Blocks\n' + 'may be grouped according to either the dimensions specified with this\n' + 'attribute (grouped into a "preferred substitute cluster"), or the one\n' + 'specified with :py:obj:`~.cudaLaunchAttributeClusterDimension` attribute\n' + '(grouped into a "regular cluster"). The cluster dimensions of a "preferred\n' + 'substitute cluster" shall be an integer multiple greater than zero of the\n' + 'regular cluster dimensions. The device will attempt - on a best-effort\n' + 'basis - to group thread blocks into preferred clusters over grouping them\n' + 'into regular clusters. When it deems necessary (primarily when the device\n' + 'temporarily runs out of physical resources to launch the larger preferred\n' + 'clusters), the device may switch to launch the regular clusters instead to\n' + 'attempt to 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 'cudaLaunchAttributeLaunchCompletionEvent' in found_values}} + + cudaLaunchAttributeLaunchCompletionEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributeDeviceUpdatableKernelNode' in found_values}} + + cudaLaunchAttributeDeviceUpdatableKernelNode = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, + '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' + ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' + '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' + '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:`~.cudaGraphDestroyNode`. 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:`~.cudaGraphKernelNodeCopyAttributes`.\n' + 'Graphs containing one or more device-updatable nodes also do not allow\n' + 'multiple instantiation, and neither the graph nor its instantiated version\n' + 'can be passed to :py:obj:`~.cudaGraphExecUpdate`.\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 'cudaLaunchAttributePreferredSharedMemoryCarveout' in found_values}} + + cudaLaunchAttributePreferredSharedMemoryCarveout = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout, + 'Valid for launches. On devices where the L1 cache and shared memory use the\n' + 'same hardware resources, setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.sharedMemCarveout` to a percentage\n' + 'between 0-100 signals sets the shared memory carveout preference in percent\n' + 'of the total shared memory for that kernel launch. This attribute takes\n' + 'precedence over :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout`.\n' + 'This is only a hint, and the driver can choose a different configuration if\n' + 'required for the launch.\n' + ){{endif}} + +{{endif}} +{{if 'cudaLaunchAttributeID' in found_types}} + +class cudaKernelNodeAttrID(_FastEnum): + """ + Launch attributes enum; used as id field of + :py:obj:`~.cudaLaunchAttribute` + """ + {{if 'cudaLaunchAttributeIgnore' in found_values}} + + cudaLaunchAttributeIgnore = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore, + 'Ignored entry, for convenient composition\n' + ){{endif}} + {{if 'cudaLaunchAttributeAccessPolicyWindow' in found_values}} + + cudaLaunchAttributeAccessPolicyWindow = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeCooperative' in found_values}} + + cudaLaunchAttributeCooperative = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeCooperative, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.cooperative`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeSynchronizationPolicy' in found_values}} + + cudaLaunchAttributeSynchronizationPolicy = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy, + 'Valid for streams. See :py:obj:`~.cudaLaunchAttributeValue.syncPolicy`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterDimension' in found_values}} + + cudaLaunchAttributeClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterDim`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeClusterSchedulingPolicyPreference' in found_values}} + + cudaLaunchAttributeClusterSchedulingPolicyPreference = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeProgrammaticStreamSerialization' in found_values}} + + cudaLaunchAttributeProgrammaticStreamSerialization = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization, + 'Valid for launches. Setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 'cudaLaunchAttributeProgrammaticEvent' in found_values}} + + cudaLaunchAttributeProgrammaticEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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 programmatically in a future CUDA release. A trigger can\n' + "also be inserted at the beginning of each block's execution if\n" + 'triggerAtBlockStart is set to non-0. The dependent launches can choose to\n' + 'wait on the dependency using the programmatic sync\n' + '(cudaGridDependencySynchronize() or equivalent PTX instructions). Note that\n' + 'dependents (including the CPU thread calling\n' + ':py:obj:`~.cudaEventSynchronize()`) are not guaranteed to observe the\n' + 'release precisely when it is released. For example,\n' + ':py:obj:`~.cudaEventSynchronize()` 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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributePriority' in found_values}} + + cudaLaunchAttributePriority = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePriority, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.priority`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomainMap' in found_values}} + + cudaLaunchAttributeMemSyncDomainMap = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`.\n' + ){{endif}} + {{if 'cudaLaunchAttributeMemSyncDomain' in found_values}} + + cudaLaunchAttributeMemSyncDomain = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`.\n' + ){{endif}} + {{if 'cudaLaunchAttributePreferredClusterDimension' in found_values}} + + cudaLaunchAttributePreferredClusterDimension = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension, + 'Valid for graph nodes and launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.preferredClusterDim` to allow the\n' + 'kernel launch to specify a preferred substitute cluster dimension. Blocks\n' + 'may be grouped according to either the dimensions specified with this\n' + 'attribute (grouped into a "preferred substitute cluster"), or the one\n' + 'specified with :py:obj:`~.cudaLaunchAttributeClusterDimension` attribute\n' + '(grouped into a "regular cluster"). The cluster dimensions of a "preferred\n' + 'substitute cluster" shall be an integer multiple greater than zero of the\n' + 'regular cluster dimensions. The device will attempt - on a best-effort\n' + 'basis - to group thread blocks into preferred clusters over grouping them\n' + 'into regular clusters. When it deems necessary (primarily when the device\n' + 'temporarily runs out of physical resources to launch the larger preferred\n' + 'clusters), the device may switch to launch the regular clusters instead to\n' + 'attempt to 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 'cudaLaunchAttributeLaunchCompletionEvent' in found_values}} + + cudaLaunchAttributeLaunchCompletionEvent = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent, + 'Valid for launches. Set\n' + ':py:obj:`~.cudaLaunchAttributeValue.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:`~.cudaEventDisableTiming` flag set).\n' + ){{endif}} + {{if 'cudaLaunchAttributeDeviceUpdatableKernelNode' in found_values}} + + cudaLaunchAttributeDeviceUpdatableKernelNode = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, + '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' + ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' + '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' + '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:`~.cudaGraphDestroyNode`. 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:`~.cudaGraphKernelNodeCopyAttributes`.\n' + 'Graphs containing one or more device-updatable nodes also do not allow\n' + 'multiple instantiation, and neither the graph nor its instantiated version\n' + 'can be passed to :py:obj:`~.cudaGraphExecUpdate`.\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 'cudaLaunchAttributePreferredSharedMemoryCarveout' in found_values}} + + cudaLaunchAttributePreferredSharedMemoryCarveout = ( + cyruntime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout, + 'Valid for launches. On devices where the L1 cache and shared memory use the\n' + 'same hardware resources, setting\n' + ':py:obj:`~.cudaLaunchAttributeValue.sharedMemCarveout` to a percentage\n' + 'between 0-100 signals sets the shared memory carveout preference in percent\n' + 'of the total shared memory for that kernel launch. This attribute takes\n' + 'precedence over :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout`.\n' + 'This is only a hint, and the driver can choose a different configuration if\n' + 'required for the launch.\n' + ){{endif}} + +{{endif}} +{{if 'cudaArray_t' in found_types}} + +cdef class cudaArray_t: + """ + + CUDA array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaArray_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaArray_const_t' in found_types}} + +cdef class cudaArray_const_t: + """ + + CUDA array (as source copy argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaArray_const_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaMipmappedArray_t' in found_types}} + +cdef class cudaMipmappedArray_t: + """ + + CUDA mipmapped array + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaMipmappedArray_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaMipmappedArray_const_t' in found_types}} + +cdef class cudaMipmappedArray_const_t: + """ + + CUDA mipmapped array (as source argument) + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaMipmappedArray_const_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaGraphicsResource_t' in found_types}} + +cdef class cudaGraphicsResource_t: + """ + + CUDA graphics resource types + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaGraphicsResource_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaExternalMemory_t' in found_types}} + +cdef class cudaExternalMemory_t: + """ + + CUDA external memory + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaExternalMemory_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaExternalSemaphore_t' in found_types}} + +cdef class cudaExternalSemaphore_t: + """ + + CUDA external semaphore + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaExternalSemaphore_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaKernel_t' in found_types}} + +cdef class cudaKernel_t: + """ + + CUDA kernel + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaKernel_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaLibrary_t' in found_types}} + +cdef class cudaLibrary_t: + """ + + CUDA library + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaLibrary_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaGraphDeviceNode_t' in found_types}} + +cdef class cudaGraphDeviceNode_t: + """ + + CUDA device node handle for device-side node update + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaGraphDeviceNode_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaAsyncCallbackHandle_t' in found_types}} + +cdef class cudaAsyncCallbackHandle_t: + """ + + CUDA async callback handle + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, cudaAsyncCallbackHandle_t): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLImageKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLImageKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLStreamKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLStreamKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLSyncKHR: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, EGLSyncKHR): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaHostFn_t' in found_types}} + +cdef class cudaHostFn_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 'cudaAsyncCallback' in found_types}} + +cdef class cudaAsyncCallback: + """ + + 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 'cudaStreamCallback_t' in found_types}} + +cdef class cudaStreamCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'dim3' in found_struct}} + +cdef class dim3: + """ + Attributes + ---------- + {{if 'dim3.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'dim3.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'dim3.z' in found_struct}} + z : unsigned int + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'dim3.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'dim3.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'dim3.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 'dim3.x' in found_struct}} + @property + def x(self): + return self._pvt_ptr[0].x + @x.setter + def x(self, unsigned int x): + self._pvt_ptr[0].x = x + {{endif}} + {{if 'dim3.y' in found_struct}} + @property + def y(self): + return self._pvt_ptr[0].y + @y.setter + def y(self, unsigned int y): + self._pvt_ptr[0].y = y + {{endif}} + {{if 'dim3.z' in found_struct}} + @property + def z(self): + return self._pvt_ptr[0].z + @z.setter + def z(self, unsigned int z): + self._pvt_ptr[0].z = z + {{endif}} +{{endif}} +{{if 'cudaChannelFormatDesc' in found_struct}} + +cdef class cudaChannelFormatDesc: + """ + CUDA Channel format descriptor + + Attributes + ---------- + {{if 'cudaChannelFormatDesc.x' in found_struct}} + x : int + x + {{endif}} + {{if 'cudaChannelFormatDesc.y' in found_struct}} + y : int + y + {{endif}} + {{if 'cudaChannelFormatDesc.z' in found_struct}} + z : int + z + {{endif}} + {{if 'cudaChannelFormatDesc.w' in found_struct}} + w : int + w + {{endif}} + {{if 'cudaChannelFormatDesc.f' in found_struct}} + f : cudaChannelFormatKind + Channel format kind + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaChannelFormatDesc.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'cudaChannelFormatDesc.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'cudaChannelFormatDesc.z' in found_struct}} + try: + str_list += ['z : ' + str(self.z)] + except ValueError: + str_list += ['z : '] + {{endif}} + {{if 'cudaChannelFormatDesc.w' in found_struct}} + try: + str_list += ['w : ' + str(self.w)] + except ValueError: + str_list += ['w : '] + {{endif}} + {{if 'cudaChannelFormatDesc.f' in found_struct}} + try: + str_list += ['f : ' + str(self.f)] + except ValueError: + str_list += ['f : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaChannelFormatDesc.x' in found_struct}} + @property + def x(self): + return self._pvt_ptr[0].x + @x.setter + def x(self, int x): + self._pvt_ptr[0].x = x + {{endif}} + {{if 'cudaChannelFormatDesc.y' in found_struct}} + @property + def y(self): + return self._pvt_ptr[0].y + @y.setter + def y(self, int y): + self._pvt_ptr[0].y = y + {{endif}} + {{if 'cudaChannelFormatDesc.z' in found_struct}} + @property + def z(self): + return self._pvt_ptr[0].z + @z.setter + def z(self, int z): + self._pvt_ptr[0].z = z + {{endif}} + {{if 'cudaChannelFormatDesc.w' in found_struct}} + @property + def w(self): + return self._pvt_ptr[0].w + @w.setter + def w(self, int w): + self._pvt_ptr[0].w = w + {{endif}} + {{if 'cudaChannelFormatDesc.f' in found_struct}} + @property + def f(self): + return cudaChannelFormatKind(self._pvt_ptr[0].f) + @f.setter + def f(self, f not None : cudaChannelFormatKind): + self._pvt_ptr[0].f = int(f) + {{endif}} +{{endif}} +{{if 'cudaArraySparseProperties.tileExtent' in found_struct}} + +cdef class anon_struct0: + """ + Attributes + ---------- + {{if 'cudaArraySparseProperties.tileExtent.width' in found_struct}} + width : unsigned int + + {{endif}} + {{if 'cudaArraySparseProperties.tileExtent.height' in found_struct}} + height : unsigned int + + {{endif}} + {{if 'cudaArraySparseProperties.tileExtent.depth' in found_struct}} + depth : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].tileExtent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaArraySparseProperties.tileExtent.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaArraySparseProperties.tileExtent.height' in found_struct}} + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + {{endif}} + {{if 'cudaArraySparseProperties.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 'cudaArraySparseProperties.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 'cudaArraySparseProperties.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 'cudaArraySparseProperties.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 'cudaArraySparseProperties' in found_struct}} + +cdef class cudaArraySparseProperties: + """ + Sparse CUDA array and CUDA mipmapped array properties + + Attributes + ---------- + {{if 'cudaArraySparseProperties.tileExtent' in found_struct}} + tileExtent : anon_struct0 + + {{endif}} + {{if 'cudaArraySparseProperties.miptailFirstLevel' in found_struct}} + miptailFirstLevel : unsigned int + First mip level at which the mip tail begins + {{endif}} + {{if 'cudaArraySparseProperties.miptailSize' in found_struct}} + miptailSize : unsigned long long + Total size of the mip tail. + {{endif}} + {{if 'cudaArraySparseProperties.flags' in found_struct}} + flags : unsigned int + Flags will either be zero or cudaArraySparsePropertiesSingleMipTail + {{endif}} + {{if 'cudaArraySparseProperties.reserved' in found_struct}} + reserved : list[unsigned int] + + {{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 'cudaArraySparseProperties.tileExtent' in found_struct}} + self._tileExtent = anon_struct0(_ptr=self._pvt_ptr) + {{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 'cudaArraySparseProperties.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 'cudaArraySparseProperties.miptailFirstLevel' in found_struct}} + try: + str_list += ['miptailFirstLevel : ' + str(self.miptailFirstLevel)] + except ValueError: + str_list += ['miptailFirstLevel : '] + {{endif}} + {{if 'cudaArraySparseProperties.miptailSize' in found_struct}} + try: + str_list += ['miptailSize : ' + str(self.miptailSize)] + except ValueError: + str_list += ['miptailSize : '] + {{endif}} + {{if 'cudaArraySparseProperties.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaArraySparseProperties.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 'cudaArraySparseProperties.tileExtent' in found_struct}} + @property + def tileExtent(self): + 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)) + {{endif}} + {{if 'cudaArraySparseProperties.miptailFirstLevel' in found_struct}} + @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 'cudaArraySparseProperties.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 'cudaArraySparseProperties.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 'cudaArraySparseProperties.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 'cudaArrayMemoryRequirements' in found_struct}} + +cdef class cudaArrayMemoryRequirements: + """ + CUDA array and CUDA mipmapped array memory requirements + + Attributes + ---------- + {{if 'cudaArrayMemoryRequirements.size' in found_struct}} + size : size_t + Total size of the array. + {{endif}} + {{if 'cudaArrayMemoryRequirements.alignment' in found_struct}} + alignment : size_t + Alignment necessary for mapping the array. + {{endif}} + {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} + reserved : list[unsigned int] + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaArrayMemoryRequirements.size' in found_struct}} + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + {{endif}} + {{if 'cudaArrayMemoryRequirements.alignment' in found_struct}} + try: + str_list += ['alignment : ' + str(self.alignment)] + except ValueError: + str_list += ['alignment : '] + {{endif}} + {{if 'cudaArrayMemoryRequirements.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 'cudaArrayMemoryRequirements.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 'cudaArrayMemoryRequirements.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 'cudaArrayMemoryRequirements.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 'cudaPitchedPtr' in found_struct}} + +cdef class cudaPitchedPtr: + """ + CUDA Pitched memory pointer make_cudaPitchedPtr + + Attributes + ---------- + {{if 'cudaPitchedPtr.ptr' in found_struct}} + ptr : Any + Pointer to allocated memory + {{endif}} + {{if 'cudaPitchedPtr.pitch' in found_struct}} + pitch : size_t + Pitch of allocated memory in bytes + {{endif}} + {{if 'cudaPitchedPtr.xsize' in found_struct}} + xsize : size_t + Logical width of allocation in elements + {{endif}} + {{if 'cudaPitchedPtr.ysize' in found_struct}} + ysize : size_t + Logical height of allocation in elements + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaPitchedPtr.ptr' in found_struct}} + try: + str_list += ['ptr : ' + hex(self.ptr)] + except ValueError: + str_list += ['ptr : '] + {{endif}} + {{if 'cudaPitchedPtr.pitch' in found_struct}} + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + {{endif}} + {{if 'cudaPitchedPtr.xsize' in found_struct}} + try: + str_list += ['xsize : ' + str(self.xsize)] + except ValueError: + str_list += ['xsize : '] + {{endif}} + {{if 'cudaPitchedPtr.ysize' in found_struct}} + try: + str_list += ['ysize : ' + str(self.ysize)] + except ValueError: + str_list += ['ysize : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaPitchedPtr.ptr' in found_struct}} + @property + def ptr(self): + return self._pvt_ptr[0].ptr + @ptr.setter + def ptr(self, ptr): + self._cyptr = _HelperInputVoidPtr(ptr) + self._pvt_ptr[0].ptr = self._cyptr.cptr + {{endif}} + {{if 'cudaPitchedPtr.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 'cudaPitchedPtr.xsize' in found_struct}} + @property + def xsize(self): + return self._pvt_ptr[0].xsize + @xsize.setter + def xsize(self, size_t xsize): + self._pvt_ptr[0].xsize = xsize + {{endif}} + {{if 'cudaPitchedPtr.ysize' in found_struct}} + @property + def ysize(self): + return self._pvt_ptr[0].ysize + @ysize.setter + def ysize(self, size_t ysize): + self._pvt_ptr[0].ysize = ysize + {{endif}} +{{endif}} +{{if 'cudaExtent' in found_struct}} + +cdef class cudaExtent: + """ + CUDA extent make_cudaExtent + + Attributes + ---------- + {{if 'cudaExtent.width' in found_struct}} + width : size_t + Width in elements when referring to array memory, in bytes when + referring to linear memory + {{endif}} + {{if 'cudaExtent.height' in found_struct}} + height : size_t + Height in elements + {{endif}} + {{if 'cudaExtent.depth' in found_struct}} + depth : size_t + Depth in elements + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExtent.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaExtent.height' in found_struct}} + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + {{endif}} + {{if 'cudaExtent.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 'cudaExtent.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 'cudaExtent.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 'cudaExtent.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 'cudaPos' in found_struct}} + +cdef class cudaPos: + """ + CUDA 3D position make_cudaPos + + Attributes + ---------- + {{if 'cudaPos.x' in found_struct}} + x : size_t + x + {{endif}} + {{if 'cudaPos.y' in found_struct}} + y : size_t + y + {{endif}} + {{if 'cudaPos.z' in found_struct}} + z : size_t + z + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaPos.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'cudaPos.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'cudaPos.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 'cudaPos.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 'cudaPos.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 'cudaPos.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 'cudaMemcpy3DParms' in found_struct}} + +cdef class cudaMemcpy3DParms: + """ + CUDA 3D memory copying parameters + + Attributes + ---------- + {{if 'cudaMemcpy3DParms.srcArray' in found_struct}} + srcArray : cudaArray_t + Source memory address + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + srcPos : cudaPos + Source position offset + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + srcPtr : cudaPitchedPtr + Pitched source memory address + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + dstArray : cudaArray_t + Destination memory address + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + dstPos : cudaPos + Destination position offset + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + dstPtr : cudaPitchedPtr + Pitched destination memory address + {{endif}} + {{if 'cudaMemcpy3DParms.extent' in found_struct}} + extent : cudaExtent + Requested memory copy size + {{endif}} + {{if 'cudaMemcpy3DParms.kind' in found_struct}} + kind : cudaMemcpyKind + Type of transfer + {{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 'cudaMemcpy3DParms.srcArray' in found_struct}} + self._srcArray = cudaArray_t(_ptr=&self._pvt_ptr[0].srcArray) + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + self._srcPos = cudaPos(_ptr=&self._pvt_ptr[0].srcPos) + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + self._srcPtr = cudaPitchedPtr(_ptr=&self._pvt_ptr[0].srcPtr) + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + self._dstArray = cudaArray_t(_ptr=&self._pvt_ptr[0].dstArray) + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + self._dstPos = cudaPos(_ptr=&self._pvt_ptr[0].dstPos) + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + self._dstPtr = cudaPitchedPtr(_ptr=&self._pvt_ptr[0].dstPtr) + {{endif}} + {{if 'cudaMemcpy3DParms.extent' in found_struct}} + self._extent = cudaExtent(_ptr=&self._pvt_ptr[0].extent) + {{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 'cudaMemcpy3DParms.srcArray' in found_struct}} + try: + str_list += ['srcArray : ' + str(self.srcArray)] + except ValueError: + str_list += ['srcArray : '] + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + try: + str_list += ['srcPos :\n' + '\n'.join([' ' + line for line in str(self.srcPos).splitlines()])] + except ValueError: + str_list += ['srcPos : '] + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + try: + str_list += ['srcPtr :\n' + '\n'.join([' ' + line for line in str(self.srcPtr).splitlines()])] + except ValueError: + str_list += ['srcPtr : '] + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + try: + str_list += ['dstArray : ' + str(self.dstArray)] + except ValueError: + str_list += ['dstArray : '] + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + try: + str_list += ['dstPos :\n' + '\n'.join([' ' + line for line in str(self.dstPos).splitlines()])] + except ValueError: + str_list += ['dstPos : '] + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + try: + str_list += ['dstPtr :\n' + '\n'.join([' ' + line for line in str(self.dstPtr).splitlines()])] + except ValueError: + str_list += ['dstPtr : '] + {{endif}} + {{if 'cudaMemcpy3DParms.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 'cudaMemcpy3DParms.kind' in found_struct}} + try: + str_list += ['kind : ' + str(self.kind)] + except ValueError: + str_list += ['kind : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaMemcpy3DParms.srcArray' in found_struct}} + @property + def srcArray(self): + return self._srcArray + @srcArray.setter + def srcArray(self, srcArray): + cdef cyruntime.cudaArray_t cysrcArray + if srcArray is None: + cysrcArray = 0 + elif isinstance(srcArray, (cudaArray_t,)): + psrcArray = int(srcArray) + cysrcArray = psrcArray + else: + psrcArray = int(cudaArray_t(srcArray)) + cysrcArray = psrcArray + self._srcArray._pvt_ptr[0] = cysrcArray + {{endif}} + {{if 'cudaMemcpy3DParms.srcPos' in found_struct}} + @property + def srcPos(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} + @property + def srcPtr(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} + @property + def dstArray(self): + return self._dstArray + @dstArray.setter + def dstArray(self, dstArray): + cdef cyruntime.cudaArray_t cydstArray + if dstArray is None: + cydstArray = 0 + elif isinstance(dstArray, (cudaArray_t,)): + pdstArray = int(dstArray) + cydstArray = pdstArray + else: + pdstArray = int(cudaArray_t(dstArray)) + cydstArray = pdstArray + self._dstArray._pvt_ptr[0] = cydstArray + {{endif}} + {{if 'cudaMemcpy3DParms.dstPos' in found_struct}} + @property + def dstPos(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} + @property + def dstPtr(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DParms.extent' in found_struct}} + @property + def extent(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DParms.kind' in found_struct}} + @property + def kind(self): + return cudaMemcpyKind(self._pvt_ptr[0].kind) + @kind.setter + def kind(self, kind not None : cudaMemcpyKind): + self._pvt_ptr[0].kind = int(kind) + {{endif}} +{{endif}} +{{if 'cudaMemcpyNodeParams' in found_struct}} + +cdef class cudaMemcpyNodeParams: + """ + Memcpy node parameters + + Attributes + ---------- + {{if 'cudaMemcpyNodeParams.flags' in found_struct}} + flags : int + Must be zero + {{endif}} + {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} + reserved : list[int] + Must be zero + {{endif}} + {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} + copyParams : cudaMemcpy3DParms + Parameters for the memory copy + {{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 'cudaMemcpyNodeParams.copyParams' in found_struct}} + self._copyParams = cudaMemcpy3DParms(_ptr=&self._pvt_ptr[0].copyParams) + {{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 'cudaMemcpyNodeParams.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} + {{if 'cudaMemcpyNodeParams.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 'cudaMemcpyNodeParams.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 'cudaMemcpyNodeParams.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}} + {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} + @property + def copyParams(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DPeerParms' in found_struct}} + +cdef class cudaMemcpy3DPeerParms: + """ + CUDA 3D cross-device memory copying parameters + + Attributes + ---------- + {{if 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + srcArray : cudaArray_t + Source memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + srcPos : cudaPos + Source position offset + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + srcPtr : cudaPitchedPtr + Pitched source memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcDevice' in found_struct}} + srcDevice : int + Source device + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + dstArray : cudaArray_t + Destination memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + dstPos : cudaPos + Destination position offset + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + dstPtr : cudaPitchedPtr + Pitched destination memory address + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstDevice' in found_struct}} + dstDevice : int + Destination device + {{endif}} + {{if 'cudaMemcpy3DPeerParms.extent' in found_struct}} + extent : cudaExtent + Requested memory copy size + {{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 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + self._srcArray = cudaArray_t(_ptr=&self._pvt_ptr[0].srcArray) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + self._srcPos = cudaPos(_ptr=&self._pvt_ptr[0].srcPos) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + self._srcPtr = cudaPitchedPtr(_ptr=&self._pvt_ptr[0].srcPtr) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + self._dstArray = cudaArray_t(_ptr=&self._pvt_ptr[0].dstArray) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + self._dstPos = cudaPos(_ptr=&self._pvt_ptr[0].dstPos) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + self._dstPtr = cudaPitchedPtr(_ptr=&self._pvt_ptr[0].dstPtr) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.extent' in found_struct}} + self._extent = cudaExtent(_ptr=&self._pvt_ptr[0].extent) + {{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 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + try: + str_list += ['srcArray : ' + str(self.srcArray)] + except ValueError: + str_list += ['srcArray : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + try: + str_list += ['srcPos :\n' + '\n'.join([' ' + line for line in str(self.srcPos).splitlines()])] + except ValueError: + str_list += ['srcPos : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + try: + str_list += ['srcPtr :\n' + '\n'.join([' ' + line for line in str(self.srcPtr).splitlines()])] + except ValueError: + str_list += ['srcPtr : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcDevice' in found_struct}} + try: + str_list += ['srcDevice : ' + str(self.srcDevice)] + except ValueError: + str_list += ['srcDevice : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + try: + str_list += ['dstArray : ' + str(self.dstArray)] + except ValueError: + str_list += ['dstArray : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + try: + str_list += ['dstPos :\n' + '\n'.join([' ' + line for line in str(self.dstPos).splitlines()])] + except ValueError: + str_list += ['dstPos : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + try: + str_list += ['dstPtr :\n' + '\n'.join([' ' + line for line in str(self.dstPtr).splitlines()])] + except ValueError: + str_list += ['dstPtr : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstDevice' in found_struct}} + try: + str_list += ['dstDevice : ' + str(self.dstDevice)] + except ValueError: + str_list += ['dstDevice : '] + {{endif}} + {{if 'cudaMemcpy3DPeerParms.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}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaMemcpy3DPeerParms.srcArray' in found_struct}} + @property + def srcArray(self): + return self._srcArray + @srcArray.setter + def srcArray(self, srcArray): + cdef cyruntime.cudaArray_t cysrcArray + if srcArray is None: + cysrcArray = 0 + elif isinstance(srcArray, (cudaArray_t,)): + psrcArray = int(srcArray) + cysrcArray = psrcArray + else: + psrcArray = int(cudaArray_t(srcArray)) + cysrcArray = psrcArray + self._srcArray._pvt_ptr[0] = cysrcArray + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPos' in found_struct}} + @property + def srcPos(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} + @property + def srcPtr(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.srcDevice' in found_struct}} + @property + def srcDevice(self): + return self._pvt_ptr[0].srcDevice + @srcDevice.setter + def srcDevice(self, int srcDevice): + self._pvt_ptr[0].srcDevice = srcDevice + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstArray' in found_struct}} + @property + def dstArray(self): + return self._dstArray + @dstArray.setter + def dstArray(self, dstArray): + cdef cyruntime.cudaArray_t cydstArray + if dstArray is None: + cydstArray = 0 + elif isinstance(dstArray, (cudaArray_t,)): + pdstArray = int(dstArray) + cydstArray = pdstArray + else: + pdstArray = int(cudaArray_t(dstArray)) + cydstArray = pdstArray + self._dstArray._pvt_ptr[0] = cydstArray + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPos' in found_struct}} + @property + def dstPos(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} + @property + def dstPtr(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DPeerParms.dstDevice' in found_struct}} + @property + def dstDevice(self): + return self._pvt_ptr[0].dstDevice + @dstDevice.setter + def dstDevice(self, int dstDevice): + self._pvt_ptr[0].dstDevice = dstDevice + {{endif}} + {{if 'cudaMemcpy3DPeerParms.extent' in found_struct}} + @property + def extent(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaMemsetParams' in found_struct}} + +cdef class cudaMemsetParams: + """ + CUDA Memset node parameters + + Attributes + ---------- + {{if 'cudaMemsetParams.dst' in found_struct}} + dst : Any + Destination device pointer + {{endif}} + {{if 'cudaMemsetParams.pitch' in found_struct}} + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + {{endif}} + {{if 'cudaMemsetParams.value' in found_struct}} + value : unsigned int + Value to be set + {{endif}} + {{if 'cudaMemsetParams.elementSize' in found_struct}} + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + {{endif}} + {{if 'cudaMemsetParams.width' in found_struct}} + width : size_t + Width of the row in elements + {{endif}} + {{if 'cudaMemsetParams.height' in found_struct}} + height : size_t + Number of rows + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemsetParams.dst' in found_struct}} + try: + str_list += ['dst : ' + hex(self.dst)] + except ValueError: + str_list += ['dst : '] + {{endif}} + {{if 'cudaMemsetParams.pitch' in found_struct}} + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + {{endif}} + {{if 'cudaMemsetParams.value' in found_struct}} + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + {{endif}} + {{if 'cudaMemsetParams.elementSize' in found_struct}} + try: + str_list += ['elementSize : ' + str(self.elementSize)] + except ValueError: + str_list += ['elementSize : '] + {{endif}} + {{if 'cudaMemsetParams.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaMemsetParams.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 'cudaMemsetParams.dst' in found_struct}} + @property + def dst(self): + return self._pvt_ptr[0].dst + @dst.setter + def dst(self, dst): + self._cydst = _HelperInputVoidPtr(dst) + self._pvt_ptr[0].dst = self._cydst.cptr + {{endif}} + {{if 'cudaMemsetParams.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 'cudaMemsetParams.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 'cudaMemsetParams.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 'cudaMemsetParams.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 'cudaMemsetParams.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 'cudaMemsetParamsV2' in found_struct}} + +cdef class cudaMemsetParamsV2: + """ + CUDA Memset node parameters + + Attributes + ---------- + {{if 'cudaMemsetParamsV2.dst' in found_struct}} + dst : Any + Destination device pointer + {{endif}} + {{if 'cudaMemsetParamsV2.pitch' in found_struct}} + pitch : size_t + Pitch of destination device pointer. Unused if height is 1 + {{endif}} + {{if 'cudaMemsetParamsV2.value' in found_struct}} + value : unsigned int + Value to be set + {{endif}} + {{if 'cudaMemsetParamsV2.elementSize' in found_struct}} + elementSize : unsigned int + Size of each element in bytes. Must be 1, 2, or 4. + {{endif}} + {{if 'cudaMemsetParamsV2.width' in found_struct}} + width : size_t + Width of the row in elements + {{endif}} + {{if 'cudaMemsetParamsV2.height' in found_struct}} + height : size_t + Number of rows + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemsetParamsV2.dst' in found_struct}} + try: + str_list += ['dst : ' + hex(self.dst)] + except ValueError: + str_list += ['dst : '] + {{endif}} + {{if 'cudaMemsetParamsV2.pitch' in found_struct}} + try: + str_list += ['pitch : ' + str(self.pitch)] + except ValueError: + str_list += ['pitch : '] + {{endif}} + {{if 'cudaMemsetParamsV2.value' in found_struct}} + try: + str_list += ['value : ' + str(self.value)] + except ValueError: + str_list += ['value : '] + {{endif}} + {{if 'cudaMemsetParamsV2.elementSize' in found_struct}} + try: + str_list += ['elementSize : ' + str(self.elementSize)] + except ValueError: + str_list += ['elementSize : '] + {{endif}} + {{if 'cudaMemsetParamsV2.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaMemsetParamsV2.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 'cudaMemsetParamsV2.dst' in found_struct}} + @property + def dst(self): + return self._pvt_ptr[0].dst + @dst.setter + def dst(self, dst): + self._cydst = _HelperInputVoidPtr(dst) + self._pvt_ptr[0].dst = self._cydst.cptr + {{endif}} + {{if 'cudaMemsetParamsV2.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 'cudaMemsetParamsV2.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 'cudaMemsetParamsV2.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 'cudaMemsetParamsV2.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 'cudaMemsetParamsV2.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 'cudaAccessPolicyWindow' in found_struct}} + +cdef class cudaAccessPolicyWindow: + """ + Specifies an access policy for a window, a contiguous extent of + memory beginning at base_ptr and ending at base_ptr + num_bytes. + Partition into many segments and assign segments such that. sum of + "hit segments" / window == approx. ratio. sum of "miss segments" / + window == approx 1-ratio. Segments and ratio specifications are + fitted to the capabilities of the architecture. Accesses in a hit + segment apply the hitProp access policy. Accesses in a miss segment + apply the missProp access policy. + + Attributes + ---------- + {{if 'cudaAccessPolicyWindow.base_ptr' in found_struct}} + base_ptr : Any + Starting address of the access policy window. CUDA driver may align + it. + {{endif}} + {{if 'cudaAccessPolicyWindow.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 'cudaAccessPolicyWindow.hitRatio' in found_struct}} + hitRatio : float + hitRatio specifies percentage of lines assigned hitProp, rest are + assigned missProp. + {{endif}} + {{if 'cudaAccessPolicyWindow.hitProp' in found_struct}} + hitProp : cudaAccessProperty + ::CUaccessProperty set for hit. + {{endif}} + {{if 'cudaAccessPolicyWindow.missProp' in found_struct}} + missProp : cudaAccessProperty + ::CUaccessProperty set for miss. Must be either NORMAL or + STREAMING. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaAccessPolicyWindow.base_ptr' in found_struct}} + try: + str_list += ['base_ptr : ' + hex(self.base_ptr)] + except ValueError: + str_list += ['base_ptr : '] + {{endif}} + {{if 'cudaAccessPolicyWindow.num_bytes' in found_struct}} + try: + str_list += ['num_bytes : ' + str(self.num_bytes)] + except ValueError: + str_list += ['num_bytes : '] + {{endif}} + {{if 'cudaAccessPolicyWindow.hitRatio' in found_struct}} + try: + str_list += ['hitRatio : ' + str(self.hitRatio)] + except ValueError: + str_list += ['hitRatio : '] + {{endif}} + {{if 'cudaAccessPolicyWindow.hitProp' in found_struct}} + try: + str_list += ['hitProp : ' + str(self.hitProp)] + except ValueError: + str_list += ['hitProp : '] + {{endif}} + {{if 'cudaAccessPolicyWindow.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 'cudaAccessPolicyWindow.base_ptr' in found_struct}} + @property + def base_ptr(self): + return self._pvt_ptr[0].base_ptr + @base_ptr.setter + def base_ptr(self, base_ptr): + self._cybase_ptr = _HelperInputVoidPtr(base_ptr) + self._pvt_ptr[0].base_ptr = self._cybase_ptr.cptr + {{endif}} + {{if 'cudaAccessPolicyWindow.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 'cudaAccessPolicyWindow.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 'cudaAccessPolicyWindow.hitProp' in found_struct}} + @property + def hitProp(self): + return cudaAccessProperty(self._pvt_ptr[0].hitProp) + @hitProp.setter + def hitProp(self, hitProp not None : cudaAccessProperty): + self._pvt_ptr[0].hitProp = int(hitProp) + {{endif}} + {{if 'cudaAccessPolicyWindow.missProp' in found_struct}} + @property + def missProp(self): + return cudaAccessProperty(self._pvt_ptr[0].missProp) + @missProp.setter + def missProp(self, missProp not None : cudaAccessProperty): + self._pvt_ptr[0].missProp = int(missProp) + {{endif}} +{{endif}} +{{if 'cudaHostNodeParams' in found_struct}} + +cdef class cudaHostNodeParams: + """ + CUDA host node parameters + + Attributes + ---------- + {{if 'cudaHostNodeParams.fn' in found_struct}} + fn : cudaHostFn_t + The function to call when the node executes + {{endif}} + {{if 'cudaHostNodeParams.userData' in found_struct}} + userData : Any + Argument to pass to the 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 'cudaHostNodeParams.fn' in found_struct}} + self._fn = cudaHostFn_t(_ptr=&self._pvt_ptr[0].fn) + {{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 'cudaHostNodeParams.fn' in found_struct}} + try: + str_list += ['fn : ' + str(self.fn)] + except ValueError: + str_list += ['fn : '] + {{endif}} + {{if 'cudaHostNodeParams.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 'cudaHostNodeParams.fn' in found_struct}} + @property + def fn(self): + return self._fn + @fn.setter + def fn(self, fn): + cdef cyruntime.cudaHostFn_t cyfn + if fn is None: + cyfn = 0 + elif isinstance(fn, (cudaHostFn_t)): + pfn = int(fn) + cyfn = pfn + else: + pfn = int(cudaHostFn_t(fn)) + cyfn = pfn + self._fn._pvt_ptr[0] = cyfn + {{endif}} + {{if 'cudaHostNodeParams.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 'cudaHostNodeParamsV2' in found_struct}} + +cdef class cudaHostNodeParamsV2: + """ + CUDA host node parameters + + Attributes + ---------- + {{if 'cudaHostNodeParamsV2.fn' in found_struct}} + fn : cudaHostFn_t + The function to call when the node executes + {{endif}} + {{if 'cudaHostNodeParamsV2.userData' in found_struct}} + userData : Any + Argument to pass to the 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 'cudaHostNodeParamsV2.fn' in found_struct}} + self._fn = cudaHostFn_t(_ptr=&self._pvt_ptr[0].fn) + {{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 'cudaHostNodeParamsV2.fn' in found_struct}} + try: + str_list += ['fn : ' + str(self.fn)] + except ValueError: + str_list += ['fn : '] + {{endif}} + {{if 'cudaHostNodeParamsV2.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 'cudaHostNodeParamsV2.fn' in found_struct}} + @property + def fn(self): + return self._fn + @fn.setter + def fn(self, fn): + cdef cyruntime.cudaHostFn_t cyfn + if fn is None: + cyfn = 0 + elif isinstance(fn, (cudaHostFn_t)): + pfn = int(fn) + cyfn = pfn + else: + pfn = int(cudaHostFn_t(fn)) + cyfn = pfn + self._fn._pvt_ptr[0] = cyfn + {{endif}} + {{if 'cudaHostNodeParamsV2.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 'cudaResourceDesc.res.array' in found_struct}} + +cdef class anon_struct1: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.array.array' in found_struct}} + array : cudaArray_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaResourceDesc.res.array.array' in found_struct}} + self._array = cudaArray_t(_ptr=&self._pvt_ptr[0].res.array.array) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.array + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.res.array.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 'cudaResourceDesc.res.array.array' in found_struct}} + @property + def array(self): + return self._array + @array.setter + def array(self, array): + cdef cyruntime.cudaArray_t cyarray + if array is None: + cyarray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + cyarray = parray + else: + parray = int(cudaArray_t(array)) + cyarray = parray + self._array._pvt_ptr[0] = cyarray + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.mipmap' in found_struct}} + +cdef class anon_struct2: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + mipmap : cudaMipmappedArray_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + self._mipmap = cudaMipmappedArray_t(_ptr=&self._pvt_ptr[0].res.mipmap.mipmap) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.mipmap + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + try: + str_list += ['mipmap : ' + str(self.mipmap)] + except ValueError: + str_list += ['mipmap : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaResourceDesc.res.mipmap.mipmap' in found_struct}} + @property + def mipmap(self): + return self._mipmap + @mipmap.setter + def mipmap(self, mipmap): + cdef cyruntime.cudaMipmappedArray_t cymipmap + if mipmap is None: + cymipmap = 0 + elif isinstance(mipmap, (cudaMipmappedArray_t,)): + pmipmap = int(mipmap) + cymipmap = pmipmap + else: + pmipmap = int(cudaMipmappedArray_t(mipmap)) + cymipmap = pmipmap + self._mipmap._pvt_ptr[0] = cymipmap + {{endif}} +{{endif}} +{{if 'cudaResourceDesc.res.linear' in found_struct}} + +cdef class anon_struct3: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.linear.devPtr' in found_struct}} + devPtr : Any + + {{endif}} + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + desc : cudaChannelFormatDesc + + {{endif}} + {{if 'cudaResourceDesc.res.linear.sizeInBytes' in found_struct}} + sizeInBytes : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + self._desc = cudaChannelFormatDesc(_ptr=&self._pvt_ptr[0].res.linear.desc) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.linear + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.res.linear.devPtr' in found_struct}} + try: + str_list += ['devPtr : ' + hex(self.devPtr)] + except ValueError: + str_list += ['devPtr : '] + {{endif}} + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + try: + str_list += ['desc :\n' + '\n'.join([' ' + line for line in str(self.desc).splitlines()])] + except ValueError: + str_list += ['desc : '] + {{endif}} + {{if 'cudaResourceDesc.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 'cudaResourceDesc.res.linear.devPtr' in found_struct}} + @property + def devPtr(self): + return self._pvt_ptr[0].res.linear.devPtr + @devPtr.setter + def devPtr(self, devPtr): + self._cydevPtr = _HelperInputVoidPtr(devPtr) + self._pvt_ptr[0].res.linear.devPtr = self._cydevPtr.cptr + {{endif}} + {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} + @property + def desc(self): + 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)) + {{endif}} + {{if 'cudaResourceDesc.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 'cudaResourceDesc.res.pitch2D' in found_struct}} + +cdef class anon_struct4: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.pitch2D.devPtr' in found_struct}} + devPtr : Any + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + desc : cudaChannelFormatDesc + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.width' in found_struct}} + width : size_t + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.height' in found_struct}} + height : size_t + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.pitchInBytes' in found_struct}} + pitchInBytes : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + self._desc = cudaChannelFormatDesc(_ptr=&self._pvt_ptr[0].res.pitch2D.desc) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res.pitch2D + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.res.pitch2D.devPtr' in found_struct}} + try: + str_list += ['devPtr : ' + hex(self.devPtr)] + except ValueError: + str_list += ['devPtr : '] + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + try: + str_list += ['desc :\n' + '\n'.join([' ' + line for line in str(self.desc).splitlines()])] + except ValueError: + str_list += ['desc : '] + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.height' in found_struct}} + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + {{endif}} + {{if 'cudaResourceDesc.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 'cudaResourceDesc.res.pitch2D.devPtr' in found_struct}} + @property + def devPtr(self): + return self._pvt_ptr[0].res.pitch2D.devPtr + @devPtr.setter + def devPtr(self, devPtr): + self._cydevPtr = _HelperInputVoidPtr(devPtr) + self._pvt_ptr[0].res.pitch2D.devPtr = self._cydevPtr.cptr + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} + @property + def desc(self): + 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)) + {{endif}} + {{if 'cudaResourceDesc.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 'cudaResourceDesc.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 'cudaResourceDesc.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 'cudaResourceDesc.res' in found_struct}} + +cdef class anon_union0: + """ + Attributes + ---------- + {{if 'cudaResourceDesc.res.array' in found_struct}} + array : anon_struct1 + + {{endif}} + {{if 'cudaResourceDesc.res.mipmap' in found_struct}} + mipmap : anon_struct2 + + {{endif}} + {{if 'cudaResourceDesc.res.linear' in found_struct}} + linear : anon_struct3 + + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + pitch2D : anon_struct4 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaResourceDesc.res.array' in found_struct}} + self._array = anon_struct1(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaResourceDesc.res.mipmap' in found_struct}} + self._mipmap = anon_struct2(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaResourceDesc.res.linear' in found_struct}} + self._linear = anon_struct3(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + self._pitch2D = anon_struct4(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].res + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceDesc.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 'cudaResourceDesc.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 'cudaResourceDesc.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 'cudaResourceDesc.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}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaResourceDesc.res.array' in found_struct}} + @property + def array(self): + 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)) + {{endif}} + {{if 'cudaResourceDesc.res.mipmap' in found_struct}} + @property + def mipmap(self): + 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)) + {{endif}} + {{if 'cudaResourceDesc.res.linear' in found_struct}} + @property + def linear(self): + 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)) + {{endif}} + {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} + @property + def pitch2D(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaResourceDesc' in found_struct}} + +cdef class cudaResourceDesc: + """ + CUDA resource descriptor + + Attributes + ---------- + {{if 'cudaResourceDesc.resType' in found_struct}} + resType : cudaResourceType + Resource type + {{endif}} + {{if 'cudaResourceDesc.res' in found_struct}} + res : anon_union0 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaResourceDesc)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaResourceDesc.res' in found_struct}} + self._res = anon_union0(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{if 'cudaResourceDesc.resType' in found_struct}} + try: + str_list += ['resType : ' + str(self.resType)] + except ValueError: + str_list += ['resType : '] + {{endif}} + {{if 'cudaResourceDesc.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}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaResourceDesc.resType' in found_struct}} + @property + def resType(self): + return cudaResourceType(self._pvt_ptr[0].resType) + @resType.setter + def resType(self, resType not None : cudaResourceType): + self._pvt_ptr[0].resType = int(resType) + {{endif}} + {{if 'cudaResourceDesc.res' in found_struct}} + @property + def res(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaResourceViewDesc' in found_struct}} + +cdef class cudaResourceViewDesc: + """ + CUDA resource view descriptor + + Attributes + ---------- + {{if 'cudaResourceViewDesc.format' in found_struct}} + format : cudaResourceViewFormat + Resource view format + {{endif}} + {{if 'cudaResourceViewDesc.width' in found_struct}} + width : size_t + Width of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.height' in found_struct}} + height : size_t + Height of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.depth' in found_struct}} + depth : size_t + Depth of the resource view + {{endif}} + {{if 'cudaResourceViewDesc.firstMipmapLevel' in found_struct}} + firstMipmapLevel : unsigned int + First defined mipmap level + {{endif}} + {{if 'cudaResourceViewDesc.lastMipmapLevel' in found_struct}} + lastMipmapLevel : unsigned int + Last defined mipmap level + {{endif}} + {{if 'cudaResourceViewDesc.firstLayer' in found_struct}} + firstLayer : unsigned int + First layer index + {{endif}} + {{if 'cudaResourceViewDesc.lastLayer' in found_struct}} + lastLayer : unsigned int + Last layer index + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaResourceViewDesc.format' in found_struct}} + try: + str_list += ['format : ' + str(self.format)] + except ValueError: + str_list += ['format : '] + {{endif}} + {{if 'cudaResourceViewDesc.width' in found_struct}} + try: + str_list += ['width : ' + str(self.width)] + except ValueError: + str_list += ['width : '] + {{endif}} + {{if 'cudaResourceViewDesc.height' in found_struct}} + try: + str_list += ['height : ' + str(self.height)] + except ValueError: + str_list += ['height : '] + {{endif}} + {{if 'cudaResourceViewDesc.depth' in found_struct}} + try: + str_list += ['depth : ' + str(self.depth)] + except ValueError: + str_list += ['depth : '] + {{endif}} + {{if 'cudaResourceViewDesc.firstMipmapLevel' in found_struct}} + try: + str_list += ['firstMipmapLevel : ' + str(self.firstMipmapLevel)] + except ValueError: + str_list += ['firstMipmapLevel : '] + {{endif}} + {{if 'cudaResourceViewDesc.lastMipmapLevel' in found_struct}} + try: + str_list += ['lastMipmapLevel : ' + str(self.lastMipmapLevel)] + except ValueError: + str_list += ['lastMipmapLevel : '] + {{endif}} + {{if 'cudaResourceViewDesc.firstLayer' in found_struct}} + try: + str_list += ['firstLayer : ' + str(self.firstLayer)] + except ValueError: + str_list += ['firstLayer : '] + {{endif}} + {{if 'cudaResourceViewDesc.lastLayer' in found_struct}} + try: + str_list += ['lastLayer : ' + str(self.lastLayer)] + except ValueError: + str_list += ['lastLayer : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaResourceViewDesc.format' in found_struct}} + @property + def format(self): + return cudaResourceViewFormat(self._pvt_ptr[0].format) + @format.setter + def format(self, format not None : cudaResourceViewFormat): + self._pvt_ptr[0].format = int(format) + {{endif}} + {{if 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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 'cudaResourceViewDesc.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}} +{{endif}} +{{if 'cudaPointerAttributes' in found_struct}} + +cdef class cudaPointerAttributes: + """ + CUDA pointer attributes + + Attributes + ---------- + {{if 'cudaPointerAttributes.type' in found_struct}} + type : cudaMemoryType + The type of memory - cudaMemoryTypeUnregistered, + cudaMemoryTypeHost, cudaMemoryTypeDevice or cudaMemoryTypeManaged. + {{endif}} + {{if 'cudaPointerAttributes.device' in found_struct}} + device : int + The device against which the memory was allocated or registered. If + the memory type is cudaMemoryTypeDevice then this identifies the + device on which the memory referred physically resides. If the + memory type is cudaMemoryTypeHost or::cudaMemoryTypeManaged then + this identifies the device which was current when the memory was + allocated or registered (and if that device is deinitialized then + this allocation will vanish with that device's state). + {{endif}} + {{if 'cudaPointerAttributes.devicePointer' in found_struct}} + devicePointer : Any + The address which may be dereferenced on the current device to + access the memory or NULL if no such address exists. + {{endif}} + {{if 'cudaPointerAttributes.hostPointer' in found_struct}} + hostPointer : Any + The address which may be dereferenced on the host to access the + memory or NULL if no such address exists. CUDA doesn't check if + unregistered memory is allocated so this field may contain invalid + pointer if an invalid pointer has been passed to CUDA. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaPointerAttributes.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaPointerAttributes.device' in found_struct}} + try: + str_list += ['device : ' + str(self.device)] + except ValueError: + str_list += ['device : '] + {{endif}} + {{if 'cudaPointerAttributes.devicePointer' in found_struct}} + try: + str_list += ['devicePointer : ' + hex(self.devicePointer)] + except ValueError: + str_list += ['devicePointer : '] + {{endif}} + {{if 'cudaPointerAttributes.hostPointer' in found_struct}} + try: + str_list += ['hostPointer : ' + hex(self.hostPointer)] + except ValueError: + str_list += ['hostPointer : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaPointerAttributes.type' in found_struct}} + @property + def type(self): + return cudaMemoryType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaMemoryType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaPointerAttributes.device' in found_struct}} + @property + def device(self): + return self._pvt_ptr[0].device + @device.setter + def device(self, int device): + self._pvt_ptr[0].device = device + {{endif}} + {{if 'cudaPointerAttributes.devicePointer' in found_struct}} + @property + def devicePointer(self): + return self._pvt_ptr[0].devicePointer + @devicePointer.setter + def devicePointer(self, devicePointer): + self._cydevicePointer = _HelperInputVoidPtr(devicePointer) + self._pvt_ptr[0].devicePointer = self._cydevicePointer.cptr + {{endif}} + {{if 'cudaPointerAttributes.hostPointer' in found_struct}} + @property + def hostPointer(self): + return self._pvt_ptr[0].hostPointer + @hostPointer.setter + def hostPointer(self, hostPointer): + self._cyhostPointer = _HelperInputVoidPtr(hostPointer) + self._pvt_ptr[0].hostPointer = self._cyhostPointer.cptr + {{endif}} +{{endif}} +{{if 'cudaFuncAttributes' in found_struct}} + +cdef class cudaFuncAttributes: + """ + CUDA function attributes + + Attributes + ---------- + {{if 'cudaFuncAttributes.sharedSizeBytes' in found_struct}} + sharedSizeBytes : size_t + The size in bytes of statically-allocated shared memory per block + required by this function. This does not include dynamically- + allocated shared memory requested by the user at runtime. + {{endif}} + {{if 'cudaFuncAttributes.constSizeBytes' in found_struct}} + constSizeBytes : size_t + The size in bytes of user-allocated constant memory required by + this function. + {{endif}} + {{if 'cudaFuncAttributes.localSizeBytes' in found_struct}} + localSizeBytes : size_t + The size in bytes of local memory used by each thread of this + function. + {{endif}} + {{if 'cudaFuncAttributes.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int + The maximum number of threads per block, beyond which a launch of + the function would fail. This number depends on both the function + and the device on which the function is currently loaded. + {{endif}} + {{if 'cudaFuncAttributes.numRegs' in found_struct}} + numRegs : int + The number of registers used by each thread of this function. + {{endif}} + {{if 'cudaFuncAttributes.ptxVersion' in found_struct}} + ptxVersion : int + 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. + {{endif}} + {{if 'cudaFuncAttributes.binaryVersion' in found_struct}} + binaryVersion : int + 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. + {{endif}} + {{if 'cudaFuncAttributes.cacheModeCA' in found_struct}} + cacheModeCA : int + The attribute to indicate whether the function has been compiled + with user specified option "-Xptxas --dlcm=ca" set. + {{endif}} + {{if 'cudaFuncAttributes.maxDynamicSharedSizeBytes' in found_struct}} + maxDynamicSharedSizeBytes : int + The maximum size in bytes of dynamic shared memory per block for + this function. Any launch must have a dynamic shared memory size + smaller than this value. + {{endif}} + {{if 'cudaFuncAttributes.preferredShmemCarveout' in found_struct}} + preferredShmemCarveout : int + On devices where the L1 cache and shared memory use the same + hardware resources, this sets the shared memory carveout + preference, in percent of the maximum shared memory. Refer to + cudaDevAttrMaxSharedMemoryPerMultiprocessor. This is only a hint, + and the driver can choose a different ratio if required to execute + the function. See cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.clusterDimMustBeSet' in found_struct}} + clusterDimMustBeSet : int + If this attribute is set, the kernel must launch with a valid + cluster dimension specified. + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterWidth' in found_struct}} + requiredClusterWidth : int + The required cluster width/height/depth in blocks. The values must + either all be 0 or all be positive. The validity of the cluster + dimensions is otherwise checked at launch time. If the value is + set during compile time, it cannot be set at runtime. Setting it at + runtime should return cudaErrorNotPermitted. See + cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterHeight' in found_struct}} + requiredClusterHeight : int + + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterDepth' in found_struct}} + requiredClusterDepth : int + + {{endif}} + {{if 'cudaFuncAttributes.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : int + The block scheduling policy of a function. See cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.nonPortableClusterSizeAllowed' in found_struct}} + nonPortableClusterSizeAllowed : int + Whether the function can be launched with non-portable cluster + size. 1 is allowed, 0 is disallowed. A non-portable cluster size + may only function on the specific SKUs the program is tested on. + The launch might fail if the program is run on a different hardware + platform. CUDA API provides cudaOccupancyMaxActiveClusters to + assist with checking whether the desired size can be launched on + the current device. Portable Cluster Size A portable cluster size + is guaranteed to be functional on all compute capabilities higher + than the target compute capability. The portable cluster size for + sm_90 is 8 blocks per cluster. This value may increase for future + compute capabilities. The specific hardware unit may support + higher cluster sizes that’s not guaranteed to be portable. See + cudaFuncSetAttribute + {{endif}} + {{if 'cudaFuncAttributes.reserved' in found_struct}} + reserved : list[int] + Reserved for future use. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaFuncAttributes.sharedSizeBytes' in found_struct}} + try: + str_list += ['sharedSizeBytes : ' + str(self.sharedSizeBytes)] + except ValueError: + str_list += ['sharedSizeBytes : '] + {{endif}} + {{if 'cudaFuncAttributes.constSizeBytes' in found_struct}} + try: + str_list += ['constSizeBytes : ' + str(self.constSizeBytes)] + except ValueError: + str_list += ['constSizeBytes : '] + {{endif}} + {{if 'cudaFuncAttributes.localSizeBytes' in found_struct}} + try: + str_list += ['localSizeBytes : ' + str(self.localSizeBytes)] + except ValueError: + str_list += ['localSizeBytes : '] + {{endif}} + {{if 'cudaFuncAttributes.maxThreadsPerBlock' in found_struct}} + try: + str_list += ['maxThreadsPerBlock : ' + str(self.maxThreadsPerBlock)] + except ValueError: + str_list += ['maxThreadsPerBlock : '] + {{endif}} + {{if 'cudaFuncAttributes.numRegs' in found_struct}} + try: + str_list += ['numRegs : ' + str(self.numRegs)] + except ValueError: + str_list += ['numRegs : '] + {{endif}} + {{if 'cudaFuncAttributes.ptxVersion' in found_struct}} + try: + str_list += ['ptxVersion : ' + str(self.ptxVersion)] + except ValueError: + str_list += ['ptxVersion : '] + {{endif}} + {{if 'cudaFuncAttributes.binaryVersion' in found_struct}} + try: + str_list += ['binaryVersion : ' + str(self.binaryVersion)] + except ValueError: + str_list += ['binaryVersion : '] + {{endif}} + {{if 'cudaFuncAttributes.cacheModeCA' in found_struct}} + try: + str_list += ['cacheModeCA : ' + str(self.cacheModeCA)] + except ValueError: + str_list += ['cacheModeCA : '] + {{endif}} + {{if 'cudaFuncAttributes.maxDynamicSharedSizeBytes' in found_struct}} + try: + str_list += ['maxDynamicSharedSizeBytes : ' + str(self.maxDynamicSharedSizeBytes)] + except ValueError: + str_list += ['maxDynamicSharedSizeBytes : '] + {{endif}} + {{if 'cudaFuncAttributes.preferredShmemCarveout' in found_struct}} + try: + str_list += ['preferredShmemCarveout : ' + str(self.preferredShmemCarveout)] + except ValueError: + str_list += ['preferredShmemCarveout : '] + {{endif}} + {{if 'cudaFuncAttributes.clusterDimMustBeSet' in found_struct}} + try: + str_list += ['clusterDimMustBeSet : ' + str(self.clusterDimMustBeSet)] + except ValueError: + str_list += ['clusterDimMustBeSet : '] + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterWidth' in found_struct}} + try: + str_list += ['requiredClusterWidth : ' + str(self.requiredClusterWidth)] + except ValueError: + str_list += ['requiredClusterWidth : '] + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterHeight' in found_struct}} + try: + str_list += ['requiredClusterHeight : ' + str(self.requiredClusterHeight)] + except ValueError: + str_list += ['requiredClusterHeight : '] + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterDepth' in found_struct}} + try: + str_list += ['requiredClusterDepth : ' + str(self.requiredClusterDepth)] + except ValueError: + str_list += ['requiredClusterDepth : '] + {{endif}} + {{if 'cudaFuncAttributes.clusterSchedulingPolicyPreference' in found_struct}} + try: + str_list += ['clusterSchedulingPolicyPreference : ' + str(self.clusterSchedulingPolicyPreference)] + except ValueError: + str_list += ['clusterSchedulingPolicyPreference : '] + {{endif}} + {{if 'cudaFuncAttributes.nonPortableClusterSizeAllowed' in found_struct}} + try: + str_list += ['nonPortableClusterSizeAllowed : ' + str(self.nonPortableClusterSizeAllowed)] + except ValueError: + str_list += ['nonPortableClusterSizeAllowed : '] + {{endif}} + {{if 'cudaFuncAttributes.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 'cudaFuncAttributes.sharedSizeBytes' in found_struct}} + @property + def sharedSizeBytes(self): + return self._pvt_ptr[0].sharedSizeBytes + @sharedSizeBytes.setter + def sharedSizeBytes(self, size_t sharedSizeBytes): + self._pvt_ptr[0].sharedSizeBytes = sharedSizeBytes + {{endif}} + {{if 'cudaFuncAttributes.constSizeBytes' in found_struct}} + @property + def constSizeBytes(self): + return self._pvt_ptr[0].constSizeBytes + @constSizeBytes.setter + def constSizeBytes(self, size_t constSizeBytes): + self._pvt_ptr[0].constSizeBytes = constSizeBytes + {{endif}} + {{if 'cudaFuncAttributes.localSizeBytes' in found_struct}} + @property + def localSizeBytes(self): + return self._pvt_ptr[0].localSizeBytes + @localSizeBytes.setter + def localSizeBytes(self, size_t localSizeBytes): + self._pvt_ptr[0].localSizeBytes = localSizeBytes + {{endif}} + {{if 'cudaFuncAttributes.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 'cudaFuncAttributes.numRegs' in found_struct}} + @property + def numRegs(self): + return self._pvt_ptr[0].numRegs + @numRegs.setter + def numRegs(self, int numRegs): + self._pvt_ptr[0].numRegs = numRegs + {{endif}} + {{if 'cudaFuncAttributes.ptxVersion' in found_struct}} + @property + def ptxVersion(self): + return self._pvt_ptr[0].ptxVersion + @ptxVersion.setter + def ptxVersion(self, int ptxVersion): + self._pvt_ptr[0].ptxVersion = ptxVersion + {{endif}} + {{if 'cudaFuncAttributes.binaryVersion' in found_struct}} + @property + def binaryVersion(self): + return self._pvt_ptr[0].binaryVersion + @binaryVersion.setter + def binaryVersion(self, int binaryVersion): + self._pvt_ptr[0].binaryVersion = binaryVersion + {{endif}} + {{if 'cudaFuncAttributes.cacheModeCA' in found_struct}} + @property + def cacheModeCA(self): + return self._pvt_ptr[0].cacheModeCA + @cacheModeCA.setter + def cacheModeCA(self, int cacheModeCA): + self._pvt_ptr[0].cacheModeCA = cacheModeCA + {{endif}} + {{if 'cudaFuncAttributes.maxDynamicSharedSizeBytes' in found_struct}} + @property + def maxDynamicSharedSizeBytes(self): + return self._pvt_ptr[0].maxDynamicSharedSizeBytes + @maxDynamicSharedSizeBytes.setter + def maxDynamicSharedSizeBytes(self, int maxDynamicSharedSizeBytes): + self._pvt_ptr[0].maxDynamicSharedSizeBytes = maxDynamicSharedSizeBytes + {{endif}} + {{if 'cudaFuncAttributes.preferredShmemCarveout' in found_struct}} + @property + def preferredShmemCarveout(self): + return self._pvt_ptr[0].preferredShmemCarveout + @preferredShmemCarveout.setter + def preferredShmemCarveout(self, int preferredShmemCarveout): + self._pvt_ptr[0].preferredShmemCarveout = preferredShmemCarveout + {{endif}} + {{if 'cudaFuncAttributes.clusterDimMustBeSet' in found_struct}} + @property + def clusterDimMustBeSet(self): + return self._pvt_ptr[0].clusterDimMustBeSet + @clusterDimMustBeSet.setter + def clusterDimMustBeSet(self, int clusterDimMustBeSet): + self._pvt_ptr[0].clusterDimMustBeSet = clusterDimMustBeSet + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterWidth' in found_struct}} + @property + def requiredClusterWidth(self): + return self._pvt_ptr[0].requiredClusterWidth + @requiredClusterWidth.setter + def requiredClusterWidth(self, int requiredClusterWidth): + self._pvt_ptr[0].requiredClusterWidth = requiredClusterWidth + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterHeight' in found_struct}} + @property + def requiredClusterHeight(self): + return self._pvt_ptr[0].requiredClusterHeight + @requiredClusterHeight.setter + def requiredClusterHeight(self, int requiredClusterHeight): + self._pvt_ptr[0].requiredClusterHeight = requiredClusterHeight + {{endif}} + {{if 'cudaFuncAttributes.requiredClusterDepth' in found_struct}} + @property + def requiredClusterDepth(self): + return self._pvt_ptr[0].requiredClusterDepth + @requiredClusterDepth.setter + def requiredClusterDepth(self, int requiredClusterDepth): + self._pvt_ptr[0].requiredClusterDepth = requiredClusterDepth + {{endif}} + {{if 'cudaFuncAttributes.clusterSchedulingPolicyPreference' in found_struct}} + @property + def clusterSchedulingPolicyPreference(self): + return self._pvt_ptr[0].clusterSchedulingPolicyPreference + @clusterSchedulingPolicyPreference.setter + def clusterSchedulingPolicyPreference(self, int clusterSchedulingPolicyPreference): + self._pvt_ptr[0].clusterSchedulingPolicyPreference = clusterSchedulingPolicyPreference + {{endif}} + {{if 'cudaFuncAttributes.nonPortableClusterSizeAllowed' in found_struct}} + @property + def nonPortableClusterSizeAllowed(self): + return self._pvt_ptr[0].nonPortableClusterSizeAllowed + @nonPortableClusterSizeAllowed.setter + def nonPortableClusterSizeAllowed(self, int nonPortableClusterSizeAllowed): + self._pvt_ptr[0].nonPortableClusterSizeAllowed = nonPortableClusterSizeAllowed + {{endif}} + {{if 'cudaFuncAttributes.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 'cudaMemLocation' in found_struct}} + +cdef class cudaMemLocation: + """ + Specifies a memory location. To specify a gpu, set type = + cudaMemLocationTypeDevice and set id = the gpu's device ordinal. To + specify a cpu NUMA node, set type = cudaMemLocationTypeHostNuma and + set id = host NUMA node id. + + Attributes + ---------- + {{if 'cudaMemLocation.type' in found_struct}} + type : cudaMemLocationType + Specifies the location type, which modifies the meaning of id. + {{endif}} + {{if 'cudaMemLocation.id' in found_struct}} + id : int + identifier for a given this location's ::CUmemLocationType. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemLocation.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaMemLocation.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 'cudaMemLocation.type' in found_struct}} + @property + def type(self): + return cudaMemLocationType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaMemLocationType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaMemLocation.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 'cudaMemAccessDesc' in found_struct}} + +cdef class cudaMemAccessDesc: + """ + Memory access descriptor + + Attributes + ---------- + {{if 'cudaMemAccessDesc.location' in found_struct}} + location : cudaMemLocation + Location on which the request is to change it's accessibility + {{endif}} + {{if 'cudaMemAccessDesc.flags' in found_struct}} + flags : cudaMemAccessFlags + ::CUmemProt accessibility flags to set on the request + {{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 'cudaMemAccessDesc.location' in found_struct}} + self._location = cudaMemLocation(_ptr=&self._pvt_ptr[0].location) + {{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 'cudaMemAccessDesc.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 'cudaMemAccessDesc.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 'cudaMemAccessDesc.location' in found_struct}} + @property + def location(self): + 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)) + {{endif}} + {{if 'cudaMemAccessDesc.flags' in found_struct}} + @property + def flags(self): + return cudaMemAccessFlags(self._pvt_ptr[0].flags) + @flags.setter + def flags(self, flags not None : cudaMemAccessFlags): + self._pvt_ptr[0].flags = int(flags) + {{endif}} +{{endif}} +{{if 'cudaMemPoolProps' in found_struct}} + +cdef class cudaMemPoolProps: + """ + Specifies the properties of allocations made from the pool. + + Attributes + ---------- + {{if 'cudaMemPoolProps.allocType' in found_struct}} + allocType : cudaMemAllocationType + Allocation type. Currently must be specified as + cudaMemAllocationTypePinned + {{endif}} + {{if 'cudaMemPoolProps.handleTypes' in found_struct}} + handleTypes : cudaMemAllocationHandleType + Handle types that will be supported by allocations from the pool. + {{endif}} + {{if 'cudaMemPoolProps.location' in found_struct}} + location : cudaMemLocation + Location allocations should reside. + {{endif}} + {{if 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} + win32SecurityAttributes : Any + Windows-specific LPSECURITYATTRIBUTES required when + cudaMemHandleTypeWin32 is specified. This security attribute + defines the scope of which exported allocations may be tranferred + to other processes. In all other cases, this field is required to + be zero. + {{endif}} + {{if 'cudaMemPoolProps.maxSize' in found_struct}} + maxSize : size_t + Maximum pool size. When set to 0, defaults to a system dependent + value. + {{endif}} + {{if 'cudaMemPoolProps.usage' in found_struct}} + usage : unsigned short + Bitmask indicating intended usage for the pool. + {{endif}} + {{if 'cudaMemPoolProps.reserved' in found_struct}} + reserved : bytes + reserved for future use, must be 0 + {{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 'cudaMemPoolProps.location' in found_struct}} + self._location = cudaMemLocation(_ptr=&self._pvt_ptr[0].location) + {{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 'cudaMemPoolProps.allocType' in found_struct}} + try: + str_list += ['allocType : ' + str(self.allocType)] + except ValueError: + str_list += ['allocType : '] + {{endif}} + {{if 'cudaMemPoolProps.handleTypes' in found_struct}} + try: + str_list += ['handleTypes : ' + str(self.handleTypes)] + except ValueError: + str_list += ['handleTypes : '] + {{endif}} + {{if 'cudaMemPoolProps.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 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} + try: + str_list += ['win32SecurityAttributes : ' + hex(self.win32SecurityAttributes)] + except ValueError: + str_list += ['win32SecurityAttributes : '] + {{endif}} + {{if 'cudaMemPoolProps.maxSize' in found_struct}} + try: + str_list += ['maxSize : ' + str(self.maxSize)] + except ValueError: + str_list += ['maxSize : '] + {{endif}} + {{if 'cudaMemPoolProps.usage' in found_struct}} + try: + str_list += ['usage : ' + str(self.usage)] + except ValueError: + str_list += ['usage : '] + {{endif}} + {{if 'cudaMemPoolProps.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 'cudaMemPoolProps.allocType' in found_struct}} + @property + def allocType(self): + return cudaMemAllocationType(self._pvt_ptr[0].allocType) + @allocType.setter + def allocType(self, allocType not None : cudaMemAllocationType): + self._pvt_ptr[0].allocType = int(allocType) + {{endif}} + {{if 'cudaMemPoolProps.handleTypes' in found_struct}} + @property + def handleTypes(self): + return cudaMemAllocationHandleType(self._pvt_ptr[0].handleTypes) + @handleTypes.setter + def handleTypes(self, handleTypes not None : cudaMemAllocationHandleType): + self._pvt_ptr[0].handleTypes = int(handleTypes) + {{endif}} + {{if 'cudaMemPoolProps.location' in found_struct}} + @property + def location(self): + 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)) + {{endif}} + {{if 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} + @property + def win32SecurityAttributes(self): + return self._pvt_ptr[0].win32SecurityAttributes + @win32SecurityAttributes.setter + def win32SecurityAttributes(self, win32SecurityAttributes): + self._cywin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) + self._pvt_ptr[0].win32SecurityAttributes = self._cywin32SecurityAttributes.cptr + {{endif}} + {{if 'cudaMemPoolProps.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 'cudaMemPoolProps.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 'cudaMemPoolProps.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 54) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 54: + 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 'cudaMemPoolPtrExportData' in found_struct}} + +cdef class cudaMemPoolPtrExportData: + """ + Opaque data for exporting a pool allocation + + Attributes + ---------- + {{if 'cudaMemPoolPtrExportData.reserved' in found_struct}} + reserved : bytes + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemPoolPtrExportData.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 'cudaMemPoolPtrExportData.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 64: + 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 'cudaMemAllocNodeParams' in found_struct}} + +cdef class cudaMemAllocNodeParams: + """ + Memory allocation node parameters + + Attributes + ---------- + {{if 'cudaMemAllocNodeParams.poolProps' in found_struct}} + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescCount' in found_struct}} + accessDescCount : size_t + in: Number of `accessDescs`s + {{endif}} + {{if 'cudaMemAllocNodeParams.bytesize' in found_struct}} + bytesize : size_t + in: size in bytes of the requested allocation + {{endif}} + {{if 'cudaMemAllocNodeParams.dptr' in found_struct}} + dptr : Any + out: address of the allocation returned by CUDA + {{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 'cudaMemAllocNodeParams.poolProps' in found_struct}} + self._poolProps = cudaMemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) + {{endif}} + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemAllocNodeParams.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 'cudaMemAllocNodeParams.accessDescs' in found_struct}} + try: + str_list += ['accessDescs : ' + str(self.accessDescs)] + except ValueError: + str_list += ['accessDescs : '] + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescCount' in found_struct}} + try: + str_list += ['accessDescCount : ' + str(self.accessDescCount)] + except ValueError: + str_list += ['accessDescCount : '] + {{endif}} + {{if 'cudaMemAllocNodeParams.bytesize' in found_struct}} + try: + str_list += ['bytesize : ' + str(self.bytesize)] + except ValueError: + str_list += ['bytesize : '] + {{endif}} + {{if 'cudaMemAllocNodeParams.dptr' in found_struct}} + try: + str_list += ['dptr : ' + hex(self.dptr)] + except ValueError: + str_list += ['dptr : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaMemAllocNodeParams.poolProps' in found_struct}} + @property + def poolProps(self): + 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)) + {{endif}} + {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} + @property + def accessDescs(self): + arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cyruntime.cudaMemAccessDesc) for x in range(self._accessDescs_length)] + return [cudaMemAccessDesc(_ptr=arr) for arr in arrs] + @accessDescs.setter + 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: + if self._accessDescs_length != len(val): + free(self._accessDescs) + self._accessDescs = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) + if self._accessDescs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaMemAccessDesc))) + self._accessDescs_length = len(val) + self._pvt_ptr[0].accessDescs = self._accessDescs + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + + {{endif}} + {{if 'cudaMemAllocNodeParams.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 'cudaMemAllocNodeParams.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 'cudaMemAllocNodeParams.dptr' in found_struct}} + @property + def dptr(self): + return self._pvt_ptr[0].dptr + @dptr.setter + def dptr(self, dptr): + self._cydptr = _HelperInputVoidPtr(dptr) + self._pvt_ptr[0].dptr = self._cydptr.cptr + {{endif}} +{{endif}} +{{if 'cudaMemAllocNodeParamsV2' in found_struct}} + +cdef class cudaMemAllocNodeParamsV2: + """ + Memory allocation node parameters + + Attributes + ---------- + {{if 'cudaMemAllocNodeParamsV2.poolProps' in found_struct}} + poolProps : cudaMemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be cudaMemHandleTypeNone. IPC is + not supported. in: array of memory access descriptors. Used to + describe peer GPU access + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} + accessDescs : cudaMemAccessDesc + in: number of memory access descriptors. Must not exceed the number + of GPUs. + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescCount' in found_struct}} + accessDescCount : size_t + in: Number of `accessDescs`s + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.bytesize' in found_struct}} + bytesize : size_t + in: size in bytes of the requested allocation + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.dptr' in found_struct}} + dptr : Any + out: address of the allocation returned by CUDA + {{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 'cudaMemAllocNodeParamsV2.poolProps' in found_struct}} + self._poolProps = cudaMemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) + {{endif}} + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemAllocNodeParamsV2.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 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} + try: + str_list += ['accessDescs : ' + str(self.accessDescs)] + except ValueError: + str_list += ['accessDescs : '] + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescCount' in found_struct}} + try: + str_list += ['accessDescCount : ' + str(self.accessDescCount)] + except ValueError: + str_list += ['accessDescCount : '] + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.bytesize' in found_struct}} + try: + str_list += ['bytesize : ' + str(self.bytesize)] + except ValueError: + str_list += ['bytesize : '] + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.dptr' in found_struct}} + try: + str_list += ['dptr : ' + hex(self.dptr)] + except ValueError: + str_list += ['dptr : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaMemAllocNodeParamsV2.poolProps' in found_struct}} + @property + def poolProps(self): + 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)) + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} + @property + def accessDescs(self): + arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cyruntime.cudaMemAccessDesc) for x in range(self._accessDescs_length)] + return [cudaMemAccessDesc(_ptr=arr) for arr in arrs] + @accessDescs.setter + 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: + if self._accessDescs_length != len(val): + free(self._accessDescs) + self._accessDescs = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) + if self._accessDescs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaMemAccessDesc))) + self._accessDescs_length = len(val) + self._pvt_ptr[0].accessDescs = self._accessDescs + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + + {{endif}} + {{if 'cudaMemAllocNodeParamsV2.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 'cudaMemAllocNodeParamsV2.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 'cudaMemAllocNodeParamsV2.dptr' in found_struct}} + @property + def dptr(self): + return self._pvt_ptr[0].dptr + @dptr.setter + def dptr(self, dptr): + self._cydptr = _HelperInputVoidPtr(dptr) + self._pvt_ptr[0].dptr = self._cydptr.cptr + {{endif}} +{{endif}} +{{if 'cudaMemFreeNodeParams' in found_struct}} + +cdef class cudaMemFreeNodeParams: + """ + Memory free node parameters + + Attributes + ---------- + {{if 'cudaMemFreeNodeParams.dptr' in found_struct}} + dptr : Any + in: the pointer to free + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemFreeNodeParams.dptr' in found_struct}} + try: + str_list += ['dptr : ' + hex(self.dptr)] + except ValueError: + str_list += ['dptr : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaMemFreeNodeParams.dptr' in found_struct}} + @property + def dptr(self): + return self._pvt_ptr[0].dptr + @dptr.setter + def dptr(self, dptr): + self._cydptr = _HelperInputVoidPtr(dptr) + self._pvt_ptr[0].dptr = self._cydptr.cptr + {{endif}} +{{endif}} +{{if 'cudaMemcpyAttributes' in found_struct}} + +cdef class cudaMemcpyAttributes: + """ + Attributes specific to copies within a batch. For more details on + usage see cudaMemcpyBatchAsync. + + Attributes + ---------- + {{if 'cudaMemcpyAttributes.srcAccessOrder' in found_struct}} + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copies with this + attribute. + {{endif}} + {{if 'cudaMemcpyAttributes.srcLocHint' in found_struct}} + srcLocHint : cudaMemLocation + Hint location for the source operand. Ignored when the pointers are + not managed memory or memory allocated outside CUDA. + {{endif}} + {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} + dstLocHint : cudaMemLocation + Hint location for the destination operand. Ignored when the + pointers are not managed memory or memory allocated outside CUDA. + {{endif}} + {{if 'cudaMemcpyAttributes.flags' in found_struct}} + flags : unsigned int + Additional flags for copies with this attribute. See + cudaMemcpyFlags. + {{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 'cudaMemcpyAttributes.srcLocHint' in found_struct}} + self._srcLocHint = cudaMemLocation(_ptr=&self._pvt_ptr[0].srcLocHint) + {{endif}} + {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} + self._dstLocHint = cudaMemLocation(_ptr=&self._pvt_ptr[0].dstLocHint) + {{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 'cudaMemcpyAttributes.srcAccessOrder' in found_struct}} + try: + str_list += ['srcAccessOrder : ' + str(self.srcAccessOrder)] + except ValueError: + str_list += ['srcAccessOrder : '] + {{endif}} + {{if 'cudaMemcpyAttributes.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 'cudaMemcpyAttributes.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 'cudaMemcpyAttributes.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 'cudaMemcpyAttributes.srcAccessOrder' in found_struct}} + @property + def srcAccessOrder(self): + return cudaMemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) + @srcAccessOrder.setter + def srcAccessOrder(self, srcAccessOrder not None : cudaMemcpySrcAccessOrder): + self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) + {{endif}} + {{if 'cudaMemcpyAttributes.srcLocHint' in found_struct}} + @property + def srcLocHint(self): + 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)) + {{endif}} + {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} + @property + def dstLocHint(self): + 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)) + {{endif}} + {{if 'cudaMemcpyAttributes.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 'cudaOffset3D' in found_struct}} + +cdef class cudaOffset3D: + """ + Struct representing offset into a cudaArray_t in elements + + Attributes + ---------- + {{if 'cudaOffset3D.x' in found_struct}} + x : size_t + + {{endif}} + {{if 'cudaOffset3D.y' in found_struct}} + y : size_t + + {{endif}} + {{if 'cudaOffset3D.z' in found_struct}} + z : size_t + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaOffset3D.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'cudaOffset3D.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'cudaOffset3D.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 'cudaOffset3D.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 'cudaOffset3D.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 'cudaOffset3D.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 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + +cdef class anon_struct5: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.ptr.ptr' in found_struct}} + ptr : Any + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.rowLength' in found_struct}} + rowLength : size_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.layerHeight' in found_struct}} + layerHeight : size_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.locHint' in found_struct}} + locHint : cudaMemLocation + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaMemcpy3DOperand.op.ptr.locHint' in found_struct}} + self._locHint = cudaMemLocation(_ptr=&self._pvt_ptr[0].op.ptr.locHint) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op.ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemcpy3DOperand.op.ptr.ptr' in found_struct}} + try: + str_list += ['ptr : ' + hex(self.ptr)] + except ValueError: + str_list += ['ptr : '] + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.rowLength' in found_struct}} + try: + str_list += ['rowLength : ' + str(self.rowLength)] + except ValueError: + str_list += ['rowLength : '] + {{endif}} + {{if 'cudaMemcpy3DOperand.op.ptr.layerHeight' in found_struct}} + try: + str_list += ['layerHeight : ' + str(self.layerHeight)] + except ValueError: + str_list += ['layerHeight : '] + {{endif}} + {{if 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.op.ptr.ptr' in found_struct}} + @property + def ptr(self): + return self._pvt_ptr[0].op.ptr.ptr + @ptr.setter + def ptr(self, ptr): + self._cyptr = _HelperInputVoidPtr(ptr) + self._pvt_ptr[0].op.ptr.ptr = self._cyptr.cptr + {{endif}} + {{if 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.op.ptr.locHint' in found_struct}} + @property + def locHint(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + +cdef class anon_struct6: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + array : cudaArray_t + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array.offset' in found_struct}} + offset : cudaOffset3D + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + self._array = cudaArray_t(_ptr=&self._pvt_ptr[0].op.array.array) + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array.offset' in found_struct}} + self._offset = cudaOffset3D(_ptr=&self._pvt_ptr[0].op.array.offset) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op.array + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + try: + str_list += ['array : ' + str(self.array)] + except ValueError: + str_list += ['array : '] + {{endif}} + {{if 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.op.array.array' in found_struct}} + @property + def array(self): + return self._array + @array.setter + def array(self, array): + cdef cyruntime.cudaArray_t cyarray + if array is None: + cyarray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + cyarray = parray + else: + parray = int(cudaArray_t(array)) + cyarray = parray + self._array._pvt_ptr[0] = cyarray + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array.offset' in found_struct}} + @property + def offset(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand.op' in found_struct}} + +cdef class anon_union1: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + ptr : anon_struct5 + + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + array : anon_struct6 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + self._ptr = anon_struct5(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + self._array = anon_struct6(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.op.ptr' in found_struct}} + @property + def ptr(self): + return self._ptr + @ptr.setter + def ptr(self, ptr not None : anon_struct5): + string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) + {{endif}} + {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} + @property + def array(self): + return self._array + @array.setter + def array(self, array not None : anon_struct6): + string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DOperand' in found_struct}} + +cdef class cudaMemcpy3DOperand: + """ + Struct representing an operand for copy with cudaMemcpy3DBatchAsync + + Attributes + ---------- + {{if 'cudaMemcpy3DOperand.type' in found_struct}} + type : cudaMemcpy3DOperandType + + {{endif}} + {{if 'cudaMemcpy3DOperand.op' in found_struct}} + op : anon_union1 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaMemcpy3DOperand)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaMemcpy3DOperand.op' in found_struct}} + self._op = anon_union1(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{if 'cudaMemcpy3DOperand.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaMemcpy3DOperand.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 'cudaMemcpy3DOperand.type' in found_struct}} + @property + def type(self): + return cudaMemcpy3DOperandType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaMemcpy3DOperandType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaMemcpy3DOperand.op' in found_struct}} + @property + 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)) + {{endif}} +{{endif}} +{{if 'cudaMemcpy3DBatchOp' in found_struct}} + +cdef class cudaMemcpy3DBatchOp: + """ + Attributes + ---------- + {{if 'cudaMemcpy3DBatchOp.src' in found_struct}} + src : cudaMemcpy3DOperand + Source memcpy operand. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} + dst : cudaMemcpy3DOperand + Destination memcpy operand. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} + extent : cudaExtent + Extents of the memcpy between src and dst. The width, height and + depth components must not be 0. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} + srcAccessOrder : cudaMemcpySrcAccessOrder + Source access ordering to be observed for copy from src to dst. + {{endif}} + {{if 'cudaMemcpy3DBatchOp.flags' in found_struct}} + flags : unsigned int + Additional flags for copy from src to dst. See cudaMemcpyFlags. + {{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 'cudaMemcpy3DBatchOp.src' in found_struct}} + self._src = cudaMemcpy3DOperand(_ptr=&self._pvt_ptr[0].src) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} + self._dst = cudaMemcpy3DOperand(_ptr=&self._pvt_ptr[0].dst) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} + self._extent = cudaExtent(_ptr=&self._pvt_ptr[0].extent) + {{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 'cudaMemcpy3DBatchOp.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 'cudaMemcpy3DBatchOp.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 'cudaMemcpy3DBatchOp.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 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} + try: + str_list += ['srcAccessOrder : ' + str(self.srcAccessOrder)] + except ValueError: + str_list += ['srcAccessOrder : '] + {{endif}} + {{if 'cudaMemcpy3DBatchOp.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 'cudaMemcpy3DBatchOp.src' in found_struct}} + @property + def src(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} + @property + def dst(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} + @property + def extent(self): + 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)) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} + @property + def srcAccessOrder(self): + return cudaMemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) + @srcAccessOrder.setter + def srcAccessOrder(self, srcAccessOrder not None : cudaMemcpySrcAccessOrder): + self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) + {{endif}} + {{if 'cudaMemcpy3DBatchOp.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 '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 + ------- + 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 = [] + {{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 'cudaDeviceProp' in found_struct}} + +cdef class cudaDeviceProp: + """ + CUDA device properties + + Attributes + ---------- + {{if 'cudaDeviceProp.name' in found_struct}} + name : bytes + ASCII string identifying device + {{endif}} + {{if 'cudaDeviceProp.uuid' in found_struct}} + uuid : cudaUUID_t + 16-byte unique identifier + {{endif}} + {{if 'cudaDeviceProp.luid' in found_struct}} + luid : bytes + 8-byte locally unique identifier. Value is undefined on TCC and + non-Windows platforms + {{endif}} + {{if 'cudaDeviceProp.luidDeviceNodeMask' in found_struct}} + luidDeviceNodeMask : unsigned int + LUID device node mask. Value is undefined on TCC and non-Windows + platforms + {{endif}} + {{if 'cudaDeviceProp.totalGlobalMem' in found_struct}} + totalGlobalMem : size_t + Global memory available on device in bytes + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlock' in found_struct}} + sharedMemPerBlock : size_t + Shared memory available per block in bytes + {{endif}} + {{if 'cudaDeviceProp.regsPerBlock' in found_struct}} + regsPerBlock : int + 32-bit registers available per block + {{endif}} + {{if 'cudaDeviceProp.warpSize' in found_struct}} + warpSize : int + Warp size in threads + {{endif}} + {{if 'cudaDeviceProp.memPitch' in found_struct}} + memPitch : size_t + Maximum pitch in bytes allowed by memory copies + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int + Maximum number of threads per block + {{endif}} + {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} + maxThreadsDim : list[int] + Maximum size of each dimension of a block + {{endif}} + {{if 'cudaDeviceProp.maxGridSize' in found_struct}} + maxGridSize : list[int] + Maximum size of each dimension of a grid + {{endif}} + {{if 'cudaDeviceProp.clockRate' in found_struct}} + clockRate : int + Deprecated, Clock frequency in kilohertz + {{endif}} + {{if 'cudaDeviceProp.totalConstMem' in found_struct}} + totalConstMem : size_t + Constant memory available on device in bytes + {{endif}} + {{if 'cudaDeviceProp.major' in found_struct}} + major : int + Major compute capability + {{endif}} + {{if 'cudaDeviceProp.minor' in found_struct}} + minor : int + Minor compute capability + {{endif}} + {{if 'cudaDeviceProp.textureAlignment' in found_struct}} + textureAlignment : size_t + Alignment requirement for textures + {{endif}} + {{if 'cudaDeviceProp.texturePitchAlignment' in found_struct}} + texturePitchAlignment : size_t + Pitch alignment requirement for texture references bound to pitched + memory + {{endif}} + {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} + deviceOverlap : int + Device can concurrently copy memory and execute a kernel. + Deprecated. Use instead asyncEngineCount. + {{endif}} + {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} + multiProcessorCount : int + Number of multiprocessors on device + {{endif}} + {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} + kernelExecTimeoutEnabled : int + Deprecated, Specified whether there is a run time limit on kernels + {{endif}} + {{if 'cudaDeviceProp.integrated' in found_struct}} + integrated : int + Device is integrated as opposed to discrete + {{endif}} + {{if 'cudaDeviceProp.canMapHostMemory' in found_struct}} + canMapHostMemory : int + Device can map host memory with + cudaHostAlloc/cudaHostGetDevicePointer + {{endif}} + {{if 'cudaDeviceProp.computeMode' in found_struct}} + computeMode : int + Deprecated, Compute mode (See cudaComputeMode) + {{endif}} + {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} + maxTexture1D : int + Maximum 1D texture size + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DMipmap' in found_struct}} + maxTexture1DMipmap : int + Maximum 1D mipmapped texture size + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} + maxTexture1DLinear : int + Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() + or cuDeviceGetTexture1DLinearMaxWidth() instead. + {{endif}} + {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} + maxTexture2D : list[int] + Maximum 2D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} + maxTexture2DMipmap : list[int] + Maximum 2D mipmapped texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} + maxTexture2DLinear : list[int] + Maximum dimensions (width, height, pitch) for 2D textures bound to + pitched memory + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} + maxTexture2DGather : list[int] + Maximum 2D texture dimensions if texture gather operations have to + be performed + {{endif}} + {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} + maxTexture3D : list[int] + Maximum 3D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} + maxTexture3DAlt : list[int] + Maximum alternate 3D texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} + maxTextureCubemap : int + Maximum Cubemap texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} + maxTexture1DLayered : list[int] + Maximum 1D layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} + maxTexture2DLayered : list[int] + Maximum 2D layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} + maxTextureCubemapLayered : list[int] + Maximum Cubemap layered texture dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} + maxSurface1D : int + Maximum 1D surface size + {{endif}} + {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} + maxSurface2D : list[int] + Maximum 2D surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} + maxSurface3D : list[int] + Maximum 3D surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} + maxSurface1DLayered : list[int] + Maximum 1D layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} + maxSurface2DLayered : list[int] + Maximum 2D layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} + maxSurfaceCubemap : int + Maximum Cubemap surface dimensions + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} + maxSurfaceCubemapLayered : list[int] + Maximum Cubemap layered surface dimensions + {{endif}} + {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} + surfaceAlignment : size_t + Alignment requirements for surfaces + {{endif}} + {{if 'cudaDeviceProp.concurrentKernels' in found_struct}} + concurrentKernels : int + Device can possibly execute multiple kernels concurrently + {{endif}} + {{if 'cudaDeviceProp.ECCEnabled' in found_struct}} + ECCEnabled : int + Device has ECC support enabled + {{endif}} + {{if 'cudaDeviceProp.pciBusID' in found_struct}} + pciBusID : int + PCI bus ID of the device + {{endif}} + {{if 'cudaDeviceProp.pciDeviceID' in found_struct}} + pciDeviceID : int + PCI device ID of the device + {{endif}} + {{if 'cudaDeviceProp.pciDomainID' in found_struct}} + pciDomainID : int + PCI domain ID of the device + {{endif}} + {{if 'cudaDeviceProp.tccDriver' in found_struct}} + tccDriver : int + 1 if device is a Tesla device using TCC driver, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.asyncEngineCount' in found_struct}} + asyncEngineCount : int + Number of asynchronous engines + {{endif}} + {{if 'cudaDeviceProp.unifiedAddressing' in found_struct}} + unifiedAddressing : int + Device shares a unified address space with the host + {{endif}} + {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} + memoryClockRate : int + Deprecated, Peak memory clock frequency in kilohertz + {{endif}} + {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} + memoryBusWidth : int + Global memory bus width in bits + {{endif}} + {{if 'cudaDeviceProp.l2CacheSize' in found_struct}} + l2CacheSize : int + Size of L2 cache in bytes + {{endif}} + {{if 'cudaDeviceProp.persistingL2CacheMaxSize' in found_struct}} + persistingL2CacheMaxSize : int + Device's maximum l2 persisting lines capacity setting in bytes + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerMultiProcessor' in found_struct}} + maxThreadsPerMultiProcessor : int + Maximum resident threads per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.streamPrioritiesSupported' in found_struct}} + streamPrioritiesSupported : int + Device supports stream priorities + {{endif}} + {{if 'cudaDeviceProp.globalL1CacheSupported' in found_struct}} + globalL1CacheSupported : int + Device supports caching globals in L1 + {{endif}} + {{if 'cudaDeviceProp.localL1CacheSupported' in found_struct}} + localL1CacheSupported : int + Device supports caching locals in L1 + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerMultiprocessor' in found_struct}} + sharedMemPerMultiprocessor : size_t + Shared memory available per multiprocessor in bytes + {{endif}} + {{if 'cudaDeviceProp.regsPerMultiprocessor' in found_struct}} + regsPerMultiprocessor : int + 32-bit registers available per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.managedMemory' in found_struct}} + managedMemory : int + Device supports allocating managed memory on this system + {{endif}} + {{if 'cudaDeviceProp.isMultiGpuBoard' in found_struct}} + isMultiGpuBoard : int + Device is on a multi-GPU board + {{endif}} + {{if 'cudaDeviceProp.multiGpuBoardGroupID' in found_struct}} + multiGpuBoardGroupID : int + Unique identifier for a group of devices on the same multi-GPU + board + {{endif}} + {{if 'cudaDeviceProp.hostNativeAtomicSupported' in found_struct}} + hostNativeAtomicSupported : int + Link between the device and the host supports native atomic + operations + {{endif}} + {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} + singleToDoublePrecisionPerfRatio : int + Deprecated, Ratio of single precision performance (in floating- + point operations per second) to double precision performance + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} + pageableMemoryAccess : int + Device supports coherently accessing pageable memory without + calling cudaHostRegister on it + {{endif}} + {{if 'cudaDeviceProp.concurrentManagedAccess' in found_struct}} + concurrentManagedAccess : int + Device can coherently access managed memory concurrently with the + CPU + {{endif}} + {{if 'cudaDeviceProp.computePreemptionSupported' in found_struct}} + computePreemptionSupported : int + Device supports Compute Preemption + {{endif}} + {{if 'cudaDeviceProp.canUseHostPointerForRegisteredMem' in found_struct}} + canUseHostPointerForRegisteredMem : int + Device can access host registered memory at the same virtual + address as the CPU + {{endif}} + {{if 'cudaDeviceProp.cooperativeLaunch' in found_struct}} + cooperativeLaunch : int + Device supports launching cooperative kernels via + cudaLaunchCooperativeKernel + {{endif}} + {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} + cooperativeMultiDeviceLaunch : int + Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} + sharedMemPerBlockOptin : size_t + Per device maximum shared memory per block usable by special opt in + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccessUsesHostPageTables' in found_struct}} + pageableMemoryAccessUsesHostPageTables : int + Device accesses pageable memory via the host's page tables + {{endif}} + {{if 'cudaDeviceProp.directManagedMemAccessFromHost' in found_struct}} + directManagedMemAccessFromHost : int + Host can directly access managed memory on the device without + migration. + {{endif}} + {{if 'cudaDeviceProp.maxBlocksPerMultiProcessor' in found_struct}} + maxBlocksPerMultiProcessor : int + Maximum number of resident blocks per multiprocessor + {{endif}} + {{if 'cudaDeviceProp.accessPolicyMaxWindowSize' in found_struct}} + accessPolicyMaxWindowSize : int + The maximum value of cudaAccessPolicyWindow::num_bytes. + {{endif}} + {{if 'cudaDeviceProp.reservedSharedMemPerBlock' in found_struct}} + reservedSharedMemPerBlock : size_t + Shared memory reserved by CUDA driver per block in bytes + {{endif}} + {{if 'cudaDeviceProp.hostRegisterSupported' in found_struct}} + hostRegisterSupported : int + Device supports host memory registration via cudaHostRegister. + {{endif}} + {{if 'cudaDeviceProp.sparseCudaArraySupported' in found_struct}} + sparseCudaArraySupported : int + 1 if the device supports sparse CUDA arrays and sparse CUDA + mipmapped arrays, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.hostRegisterReadOnlySupported' in found_struct}} + hostRegisterReadOnlySupported : int + Device supports using the cudaHostRegister flag + cudaHostRegisterReadOnly to register memory that must be mapped as + read-only to the GPU + {{endif}} + {{if 'cudaDeviceProp.timelineSemaphoreInteropSupported' in found_struct}} + timelineSemaphoreInteropSupported : int + External timeline semaphore interop is supported on the device + {{endif}} + {{if 'cudaDeviceProp.memoryPoolsSupported' in found_struct}} + memoryPoolsSupported : int + 1 if the device supports using the cudaMallocAsync and cudaMemPool + family of APIs, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMASupported' in found_struct}} + gpuDirectRDMASupported : int + 1 if the device supports GPUDirect RDMA APIs, 0 otherwise + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAFlushWritesOptions' in found_struct}} + gpuDirectRDMAFlushWritesOptions : unsigned int + Bitmask to be interpreted according to the + cudaFlushGPUDirectRDMAWritesOptions enum + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAWritesOrdering' in found_struct}} + gpuDirectRDMAWritesOrdering : int + See the cudaGPUDirectRDMAWritesOrdering enum for numerical values + {{endif}} + {{if 'cudaDeviceProp.memoryPoolSupportedHandleTypes' in found_struct}} + memoryPoolSupportedHandleTypes : unsigned int + Bitmask of handle types supported with mempool-based IPC + {{endif}} + {{if 'cudaDeviceProp.deferredMappingCudaArraySupported' in found_struct}} + deferredMappingCudaArraySupported : int + 1 if the device supports deferred mapping CUDA arrays and CUDA + mipmapped arrays + {{endif}} + {{if 'cudaDeviceProp.ipcEventSupported' in found_struct}} + ipcEventSupported : int + Device supports IPC Events. + {{endif}} + {{if 'cudaDeviceProp.clusterLaunch' in found_struct}} + clusterLaunch : int + Indicates device supports cluster launch + {{endif}} + {{if 'cudaDeviceProp.unifiedFunctionPointers' in found_struct}} + unifiedFunctionPointers : int + Indicates device supports unified pointers + {{endif}} + {{if 'cudaDeviceProp.reserved' in found_struct}} + reserved : list[int] + Reserved for future use + {{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 'cudaDeviceProp.uuid' in found_struct}} + self._uuid = cudaUUID_t(_ptr=&self._pvt_ptr[0].uuid) + {{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 'cudaDeviceProp.name' in found_struct}} + try: + str_list += ['name : ' + self.name.decode('utf-8')] + except ValueError: + str_list += ['name : '] + {{endif}} + {{if 'cudaDeviceProp.uuid' in found_struct}} + try: + str_list += ['uuid :\n' + '\n'.join([' ' + line for line in str(self.uuid).splitlines()])] + except ValueError: + str_list += ['uuid : '] + {{endif}} + {{if 'cudaDeviceProp.luid' in found_struct}} + try: + str_list += ['luid : ' + self.luid.hex()] + except ValueError: + str_list += ['luid : '] + {{endif}} + {{if 'cudaDeviceProp.luidDeviceNodeMask' in found_struct}} + try: + str_list += ['luidDeviceNodeMask : ' + str(self.luidDeviceNodeMask)] + except ValueError: + str_list += ['luidDeviceNodeMask : '] + {{endif}} + {{if 'cudaDeviceProp.totalGlobalMem' in found_struct}} + try: + str_list += ['totalGlobalMem : ' + str(self.totalGlobalMem)] + except ValueError: + str_list += ['totalGlobalMem : '] + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlock' in found_struct}} + try: + str_list += ['sharedMemPerBlock : ' + str(self.sharedMemPerBlock)] + except ValueError: + str_list += ['sharedMemPerBlock : '] + {{endif}} + {{if 'cudaDeviceProp.regsPerBlock' in found_struct}} + try: + str_list += ['regsPerBlock : ' + str(self.regsPerBlock)] + except ValueError: + str_list += ['regsPerBlock : '] + {{endif}} + {{if 'cudaDeviceProp.warpSize' in found_struct}} + try: + str_list += ['warpSize : ' + str(self.warpSize)] + except ValueError: + str_list += ['warpSize : '] + {{endif}} + {{if 'cudaDeviceProp.memPitch' in found_struct}} + try: + str_list += ['memPitch : ' + str(self.memPitch)] + except ValueError: + str_list += ['memPitch : '] + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerBlock' in found_struct}} + try: + str_list += ['maxThreadsPerBlock : ' + str(self.maxThreadsPerBlock)] + except ValueError: + str_list += ['maxThreadsPerBlock : '] + {{endif}} + {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} + try: + str_list += ['maxThreadsDim : ' + str(self.maxThreadsDim)] + except ValueError: + str_list += ['maxThreadsDim : '] + {{endif}} + {{if 'cudaDeviceProp.maxGridSize' in found_struct}} + try: + str_list += ['maxGridSize : ' + str(self.maxGridSize)] + except ValueError: + str_list += ['maxGridSize : '] + {{endif}} + {{if 'cudaDeviceProp.clockRate' in found_struct}} + try: + str_list += ['clockRate : ' + str(self.clockRate)] + except ValueError: + str_list += ['clockRate : '] + {{endif}} + {{if 'cudaDeviceProp.totalConstMem' in found_struct}} + try: + str_list += ['totalConstMem : ' + str(self.totalConstMem)] + except ValueError: + str_list += ['totalConstMem : '] + {{endif}} + {{if 'cudaDeviceProp.major' in found_struct}} + try: + str_list += ['major : ' + str(self.major)] + except ValueError: + str_list += ['major : '] + {{endif}} + {{if 'cudaDeviceProp.minor' in found_struct}} + try: + str_list += ['minor : ' + str(self.minor)] + except ValueError: + str_list += ['minor : '] + {{endif}} + {{if 'cudaDeviceProp.textureAlignment' in found_struct}} + try: + str_list += ['textureAlignment : ' + str(self.textureAlignment)] + except ValueError: + str_list += ['textureAlignment : '] + {{endif}} + {{if 'cudaDeviceProp.texturePitchAlignment' in found_struct}} + try: + str_list += ['texturePitchAlignment : ' + str(self.texturePitchAlignment)] + except ValueError: + str_list += ['texturePitchAlignment : '] + {{endif}} + {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} + try: + str_list += ['deviceOverlap : ' + str(self.deviceOverlap)] + except ValueError: + str_list += ['deviceOverlap : '] + {{endif}} + {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} + try: + str_list += ['multiProcessorCount : ' + str(self.multiProcessorCount)] + except ValueError: + str_list += ['multiProcessorCount : '] + {{endif}} + {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} + try: + str_list += ['kernelExecTimeoutEnabled : ' + str(self.kernelExecTimeoutEnabled)] + except ValueError: + str_list += ['kernelExecTimeoutEnabled : '] + {{endif}} + {{if 'cudaDeviceProp.integrated' in found_struct}} + try: + str_list += ['integrated : ' + str(self.integrated)] + except ValueError: + str_list += ['integrated : '] + {{endif}} + {{if 'cudaDeviceProp.canMapHostMemory' in found_struct}} + try: + str_list += ['canMapHostMemory : ' + str(self.canMapHostMemory)] + except ValueError: + str_list += ['canMapHostMemory : '] + {{endif}} + {{if 'cudaDeviceProp.computeMode' in found_struct}} + try: + str_list += ['computeMode : ' + str(self.computeMode)] + except ValueError: + str_list += ['computeMode : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} + try: + str_list += ['maxTexture1D : ' + str(self.maxTexture1D)] + except ValueError: + str_list += ['maxTexture1D : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DMipmap' in found_struct}} + try: + str_list += ['maxTexture1DMipmap : ' + str(self.maxTexture1DMipmap)] + except ValueError: + str_list += ['maxTexture1DMipmap : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} + try: + str_list += ['maxTexture1DLinear : ' + str(self.maxTexture1DLinear)] + except ValueError: + str_list += ['maxTexture1DLinear : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} + try: + str_list += ['maxTexture2D : ' + str(self.maxTexture2D)] + except ValueError: + str_list += ['maxTexture2D : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} + try: + str_list += ['maxTexture2DMipmap : ' + str(self.maxTexture2DMipmap)] + except ValueError: + str_list += ['maxTexture2DMipmap : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} + try: + str_list += ['maxTexture2DLinear : ' + str(self.maxTexture2DLinear)] + except ValueError: + str_list += ['maxTexture2DLinear : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} + try: + str_list += ['maxTexture2DGather : ' + str(self.maxTexture2DGather)] + except ValueError: + str_list += ['maxTexture2DGather : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} + try: + str_list += ['maxTexture3D : ' + str(self.maxTexture3D)] + except ValueError: + str_list += ['maxTexture3D : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} + try: + str_list += ['maxTexture3DAlt : ' + str(self.maxTexture3DAlt)] + except ValueError: + str_list += ['maxTexture3DAlt : '] + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} + try: + str_list += ['maxTextureCubemap : ' + str(self.maxTextureCubemap)] + except ValueError: + str_list += ['maxTextureCubemap : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} + try: + str_list += ['maxTexture1DLayered : ' + str(self.maxTexture1DLayered)] + except ValueError: + str_list += ['maxTexture1DLayered : '] + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} + try: + str_list += ['maxTexture2DLayered : ' + str(self.maxTexture2DLayered)] + except ValueError: + str_list += ['maxTexture2DLayered : '] + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} + try: + str_list += ['maxTextureCubemapLayered : ' + str(self.maxTextureCubemapLayered)] + except ValueError: + str_list += ['maxTextureCubemapLayered : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} + try: + str_list += ['maxSurface1D : ' + str(self.maxSurface1D)] + except ValueError: + str_list += ['maxSurface1D : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} + try: + str_list += ['maxSurface2D : ' + str(self.maxSurface2D)] + except ValueError: + str_list += ['maxSurface2D : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} + try: + str_list += ['maxSurface3D : ' + str(self.maxSurface3D)] + except ValueError: + str_list += ['maxSurface3D : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} + try: + str_list += ['maxSurface1DLayered : ' + str(self.maxSurface1DLayered)] + except ValueError: + str_list += ['maxSurface1DLayered : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} + try: + str_list += ['maxSurface2DLayered : ' + str(self.maxSurface2DLayered)] + except ValueError: + str_list += ['maxSurface2DLayered : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} + try: + str_list += ['maxSurfaceCubemap : ' + str(self.maxSurfaceCubemap)] + except ValueError: + str_list += ['maxSurfaceCubemap : '] + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} + try: + str_list += ['maxSurfaceCubemapLayered : ' + str(self.maxSurfaceCubemapLayered)] + except ValueError: + str_list += ['maxSurfaceCubemapLayered : '] + {{endif}} + {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} + try: + str_list += ['surfaceAlignment : ' + str(self.surfaceAlignment)] + except ValueError: + str_list += ['surfaceAlignment : '] + {{endif}} + {{if 'cudaDeviceProp.concurrentKernels' in found_struct}} + try: + str_list += ['concurrentKernels : ' + str(self.concurrentKernels)] + except ValueError: + str_list += ['concurrentKernels : '] + {{endif}} + {{if 'cudaDeviceProp.ECCEnabled' in found_struct}} + try: + str_list += ['ECCEnabled : ' + str(self.ECCEnabled)] + except ValueError: + str_list += ['ECCEnabled : '] + {{endif}} + {{if 'cudaDeviceProp.pciBusID' in found_struct}} + try: + str_list += ['pciBusID : ' + str(self.pciBusID)] + except ValueError: + str_list += ['pciBusID : '] + {{endif}} + {{if 'cudaDeviceProp.pciDeviceID' in found_struct}} + try: + str_list += ['pciDeviceID : ' + str(self.pciDeviceID)] + except ValueError: + str_list += ['pciDeviceID : '] + {{endif}} + {{if 'cudaDeviceProp.pciDomainID' in found_struct}} + try: + str_list += ['pciDomainID : ' + str(self.pciDomainID)] + except ValueError: + str_list += ['pciDomainID : '] + {{endif}} + {{if 'cudaDeviceProp.tccDriver' in found_struct}} + try: + str_list += ['tccDriver : ' + str(self.tccDriver)] + except ValueError: + str_list += ['tccDriver : '] + {{endif}} + {{if 'cudaDeviceProp.asyncEngineCount' in found_struct}} + try: + str_list += ['asyncEngineCount : ' + str(self.asyncEngineCount)] + except ValueError: + str_list += ['asyncEngineCount : '] + {{endif}} + {{if 'cudaDeviceProp.unifiedAddressing' in found_struct}} + try: + str_list += ['unifiedAddressing : ' + str(self.unifiedAddressing)] + except ValueError: + str_list += ['unifiedAddressing : '] + {{endif}} + {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} + try: + str_list += ['memoryClockRate : ' + str(self.memoryClockRate)] + except ValueError: + str_list += ['memoryClockRate : '] + {{endif}} + {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} + try: + str_list += ['memoryBusWidth : ' + str(self.memoryBusWidth)] + except ValueError: + str_list += ['memoryBusWidth : '] + {{endif}} + {{if 'cudaDeviceProp.l2CacheSize' in found_struct}} + try: + str_list += ['l2CacheSize : ' + str(self.l2CacheSize)] + except ValueError: + str_list += ['l2CacheSize : '] + {{endif}} + {{if 'cudaDeviceProp.persistingL2CacheMaxSize' in found_struct}} + try: + str_list += ['persistingL2CacheMaxSize : ' + str(self.persistingL2CacheMaxSize)] + except ValueError: + str_list += ['persistingL2CacheMaxSize : '] + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerMultiProcessor' in found_struct}} + try: + str_list += ['maxThreadsPerMultiProcessor : ' + str(self.maxThreadsPerMultiProcessor)] + except ValueError: + str_list += ['maxThreadsPerMultiProcessor : '] + {{endif}} + {{if 'cudaDeviceProp.streamPrioritiesSupported' in found_struct}} + try: + str_list += ['streamPrioritiesSupported : ' + str(self.streamPrioritiesSupported)] + except ValueError: + str_list += ['streamPrioritiesSupported : '] + {{endif}} + {{if 'cudaDeviceProp.globalL1CacheSupported' in found_struct}} + try: + str_list += ['globalL1CacheSupported : ' + str(self.globalL1CacheSupported)] + except ValueError: + str_list += ['globalL1CacheSupported : '] + {{endif}} + {{if 'cudaDeviceProp.localL1CacheSupported' in found_struct}} + try: + str_list += ['localL1CacheSupported : ' + str(self.localL1CacheSupported)] + except ValueError: + str_list += ['localL1CacheSupported : '] + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerMultiprocessor' in found_struct}} + try: + str_list += ['sharedMemPerMultiprocessor : ' + str(self.sharedMemPerMultiprocessor)] + except ValueError: + str_list += ['sharedMemPerMultiprocessor : '] + {{endif}} + {{if 'cudaDeviceProp.regsPerMultiprocessor' in found_struct}} + try: + str_list += ['regsPerMultiprocessor : ' + str(self.regsPerMultiprocessor)] + except ValueError: + str_list += ['regsPerMultiprocessor : '] + {{endif}} + {{if 'cudaDeviceProp.managedMemory' in found_struct}} + try: + str_list += ['managedMemory : ' + str(self.managedMemory)] + except ValueError: + str_list += ['managedMemory : '] + {{endif}} + {{if 'cudaDeviceProp.isMultiGpuBoard' in found_struct}} + try: + str_list += ['isMultiGpuBoard : ' + str(self.isMultiGpuBoard)] + except ValueError: + str_list += ['isMultiGpuBoard : '] + {{endif}} + {{if 'cudaDeviceProp.multiGpuBoardGroupID' in found_struct}} + try: + str_list += ['multiGpuBoardGroupID : ' + str(self.multiGpuBoardGroupID)] + except ValueError: + str_list += ['multiGpuBoardGroupID : '] + {{endif}} + {{if 'cudaDeviceProp.hostNativeAtomicSupported' in found_struct}} + try: + str_list += ['hostNativeAtomicSupported : ' + str(self.hostNativeAtomicSupported)] + except ValueError: + str_list += ['hostNativeAtomicSupported : '] + {{endif}} + {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} + try: + str_list += ['singleToDoublePrecisionPerfRatio : ' + str(self.singleToDoublePrecisionPerfRatio)] + except ValueError: + str_list += ['singleToDoublePrecisionPerfRatio : '] + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} + try: + str_list += ['pageableMemoryAccess : ' + str(self.pageableMemoryAccess)] + except ValueError: + str_list += ['pageableMemoryAccess : '] + {{endif}} + {{if 'cudaDeviceProp.concurrentManagedAccess' in found_struct}} + try: + str_list += ['concurrentManagedAccess : ' + str(self.concurrentManagedAccess)] + except ValueError: + str_list += ['concurrentManagedAccess : '] + {{endif}} + {{if 'cudaDeviceProp.computePreemptionSupported' in found_struct}} + try: + str_list += ['computePreemptionSupported : ' + str(self.computePreemptionSupported)] + except ValueError: + str_list += ['computePreemptionSupported : '] + {{endif}} + {{if 'cudaDeviceProp.canUseHostPointerForRegisteredMem' in found_struct}} + try: + str_list += ['canUseHostPointerForRegisteredMem : ' + str(self.canUseHostPointerForRegisteredMem)] + except ValueError: + str_list += ['canUseHostPointerForRegisteredMem : '] + {{endif}} + {{if 'cudaDeviceProp.cooperativeLaunch' in found_struct}} + try: + str_list += ['cooperativeLaunch : ' + str(self.cooperativeLaunch)] + except ValueError: + str_list += ['cooperativeLaunch : '] + {{endif}} + {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} + try: + str_list += ['cooperativeMultiDeviceLaunch : ' + str(self.cooperativeMultiDeviceLaunch)] + except ValueError: + str_list += ['cooperativeMultiDeviceLaunch : '] + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} + try: + str_list += ['sharedMemPerBlockOptin : ' + str(self.sharedMemPerBlockOptin)] + except ValueError: + str_list += ['sharedMemPerBlockOptin : '] + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccessUsesHostPageTables' in found_struct}} + try: + str_list += ['pageableMemoryAccessUsesHostPageTables : ' + str(self.pageableMemoryAccessUsesHostPageTables)] + except ValueError: + str_list += ['pageableMemoryAccessUsesHostPageTables : '] + {{endif}} + {{if 'cudaDeviceProp.directManagedMemAccessFromHost' in found_struct}} + try: + str_list += ['directManagedMemAccessFromHost : ' + str(self.directManagedMemAccessFromHost)] + except ValueError: + str_list += ['directManagedMemAccessFromHost : '] + {{endif}} + {{if 'cudaDeviceProp.maxBlocksPerMultiProcessor' in found_struct}} + try: + str_list += ['maxBlocksPerMultiProcessor : ' + str(self.maxBlocksPerMultiProcessor)] + except ValueError: + str_list += ['maxBlocksPerMultiProcessor : '] + {{endif}} + {{if 'cudaDeviceProp.accessPolicyMaxWindowSize' in found_struct}} + try: + str_list += ['accessPolicyMaxWindowSize : ' + str(self.accessPolicyMaxWindowSize)] + except ValueError: + str_list += ['accessPolicyMaxWindowSize : '] + {{endif}} + {{if 'cudaDeviceProp.reservedSharedMemPerBlock' in found_struct}} + try: + str_list += ['reservedSharedMemPerBlock : ' + str(self.reservedSharedMemPerBlock)] + except ValueError: + str_list += ['reservedSharedMemPerBlock : '] + {{endif}} + {{if 'cudaDeviceProp.hostRegisterSupported' in found_struct}} + try: + str_list += ['hostRegisterSupported : ' + str(self.hostRegisterSupported)] + except ValueError: + str_list += ['hostRegisterSupported : '] + {{endif}} + {{if 'cudaDeviceProp.sparseCudaArraySupported' in found_struct}} + try: + str_list += ['sparseCudaArraySupported : ' + str(self.sparseCudaArraySupported)] + except ValueError: + str_list += ['sparseCudaArraySupported : '] + {{endif}} + {{if 'cudaDeviceProp.hostRegisterReadOnlySupported' in found_struct}} + try: + str_list += ['hostRegisterReadOnlySupported : ' + str(self.hostRegisterReadOnlySupported)] + except ValueError: + str_list += ['hostRegisterReadOnlySupported : '] + {{endif}} + {{if 'cudaDeviceProp.timelineSemaphoreInteropSupported' in found_struct}} + try: + str_list += ['timelineSemaphoreInteropSupported : ' + str(self.timelineSemaphoreInteropSupported)] + except ValueError: + str_list += ['timelineSemaphoreInteropSupported : '] + {{endif}} + {{if 'cudaDeviceProp.memoryPoolsSupported' in found_struct}} + try: + str_list += ['memoryPoolsSupported : ' + str(self.memoryPoolsSupported)] + except ValueError: + str_list += ['memoryPoolsSupported : '] + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMASupported' in found_struct}} + try: + str_list += ['gpuDirectRDMASupported : ' + str(self.gpuDirectRDMASupported)] + except ValueError: + str_list += ['gpuDirectRDMASupported : '] + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAFlushWritesOptions' in found_struct}} + try: + str_list += ['gpuDirectRDMAFlushWritesOptions : ' + str(self.gpuDirectRDMAFlushWritesOptions)] + except ValueError: + str_list += ['gpuDirectRDMAFlushWritesOptions : '] + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAWritesOrdering' in found_struct}} + try: + str_list += ['gpuDirectRDMAWritesOrdering : ' + str(self.gpuDirectRDMAWritesOrdering)] + except ValueError: + str_list += ['gpuDirectRDMAWritesOrdering : '] + {{endif}} + {{if 'cudaDeviceProp.memoryPoolSupportedHandleTypes' in found_struct}} + try: + str_list += ['memoryPoolSupportedHandleTypes : ' + str(self.memoryPoolSupportedHandleTypes)] + except ValueError: + str_list += ['memoryPoolSupportedHandleTypes : '] + {{endif}} + {{if 'cudaDeviceProp.deferredMappingCudaArraySupported' in found_struct}} + try: + str_list += ['deferredMappingCudaArraySupported : ' + str(self.deferredMappingCudaArraySupported)] + except ValueError: + str_list += ['deferredMappingCudaArraySupported : '] + {{endif}} + {{if 'cudaDeviceProp.ipcEventSupported' in found_struct}} + try: + str_list += ['ipcEventSupported : ' + str(self.ipcEventSupported)] + except ValueError: + str_list += ['ipcEventSupported : '] + {{endif}} + {{if 'cudaDeviceProp.clusterLaunch' in found_struct}} + try: + str_list += ['clusterLaunch : ' + str(self.clusterLaunch)] + except ValueError: + str_list += ['clusterLaunch : '] + {{endif}} + {{if 'cudaDeviceProp.unifiedFunctionPointers' in found_struct}} + try: + str_list += ['unifiedFunctionPointers : ' + str(self.unifiedFunctionPointers)] + except ValueError: + str_list += ['unifiedFunctionPointers : '] + {{endif}} + {{if 'cudaDeviceProp.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 'cudaDeviceProp.name' in found_struct}} + @property + def name(self): + return self._pvt_ptr[0].name + @name.setter + def name(self, name): + pass + self._pvt_ptr[0].name = name + {{endif}} + {{if 'cudaDeviceProp.uuid' in found_struct}} + @property + def uuid(self): + 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)) + {{endif}} + {{if 'cudaDeviceProp.luid' in found_struct}} + @property + def luid(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].luid, 8) + @luid.setter + def luid(self, luid): + if len(luid) != 8: + raise ValueError("luid length must be 8, is " + str(len(luid))) + if CHAR_MIN == 0: + for i, b in enumerate(luid): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].luid[i] = b + else: + for i, b in enumerate(luid): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].luid[i] = b + {{endif}} + {{if 'cudaDeviceProp.luidDeviceNodeMask' in found_struct}} + @property + def luidDeviceNodeMask(self): + return self._pvt_ptr[0].luidDeviceNodeMask + @luidDeviceNodeMask.setter + def luidDeviceNodeMask(self, unsigned int luidDeviceNodeMask): + self._pvt_ptr[0].luidDeviceNodeMask = luidDeviceNodeMask + {{endif}} + {{if 'cudaDeviceProp.totalGlobalMem' in found_struct}} + @property + def totalGlobalMem(self): + return self._pvt_ptr[0].totalGlobalMem + @totalGlobalMem.setter + def totalGlobalMem(self, size_t totalGlobalMem): + self._pvt_ptr[0].totalGlobalMem = totalGlobalMem + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlock' in found_struct}} + @property + def sharedMemPerBlock(self): + return self._pvt_ptr[0].sharedMemPerBlock + @sharedMemPerBlock.setter + def sharedMemPerBlock(self, size_t sharedMemPerBlock): + self._pvt_ptr[0].sharedMemPerBlock = sharedMemPerBlock + {{endif}} + {{if 'cudaDeviceProp.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 'cudaDeviceProp.warpSize' in found_struct}} + @property + def warpSize(self): + return self._pvt_ptr[0].warpSize + @warpSize.setter + def warpSize(self, int warpSize): + self._pvt_ptr[0].warpSize = warpSize + {{endif}} + {{if 'cudaDeviceProp.memPitch' in found_struct}} + @property + def memPitch(self): + return self._pvt_ptr[0].memPitch + @memPitch.setter + def memPitch(self, size_t memPitch): + self._pvt_ptr[0].memPitch = memPitch + {{endif}} + {{if 'cudaDeviceProp.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 'cudaDeviceProp.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 'cudaDeviceProp.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 'cudaDeviceProp.clockRate' in found_struct}} + @property + def clockRate(self): + return self._pvt_ptr[0].clockRate + @clockRate.setter + def clockRate(self, int clockRate): + self._pvt_ptr[0].clockRate = clockRate + {{endif}} + {{if 'cudaDeviceProp.totalConstMem' in found_struct}} + @property + def totalConstMem(self): + return self._pvt_ptr[0].totalConstMem + @totalConstMem.setter + def totalConstMem(self, size_t totalConstMem): + self._pvt_ptr[0].totalConstMem = totalConstMem + {{endif}} + {{if 'cudaDeviceProp.major' in found_struct}} + @property + def major(self): + return self._pvt_ptr[0].major + @major.setter + def major(self, int major): + self._pvt_ptr[0].major = major + {{endif}} + {{if 'cudaDeviceProp.minor' in found_struct}} + @property + def minor(self): + return self._pvt_ptr[0].minor + @minor.setter + def minor(self, int minor): + self._pvt_ptr[0].minor = minor + {{endif}} + {{if 'cudaDeviceProp.textureAlignment' in found_struct}} + @property + def textureAlignment(self): + return self._pvt_ptr[0].textureAlignment + @textureAlignment.setter + def textureAlignment(self, size_t textureAlignment): + self._pvt_ptr[0].textureAlignment = textureAlignment + {{endif}} + {{if 'cudaDeviceProp.texturePitchAlignment' in found_struct}} + @property + def texturePitchAlignment(self): + return self._pvt_ptr[0].texturePitchAlignment + @texturePitchAlignment.setter + def texturePitchAlignment(self, size_t texturePitchAlignment): + self._pvt_ptr[0].texturePitchAlignment = texturePitchAlignment + {{endif}} + {{if 'cudaDeviceProp.deviceOverlap' in found_struct}} + @property + def deviceOverlap(self): + return self._pvt_ptr[0].deviceOverlap + @deviceOverlap.setter + def deviceOverlap(self, int deviceOverlap): + self._pvt_ptr[0].deviceOverlap = deviceOverlap + {{endif}} + {{if 'cudaDeviceProp.multiProcessorCount' in found_struct}} + @property + def multiProcessorCount(self): + return self._pvt_ptr[0].multiProcessorCount + @multiProcessorCount.setter + def multiProcessorCount(self, int multiProcessorCount): + self._pvt_ptr[0].multiProcessorCount = multiProcessorCount + {{endif}} + {{if 'cudaDeviceProp.kernelExecTimeoutEnabled' in found_struct}} + @property + def kernelExecTimeoutEnabled(self): + return self._pvt_ptr[0].kernelExecTimeoutEnabled + @kernelExecTimeoutEnabled.setter + def kernelExecTimeoutEnabled(self, int kernelExecTimeoutEnabled): + self._pvt_ptr[0].kernelExecTimeoutEnabled = kernelExecTimeoutEnabled + {{endif}} + {{if 'cudaDeviceProp.integrated' in found_struct}} + @property + def integrated(self): + return self._pvt_ptr[0].integrated + @integrated.setter + def integrated(self, int integrated): + self._pvt_ptr[0].integrated = integrated + {{endif}} + {{if 'cudaDeviceProp.canMapHostMemory' in found_struct}} + @property + def canMapHostMemory(self): + return self._pvt_ptr[0].canMapHostMemory + @canMapHostMemory.setter + def canMapHostMemory(self, int canMapHostMemory): + self._pvt_ptr[0].canMapHostMemory = canMapHostMemory + {{endif}} + {{if 'cudaDeviceProp.computeMode' in found_struct}} + @property + def computeMode(self): + return self._pvt_ptr[0].computeMode + @computeMode.setter + def computeMode(self, int computeMode): + self._pvt_ptr[0].computeMode = computeMode + {{endif}} + {{if 'cudaDeviceProp.maxTexture1D' in found_struct}} + @property + def maxTexture1D(self): + return self._pvt_ptr[0].maxTexture1D + @maxTexture1D.setter + def maxTexture1D(self, int maxTexture1D): + self._pvt_ptr[0].maxTexture1D = maxTexture1D + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DMipmap' in found_struct}} + @property + def maxTexture1DMipmap(self): + return self._pvt_ptr[0].maxTexture1DMipmap + @maxTexture1DMipmap.setter + def maxTexture1DMipmap(self, int maxTexture1DMipmap): + self._pvt_ptr[0].maxTexture1DMipmap = maxTexture1DMipmap + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLinear' in found_struct}} + @property + def maxTexture1DLinear(self): + return self._pvt_ptr[0].maxTexture1DLinear + @maxTexture1DLinear.setter + def maxTexture1DLinear(self, int maxTexture1DLinear): + self._pvt_ptr[0].maxTexture1DLinear = maxTexture1DLinear + {{endif}} + {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} + @property + def maxTexture2D(self): + return self._pvt_ptr[0].maxTexture2D + @maxTexture2D.setter + def maxTexture2D(self, maxTexture2D): + self._pvt_ptr[0].maxTexture2D = maxTexture2D + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} + @property + def maxTexture2DMipmap(self): + return self._pvt_ptr[0].maxTexture2DMipmap + @maxTexture2DMipmap.setter + def maxTexture2DMipmap(self, maxTexture2DMipmap): + self._pvt_ptr[0].maxTexture2DMipmap = maxTexture2DMipmap + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} + @property + def maxTexture2DLinear(self): + return self._pvt_ptr[0].maxTexture2DLinear + @maxTexture2DLinear.setter + def maxTexture2DLinear(self, maxTexture2DLinear): + self._pvt_ptr[0].maxTexture2DLinear = maxTexture2DLinear + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} + @property + def maxTexture2DGather(self): + return self._pvt_ptr[0].maxTexture2DGather + @maxTexture2DGather.setter + def maxTexture2DGather(self, maxTexture2DGather): + self._pvt_ptr[0].maxTexture2DGather = maxTexture2DGather + {{endif}} + {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} + @property + def maxTexture3D(self): + return self._pvt_ptr[0].maxTexture3D + @maxTexture3D.setter + def maxTexture3D(self, maxTexture3D): + self._pvt_ptr[0].maxTexture3D = maxTexture3D + {{endif}} + {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} + @property + def maxTexture3DAlt(self): + return self._pvt_ptr[0].maxTexture3DAlt + @maxTexture3DAlt.setter + def maxTexture3DAlt(self, maxTexture3DAlt): + self._pvt_ptr[0].maxTexture3DAlt = maxTexture3DAlt + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} + @property + def maxTextureCubemap(self): + return self._pvt_ptr[0].maxTextureCubemap + @maxTextureCubemap.setter + def maxTextureCubemap(self, int maxTextureCubemap): + self._pvt_ptr[0].maxTextureCubemap = maxTextureCubemap + {{endif}} + {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} + @property + def maxTexture1DLayered(self): + return self._pvt_ptr[0].maxTexture1DLayered + @maxTexture1DLayered.setter + def maxTexture1DLayered(self, maxTexture1DLayered): + self._pvt_ptr[0].maxTexture1DLayered = maxTexture1DLayered + {{endif}} + {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} + @property + def maxTexture2DLayered(self): + return self._pvt_ptr[0].maxTexture2DLayered + @maxTexture2DLayered.setter + def maxTexture2DLayered(self, maxTexture2DLayered): + self._pvt_ptr[0].maxTexture2DLayered = maxTexture2DLayered + {{endif}} + {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} + @property + def maxTextureCubemapLayered(self): + return self._pvt_ptr[0].maxTextureCubemapLayered + @maxTextureCubemapLayered.setter + def maxTextureCubemapLayered(self, maxTextureCubemapLayered): + self._pvt_ptr[0].maxTextureCubemapLayered = maxTextureCubemapLayered + {{endif}} + {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} + @property + def maxSurface1D(self): + return self._pvt_ptr[0].maxSurface1D + @maxSurface1D.setter + def maxSurface1D(self, int maxSurface1D): + self._pvt_ptr[0].maxSurface1D = maxSurface1D + {{endif}} + {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} + @property + def maxSurface2D(self): + return self._pvt_ptr[0].maxSurface2D + @maxSurface2D.setter + def maxSurface2D(self, maxSurface2D): + self._pvt_ptr[0].maxSurface2D = maxSurface2D + {{endif}} + {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} + @property + def maxSurface3D(self): + return self._pvt_ptr[0].maxSurface3D + @maxSurface3D.setter + def maxSurface3D(self, maxSurface3D): + self._pvt_ptr[0].maxSurface3D = maxSurface3D + {{endif}} + {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} + @property + def maxSurface1DLayered(self): + return self._pvt_ptr[0].maxSurface1DLayered + @maxSurface1DLayered.setter + def maxSurface1DLayered(self, maxSurface1DLayered): + self._pvt_ptr[0].maxSurface1DLayered = maxSurface1DLayered + {{endif}} + {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} + @property + def maxSurface2DLayered(self): + return self._pvt_ptr[0].maxSurface2DLayered + @maxSurface2DLayered.setter + def maxSurface2DLayered(self, maxSurface2DLayered): + self._pvt_ptr[0].maxSurface2DLayered = maxSurface2DLayered + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} + @property + def maxSurfaceCubemap(self): + return self._pvt_ptr[0].maxSurfaceCubemap + @maxSurfaceCubemap.setter + def maxSurfaceCubemap(self, int maxSurfaceCubemap): + self._pvt_ptr[0].maxSurfaceCubemap = maxSurfaceCubemap + {{endif}} + {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} + @property + def maxSurfaceCubemapLayered(self): + return self._pvt_ptr[0].maxSurfaceCubemapLayered + @maxSurfaceCubemapLayered.setter + def maxSurfaceCubemapLayered(self, maxSurfaceCubemapLayered): + self._pvt_ptr[0].maxSurfaceCubemapLayered = maxSurfaceCubemapLayered + {{endif}} + {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} + @property + def surfaceAlignment(self): + return self._pvt_ptr[0].surfaceAlignment + @surfaceAlignment.setter + def surfaceAlignment(self, size_t surfaceAlignment): + self._pvt_ptr[0].surfaceAlignment = surfaceAlignment + {{endif}} + {{if 'cudaDeviceProp.concurrentKernels' in found_struct}} + @property + def concurrentKernels(self): + return self._pvt_ptr[0].concurrentKernels + @concurrentKernels.setter + def concurrentKernels(self, int concurrentKernels): + self._pvt_ptr[0].concurrentKernels = concurrentKernels + {{endif}} + {{if 'cudaDeviceProp.ECCEnabled' in found_struct}} + @property + def ECCEnabled(self): + return self._pvt_ptr[0].ECCEnabled + @ECCEnabled.setter + def ECCEnabled(self, int ECCEnabled): + self._pvt_ptr[0].ECCEnabled = ECCEnabled + {{endif}} + {{if 'cudaDeviceProp.pciBusID' in found_struct}} + @property + def pciBusID(self): + return self._pvt_ptr[0].pciBusID + @pciBusID.setter + def pciBusID(self, int pciBusID): + self._pvt_ptr[0].pciBusID = pciBusID + {{endif}} + {{if 'cudaDeviceProp.pciDeviceID' in found_struct}} + @property + def pciDeviceID(self): + return self._pvt_ptr[0].pciDeviceID + @pciDeviceID.setter + def pciDeviceID(self, int pciDeviceID): + self._pvt_ptr[0].pciDeviceID = pciDeviceID + {{endif}} + {{if 'cudaDeviceProp.pciDomainID' in found_struct}} + @property + def pciDomainID(self): + return self._pvt_ptr[0].pciDomainID + @pciDomainID.setter + def pciDomainID(self, int pciDomainID): + self._pvt_ptr[0].pciDomainID = pciDomainID + {{endif}} + {{if 'cudaDeviceProp.tccDriver' in found_struct}} + @property + def tccDriver(self): + return self._pvt_ptr[0].tccDriver + @tccDriver.setter + def tccDriver(self, int tccDriver): + self._pvt_ptr[0].tccDriver = tccDriver + {{endif}} + {{if 'cudaDeviceProp.asyncEngineCount' in found_struct}} + @property + def asyncEngineCount(self): + return self._pvt_ptr[0].asyncEngineCount + @asyncEngineCount.setter + def asyncEngineCount(self, int asyncEngineCount): + self._pvt_ptr[0].asyncEngineCount = asyncEngineCount + {{endif}} + {{if 'cudaDeviceProp.unifiedAddressing' in found_struct}} + @property + def unifiedAddressing(self): + return self._pvt_ptr[0].unifiedAddressing + @unifiedAddressing.setter + def unifiedAddressing(self, int unifiedAddressing): + self._pvt_ptr[0].unifiedAddressing = unifiedAddressing + {{endif}} + {{if 'cudaDeviceProp.memoryClockRate' in found_struct}} + @property + def memoryClockRate(self): + return self._pvt_ptr[0].memoryClockRate + @memoryClockRate.setter + def memoryClockRate(self, int memoryClockRate): + self._pvt_ptr[0].memoryClockRate = memoryClockRate + {{endif}} + {{if 'cudaDeviceProp.memoryBusWidth' in found_struct}} + @property + def memoryBusWidth(self): + return self._pvt_ptr[0].memoryBusWidth + @memoryBusWidth.setter + def memoryBusWidth(self, int memoryBusWidth): + self._pvt_ptr[0].memoryBusWidth = memoryBusWidth + {{endif}} + {{if 'cudaDeviceProp.l2CacheSize' in found_struct}} + @property + def l2CacheSize(self): + return self._pvt_ptr[0].l2CacheSize + @l2CacheSize.setter + def l2CacheSize(self, int l2CacheSize): + self._pvt_ptr[0].l2CacheSize = l2CacheSize + {{endif}} + {{if 'cudaDeviceProp.persistingL2CacheMaxSize' in found_struct}} + @property + def persistingL2CacheMaxSize(self): + return self._pvt_ptr[0].persistingL2CacheMaxSize + @persistingL2CacheMaxSize.setter + def persistingL2CacheMaxSize(self, int persistingL2CacheMaxSize): + self._pvt_ptr[0].persistingL2CacheMaxSize = persistingL2CacheMaxSize + {{endif}} + {{if 'cudaDeviceProp.maxThreadsPerMultiProcessor' in found_struct}} + @property + def maxThreadsPerMultiProcessor(self): + return self._pvt_ptr[0].maxThreadsPerMultiProcessor + @maxThreadsPerMultiProcessor.setter + def maxThreadsPerMultiProcessor(self, int maxThreadsPerMultiProcessor): + self._pvt_ptr[0].maxThreadsPerMultiProcessor = maxThreadsPerMultiProcessor + {{endif}} + {{if 'cudaDeviceProp.streamPrioritiesSupported' in found_struct}} + @property + def streamPrioritiesSupported(self): + return self._pvt_ptr[0].streamPrioritiesSupported + @streamPrioritiesSupported.setter + def streamPrioritiesSupported(self, int streamPrioritiesSupported): + self._pvt_ptr[0].streamPrioritiesSupported = streamPrioritiesSupported + {{endif}} + {{if 'cudaDeviceProp.globalL1CacheSupported' in found_struct}} + @property + def globalL1CacheSupported(self): + return self._pvt_ptr[0].globalL1CacheSupported + @globalL1CacheSupported.setter + def globalL1CacheSupported(self, int globalL1CacheSupported): + self._pvt_ptr[0].globalL1CacheSupported = globalL1CacheSupported + {{endif}} + {{if 'cudaDeviceProp.localL1CacheSupported' in found_struct}} + @property + def localL1CacheSupported(self): + return self._pvt_ptr[0].localL1CacheSupported + @localL1CacheSupported.setter + def localL1CacheSupported(self, int localL1CacheSupported): + self._pvt_ptr[0].localL1CacheSupported = localL1CacheSupported + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerMultiprocessor' in found_struct}} + @property + def sharedMemPerMultiprocessor(self): + return self._pvt_ptr[0].sharedMemPerMultiprocessor + @sharedMemPerMultiprocessor.setter + def sharedMemPerMultiprocessor(self, size_t sharedMemPerMultiprocessor): + self._pvt_ptr[0].sharedMemPerMultiprocessor = sharedMemPerMultiprocessor + {{endif}} + {{if 'cudaDeviceProp.regsPerMultiprocessor' in found_struct}} + @property + def regsPerMultiprocessor(self): + return self._pvt_ptr[0].regsPerMultiprocessor + @regsPerMultiprocessor.setter + def regsPerMultiprocessor(self, int regsPerMultiprocessor): + self._pvt_ptr[0].regsPerMultiprocessor = regsPerMultiprocessor + {{endif}} + {{if 'cudaDeviceProp.managedMemory' in found_struct}} + @property + def managedMemory(self): + return self._pvt_ptr[0].managedMemory + @managedMemory.setter + def managedMemory(self, int managedMemory): + self._pvt_ptr[0].managedMemory = managedMemory + {{endif}} + {{if 'cudaDeviceProp.isMultiGpuBoard' in found_struct}} + @property + def isMultiGpuBoard(self): + return self._pvt_ptr[0].isMultiGpuBoard + @isMultiGpuBoard.setter + def isMultiGpuBoard(self, int isMultiGpuBoard): + self._pvt_ptr[0].isMultiGpuBoard = isMultiGpuBoard + {{endif}} + {{if 'cudaDeviceProp.multiGpuBoardGroupID' in found_struct}} + @property + def multiGpuBoardGroupID(self): + return self._pvt_ptr[0].multiGpuBoardGroupID + @multiGpuBoardGroupID.setter + def multiGpuBoardGroupID(self, int multiGpuBoardGroupID): + self._pvt_ptr[0].multiGpuBoardGroupID = multiGpuBoardGroupID + {{endif}} + {{if 'cudaDeviceProp.hostNativeAtomicSupported' in found_struct}} + @property + def hostNativeAtomicSupported(self): + return self._pvt_ptr[0].hostNativeAtomicSupported + @hostNativeAtomicSupported.setter + def hostNativeAtomicSupported(self, int hostNativeAtomicSupported): + self._pvt_ptr[0].hostNativeAtomicSupported = hostNativeAtomicSupported + {{endif}} + {{if 'cudaDeviceProp.singleToDoublePrecisionPerfRatio' in found_struct}} + @property + def singleToDoublePrecisionPerfRatio(self): + return self._pvt_ptr[0].singleToDoublePrecisionPerfRatio + @singleToDoublePrecisionPerfRatio.setter + def singleToDoublePrecisionPerfRatio(self, int singleToDoublePrecisionPerfRatio): + self._pvt_ptr[0].singleToDoublePrecisionPerfRatio = singleToDoublePrecisionPerfRatio + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccess' in found_struct}} + @property + def pageableMemoryAccess(self): + return self._pvt_ptr[0].pageableMemoryAccess + @pageableMemoryAccess.setter + def pageableMemoryAccess(self, int pageableMemoryAccess): + self._pvt_ptr[0].pageableMemoryAccess = pageableMemoryAccess + {{endif}} + {{if 'cudaDeviceProp.concurrentManagedAccess' in found_struct}} + @property + def concurrentManagedAccess(self): + return self._pvt_ptr[0].concurrentManagedAccess + @concurrentManagedAccess.setter + def concurrentManagedAccess(self, int concurrentManagedAccess): + self._pvt_ptr[0].concurrentManagedAccess = concurrentManagedAccess + {{endif}} + {{if 'cudaDeviceProp.computePreemptionSupported' in found_struct}} + @property + def computePreemptionSupported(self): + return self._pvt_ptr[0].computePreemptionSupported + @computePreemptionSupported.setter + def computePreemptionSupported(self, int computePreemptionSupported): + self._pvt_ptr[0].computePreemptionSupported = computePreemptionSupported + {{endif}} + {{if 'cudaDeviceProp.canUseHostPointerForRegisteredMem' in found_struct}} + @property + def canUseHostPointerForRegisteredMem(self): + return self._pvt_ptr[0].canUseHostPointerForRegisteredMem + @canUseHostPointerForRegisteredMem.setter + def canUseHostPointerForRegisteredMem(self, int canUseHostPointerForRegisteredMem): + self._pvt_ptr[0].canUseHostPointerForRegisteredMem = canUseHostPointerForRegisteredMem + {{endif}} + {{if 'cudaDeviceProp.cooperativeLaunch' in found_struct}} + @property + def cooperativeLaunch(self): + return self._pvt_ptr[0].cooperativeLaunch + @cooperativeLaunch.setter + def cooperativeLaunch(self, int cooperativeLaunch): + self._pvt_ptr[0].cooperativeLaunch = cooperativeLaunch + {{endif}} + {{if 'cudaDeviceProp.cooperativeMultiDeviceLaunch' in found_struct}} + @property + def cooperativeMultiDeviceLaunch(self): + return self._pvt_ptr[0].cooperativeMultiDeviceLaunch + @cooperativeMultiDeviceLaunch.setter + def cooperativeMultiDeviceLaunch(self, int cooperativeMultiDeviceLaunch): + self._pvt_ptr[0].cooperativeMultiDeviceLaunch = cooperativeMultiDeviceLaunch + {{endif}} + {{if 'cudaDeviceProp.sharedMemPerBlockOptin' in found_struct}} + @property + def sharedMemPerBlockOptin(self): + return self._pvt_ptr[0].sharedMemPerBlockOptin + @sharedMemPerBlockOptin.setter + def sharedMemPerBlockOptin(self, size_t sharedMemPerBlockOptin): + self._pvt_ptr[0].sharedMemPerBlockOptin = sharedMemPerBlockOptin + {{endif}} + {{if 'cudaDeviceProp.pageableMemoryAccessUsesHostPageTables' in found_struct}} + @property + def pageableMemoryAccessUsesHostPageTables(self): + return self._pvt_ptr[0].pageableMemoryAccessUsesHostPageTables + @pageableMemoryAccessUsesHostPageTables.setter + def pageableMemoryAccessUsesHostPageTables(self, int pageableMemoryAccessUsesHostPageTables): + self._pvt_ptr[0].pageableMemoryAccessUsesHostPageTables = pageableMemoryAccessUsesHostPageTables + {{endif}} + {{if 'cudaDeviceProp.directManagedMemAccessFromHost' in found_struct}} + @property + def directManagedMemAccessFromHost(self): + return self._pvt_ptr[0].directManagedMemAccessFromHost + @directManagedMemAccessFromHost.setter + def directManagedMemAccessFromHost(self, int directManagedMemAccessFromHost): + self._pvt_ptr[0].directManagedMemAccessFromHost = directManagedMemAccessFromHost + {{endif}} + {{if 'cudaDeviceProp.maxBlocksPerMultiProcessor' in found_struct}} + @property + def maxBlocksPerMultiProcessor(self): + return self._pvt_ptr[0].maxBlocksPerMultiProcessor + @maxBlocksPerMultiProcessor.setter + def maxBlocksPerMultiProcessor(self, int maxBlocksPerMultiProcessor): + self._pvt_ptr[0].maxBlocksPerMultiProcessor = maxBlocksPerMultiProcessor + {{endif}} + {{if 'cudaDeviceProp.accessPolicyMaxWindowSize' in found_struct}} + @property + def accessPolicyMaxWindowSize(self): + return self._pvt_ptr[0].accessPolicyMaxWindowSize + @accessPolicyMaxWindowSize.setter + def accessPolicyMaxWindowSize(self, int accessPolicyMaxWindowSize): + self._pvt_ptr[0].accessPolicyMaxWindowSize = accessPolicyMaxWindowSize + {{endif}} + {{if 'cudaDeviceProp.reservedSharedMemPerBlock' in found_struct}} + @property + def reservedSharedMemPerBlock(self): + return self._pvt_ptr[0].reservedSharedMemPerBlock + @reservedSharedMemPerBlock.setter + def reservedSharedMemPerBlock(self, size_t reservedSharedMemPerBlock): + self._pvt_ptr[0].reservedSharedMemPerBlock = reservedSharedMemPerBlock + {{endif}} + {{if 'cudaDeviceProp.hostRegisterSupported' in found_struct}} + @property + def hostRegisterSupported(self): + return self._pvt_ptr[0].hostRegisterSupported + @hostRegisterSupported.setter + def hostRegisterSupported(self, int hostRegisterSupported): + self._pvt_ptr[0].hostRegisterSupported = hostRegisterSupported + {{endif}} + {{if 'cudaDeviceProp.sparseCudaArraySupported' in found_struct}} + @property + def sparseCudaArraySupported(self): + return self._pvt_ptr[0].sparseCudaArraySupported + @sparseCudaArraySupported.setter + def sparseCudaArraySupported(self, int sparseCudaArraySupported): + self._pvt_ptr[0].sparseCudaArraySupported = sparseCudaArraySupported + {{endif}} + {{if 'cudaDeviceProp.hostRegisterReadOnlySupported' in found_struct}} + @property + def hostRegisterReadOnlySupported(self): + return self._pvt_ptr[0].hostRegisterReadOnlySupported + @hostRegisterReadOnlySupported.setter + def hostRegisterReadOnlySupported(self, int hostRegisterReadOnlySupported): + self._pvt_ptr[0].hostRegisterReadOnlySupported = hostRegisterReadOnlySupported + {{endif}} + {{if 'cudaDeviceProp.timelineSemaphoreInteropSupported' in found_struct}} + @property + def timelineSemaphoreInteropSupported(self): + return self._pvt_ptr[0].timelineSemaphoreInteropSupported + @timelineSemaphoreInteropSupported.setter + def timelineSemaphoreInteropSupported(self, int timelineSemaphoreInteropSupported): + self._pvt_ptr[0].timelineSemaphoreInteropSupported = timelineSemaphoreInteropSupported + {{endif}} + {{if 'cudaDeviceProp.memoryPoolsSupported' in found_struct}} + @property + def memoryPoolsSupported(self): + return self._pvt_ptr[0].memoryPoolsSupported + @memoryPoolsSupported.setter + def memoryPoolsSupported(self, int memoryPoolsSupported): + self._pvt_ptr[0].memoryPoolsSupported = memoryPoolsSupported + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMASupported' in found_struct}} + @property + def gpuDirectRDMASupported(self): + return self._pvt_ptr[0].gpuDirectRDMASupported + @gpuDirectRDMASupported.setter + def gpuDirectRDMASupported(self, int gpuDirectRDMASupported): + self._pvt_ptr[0].gpuDirectRDMASupported = gpuDirectRDMASupported + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAFlushWritesOptions' in found_struct}} + @property + def gpuDirectRDMAFlushWritesOptions(self): + return self._pvt_ptr[0].gpuDirectRDMAFlushWritesOptions + @gpuDirectRDMAFlushWritesOptions.setter + def gpuDirectRDMAFlushWritesOptions(self, unsigned int gpuDirectRDMAFlushWritesOptions): + self._pvt_ptr[0].gpuDirectRDMAFlushWritesOptions = gpuDirectRDMAFlushWritesOptions + {{endif}} + {{if 'cudaDeviceProp.gpuDirectRDMAWritesOrdering' in found_struct}} + @property + def gpuDirectRDMAWritesOrdering(self): + return self._pvt_ptr[0].gpuDirectRDMAWritesOrdering + @gpuDirectRDMAWritesOrdering.setter + def gpuDirectRDMAWritesOrdering(self, int gpuDirectRDMAWritesOrdering): + self._pvt_ptr[0].gpuDirectRDMAWritesOrdering = gpuDirectRDMAWritesOrdering + {{endif}} + {{if 'cudaDeviceProp.memoryPoolSupportedHandleTypes' in found_struct}} + @property + def memoryPoolSupportedHandleTypes(self): + return self._pvt_ptr[0].memoryPoolSupportedHandleTypes + @memoryPoolSupportedHandleTypes.setter + def memoryPoolSupportedHandleTypes(self, unsigned int memoryPoolSupportedHandleTypes): + self._pvt_ptr[0].memoryPoolSupportedHandleTypes = memoryPoolSupportedHandleTypes + {{endif}} + {{if 'cudaDeviceProp.deferredMappingCudaArraySupported' in found_struct}} + @property + def deferredMappingCudaArraySupported(self): + return self._pvt_ptr[0].deferredMappingCudaArraySupported + @deferredMappingCudaArraySupported.setter + def deferredMappingCudaArraySupported(self, int deferredMappingCudaArraySupported): + self._pvt_ptr[0].deferredMappingCudaArraySupported = deferredMappingCudaArraySupported + {{endif}} + {{if 'cudaDeviceProp.ipcEventSupported' in found_struct}} + @property + def ipcEventSupported(self): + return self._pvt_ptr[0].ipcEventSupported + @ipcEventSupported.setter + def ipcEventSupported(self, int ipcEventSupported): + self._pvt_ptr[0].ipcEventSupported = ipcEventSupported + {{endif}} + {{if 'cudaDeviceProp.clusterLaunch' in found_struct}} + @property + def clusterLaunch(self): + return self._pvt_ptr[0].clusterLaunch + @clusterLaunch.setter + def clusterLaunch(self, int clusterLaunch): + self._pvt_ptr[0].clusterLaunch = clusterLaunch + {{endif}} + {{if 'cudaDeviceProp.unifiedFunctionPointers' in found_struct}} + @property + def unifiedFunctionPointers(self): + return self._pvt_ptr[0].unifiedFunctionPointers + @unifiedFunctionPointers.setter + def unifiedFunctionPointers(self, int unifiedFunctionPointers): + self._pvt_ptr[0].unifiedFunctionPointers = unifiedFunctionPointers + {{endif}} + {{if 'cudaDeviceProp.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 'cudaIpcEventHandle_st' in found_struct}} + +cdef class cudaIpcEventHandle_st: + """ + CUDA IPC event handle + + Attributes + ---------- + {{if 'cudaIpcEventHandle_st.reserved' in found_struct}} + reserved : bytes + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaIpcEventHandle_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 'cudaIpcEventHandle_st.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 64: + raise ValueError("reserved length must be 64, is " + str(len(reserved))) + if CHAR_MIN == 0: + for i, b in enumerate(reserved): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].reserved[i] = b + else: + for i, b in enumerate(reserved): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].reserved[i] = b + {{endif}} +{{endif}} +{{if 'cudaIpcMemHandle_st' in found_struct}} + +cdef class cudaIpcMemHandle_st: + """ + CUDA IPC memory handle + + Attributes + ---------- + {{if 'cudaIpcMemHandle_st.reserved' in found_struct}} + reserved : bytes + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaIpcMemHandle_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 'cudaIpcMemHandle_st.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 64: + raise ValueError("reserved length must be 64, is " + str(len(reserved))) + if CHAR_MIN == 0: + for i, b in enumerate(reserved): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].reserved[i] = b + else: + for i, b in enumerate(reserved): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].reserved[i] = b + {{endif}} +{{endif}} +{{if 'cudaMemFabricHandle_st' in found_struct}} + +cdef class cudaMemFabricHandle_st: + """ + Attributes + ---------- + {{if 'cudaMemFabricHandle_st.reserved' in found_struct}} + reserved : bytes + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaMemFabricHandle_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 'cudaMemFabricHandle_st.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 64: + raise ValueError("reserved length must be 64, is " + str(len(reserved))) + if CHAR_MIN == 0: + for i, b in enumerate(reserved): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].reserved[i] = b + else: + for i, b in enumerate(reserved): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].reserved[i] = b + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + +cdef class anon_struct7: + """ + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.handle.win32.handle' in found_struct}} + handle : Any + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} + name : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle.win32 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalMemoryHandleDesc.handle.win32.handle' in found_struct}} + try: + str_list += ['handle : ' + hex(self.handle)] + except ValueError: + str_list += ['handle : '] + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.handle.win32.handle' in found_struct}} + @property + def handle(self): + return self._pvt_ptr[0].handle.win32.handle + @handle.setter + def handle(self, handle): + self._cyhandle = _HelperInputVoidPtr(handle) + self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} + @property + def name(self): + return self._pvt_ptr[0].handle.win32.name + @name.setter + def name(self, name): + self._cyname = _HelperInputVoidPtr(name) + self._pvt_ptr[0].handle.win32.name = self._cyname.cptr + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + +cdef class anon_union2: + """ + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.handle.fd' in found_struct}} + fd : int + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + win32 : anon_struct7 + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} + nvSciBufObject : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + self._win32 = anon_struct7(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalMemoryHandleDesc.handle.fd' in found_struct}} + try: + str_list += ['fd : ' + str(self.fd)] + except ValueError: + str_list += ['fd : '] + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.handle.win32' in found_struct}} + @property + def win32(self): + return self._win32 + @win32.setter + def win32(self, win32 not None : anon_struct7): + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle.nvSciBufObject' in found_struct}} + @property + def nvSciBufObject(self): + return self._pvt_ptr[0].handle.nvSciBufObject + @nvSciBufObject.setter + def nvSciBufObject(self, nvSciBufObject): + self._cynvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) + self._pvt_ptr[0].handle.nvSciBufObject = self._cynvSciBufObject.cptr + {{endif}} +{{endif}} +{{if 'cudaExternalMemoryHandleDesc' in found_struct}} + +cdef class cudaExternalMemoryHandleDesc: + """ + External memory handle descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryHandleDesc.type' in found_struct}} + type : cudaExternalMemoryHandleType + Type of the handle + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + handle : anon_union2 + + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.size' in found_struct}} + size : unsigned long long + Size of the memory allocation + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.flags' in found_struct}} + flags : unsigned int + Flags must either be zero or cudaExternalMemoryDedicated + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaExternalMemoryHandleDesc)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + self._handle = anon_union2(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{if 'cudaExternalMemoryHandleDesc.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.size' in found_struct}} + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.type' in found_struct}} + @property + def type(self): + return cudaExternalMemoryHandleType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaExternalMemoryHandleType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} + @property + 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)) + {{endif}} + {{if 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryHandleDesc.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 'cudaExternalMemoryBufferDesc' in found_struct}} + +cdef class cudaExternalMemoryBufferDesc: + """ + External memory buffer descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryBufferDesc.offset' in found_struct}} + offset : unsigned long long + Offset into the memory object where the buffer's base is + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.size' in found_struct}} + size : unsigned long long + Size of the buffer + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.flags' in found_struct}} + flags : unsigned int + Flags reserved for future use. Must be zero. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalMemoryBufferDesc.offset' in found_struct}} + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.size' in found_struct}} + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + {{endif}} + {{if 'cudaExternalMemoryBufferDesc.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 'cudaExternalMemoryBufferDesc.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 'cudaExternalMemoryBufferDesc.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 'cudaExternalMemoryBufferDesc.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 'cudaExternalMemoryMipmappedArrayDesc' in found_struct}} + +cdef class cudaExternalMemoryMipmappedArrayDesc: + """ + External memory mipmap descriptor + + Attributes + ---------- + {{if 'cudaExternalMemoryMipmappedArrayDesc.offset' in found_struct}} + offset : unsigned long long + Offset into the memory object where the base level of the mipmap + chain is. + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + formatDesc : cudaChannelFormatDesc + Format of base level of the mipmap chain + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} + extent : cudaExtent + Dimensions of base level of the mipmap chain + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.flags' in found_struct}} + flags : unsigned int + Flags associated with CUDA mipmapped arrays. See + cudaMallocMipmappedArray + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.numLevels' in found_struct}} + numLevels : unsigned int + Total number of levels in the mipmap chain + {{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 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + self._formatDesc = cudaChannelFormatDesc(_ptr=&self._pvt_ptr[0].formatDesc) + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} + self._extent = cudaExtent(_ptr=&self._pvt_ptr[0].extent) + {{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 'cudaExternalMemoryMipmappedArrayDesc.offset' in found_struct}} + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + try: + str_list += ['formatDesc :\n' + '\n'.join([' ' + line for line in str(self.formatDesc).splitlines()])] + except ValueError: + str_list += ['formatDesc : '] + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.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 'cudaExternalMemoryMipmappedArrayDesc.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.numLevels' in found_struct}} + try: + str_list += ['numLevels : ' + str(self.numLevels)] + except ValueError: + str_list += ['numLevels : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaExternalMemoryMipmappedArrayDesc.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 'cudaExternalMemoryMipmappedArrayDesc.formatDesc' in found_struct}} + @property + def formatDesc(self): + 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)) + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} + @property + def extent(self): + 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)) + {{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc.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 'cudaExternalMemoryMipmappedArrayDesc.numLevels' in found_struct}} + @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}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + +cdef class anon_struct8: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.handle' in found_struct}} + handle : Any + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} + name : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle.win32 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.handle' in found_struct}} + try: + str_list += ['handle : ' + hex(self.handle)] + except ValueError: + str_list += ['handle : '] + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.handle.win32.handle' in found_struct}} + @property + def handle(self): + return self._pvt_ptr[0].handle.win32.handle + @handle.setter + def handle(self, handle): + self._cyhandle = _HelperInputVoidPtr(handle) + self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} + @property + def name(self): + return self._pvt_ptr[0].handle.win32.name + @name.setter + def name(self, name): + self._cyname = _HelperInputVoidPtr(name) + self._pvt_ptr[0].handle.win32.name = self._cyname.cptr + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + +cdef class anon_union3: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.handle.fd' in found_struct}} + fd : int + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + win32 : anon_struct8 + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} + nvSciSyncObj : Any + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + self._win32 = anon_struct8(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].handle + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreHandleDesc.handle.fd' in found_struct}} + try: + str_list += ['fd : ' + str(self.fd)] + except ValueError: + str_list += ['fd : '] + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.handle.win32' in found_struct}} + @property + def win32(self): + return self._win32 + @win32.setter + def win32(self, win32 not None : anon_struct8): + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj' in found_struct}} + @property + def nvSciSyncObj(self): + return self._pvt_ptr[0].handle.nvSciSyncObj + @nvSciSyncObj.setter + def nvSciSyncObj(self, nvSciSyncObj): + self._cynvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) + self._pvt_ptr[0].handle.nvSciSyncObj = self._cynvSciSyncObj.cptr + {{endif}} +{{endif}} +{{if 'cudaExternalSemaphoreHandleDesc' in found_struct}} + +cdef class cudaExternalSemaphoreHandleDesc: + """ + External semaphore handle descriptor + + Attributes + ---------- + {{if 'cudaExternalSemaphoreHandleDesc.type' in found_struct}} + type : cudaExternalSemaphoreHandleType + Type of the handle + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + handle : anon_union3 + + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.flags' in found_struct}} + flags : unsigned int + Flags reserved for the future. Must be zero. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaExternalSemaphoreHandleDesc)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + self._handle = anon_union3(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{if 'cudaExternalSemaphoreHandleDesc.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreHandleDesc.type' in found_struct}} + @property + def type(self): + return cudaExternalSemaphoreHandleType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaExternalSemaphoreHandleType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} + @property + 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)) + {{endif}} + {{if 'cudaExternalSemaphoreHandleDesc.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 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + +cdef class anon_struct15: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.fence.value' in found_struct}} + value : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.fence + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + +cdef class anon_union6: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.fence' in found_struct}} + fence : Any + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.reserved' in found_struct}} + reserved : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.nvSciSync + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.fence' in found_struct}} + try: + str_list += ['fence : ' + hex(self.fence)] + except ValueError: + str_list += ['fence : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params.nvSciSync.fence' in found_struct}} + @property + def fence(self): + return self._pvt_ptr[0].params.nvSciSync.fence + @fence.setter + def fence(self, fence): + self._cyfence = _HelperInputVoidPtr(fence) + self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + +cdef class anon_struct16: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex.key' in found_struct}} + key : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.keyedMutex + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + +cdef class anon_struct17: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + fence : anon_struct15 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + nvSciSync : anon_union6 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + keyedMutex : anon_struct16 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + self._fence = anon_struct15(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + self._nvSciSync = anon_union6(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + self._keyedMutex = anon_struct16(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} + @property + def fence(self): + return self._fence + @fence.setter + def fence(self, fence not None : anon_struct15): + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} + @property + def nvSciSync(self): + return self._nvSciSync + @nvSciSync.setter + def nvSciSync(self, nvSciSync not None : anon_union6): + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} + @property + def keyedMutex(self): + return self._keyedMutex + @keyedMutex.setter + def keyedMutex(self, keyedMutex not None : anon_struct16): + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} + @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 'cudaExternalSemaphoreSignalParams' in found_struct}} + +cdef class cudaExternalSemaphoreSignalParams: + """ + External semaphore signal parameters, compatible with driver type + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + params : anon_struct17 + + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while signaling the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} + reserved : list[unsigned int] + + {{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 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + self._params = anon_struct17(_ptr=self._pvt_ptr) + {{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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.params' in found_struct}} + @property + def params(self): + return self._params + @params.setter + def params(self, params not None : anon_struct17): + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + {{endif}} + {{if 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreSignalParams.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 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + +cdef class anon_struct18: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.fence.value' in found_struct}} + value : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.fence + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + +cdef class anon_union7: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.fence' in found_struct}} + fence : Any + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.reserved' in found_struct}} + reserved : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.nvSciSync + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.fence' in found_struct}} + try: + str_list += ['fence : ' + hex(self.fence)] + except ValueError: + str_list += ['fence : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params.nvSciSync.fence' in found_struct}} + @property + def fence(self): + return self._pvt_ptr[0].params.nvSciSync.fence + @fence.setter + def fence(self, fence): + self._cyfence = _HelperInputVoidPtr(fence) + self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + +cdef class anon_struct19: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex.key' in found_struct}} + key : unsigned long long + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex.timeoutMs' in found_struct}} + timeoutMs : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params.keyedMutex + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex.key' in found_struct}} + try: + str_list += ['key : ' + str(self.key)] + except ValueError: + str_list += ['key : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + +cdef class anon_struct20: + """ + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + fence : anon_struct18 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + nvSciSync : anon_union7 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + keyedMutex : anon_struct19 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} + reserved : list[unsigned int] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + self._fence = anon_struct18(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + self._keyedMutex = anon_struct19(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].params + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params.fence' in found_struct}} + @property + def fence(self): + return self._fence + @fence.setter + def fence(self, fence not None : anon_struct18): + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} + @property + def nvSciSync(self): + return self._nvSciSync + @nvSciSync.setter + def nvSciSync(self, nvSciSync not None : anon_union7): + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} + @property + def keyedMutex(self): + return self._keyedMutex + @keyedMutex.setter + def keyedMutex(self, keyedMutex not None : anon_struct19): + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} + @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 'cudaExternalSemaphoreWaitParams' in found_struct}} + +cdef class cudaExternalSemaphoreWaitParams: + """ + External semaphore wait parameters, compatible with driver type + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + params : anon_struct20 + + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} + flags : unsigned int + Only when cudaExternalSemaphoreSignalParams is used to signal a + cudaExternalSemaphore_t of type + cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is + cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates + that while waiting for the cudaExternalSemaphore_t, no memory + synchronization operations should be performed for any external + memory object imported as cudaExternalMemoryHandleTypeNvSciBuf. For + all other types of cudaExternalSemaphore_t, flags must be zero. + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} + reserved : list[unsigned int] + + {{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 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + self._params = anon_struct20(_ptr=self._pvt_ptr) + {{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 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.params' in found_struct}} + @property + def params(self): + return self._params + @params.setter + def params(self, params not None : anon_struct20): + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + {{endif}} + {{if 'cudaExternalSemaphoreWaitParams.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 'cudaExternalSemaphoreWaitParams.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 'cudalibraryHostUniversalFunctionAndDataTable' in found_struct}} + +cdef class cudalibraryHostUniversalFunctionAndDataTable: + """ + Attributes + ---------- + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionTable' in found_struct}} + functionTable : Any + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionWindowSize' in found_struct}} + functionWindowSize : size_t + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataTable' in found_struct}} + dataTable : Any + + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataWindowSize' in found_struct}} + dataWindowSize : size_t + + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionTable' in found_struct}} + try: + str_list += ['functionTable : ' + hex(self.functionTable)] + except ValueError: + str_list += ['functionTable : '] + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionWindowSize' in found_struct}} + try: + str_list += ['functionWindowSize : ' + str(self.functionWindowSize)] + except ValueError: + str_list += ['functionWindowSize : '] + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataTable' in found_struct}} + try: + str_list += ['dataTable : ' + hex(self.dataTable)] + except ValueError: + str_list += ['dataTable : '] + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.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 'cudalibraryHostUniversalFunctionAndDataTable.functionTable' in found_struct}} + @property + def functionTable(self): + return self._pvt_ptr[0].functionTable + @functionTable.setter + def functionTable(self, functionTable): + self._cyfunctionTable = _HelperInputVoidPtr(functionTable) + self._pvt_ptr[0].functionTable = self._cyfunctionTable.cptr + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.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 'cudalibraryHostUniversalFunctionAndDataTable.dataTable' in found_struct}} + @property + def dataTable(self): + return self._pvt_ptr[0].dataTable + @dataTable.setter + def dataTable(self, dataTable): + self._cydataTable = _HelperInputVoidPtr(dataTable) + self._pvt_ptr[0].dataTable = self._cydataTable.cptr + {{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable.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 'cudaKernelNodeParams' in found_struct}} + +cdef class cudaKernelNodeParams: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + {{if 'cudaKernelNodeParams.func' in found_struct}} + func : Any + Kernel to launch + {{endif}} + {{if 'cudaKernelNodeParams.gridDim' in found_struct}} + gridDim : dim3 + Grid dimensions + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + blockDim : dim3 + Block dimensions + {{endif}} + {{if 'cudaKernelNodeParams.sharedMemBytes' in found_struct}} + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + {{endif}} + {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} + kernelParams : Any + Array of pointers to individual kernel arguments + {{endif}} + {{if 'cudaKernelNodeParams.extra' in found_struct}} + extra : Any + Pointer to kernel arguments in the "extra" format + {{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 'cudaKernelNodeParams.gridDim' in found_struct}} + self._gridDim = dim3(_ptr=&self._pvt_ptr[0].gridDim) + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + self._blockDim = dim3(_ptr=&self._pvt_ptr[0].blockDim) + {{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 'cudaKernelNodeParams.func' in found_struct}} + try: + str_list += ['func : ' + hex(self.func)] + except ValueError: + str_list += ['func : '] + {{endif}} + {{if 'cudaKernelNodeParams.gridDim' in found_struct}} + try: + str_list += ['gridDim :\n' + '\n'.join([' ' + line for line in str(self.gridDim).splitlines()])] + except ValueError: + str_list += ['gridDim : '] + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + try: + str_list += ['blockDim :\n' + '\n'.join([' ' + line for line in str(self.blockDim).splitlines()])] + except ValueError: + str_list += ['blockDim : '] + {{endif}} + {{if 'cudaKernelNodeParams.sharedMemBytes' in found_struct}} + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + {{endif}} + {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + {{endif}} + {{if 'cudaKernelNodeParams.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 'cudaKernelNodeParams.func' in found_struct}} + @property + def func(self): + return self._pvt_ptr[0].func + @func.setter + def func(self, func): + self._cyfunc = _HelperInputVoidPtr(func) + self._pvt_ptr[0].func = self._cyfunc.cptr + {{endif}} + {{if 'cudaKernelNodeParams.gridDim' in found_struct}} + @property + def gridDim(self): + 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)) + {{endif}} + {{if 'cudaKernelNodeParams.blockDim' in found_struct}} + @property + def blockDim(self): + 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)) + {{endif}} + {{if 'cudaKernelNodeParams.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 'cudaKernelNodeParams.kernelParams' in found_struct}} + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + {{endif}} + {{if 'cudaKernelNodeParams.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 'cudaKernelNodeParamsV2' in found_struct}} + +cdef class cudaKernelNodeParamsV2: + """ + CUDA GPU kernel node parameters + + Attributes + ---------- + {{if 'cudaKernelNodeParamsV2.func' in found_struct}} + func : Any + Kernel to launch + {{endif}} + {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + gridDim : dim3 + Grid dimensions + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + blockDim : dim3 + Block dimensions + {{endif}} + {{if 'cudaKernelNodeParamsV2.sharedMemBytes' in found_struct}} + sharedMemBytes : unsigned int + Dynamic shared-memory size per thread block in bytes + {{endif}} + {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} + kernelParams : Any + Array of pointers to individual kernel arguments + {{endif}} + {{if 'cudaKernelNodeParamsV2.extra' in found_struct}} + extra : Any + Pointer to kernel arguments in the "extra" format + {{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 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + self._gridDim = dim3(_ptr=&self._pvt_ptr[0].gridDim) + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + self._blockDim = dim3(_ptr=&self._pvt_ptr[0].blockDim) + {{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 'cudaKernelNodeParamsV2.func' in found_struct}} + try: + str_list += ['func : ' + hex(self.func)] + except ValueError: + str_list += ['func : '] + {{endif}} + {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + try: + str_list += ['gridDim :\n' + '\n'.join([' ' + line for line in str(self.gridDim).splitlines()])] + except ValueError: + str_list += ['gridDim : '] + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + try: + str_list += ['blockDim :\n' + '\n'.join([' ' + line for line in str(self.blockDim).splitlines()])] + except ValueError: + str_list += ['blockDim : '] + {{endif}} + {{if 'cudaKernelNodeParamsV2.sharedMemBytes' in found_struct}} + try: + str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] + except ValueError: + str_list += ['sharedMemBytes : '] + {{endif}} + {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} + try: + str_list += ['kernelParams : ' + str(self.kernelParams)] + except ValueError: + str_list += ['kernelParams : '] + {{endif}} + {{if 'cudaKernelNodeParamsV2.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 'cudaKernelNodeParamsV2.func' in found_struct}} + @property + def func(self): + return self._pvt_ptr[0].func + @func.setter + def func(self, func): + self._cyfunc = _HelperInputVoidPtr(func) + self._pvt_ptr[0].func = self._cyfunc.cptr + {{endif}} + {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} + @property + def gridDim(self): + 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)) + {{endif}} + {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} + @property + def blockDim(self): + 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)) + {{endif}} + {{if 'cudaKernelNodeParamsV2.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 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} + @property + def kernelParams(self): + return self._pvt_ptr[0].kernelParams + @kernelParams.setter + def kernelParams(self, kernelParams): + self._cykernelParams = _HelperKernelParams(kernelParams) + self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams + {{endif}} + {{if 'cudaKernelNodeParamsV2.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 'cudaExternalSemaphoreSignalNodeParams' in found_struct}} + +cdef class cudaExternalSemaphoreSignalNodeParams: + """ + External semaphore signal node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{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 + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.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 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cyruntime.cudaExternalSemaphore_t) for x in range(self._extSemArray_length)] + return [cudaExternalSemaphore_t(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphore_t)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} + @property + def paramsArray(self): + arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cyruntime.cudaExternalSemaphoreSignalParams) for x in range(self._paramsArray_length)] + return [cudaExternalSemaphoreSignalParams(_ptr=arr) for arr in arrs] + @paramsArray.setter + 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: + if self._paramsArray_length != len(val): + free(self._paramsArray) + self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + if self._paramsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreSignalParams))) + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = self._paramsArray + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams.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 'cudaExternalSemaphoreSignalNodeParamsV2' in found_struct}} + +cdef class cudaExternalSemaphoreSignalNodeParamsV2: + """ + External semaphore signal node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreSignalParams + Array of external semaphore signal parameters. + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{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 + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.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 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cyruntime.cudaExternalSemaphore_t) for x in range(self._extSemArray_length)] + return [cudaExternalSemaphore_t(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphore_t)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} + @property + def paramsArray(self): + arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cyruntime.cudaExternalSemaphoreSignalParams) for x in range(self._paramsArray_length)] + return [cudaExternalSemaphoreSignalParams(_ptr=arr) for arr in arrs] + @paramsArray.setter + 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: + if self._paramsArray_length != len(val): + free(self._paramsArray) + self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + if self._paramsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreSignalParams))) + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = self._paramsArray + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + + {{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2.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 'cudaExternalSemaphoreWaitNodeParams' in found_struct}} + +cdef class cudaExternalSemaphoreWaitNodeParams: + """ + External semaphore wait node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{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 + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.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 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cyruntime.cudaExternalSemaphore_t) for x in range(self._extSemArray_length)] + return [cudaExternalSemaphore_t(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphore_t)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} + @property + def paramsArray(self): + arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cyruntime.cudaExternalSemaphoreWaitParams) for x in range(self._paramsArray_length)] + return [cudaExternalSemaphoreWaitParams(_ptr=arr) for arr in arrs] + @paramsArray.setter + 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: + if self._paramsArray_length != len(val): + free(self._paramsArray) + self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + if self._paramsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreWaitParams))) + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = self._paramsArray + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams.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 'cudaExternalSemaphoreWaitNodeParamsV2' in found_struct}} + +cdef class cudaExternalSemaphoreWaitNodeParamsV2: + """ + External semaphore wait node parameters + + Attributes + ---------- + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} + extSemArray : cudaExternalSemaphore_t + Array of external semaphore handles. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} + paramsArray : cudaExternalSemaphoreWaitParams + Array of external semaphore wait parameters. + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.numExtSems' in found_struct}} + numExtSems : unsigned int + Number of handles and parameters supplied in extSemArray and + paramsArray. + {{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 + def __dealloc__(self): + pass + {{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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} + try: + str_list += ['extSemArray : ' + str(self.extSemArray)] + except ValueError: + str_list += ['extSemArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} + try: + str_list += ['paramsArray : ' + str(self.paramsArray)] + except ValueError: + str_list += ['paramsArray : '] + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.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 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} + @property + def extSemArray(self): + arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cyruntime.cudaExternalSemaphore_t) for x in range(self._extSemArray_length)] + return [cudaExternalSemaphore_t(_ptr=arr) for arr in arrs] + @extSemArray.setter + 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: + if self._extSemArray_length != len(val): + free(self._extSemArray) + self._extSemArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphore_t)) + if self._extSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + self._extSemArray_length = len(val) + self._pvt_ptr[0].extSemArray = self._extSemArray + for idx in range(len(val)): + self._extSemArray[idx] = (val[idx])._pvt_ptr[0] + + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} + @property + def paramsArray(self): + arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cyruntime.cudaExternalSemaphoreWaitParams) for x in range(self._paramsArray_length)] + return [cudaExternalSemaphoreWaitParams(_ptr=arr) for arr in arrs] + @paramsArray.setter + 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: + if self._paramsArray_length != len(val): + free(self._paramsArray) + self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + if self._paramsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreWaitParams))) + self._paramsArray_length = len(val) + self._pvt_ptr[0].paramsArray = self._paramsArray + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + + {{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2.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 'cudaConditionalNodeParams' in found_struct}} + +cdef class cudaConditionalNodeParams: + """ + CUDA conditional node parameters + + Attributes + ---------- + {{if 'cudaConditionalNodeParams.handle' in found_struct}} + handle : cudaGraphConditionalHandle + Conditional node handle. Handles must be created in advance of + creating the node using cudaGraphConditionalHandleCreate. + {{endif}} + {{if 'cudaConditionalNodeParams.type' in found_struct}} + type : cudaGraphConditionalNodeType + Type of conditional node. + {{endif}} + {{if 'cudaConditionalNodeParams.size' in found_struct}} + size : unsigned int + Size of graph output array. Allowed values are 1 for + cudaGraphCondTypeWhile, 1 or 2 for cudaGraphCondTypeWhile, or any + value greater than zero for cudaGraphCondTypeSwitch. + {{endif}} + {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} + phGraph_out : cudaGraph_t + CUDA-owned array populated with conditional node child graphs + during creation of the node. Valid for the lifetime of the + conditional node. The contents of the graph(s) are subject to the + following constraints: - Allowed node types are kernel nodes, + empty nodes, child graphs, memsets, memcopies, and conditionals. + This applies recursively to child graphs and conditional bodies. + - All kernels, including kernels in nested conditionals or child + graphs at any level, must belong to the same CUDA context. + These graphs may be populated using graph node creation APIs or + cudaStreamBeginCaptureToGraph. cudaGraphCondTypeIf: phGraph_out[0] + is executed when the condition is non-zero. If `size` == 2, + phGraph_out[1] will be executed when the condition is zero. + cudaGraphCondTypeWhile: phGraph_out[0] is executed as long as the + condition is non-zero. cudaGraphCondTypeSwitch: phGraph_out[n] is + executed when the condition is equal to n. If the condition >= + `size`, no body graph is executed. + {{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 'cudaConditionalNodeParams.handle' in found_struct}} + self._handle = cudaGraphConditionalHandle(_ptr=&self._pvt_ptr[0].handle) + {{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 'cudaConditionalNodeParams.handle' in found_struct}} + try: + str_list += ['handle : ' + str(self.handle)] + except ValueError: + str_list += ['handle : '] + {{endif}} + {{if 'cudaConditionalNodeParams.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaConditionalNodeParams.size' in found_struct}} + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + {{endif}} + {{if 'cudaConditionalNodeParams.phGraph_out' in found_struct}} + try: + str_list += ['phGraph_out : ' + str(self.phGraph_out)] + except ValueError: + str_list += ['phGraph_out : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaConditionalNodeParams.handle' in found_struct}} + @property + def handle(self): + return self._handle + @handle.setter + def handle(self, handle): + cdef cyruntime.cudaGraphConditionalHandle cyhandle + if handle is None: + cyhandle = 0 + elif isinstance(handle, (cudaGraphConditionalHandle)): + phandle = int(handle) + cyhandle = phandle + else: + phandle = int(cudaGraphConditionalHandle(handle)) + cyhandle = phandle + self._handle._pvt_ptr[0] = cyhandle + + {{endif}} + {{if 'cudaConditionalNodeParams.type' in found_struct}} + @property + def type(self): + return cudaGraphConditionalNodeType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaGraphConditionalNodeType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaConditionalNodeParams.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 'cudaConditionalNodeParams.phGraph_out' in found_struct}} + @property + def phGraph_out(self): + arrs = [self._pvt_ptr[0].phGraph_out + x*sizeof(cyruntime.cudaGraph_t) for x in range(self.size)] + return [cudaGraph_t(_ptr=arr) for arr in arrs] + {{endif}} +{{endif}} +{{if 'cudaChildGraphNodeParams' in found_struct}} + +cdef class cudaChildGraphNodeParams: + """ + Child graph node parameters + + Attributes + ---------- + {{if 'cudaChildGraphNodeParams.graph' in found_struct}} + graph : cudaGraph_t + 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 'cudaChildGraphNodeParams.ownership' in found_struct}} + ownership : cudaGraphChildGraphNodeOwnership + The ownership relationship of the child graph node. + {{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 'cudaChildGraphNodeParams.graph' in found_struct}} + self._graph = cudaGraph_t(_ptr=&self._pvt_ptr[0].graph) + {{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 'cudaChildGraphNodeParams.graph' in found_struct}} + try: + str_list += ['graph : ' + str(self.graph)] + except ValueError: + str_list += ['graph : '] + {{endif}} + {{if 'cudaChildGraphNodeParams.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 'cudaChildGraphNodeParams.graph' in found_struct}} + @property + def graph(self): + return self._graph + @graph.setter + def graph(self, graph): + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + cygraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + cygraph = pgraph + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + self._graph._pvt_ptr[0] = cygraph + {{endif}} + {{if 'cudaChildGraphNodeParams.ownership' in found_struct}} + @property + def ownership(self): + return cudaGraphChildGraphNodeOwnership(self._pvt_ptr[0].ownership) + @ownership.setter + def ownership(self, ownership not None : cudaGraphChildGraphNodeOwnership): + self._pvt_ptr[0].ownership = int(ownership) + {{endif}} +{{endif}} +{{if 'cudaEventRecordNodeParams' in found_struct}} + +cdef class cudaEventRecordNodeParams: + """ + Event record node parameters + + Attributes + ---------- + {{if 'cudaEventRecordNodeParams.event' in found_struct}} + event : cudaEvent_t + The event to record when the node executes + {{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 'cudaEventRecordNodeParams.event' in found_struct}} + self._event = cudaEvent_t(_ptr=&self._pvt_ptr[0].event) + {{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 'cudaEventRecordNodeParams.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 'cudaEventRecordNodeParams.event' in found_struct}} + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cyruntime.cudaEvent_t cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + {{endif}} +{{endif}} +{{if 'cudaEventWaitNodeParams' in found_struct}} + +cdef class cudaEventWaitNodeParams: + """ + Event wait node parameters + + Attributes + ---------- + {{if 'cudaEventWaitNodeParams.event' in found_struct}} + event : cudaEvent_t + The event to wait on from the node + {{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 'cudaEventWaitNodeParams.event' in found_struct}} + self._event = cudaEvent_t(_ptr=&self._pvt_ptr[0].event) + {{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 'cudaEventWaitNodeParams.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 'cudaEventWaitNodeParams.event' in found_struct}} + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cyruntime.cudaEvent_t cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + {{endif}} +{{endif}} +{{if 'cudaGraphNodeParams' in found_struct}} + +cdef class cudaGraphNodeParams: + """ + Graph node parameters. See cudaGraphAddNode. + + Attributes + ---------- + {{if 'cudaGraphNodeParams.type' in found_struct}} + type : cudaGraphNodeType + Type of the node + {{endif}} + {{if 'cudaGraphNodeParams.reserved0' in found_struct}} + reserved0 : list[int] + Reserved. Must be zero. + {{endif}} + {{if 'cudaGraphNodeParams.reserved1' in found_struct}} + reserved1 : list[long long] + Padding. Unused bytes must be zero. + {{endif}} + {{if 'cudaGraphNodeParams.kernel' in found_struct}} + kernel : cudaKernelNodeParamsV2 + Kernel node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.memcpy' in found_struct}} + memcpy : cudaMemcpyNodeParams + Memcpy node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.memset' in found_struct}} + memset : cudaMemsetParamsV2 + Memset node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.host' in found_struct}} + host : cudaHostNodeParamsV2 + Host node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.graph' in found_struct}} + graph : cudaChildGraphNodeParams + Child graph node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.eventWait' in found_struct}} + eventWait : cudaEventWaitNodeParams + Event wait node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} + eventRecord : cudaEventRecordNodeParams + Event record node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} + extSemSignal : cudaExternalSemaphoreSignalNodeParamsV2 + External semaphore signal node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} + extSemWait : cudaExternalSemaphoreWaitNodeParamsV2 + External semaphore wait node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.alloc' in found_struct}} + alloc : cudaMemAllocNodeParamsV2 + Memory allocation node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.free' in found_struct}} + free : cudaMemFreeNodeParams + Memory free node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.conditional' in found_struct}} + conditional : cudaConditionalNodeParams + Conditional node parameters. + {{endif}} + {{if 'cudaGraphNodeParams.reserved2' in found_struct}} + reserved2 : long long + Reserved bytes. Must be zero. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaGraphNodeParams)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaGraphNodeParams.kernel' in found_struct}} + self._kernel = cudaKernelNodeParamsV2(_ptr=&self._pvt_ptr[0].kernel) + {{endif}} + {{if 'cudaGraphNodeParams.memcpy' in found_struct}} + self._memcpy = cudaMemcpyNodeParams(_ptr=&self._pvt_ptr[0].memcpy) + {{endif}} + {{if 'cudaGraphNodeParams.memset' in found_struct}} + self._memset = cudaMemsetParamsV2(_ptr=&self._pvt_ptr[0].memset) + {{endif}} + {{if 'cudaGraphNodeParams.host' in found_struct}} + self._host = cudaHostNodeParamsV2(_ptr=&self._pvt_ptr[0].host) + {{endif}} + {{if 'cudaGraphNodeParams.graph' in found_struct}} + self._graph = cudaChildGraphNodeParams(_ptr=&self._pvt_ptr[0].graph) + {{endif}} + {{if 'cudaGraphNodeParams.eventWait' in found_struct}} + self._eventWait = cudaEventWaitNodeParams(_ptr=&self._pvt_ptr[0].eventWait) + {{endif}} + {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} + self._eventRecord = cudaEventRecordNodeParams(_ptr=&self._pvt_ptr[0].eventRecord) + {{endif}} + {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} + self._extSemSignal = cudaExternalSemaphoreSignalNodeParamsV2(_ptr=&self._pvt_ptr[0].extSemSignal) + {{endif}} + {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} + self._extSemWait = cudaExternalSemaphoreWaitNodeParamsV2(_ptr=&self._pvt_ptr[0].extSemWait) + {{endif}} + {{if 'cudaGraphNodeParams.alloc' in found_struct}} + self._alloc = cudaMemAllocNodeParamsV2(_ptr=&self._pvt_ptr[0].alloc) + {{endif}} + {{if 'cudaGraphNodeParams.free' in found_struct}} + self._free = cudaMemFreeNodeParams(_ptr=&self._pvt_ptr[0].free) + {{endif}} + {{if 'cudaGraphNodeParams.conditional' in found_struct}} + self._conditional = cudaConditionalNodeParams(_ptr=&self._pvt_ptr[0].conditional) + {{endif}} + 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 = [] + {{if 'cudaGraphNodeParams.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaGraphNodeParams.reserved0' in found_struct}} + try: + str_list += ['reserved0 : ' + str(self.reserved0)] + except ValueError: + str_list += ['reserved0 : '] + {{endif}} + {{if 'cudaGraphNodeParams.reserved1' in found_struct}} + try: + str_list += ['reserved1 : ' + str(self.reserved1)] + except ValueError: + str_list += ['reserved1 : '] + {{endif}} + {{if 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.reserved2' in found_struct}} + try: + str_list += ['reserved2 : ' + str(self.reserved2)] + except ValueError: + str_list += ['reserved2 : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaGraphNodeParams.type' in found_struct}} + @property + def type(self): + return cudaGraphNodeType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaGraphNodeType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaGraphNodeParams.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 'cudaGraphNodeParams.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 'cudaGraphNodeParams.kernel' in found_struct}} + @property + def kernel(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.memcpy' in found_struct}} + @property + def memcpy(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.memset' in found_struct}} + @property + def memset(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.host' in found_struct}} + @property + def host(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.graph' in found_struct}} + @property + def graph(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.eventWait' in found_struct}} + @property + def eventWait(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} + @property + def eventRecord(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} + @property + def extSemSignal(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} + @property + def extSemWait(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.alloc' in found_struct}} + @property + def alloc(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.free' in found_struct}} + @property + def free(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.conditional' in found_struct}} + @property + def conditional(self): + 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)) + {{endif}} + {{if 'cudaGraphNodeParams.reserved2' in found_struct}} + @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 'cudaGraphEdgeData_st' in found_struct}} + +cdef class cudaGraphEdgeData_st: + """ + Optional annotation for edges in a CUDA graph. Note, all edges + implicitly have annotations and default to a zero-initialized value + if not specified. A zero-initialized struct indicates a standard + full serialization of two nodes with memory visibility. + + Attributes + ---------- + {{if 'cudaGraphEdgeData_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 + of 0 in all cases means full completion of the upstream node, with + memory visibility to the downstream node or portion thereof + (indicated by `to_port`). Only kernel nodes define non-zero + ports. A kernel node can use the following output port types: + cudaGraphKernelNodePortDefault, + cudaGraphKernelNodePortProgrammatic, or + cudaGraphKernelNodePortLaunchCompletion. + {{endif}} + {{if 'cudaGraphEdgeData_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`). + The meaning is specific to the node type. A value of 0 in all cases + 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 '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. + {{endif}} + {{if 'cudaGraphEdgeData_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 + ------- + 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 = [] + {{if 'cudaGraphEdgeData_st.from_port' in found_struct}} + try: + str_list += ['from_port : ' + str(self.from_port)] + except ValueError: + str_list += ['from_port : '] + {{endif}} + {{if 'cudaGraphEdgeData_st.to_port' in found_struct}} + try: + str_list += ['to_port : ' + str(self.to_port)] + except ValueError: + str_list += ['to_port : '] + {{endif}} + {{if 'cudaGraphEdgeData_st.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaGraphEdgeData_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 'cudaGraphEdgeData_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 'cudaGraphEdgeData_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 'cudaGraphEdgeData_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 'cudaGraphEdgeData_st.reserved' in found_struct}} + @property + def reserved(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 5) + @reserved.setter + def reserved(self, reserved): + if len(reserved) != 5: + 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 'cudaGraphInstantiateParams_st' in found_struct}} + +cdef class cudaGraphInstantiateParams_st: + """ + Graph instantiation parameters + + Attributes + ---------- + {{if 'cudaGraphInstantiateParams_st.flags' in found_struct}} + flags : unsigned long long + Instantiation flags + {{endif}} + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + uploadStream : cudaStream_t + Upload stream + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + errNode_out : cudaGraphNode_t + The node which caused instantiation to fail, if any + {{endif}} + {{if 'cudaGraphInstantiateParams_st.result_out' in found_struct}} + result_out : cudaGraphInstantiateResult + Whether instantiation was successful. If it failed, the reason why + {{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 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + self._uploadStream = cudaStream_t(_ptr=&self._pvt_ptr[0].uploadStream) + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + self._errNode_out = cudaGraphNode_t(_ptr=&self._pvt_ptr[0].errNode_out) + {{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 'cudaGraphInstantiateParams_st.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + try: + str_list += ['uploadStream : ' + str(self.uploadStream)] + except ValueError: + str_list += ['uploadStream : '] + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + try: + str_list += ['errNode_out : ' + str(self.errNode_out)] + except ValueError: + str_list += ['errNode_out : '] + {{endif}} + {{if 'cudaGraphInstantiateParams_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 'cudaGraphInstantiateParams_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}} + {{if 'cudaGraphInstantiateParams_st.uploadStream' in found_struct}} + @property + def uploadStream(self): + return self._uploadStream + @uploadStream.setter + def uploadStream(self, uploadStream): + cdef cyruntime.cudaStream_t cyuploadStream + if uploadStream is None: + cyuploadStream = 0 + elif isinstance(uploadStream, (cudaStream_t,driver.CUstream)): + puploadStream = int(uploadStream) + cyuploadStream = puploadStream + else: + puploadStream = int(cudaStream_t(uploadStream)) + cyuploadStream = puploadStream + self._uploadStream._pvt_ptr[0] = cyuploadStream + {{endif}} + {{if 'cudaGraphInstantiateParams_st.errNode_out' in found_struct}} + @property + def errNode_out(self): + return self._errNode_out + @errNode_out.setter + def errNode_out(self, errNode_out): + cdef cyruntime.cudaGraphNode_t cyerrNode_out + if errNode_out is None: + cyerrNode_out = 0 + elif isinstance(errNode_out, (cudaGraphNode_t,driver.CUgraphNode)): + perrNode_out = int(errNode_out) + cyerrNode_out = perrNode_out + else: + perrNode_out = int(cudaGraphNode_t(errNode_out)) + cyerrNode_out = perrNode_out + self._errNode_out._pvt_ptr[0] = cyerrNode_out + {{endif}} + {{if 'cudaGraphInstantiateParams_st.result_out' in found_struct}} + @property + def result_out(self): + return cudaGraphInstantiateResult(self._pvt_ptr[0].result_out) + @result_out.setter + def result_out(self, result_out not None : cudaGraphInstantiateResult): + self._pvt_ptr[0].result_out = int(result_out) + {{endif}} +{{endif}} +{{if 'cudaGraphExecUpdateResultInfo_st' in found_struct}} + +cdef class cudaGraphExecUpdateResultInfo_st: + """ + Result information returned by cudaGraphExecUpdate + + Attributes + ---------- + {{if 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} + result : cudaGraphExecUpdateResult + Gives more specific detail when a cuda graph update fails. + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + errorNode : cudaGraphNode_t + 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 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + errorFromNode : cudaGraphNode_t + The from node of error edge when the topologies do not match. + Otherwise NULL. + {{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 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + self._errorNode = cudaGraphNode_t(_ptr=&self._pvt_ptr[0].errorNode) + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + self._errorFromNode = cudaGraphNode_t(_ptr=&self._pvt_ptr[0].errorFromNode) + {{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 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} + try: + str_list += ['result : ' + str(self.result)] + except ValueError: + str_list += ['result : '] + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + try: + str_list += ['errorNode : ' + str(self.errorNode)] + except ValueError: + str_list += ['errorNode : '] + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_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 'cudaGraphExecUpdateResultInfo_st.result' in found_struct}} + @property + def result(self): + return cudaGraphExecUpdateResult(self._pvt_ptr[0].result) + @result.setter + def result(self, result not None : cudaGraphExecUpdateResult): + self._pvt_ptr[0].result = int(result) + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorNode' in found_struct}} + @property + def errorNode(self): + return self._errorNode + @errorNode.setter + def errorNode(self, errorNode): + cdef cyruntime.cudaGraphNode_t cyerrorNode + if errorNode is None: + cyerrorNode = 0 + elif isinstance(errorNode, (cudaGraphNode_t,driver.CUgraphNode)): + perrorNode = int(errorNode) + cyerrorNode = perrorNode + else: + perrorNode = int(cudaGraphNode_t(errorNode)) + cyerrorNode = perrorNode + self._errorNode._pvt_ptr[0] = cyerrorNode + {{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + @property + def errorFromNode(self): + return self._errorFromNode + @errorFromNode.setter + def errorFromNode(self, errorFromNode): + cdef cyruntime.cudaGraphNode_t cyerrorFromNode + if errorFromNode is None: + cyerrorFromNode = 0 + elif isinstance(errorFromNode, (cudaGraphNode_t,driver.CUgraphNode)): + perrorFromNode = int(errorFromNode) + cyerrorFromNode = perrorFromNode + else: + perrorFromNode = int(cudaGraphNode_t(errorFromNode)) + cyerrorFromNode = perrorFromNode + self._errorFromNode._pvt_ptr[0] = cyerrorFromNode + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + +cdef class anon_struct21: + """ + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.updateData.param.pValue' in found_struct}} + pValue : Any + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} + offset : size_t + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.size' in found_struct}} + size : size_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].updateData.param + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaGraphKernelNodeUpdate.updateData.param.pValue' in found_struct}} + try: + str_list += ['pValue : ' + hex(self.pValue)] + except ValueError: + str_list += ['pValue : '] + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.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 'cudaGraphKernelNodeUpdate.updateData.param.pValue' in found_struct}} + @property + def pValue(self): + return self._pvt_ptr[0].updateData.param.pValue + @pValue.setter + def pValue(self, pValue): + self._cypValue = _HelperInputVoidPtr(pValue) + self._pvt_ptr[0].updateData.param.pValue = self._cypValue.cptr + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} + @property + def offset(self): + return self._pvt_ptr[0].updateData.param.offset + @offset.setter + def offset(self, size_t offset): + self._pvt_ptr[0].updateData.param.offset = offset + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param.size' in found_struct}} + @property + def size(self): + return self._pvt_ptr[0].updateData.param.size + @size.setter + def size(self, size_t size): + self._pvt_ptr[0].updateData.param.size = size + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + +cdef class anon_union9: + """ + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + gridDim : dim3 + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + param : anon_struct21 + + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} + isEnabled : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + self._gridDim = dim3(_ptr=&self._pvt_ptr[0].updateData.gridDim) + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + self._param = anon_struct21(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].updateData + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + try: + str_list += ['gridDim :\n' + '\n'.join([' ' + line for line in str(self.gridDim).splitlines()])] + except ValueError: + str_list += ['gridDim : '] + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.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}} + {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} + try: + str_list += ['isEnabled : ' + str(self.isEnabled)] + except ValueError: + str_list += ['isEnabled : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaGraphKernelNodeUpdate.updateData.gridDim' in found_struct}} + @property + def gridDim(self): + 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)) + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} + @property + def param(self): + return self._param + @param.setter + def param(self, param not None : anon_struct21): + string.memcpy(&self._pvt_ptr[0].updateData.param, param.getPtr(), sizeof(self._pvt_ptr[0].updateData.param)) + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData.isEnabled' in found_struct}} + @property + def isEnabled(self): + return self._pvt_ptr[0].updateData.isEnabled + @isEnabled.setter + def isEnabled(self, unsigned int isEnabled): + self._pvt_ptr[0].updateData.isEnabled = isEnabled + {{endif}} +{{endif}} +{{if 'cudaGraphKernelNodeUpdate' in found_struct}} + +cdef class cudaGraphKernelNodeUpdate: + """ + Struct to specify a single node update to pass as part of a larger + array to ::cudaGraphKernelNodeUpdatesApply + + Attributes + ---------- + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + node : cudaGraphDeviceNode_t + Node to update + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.field' in found_struct}} + field : cudaGraphKernelNodeField + Which type of update to apply. Determines how updateData is + interpreted + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + updateData : anon_union9 + Update data to apply. Which field is used depends on field's value + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaGraphKernelNodeUpdate)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + 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) + {{endif}} + 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 = [] + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + try: + str_list += ['node : ' + str(self.node)] + except ValueError: + str_list += ['node : '] + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.field' in found_struct}} + try: + str_list += ['field : ' + str(self.field)] + except ValueError: + str_list += ['field : '] + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + try: + str_list += ['updateData :\n' + '\n'.join([' ' + line for line in str(self.updateData).splitlines()])] + except ValueError: + str_list += ['updateData : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaGraphKernelNodeUpdate.node' in found_struct}} + @property + def node(self): + return self._node + @node.setter + def node(self, node): + cdef cyruntime.cudaGraphDeviceNode_t cynode + if node is None: + cynode = 0 + elif isinstance(node, (cudaGraphDeviceNode_t,)): + pnode = int(node) + cynode = pnode + else: + pnode = int(cudaGraphDeviceNode_t(node)) + cynode = pnode + self._node._pvt_ptr[0] = cynode + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.field' in found_struct}} + @property + def field(self): + return cudaGraphKernelNodeField(self._pvt_ptr[0].field) + @field.setter + def field(self, field not None : cudaGraphKernelNodeField): + self._pvt_ptr[0].field = int(field) + {{endif}} + {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} + @property + 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)) + {{endif}} +{{endif}} +{{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} + +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 + cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available + through cudaDevAttrMemSyncDomainCount. + + Attributes + ---------- + {{if 'cudaLaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes + The default domain ID to use for designated kernels + {{endif}} + {{if 'cudaLaunchMemSyncDomainMap_st.remote' in found_struct}} + remote : bytes + The remote domain ID to use for designated kernels + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchMemSyncDomainMap_st.default_' in found_struct}} + try: + str_list += ['default_ : ' + str(self.default_)] + except ValueError: + str_list += ['default_ : '] + {{endif}} + {{if 'cudaLaunchMemSyncDomainMap_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 'cudaLaunchMemSyncDomainMap_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 'cudaLaunchMemSyncDomainMap_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 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + +cdef class anon_struct22: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.clusterDim.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim.z' in found_struct}} + z : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].clusterDim + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchAttributeValue.clusterDim.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + +cdef class anon_struct23: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + event : cudaEvent_t + + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent.flags' in found_struct}} + flags : int + + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent.triggerAtBlockStart' in found_struct}} + triggerAtBlockStart : int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + self._event = cudaEvent_t(_ptr=&self._pvt_ptr[0].programmaticEvent.event) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].programmaticEvent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + try: + str_list += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent.flags' in found_struct}} + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.programmaticEvent.event' in found_struct}} + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cyruntime.cudaEvent_t cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + +cdef class anon_struct24: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.preferredClusterDim.x' in found_struct}} + x : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim.y' in found_struct}} + y : unsigned int + + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim.z' in found_struct}} + z : unsigned int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].preferredClusterDim + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchAttributeValue.preferredClusterDim.x' in found_struct}} + try: + str_list += ['x : ' + str(self.x)] + except ValueError: + str_list += ['x : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim.y' in found_struct}} + try: + str_list += ['y : ' + str(self.y)] + except ValueError: + str_list += ['y : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + +cdef class anon_struct25: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + event : cudaEvent_t + + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.flags' in found_struct}} + flags : int + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + self._event = cudaEvent_t(_ptr=&self._pvt_ptr[0].launchCompletionEvent.event) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].launchCompletionEvent + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + try: + str_list += ['event : ' + str(self.event)] + except ValueError: + str_list += ['event : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.launchCompletionEvent.event' in found_struct}} + @property + def event(self): + return self._event + @event.setter + def event(self, event): + cdef cyruntime.cudaEvent_t cyevent + if event is None: + cyevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + cyevent = pevent + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + self._event._pvt_ptr[0] = cyevent + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + +cdef class anon_struct26: + """ + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + deviceUpdatable : int + + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode' in found_struct}} + devNode : cudaGraphDeviceNode_t + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode' in found_struct}} + self._devNode = cudaGraphDeviceNode_t(_ptr=&self._pvt_ptr[0].deviceUpdatableKernelNode.devNode) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].deviceUpdatableKernelNode + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + try: + str_list += ['deviceUpdatable : ' + str(self.deviceUpdatable)] + except ValueError: + str_list += ['deviceUpdatable : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode' in found_struct}} + @property + def devNode(self): + return self._devNode + @devNode.setter + def devNode(self, devNode): + cdef cyruntime.cudaGraphDeviceNode_t cydevNode + if devNode is None: + cydevNode = 0 + elif isinstance(devNode, (cudaGraphDeviceNode_t,)): + pdevNode = int(devNode) + cydevNode = pdevNode + else: + pdevNode = int(cudaGraphDeviceNode_t(devNode)) + cydevNode = pdevNode + self._devNode._pvt_ptr[0] = cydevNode + {{endif}} +{{endif}} +{{if 'cudaLaunchAttributeValue' in found_struct}} + +cdef class cudaLaunchAttributeValue: + """ + Launch attributes union; used as value field of cudaLaunchAttribute + + Attributes + ---------- + {{if 'cudaLaunchAttributeValue.pad' in found_struct}} + pad : bytes + + {{endif}} + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + accessPolicyWindow : cudaAccessPolicyWindow + Value of launch attribute cudaLaunchAttributeAccessPolicyWindow. + {{endif}} + {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} + cooperative : int + Value of launch attribute cudaLaunchAttributeCooperative. Nonzero + indicates a cooperative kernel (see cudaLaunchCooperativeKernel). + {{endif}} + {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + syncPolicy : cudaSynchronizationPolicy + Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. + cudaSynchronizationPolicy for work queued up in this stream. + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + clusterDim : anon_struct22 + Value of launch attribute cudaLaunchAttributeClusterDimension that + represents the desired cluster dimensions for the kernel. Opaque + type with the following fields: - `x` - The X dimension of the + cluster, in blocks. Must be a divisor of the grid X dimension. - + `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 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + clusterSchedulingPolicyPreference : cudaClusterSchedulingPolicy + Value of launch attribute + cudaLaunchAttributeClusterSchedulingPolicyPreference. Cluster + scheduling policy preference for the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticStreamSerializationAllowed' in found_struct}} + programmaticStreamSerializationAllowed : int + Value of launch attribute + cudaLaunchAttributeProgrammaticStreamSerialization. + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + programmaticEvent : anon_struct23 + Value of launch attribute cudaLaunchAttributeProgrammaticEvent with + the following fields: - `cudaEvent_t` event - Event to fire when + all blocks trigger it. - `int` flags; - Event record flags, see + cudaEventRecordWithFlags. Does not accept cudaEventRecordExternal. + - `int` triggerAtBlockStart - If this is set to non-0, each block + launch will automatically trigger the event. + {{endif}} + {{if 'cudaLaunchAttributeValue.priority' in found_struct}} + priority : int + Value of launch attribute cudaLaunchAttributePriority. Execution + priority of the kernel. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + memSyncDomainMap : cudaLaunchMemSyncDomainMap + Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See + cudaLaunchMemSyncDomainMap. + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + memSyncDomain : cudaLaunchMemSyncDomain + Value of launch attribute cudaLaunchAttributeMemSyncDomain. See + cudaLaunchMemSyncDomain. + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + preferredClusterDim : anon_struct24 + Value of launch attribute + cudaLaunchAttributePreferredClusterDimension that represents the + desired preferred cluster dimensions for the kernel. Opaque type + 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. + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + launchCompletionEvent : anon_struct25 + Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent + with the following fields: - `cudaEvent_t` event - Event to fire + when the last block launches. - `int` flags - Event record + flags, see cudaEventRecordWithFlags. Does not accept + cudaEventRecordExternal. + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + deviceUpdatableKernelNode : anon_struct26 + Value of launch attribute + cudaLaunchAttributeDeviceUpdatableKernelNode with the following + fields: - `int` deviceUpdatable - Whether or not the resulting + kernel node should be device-updatable. - + `cudaGraphDeviceNode_t` devNode - Returns a handle to pass to the + various device-side update functions. + {{endif}} + {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + sharedMemCarveout : unsigned int + Value of launch attribute + cudaLaunchAttributePreferredSharedMemoryCarveout. + {{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 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + self._accessPolicyWindow = cudaAccessPolicyWindow(_ptr=&self._pvt_ptr[0].accessPolicyWindow) + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + self._clusterDim = anon_struct22(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + self._programmaticEvent = anon_struct23(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + self._memSyncDomainMap = cudaLaunchMemSyncDomainMap(_ptr=&self._pvt_ptr[0].memSyncDomainMap) + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + self._preferredClusterDim = anon_struct24(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + self._launchCompletionEvent = anon_struct25(_ptr=self._pvt_ptr) + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + self._deviceUpdatableKernelNode = anon_struct26(_ptr=self._pvt_ptr) + {{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 'cudaLaunchAttributeValue.pad' in found_struct}} + try: + str_list += ['pad : ' + str(self.pad)] + except ValueError: + str_list += ['pad : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.cooperative' in found_struct}} + try: + str_list += ['cooperative : ' + str(self.cooperative)] + except ValueError: + str_list += ['cooperative : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + try: + str_list += ['syncPolicy : ' + str(self.syncPolicy)] + except ValueError: + str_list += ['syncPolicy : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + try: + str_list += ['clusterSchedulingPolicyPreference : ' + str(self.clusterSchedulingPolicyPreference)] + except ValueError: + str_list += ['clusterSchedulingPolicyPreference : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.programmaticStreamSerializationAllowed' in found_struct}} + try: + str_list += ['programmaticStreamSerializationAllowed : ' + str(self.programmaticStreamSerializationAllowed)] + except ValueError: + str_list += ['programmaticStreamSerializationAllowed : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.priority' in found_struct}} + try: + str_list += ['priority : ' + str(self.priority)] + except ValueError: + str_list += ['priority : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + try: + str_list += ['memSyncDomain : ' + str(self.memSyncDomain)] + except ValueError: + str_list += ['memSyncDomain : '] + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + try: + str_list += ['sharedMemCarveout : ' + str(self.sharedMemCarveout)] + except ValueError: + str_list += ['sharedMemCarveout : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaLaunchAttributeValue.pad' in found_struct}} + @property + def pad(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].pad, 64) + @pad.setter + def pad(self, pad): + if len(pad) != 64: + raise ValueError("pad length must be 64, is " + str(len(pad))) + if CHAR_MIN == 0: + for i, b in enumerate(pad): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].pad[i] = b + else: + for i, b in enumerate(pad): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].pad[i] = b + {{endif}} + {{if 'cudaLaunchAttributeValue.accessPolicyWindow' in found_struct}} + @property + def accessPolicyWindow(self): + 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)) + {{endif}} + {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} + @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 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} + @property + def syncPolicy(self): + return cudaSynchronizationPolicy(self._pvt_ptr[0].syncPolicy) + @syncPolicy.setter + def syncPolicy(self, syncPolicy not None : cudaSynchronizationPolicy): + self._pvt_ptr[0].syncPolicy = int(syncPolicy) + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} + @property + def clusterDim(self): + return self._clusterDim + @clusterDim.setter + def clusterDim(self, clusterDim not None : anon_struct22): + string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) + {{endif}} + {{if 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} + @property + def clusterSchedulingPolicyPreference(self): + return cudaClusterSchedulingPolicy(self._pvt_ptr[0].clusterSchedulingPolicyPreference) + @clusterSchedulingPolicyPreference.setter + def clusterSchedulingPolicyPreference(self, clusterSchedulingPolicyPreference not None : cudaClusterSchedulingPolicy): + self._pvt_ptr[0].clusterSchedulingPolicyPreference = int(clusterSchedulingPolicyPreference) + {{endif}} + {{if 'cudaLaunchAttributeValue.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 'cudaLaunchAttributeValue.programmaticEvent' in found_struct}} + @property + def programmaticEvent(self): + return self._programmaticEvent + @programmaticEvent.setter + def programmaticEvent(self, programmaticEvent not None : anon_struct23): + string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) + {{endif}} + {{if 'cudaLaunchAttributeValue.priority' in found_struct}} + @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 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} + @property + def memSyncDomainMap(self): + 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)) + {{endif}} + {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} + @property + def memSyncDomain(self): + return cudaLaunchMemSyncDomain(self._pvt_ptr[0].memSyncDomain) + @memSyncDomain.setter + def memSyncDomain(self, memSyncDomain not None : cudaLaunchMemSyncDomain): + self._pvt_ptr[0].memSyncDomain = int(memSyncDomain) + {{endif}} + {{if 'cudaLaunchAttributeValue.preferredClusterDim' in found_struct}} + @property + def preferredClusterDim(self): + return self._preferredClusterDim + @preferredClusterDim.setter + def preferredClusterDim(self, preferredClusterDim not None : anon_struct24): + string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) + {{endif}} + {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} + @property + def launchCompletionEvent(self): + return self._launchCompletionEvent + @launchCompletionEvent.setter + def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct25): + string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) + {{endif}} + {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} + @property + def deviceUpdatableKernelNode(self): + return self._deviceUpdatableKernelNode + @deviceUpdatableKernelNode.setter + def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct26): + string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) + {{endif}} + {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} + @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}} +{{endif}} +{{if 'cudaLaunchAttribute_st' in found_struct}} + +cdef class cudaLaunchAttribute_st: + """ + Launch attribute + + Attributes + ---------- + {{if 'cudaLaunchAttribute_st.id' in found_struct}} + id : cudaLaunchAttributeID + Attribute to set + {{endif}} + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + val : cudaLaunchAttributeValue + Value of the attribute + {{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 'cudaLaunchAttribute_st.val' in found_struct}} + self._val = cudaLaunchAttributeValue(_ptr=&self._pvt_ptr[0].val) + {{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 'cudaLaunchAttribute_st.id' in found_struct}} + try: + str_list += ['id : ' + str(self.id)] + except ValueError: + str_list += ['id : '] + {{endif}} + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + try: + str_list += ['val :\n' + '\n'.join([' ' + line for line in str(self.val).splitlines()])] + except ValueError: + str_list += ['val : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaLaunchAttribute_st.id' in found_struct}} + @property + def id(self): + return cudaLaunchAttributeID(self._pvt_ptr[0].id) + @id.setter + def id(self, id not None : cudaLaunchAttributeID): + self._pvt_ptr[0].id = int(id) + {{endif}} + {{if 'cudaLaunchAttribute_st.val' in found_struct}} + @property + def val(self): + 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)) + {{endif}} +{{endif}} +{{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + +cdef class anon_struct27: + """ + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.info.overBudget.bytesOverBudget' in found_struct}} + bytesOverBudget : unsigned long long + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].info.overBudget + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaAsyncNotificationInfo.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 'cudaAsyncNotificationInfo.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 'cudaAsyncNotificationInfo.info' in found_struct}} + +cdef class anon_union10: + """ + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + overBudget : anon_struct27 + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + self._overBudget = anon_struct27(_ptr=self._pvt_ptr) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].info + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaAsyncNotificationInfo.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 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} + @property + def overBudget(self): + return self._overBudget + @overBudget.setter + def overBudget(self, overBudget not None : anon_struct27): + string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) + {{endif}} +{{endif}} +{{if 'cudaAsyncNotificationInfo' in found_struct}} + +cdef class cudaAsyncNotificationInfo: + """ + Information describing an async notification event + + Attributes + ---------- + {{if 'cudaAsyncNotificationInfo.type' in found_struct}} + type : cudaAsyncNotificationType + The type of notification being sent + {{endif}} + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + info : anon_union10 + Information about the notification. `typename` must be checked in + order to interpret this field. + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaAsyncNotificationInfo)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + self._info = anon_union10(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{if 'cudaAsyncNotificationInfo.type' in found_struct}} + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + {{endif}} + {{if 'cudaAsyncNotificationInfo.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 'cudaAsyncNotificationInfo.type' in found_struct}} + @property + def type(self): + return cudaAsyncNotificationType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : cudaAsyncNotificationType): + self._pvt_ptr[0].type = int(type) + {{endif}} + {{if 'cudaAsyncNotificationInfo.info' in found_struct}} + @property + 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)) + {{endif}} +{{endif}} +{{if 'cudaTextureDesc' in found_struct}} + +cdef class cudaTextureDesc: + """ + CUDA texture descriptor + + Attributes + ---------- + {{if 'cudaTextureDesc.addressMode' in found_struct}} + addressMode : list[cudaTextureAddressMode] + Texture address mode for up to 3 dimensions + {{endif}} + {{if 'cudaTextureDesc.filterMode' in found_struct}} + filterMode : cudaTextureFilterMode + Texture filter mode + {{endif}} + {{if 'cudaTextureDesc.readMode' in found_struct}} + readMode : cudaTextureReadMode + Texture read mode + {{endif}} + {{if 'cudaTextureDesc.sRGB' in found_struct}} + sRGB : int + Perform sRGB->linear conversion during texture read + {{endif}} + {{if 'cudaTextureDesc.borderColor' in found_struct}} + borderColor : list[float] + Texture Border Color + {{endif}} + {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} + normalizedCoords : int + Indicates whether texture reads are normalized or not + {{endif}} + {{if 'cudaTextureDesc.maxAnisotropy' in found_struct}} + maxAnisotropy : unsigned int + Limit to the anisotropy ratio + {{endif}} + {{if 'cudaTextureDesc.mipmapFilterMode' in found_struct}} + mipmapFilterMode : cudaTextureFilterMode + Mipmap filter mode + {{endif}} + {{if 'cudaTextureDesc.mipmapLevelBias' in found_struct}} + mipmapLevelBias : float + Offset applied to the supplied mipmap level + {{endif}} + {{if 'cudaTextureDesc.minMipmapLevelClamp' in found_struct}} + minMipmapLevelClamp : float + Lower end of the mipmap level range to clamp access to + {{endif}} + {{if 'cudaTextureDesc.maxMipmapLevelClamp' in found_struct}} + maxMipmapLevelClamp : float + Upper end of the mipmap level range to clamp access to + {{endif}} + {{if 'cudaTextureDesc.disableTrilinearOptimization' in found_struct}} + disableTrilinearOptimization : int + Disable any trilinear filtering optimizations. + {{endif}} + {{if 'cudaTextureDesc.seamlessCubemap' in found_struct}} + seamlessCubemap : int + Enable seamless cube map filtering. + {{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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaTextureDesc.addressMode' in found_struct}} + try: + str_list += ['addressMode : ' + str(self.addressMode)] + except ValueError: + str_list += ['addressMode : '] + {{endif}} + {{if 'cudaTextureDesc.filterMode' in found_struct}} + try: + str_list += ['filterMode : ' + str(self.filterMode)] + except ValueError: + str_list += ['filterMode : '] + {{endif}} + {{if 'cudaTextureDesc.readMode' in found_struct}} + try: + str_list += ['readMode : ' + str(self.readMode)] + except ValueError: + str_list += ['readMode : '] + {{endif}} + {{if 'cudaTextureDesc.sRGB' in found_struct}} + try: + str_list += ['sRGB : ' + str(self.sRGB)] + except ValueError: + str_list += ['sRGB : '] + {{endif}} + {{if 'cudaTextureDesc.borderColor' in found_struct}} + try: + str_list += ['borderColor : ' + str(self.borderColor)] + except ValueError: + str_list += ['borderColor : '] + {{endif}} + {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} + try: + str_list += ['normalizedCoords : ' + str(self.normalizedCoords)] + except ValueError: + str_list += ['normalizedCoords : '] + {{endif}} + {{if 'cudaTextureDesc.maxAnisotropy' in found_struct}} + try: + str_list += ['maxAnisotropy : ' + str(self.maxAnisotropy)] + except ValueError: + str_list += ['maxAnisotropy : '] + {{endif}} + {{if 'cudaTextureDesc.mipmapFilterMode' in found_struct}} + try: + str_list += ['mipmapFilterMode : ' + str(self.mipmapFilterMode)] + except ValueError: + str_list += ['mipmapFilterMode : '] + {{endif}} + {{if 'cudaTextureDesc.mipmapLevelBias' in found_struct}} + try: + str_list += ['mipmapLevelBias : ' + str(self.mipmapLevelBias)] + except ValueError: + str_list += ['mipmapLevelBias : '] + {{endif}} + {{if 'cudaTextureDesc.minMipmapLevelClamp' in found_struct}} + try: + str_list += ['minMipmapLevelClamp : ' + str(self.minMipmapLevelClamp)] + except ValueError: + str_list += ['minMipmapLevelClamp : '] + {{endif}} + {{if 'cudaTextureDesc.maxMipmapLevelClamp' in found_struct}} + try: + str_list += ['maxMipmapLevelClamp : ' + str(self.maxMipmapLevelClamp)] + except ValueError: + str_list += ['maxMipmapLevelClamp : '] + {{endif}} + {{if 'cudaTextureDesc.disableTrilinearOptimization' in found_struct}} + try: + str_list += ['disableTrilinearOptimization : ' + str(self.disableTrilinearOptimization)] + except ValueError: + str_list += ['disableTrilinearOptimization : '] + {{endif}} + {{if 'cudaTextureDesc.seamlessCubemap' in found_struct}} + try: + str_list += ['seamlessCubemap : ' + str(self.seamlessCubemap)] + except ValueError: + str_list += ['seamlessCubemap : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaTextureDesc.addressMode' in found_struct}} + @property + def addressMode(self): + return [cudaTextureAddressMode(_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 'cudaTextureDesc.filterMode' in found_struct}} + @property + def filterMode(self): + return cudaTextureFilterMode(self._pvt_ptr[0].filterMode) + @filterMode.setter + def filterMode(self, filterMode not None : cudaTextureFilterMode): + self._pvt_ptr[0].filterMode = int(filterMode) + {{endif}} + {{if 'cudaTextureDesc.readMode' in found_struct}} + @property + def readMode(self): + return cudaTextureReadMode(self._pvt_ptr[0].readMode) + @readMode.setter + def readMode(self, readMode not None : cudaTextureReadMode): + self._pvt_ptr[0].readMode = int(readMode) + {{endif}} + {{if 'cudaTextureDesc.sRGB' in found_struct}} + @property + def sRGB(self): + return self._pvt_ptr[0].sRGB + @sRGB.setter + def sRGB(self, int sRGB): + self._pvt_ptr[0].sRGB = sRGB + {{endif}} + {{if 'cudaTextureDesc.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 'cudaTextureDesc.normalizedCoords' in found_struct}} + @property + def normalizedCoords(self): + return self._pvt_ptr[0].normalizedCoords + @normalizedCoords.setter + def normalizedCoords(self, int normalizedCoords): + self._pvt_ptr[0].normalizedCoords = normalizedCoords + {{endif}} + {{if 'cudaTextureDesc.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 'cudaTextureDesc.mipmapFilterMode' in found_struct}} + @property + def mipmapFilterMode(self): + return cudaTextureFilterMode(self._pvt_ptr[0].mipmapFilterMode) + @mipmapFilterMode.setter + def mipmapFilterMode(self, mipmapFilterMode not None : cudaTextureFilterMode): + self._pvt_ptr[0].mipmapFilterMode = int(mipmapFilterMode) + {{endif}} + {{if 'cudaTextureDesc.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 'cudaTextureDesc.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 'cudaTextureDesc.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 'cudaTextureDesc.disableTrilinearOptimization' in found_struct}} + @property + def disableTrilinearOptimization(self): + return self._pvt_ptr[0].disableTrilinearOptimization + @disableTrilinearOptimization.setter + def disableTrilinearOptimization(self, int disableTrilinearOptimization): + self._pvt_ptr[0].disableTrilinearOptimization = disableTrilinearOptimization + {{endif}} + {{if 'cudaTextureDesc.seamlessCubemap' in found_struct}} + @property + def seamlessCubemap(self): + return self._pvt_ptr[0].seamlessCubemap + @seamlessCubemap.setter + def seamlessCubemap(self, int seamlessCubemap): + self._pvt_ptr[0].seamlessCubemap = seamlessCubemap + {{endif}} +{{endif}} +{{if True}} + +cdef class cudaEglPlaneDesc_st: + """ + CUDA EGL Plane Descriptor - structure defining each plane of a CUDA + EGLFrame + + Attributes + ---------- + {{if True}} + width : unsigned int + Width of plane + {{endif}} + {{if True}} + height : unsigned int + Height of plane + {{endif}} + {{if True}} + depth : unsigned int + Depth of plane + {{endif}} + {{if True}} + pitch : unsigned int + Pitch of plane + {{endif}} + {{if True}} + numChannels : unsigned int + Number of channels for the plane + {{endif}} + {{if True}} + channelDesc : cudaChannelFormatDesc + Channel Format Descriptor + {{endif}} + {{if True}} + reserved : list[unsigned int] + Reserved for future use + {{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 True}} + self._channelDesc = cudaChannelFormatDesc(_ptr=&self._pvt_ptr[0].channelDesc) + {{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 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 += ['numChannels : ' + str(self.numChannels)] + except ValueError: + str_list += ['numChannels : '] + {{endif}} + {{if True}} + try: + str_list += ['channelDesc :\n' + '\n'.join([' ' + line for line in str(self.channelDesc).splitlines()])] + except ValueError: + str_list += ['channelDesc : '] + {{endif}} + {{if True}} + try: + str_list += ['reserved : ' + str(self.reserved)] + except ValueError: + str_list += ['reserved : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if True}} + @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 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 channelDesc(self): + 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)) + {{endif}} + {{if True}} + @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 True}} + +cdef class anon_union11: + """ + Attributes + ---------- + {{if True}} + pArray : list[cudaArray_t] + + {{endif}} + {{if True}} + pPitch : list[cudaPitchedPtr] + + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].frame + 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 :\n' + '\n'.join([' ' + line for line in str(self.pPitch).splitlines()])] + except ValueError: + str_list += ['pPitch : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if True}} + @property + def pArray(self): + return [cudaArray_t(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] + @pArray.setter + def pArray(self, pArray : list[cudaArray_t]): + if len(pArray) != 3: + raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) + pArray = [int(_pArray) for _pArray in pArray] + for _idx, _pArray in enumerate(pArray): + self._pvt_ptr[0].frame.pArray[_idx] = _pArray + + {{endif}} + {{if True}} + @property + def pPitch(self): + out_pPitch = [cudaPitchedPtr() for _pPitch in self._pvt_ptr[0].frame.pPitch] + for _idx in range(len(out_pPitch)): + string.memcpy(out_pPitch[_idx].getPtr(), &self._pvt_ptr[0].frame.pPitch[_idx], sizeof(cyruntime.cudaPitchedPtr)) + return out_pPitch + @pPitch.setter + def pPitch(self, pPitch : list[cudaPitchedPtr]): + 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)) + + {{endif}} +{{endif}} +{{if True}} + +cdef class cudaEglFrame_st: + """ + CUDA EGLFrame Descriptor - structure defining one frame of EGL. + Each frame may contain one or more planes depending on whether the + surface is Multiplanar or not. Each plane of EGLFrame is + represented by cudaEglPlaneDesc which is defined as: + typedefstructcudaEglPlaneDesc_st unsignedintwidth; + unsignedintheight; unsignedintdepth; unsignedintpitch; + unsignedintnumChannels; structcudaChannelFormatDescchannelDesc; + unsignedintreserved[4]; cudaEglPlaneDesc; + + Attributes + ---------- + {{if True}} + frame : anon_union11 + + {{endif}} + {{if True}} + planeDesc : list[cudaEglPlaneDesc] + CUDA EGL Plane Descriptor cudaEglPlaneDesc + {{endif}} + {{if True}} + planeCount : unsigned int + Number of planes + {{endif}} + {{if True}} + frameType : cudaEglFrameType + Array or Pitch + {{endif}} + {{if True}} + eglColorFormat : cudaEglColorFormat + CUDA EGL Color Format + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cyruntime.cudaEglFrame_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + {{if True}} + self._frame = anon_union11(_ptr=self._pvt_ptr) + {{endif}} + 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 = [] + {{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 += ['planeDesc :\n' + '\n'.join([' ' + line for line in str(self.planeDesc).splitlines()])] + except ValueError: + str_list += ['planeDesc : '] + {{endif}} + {{if True}} + try: + str_list += ['planeCount : ' + str(self.planeCount)] + except ValueError: + str_list += ['planeCount : '] + {{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}} + 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_union11): + string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) + {{endif}} + {{if True}} + @property + def planeDesc(self): + out_planeDesc = [cudaEglPlaneDesc() for _planeDesc in self._pvt_ptr[0].planeDesc] + for _idx in range(len(out_planeDesc)): + string.memcpy(out_planeDesc[_idx].getPtr(), &self._pvt_ptr[0].planeDesc[_idx], sizeof(cyruntime.cudaEglPlaneDesc)) + return out_planeDesc + @planeDesc.setter + def planeDesc(self, planeDesc : list[cudaEglPlaneDesc]): + 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)) + + {{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 frameType(self): + return cudaEglFrameType(self._pvt_ptr[0].frameType) + @frameType.setter + def frameType(self, frameType not None : cudaEglFrameType): + self._pvt_ptr[0].frameType = int(frameType) + {{endif}} + {{if True}} + @property + def eglColorFormat(self): + return cudaEglColorFormat(self._pvt_ptr[0].eglColorFormat) + @eglColorFormat.setter + def eglColorFormat(self, eglColorFormat not None : cudaEglColorFormat): + self._pvt_ptr[0].eglColorFormat = int(eglColorFormat) + {{endif}} +{{endif}} +{{if 'cudaGraphConditionalHandle' in found_types}} + +cdef class cudaGraphConditionalHandle: + """ + + CUDA handle for conditional graph nodes + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaSurfaceObject_t' in found_types}} + +cdef class cudaSurfaceObject_t: + """ + + An opaque value that represents a CUDA Surface object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if 'cudaTextureObject_t' in found_types}} + +cdef class cudaTextureObject_t: + """ + + An opaque value that represents a CUDA texture object + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class GLenum: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class GLuint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class EGLint: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned int init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpDevice: + """ + + 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 +{{endif}} + +{{if True}} + +cdef class VdpGetProcAddress: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, unsigned long long init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + if init_value: + self._pvt_ptr[0] = init_value + def __dealloc__(self): + pass + def __repr__(self): + return '' + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr +{{endif}} + +{{if True}} + +cdef class VdpVideoSurface: + """ + + 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 +{{endif}} + +{{if True}} + +cdef class VdpOutputSurface: + """ + + 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 +{{endif}} + +{{if 'cudaDeviceReset' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceReset(): + """ Destroy all allocations and reset all state on the current device in the current process. + + Explicitly destroys and cleans up all resources associated with the + current device in the current process. It is the caller's + responsibility to ensure that the resources are not accessed or passed + in subsequent API calls and doing so will result in undefined behavior. + These resources include CUDA types :py:obj:`~.cudaStream_t`, + :py:obj:`~.cudaEvent_t`, :py:obj:`~.cudaArray_t`, + :py:obj:`~.cudaMipmappedArray_t`, :py:obj:`~.cudaPitchedPtr`, + :py:obj:`~.cudaTextureObject_t`, :py:obj:`~.cudaSurfaceObject_t`, + :py:obj:`~.textureReference`, :py:obj:`~.surfaceReference`, + :py:obj:`~.cudaExternalMemory_t`, :py:obj:`~.cudaExternalSemaphore_t` + and :py:obj:`~.cudaGraphicsResource_t`. These resources also include + memory allocations by :py:obj:`~.cudaMalloc`, + :py:obj:`~.cudaMallocHost`, :py:obj:`~.cudaMallocManaged` and + :py:obj:`~.cudaMallocPitch`. Any subsequent API call to this device + will reinitialize the device. + + Note that this function will reset the device immediately. It is the + caller's responsibility to ensure that the device is not being accessed + by any other host threads from the process when this function is + called. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + + See Also + -------- + :py:obj:`~.cudaDeviceSynchronize` + + Notes + ----- + :py:obj:`~.cudaDeviceReset()` will not destroy memory allocations by :py:obj:`~.cudaMallocAsync()` and :py:obj:`~.cudaMallocFromPoolAsync()`. These memory allocations need to be destroyed explicitly. + + If a non-primary :py:obj:`~.CUcontext` is current to the thread, :py:obj:`~.cudaDeviceReset()` will destroy only the internal CUDA RT state for that :py:obj:`~.CUcontext`. + """ + with nogil: + err = cyruntime.cudaDeviceReset() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceSynchronize' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSynchronize(): + """ Wait for compute device to finish. + + Blocks until the device has completed all preceding requested tasks. + :py:obj:`~.cudaDeviceSynchronize()` returns an error if one of the + preceding tasks has failed. If the + :py:obj:`~.cudaDeviceScheduleBlockingSync` flag was set for this + device, the host thread will block until the device has finished its + work. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + + See Also + -------- + :py:obj:`~.cudaDeviceReset`, :py:obj:`~.cuCtxSynchronize` + """ + with nogil: + err = cyruntime.cudaDeviceSynchronize() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceSetLimit' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSetLimit(limit not None : cudaLimit, size_t value): + """ Set resource limits. + + Setting `limit` to `value` is a request by the application to update + the current limit maintained by the device. The driver is free to + modify the requested value to meet h/w requirements (this could be + clamping to minimum or maximum values, rounding up to nearest element + size, etc). The application can use :py:obj:`~.cudaDeviceGetLimit()` to + find out exactly what the limit has been set to. + + Setting each :py:obj:`~.cudaLimit` has its own specific restrictions, + so each is discussed here. + + - :py:obj:`~.cudaLimitStackSize` controls the stack size in bytes of + each GPU thread. + + - :py:obj:`~.cudaLimitPrintfFifoSize` controls the size in bytes of the + shared FIFO used by the :py:obj:`~.printf()` device system call. + Setting :py:obj:`~.cudaLimitPrintfFifoSize` must not be performed + after launching any kernel that uses the :py:obj:`~.printf()` device + system call - in such case :py:obj:`~.cudaErrorInvalidValue` will be + returned. + + - :py:obj:`~.cudaLimitMallocHeapSize` controls the size in bytes of the + heap used by the :py:obj:`~.malloc()` and :py:obj:`~.free()` device + system calls. Setting :py:obj:`~.cudaLimitMallocHeapSize` must not be + performed after launching any kernel that uses the + :py:obj:`~.malloc()` or :py:obj:`~.free()` device system calls - in + such case :py:obj:`~.cudaErrorInvalidValue` will be returned. + + - :py:obj:`~.cudaLimitDevRuntimeSyncDepth` controls the maximum nesting + depth of a grid at which a thread can safely call + :py:obj:`~.cudaDeviceSynchronize()`. Setting this limit must be + performed before any launch of a kernel that uses the device runtime + and calls :py:obj:`~.cudaDeviceSynchronize()` above the default sync + depth, two levels of grids. Calls to + :py:obj:`~.cudaDeviceSynchronize()` will fail with error code + :py:obj:`~.cudaErrorSyncDepthExceeded` if the limitation is violated. + This limit can be set smaller than the default or up the maximum + launch depth of 24. When setting this limit, keep in mind that + additional levels of sync depth require the runtime to reserve large + amounts of device memory which can no longer be used for user + allocations. If these reservations of device memory fail, + :py:obj:`~.cudaDeviceSetLimit` will return + :py:obj:`~.cudaErrorMemoryAllocation`, and the limit can be reset to + a lower value. This limit is only applicable to devices of compute + capability < 9.0. Attempting to set this limit on devices of other + compute capability will results in error + :py:obj:`~.cudaErrorUnsupportedLimit` being returned. + + - :py:obj:`~.cudaLimitDevRuntimePendingLaunchCount` controls the + maximum number of outstanding device runtime launches that can be + made from the current device. A grid is outstanding from the point of + launch up until the grid is known to have been completed. Device + runtime launches which violate this limitation fail and return + :py:obj:`~.cudaErrorLaunchPendingCountExceeded` when + :py:obj:`~.cudaGetLastError()` is called after launch. If more + pending launches than the default (2048 launches) are needed for a + module using the device runtime, this limit can be increased. Keep in + mind that being able to sustain additional pending launches will + require the runtime to reserve larger amounts of device memory + upfront which can no longer be used for allocations. If these + reservations fail, :py:obj:`~.cudaDeviceSetLimit` will return + :py:obj:`~.cudaErrorMemoryAllocation`, and the limit can be reset to + a lower value. This limit is only applicable to devices of compute + capability 3.5 and higher. Attempting to set this limit on devices of + compute capability less than 3.5 will result in the error + :py:obj:`~.cudaErrorUnsupportedLimit` being returned. + + - :py:obj:`~.cudaLimitMaxL2FetchGranularity` controls the L2 cache + fetch granularity. Values can range from 0B to 128B. This is purely a + performance hint and it can be ignored or clamped depending on the + platform. + + - :py:obj:`~.cudaLimitPersistingL2CacheSize` controls size in bytes + available for persisting L2 cache. This is purely a performance hint + and it can be ignored or clamped depending on the platform. + + Parameters + ---------- + limit : :py:obj:`~.cudaLimit` + Limit to set + value : size_t + Size of limit + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorUnsupportedLimit`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + + See Also + -------- + :py:obj:`~.cudaDeviceGetLimit`, :py:obj:`~.cuCtxSetLimit` + """ + cdef cyruntime.cudaLimit cylimit = int(limit) + with nogil: + err = cyruntime.cudaDeviceSetLimit(cylimit, value) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetLimit' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetLimit(limit not None : cudaLimit): + """ Return resource limits. + + Returns in `*pValue` the current size of `limit`. The following + :py:obj:`~.cudaLimit` values are supported. + + - :py:obj:`~.cudaLimitStackSize` is the stack size in bytes of each GPU + thread. + + - :py:obj:`~.cudaLimitPrintfFifoSize` is the size in bytes of the + shared FIFO used by the :py:obj:`~.printf()` device system call. + + - :py:obj:`~.cudaLimitMallocHeapSize` is the size in bytes of the heap + used by the :py:obj:`~.malloc()` and :py:obj:`~.free()` device system + calls. + + - :py:obj:`~.cudaLimitDevRuntimeSyncDepth` is the maximum grid depth at + which a thread can isssue the device runtime call + :py:obj:`~.cudaDeviceSynchronize()` to wait on child grid launches to + complete. This functionality is removed for devices of compute + capability >= 9.0, and hence will return error + :py:obj:`~.cudaErrorUnsupportedLimit` on such devices. + + - :py:obj:`~.cudaLimitDevRuntimePendingLaunchCount` is the maximum + number of outstanding device runtime launches. + + - :py:obj:`~.cudaLimitMaxL2FetchGranularity` is the L2 cache fetch + granularity. + + - :py:obj:`~.cudaLimitPersistingL2CacheSize` is the persisting L2 cache + size in bytes. + + Parameters + ---------- + limit : :py:obj:`~.cudaLimit` + Limit to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorUnsupportedLimit`, :py:obj:`~.cudaErrorInvalidValue` + pValue : int + Returned size of the limit + + See Also + -------- + :py:obj:`~.cudaDeviceSetLimit`, :py:obj:`~.cuCtxGetLimit` + """ + cdef size_t pValue = 0 + cdef cyruntime.cudaLimit cylimit = int(limit) + with nogil: + err = cyruntime.cudaDeviceGetLimit(&pValue, cylimit) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pValue) +{{endif}} + +{{if 'cudaDeviceGetTexture1DLinearMaxWidth' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDesc], int device): + """ Returns the maximum number of elements allocatable in a 1D linear texture for a given element size. + + Returns in `maxWidthInElements` the maximum number of elements + allocatable in a 1D linear texture for given format descriptor + `fmtDesc`. + + Parameters + ---------- + fmtDesc : :py:obj:`~.cudaChannelFormatDesc` + Texture format description. + None : int + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorUnsupportedLimit`, :py:obj:`~.cudaErrorInvalidValue` + maxWidthInElements : int + Returns maximum number of texture elements allocatable for given + `fmtDesc`. + + See Also + -------- + :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth` + """ + cdef size_t maxWidthInElements = 0 + 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: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, maxWidthInElements) +{{endif}} + +{{if 'cudaDeviceGetCacheConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetCacheConfig(): + """ Returns the preferred cache configuration for the current device. + + On devices where the L1 cache and shared memory use the same hardware + resources, this returns through `pCacheConfig` the preferred cache + configuration for the current device. This is only a preference. The + runtime will use the requested configuration if possible, but it is + free to choose a different configuration if required to execute + functions. + + This will return a `pCacheConfig` of + :py:obj:`~.cudaFuncCachePreferNone` on devices where the size of the L1 + cache and shared memory are fixed. + + The supported cache configurations are: + + - :py:obj:`~.cudaFuncCachePreferNone`: no preference for shared memory + or L1 (default) + + - :py:obj:`~.cudaFuncCachePreferShared`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.cudaFuncCachePreferL1`: prefer larger L1 cache and smaller + shared memory + + - :py:obj:`~.cudaFuncCachePreferEqual`: prefer equal size L1 cache and + shared memory + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + pCacheConfig : :py:obj:`~.cudaFuncCache` + Returned cache configuration + + See Also + -------- + :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaFuncSetCacheConfig (C API)`, cudaFuncSetCacheConfig (C++ API), :py:obj:`~.cuCtxGetCacheConfig` + """ + cdef cyruntime.cudaFuncCache pCacheConfig + with nogil: + err = cyruntime.cudaDeviceGetCacheConfig(&pCacheConfig) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaFuncCache(pCacheConfig)) +{{endif}} + +{{if 'cudaDeviceGetStreamPriorityRange' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetStreamPriorityRange(): + """ Returns numerical values that correspond to the least and greatest stream priorities. + + Returns in `*leastPriority` and `*greatestPriority` the numerical + values that correspond to the least and greatest stream priorities + respectively. Stream priorities follow a convention where lower numbers + imply greater priorities. The range of meaningful stream priorities is + given by [`*greatestPriority`, `*leastPriority`]. If the user attempts + to create a stream with a priority value that is outside the the + meaningful range as specified by this API, the priority is + automatically clamped down or up to either `*leastPriority` or + `*greatestPriority` respectively. See + :py:obj:`~.cudaStreamCreateWithPriority` for details on creating a + priority stream. A NULL may be passed in for `*leastPriority` or + `*greatestPriority` if the value is not desired. + + This function will return '0' in both `*leastPriority` and + `*greatestPriority` if the current context's device does not support + stream priorities (see :py:obj:`~.cudaDeviceGetAttribute`). + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + leastPriority : int + Pointer to an int in which the numerical value for least stream + priority is returned + greatestPriority : int + Pointer to an int in which the numerical value for greatest stream + priority is returned + + See Also + -------- + :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cuCtxGetStreamPriorityRange` + """ + cdef int leastPriority = 0 + cdef int greatestPriority = 0 + with nogil: + err = cyruntime.cudaDeviceGetStreamPriorityRange(&leastPriority, &greatestPriority) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, leastPriority, greatestPriority) +{{endif}} + +{{if 'cudaDeviceSetCacheConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSetCacheConfig(cacheConfig not None : cudaFuncCache): + """ Sets the preferred cache configuration for the current device. + + On devices where the L1 cache and shared memory use the same hardware + resources, this sets through `cacheConfig` the preferred cache + configuration for the current device. This is only a preference. The + runtime will use the requested configuration if possible, but it is + free to choose a different configuration if required to execute the + function. Any function preference set via + :py:obj:`~.cudaFuncSetCacheConfig (C API)` or cudaFuncSetCacheConfig + (C++ API) will be preferred over this device-wide setting. Setting the + device-wide cache configuration to :py:obj:`~.cudaFuncCachePreferNone` + will cause subsequent kernel launches to prefer to not change the cache + configuration unless required to launch the kernel. + + This setting does nothing on devices where the size of the L1 cache and + shared memory are fixed. + + Launching a kernel with a different preference than the most recent + preference setting may insert a device-side synchronization point. + + The supported cache configurations are: + + - :py:obj:`~.cudaFuncCachePreferNone`: no preference for shared memory + or L1 (default) + + - :py:obj:`~.cudaFuncCachePreferShared`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.cudaFuncCachePreferL1`: prefer larger L1 cache and smaller + shared memory + + - :py:obj:`~.cudaFuncCachePreferEqual`: prefer equal size L1 cache and + shared memory + + Parameters + ---------- + cacheConfig : :py:obj:`~.cudaFuncCache` + Requested cache configuration + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + + See Also + -------- + :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaFuncSetCacheConfig (C API)`, cudaFuncSetCacheConfig (C++ API), :py:obj:`~.cuCtxSetCacheConfig` + """ + cdef cyruntime.cudaFuncCache cycacheConfig = int(cacheConfig) + with nogil: + err = cyruntime.cudaDeviceSetCacheConfig(cycacheConfig) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetByPCIBusId' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetByPCIBusId(char* pciBusId): + """ Returns a handle to a compute device. + + Returns in `*device` a device ordinal given a PCI bus ID string. + + where `domain`, `bus`, `device`, and `function` are all hexadecimal + values + + Parameters + ---------- + pciBusId : bytes + String in one of the following forms: + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + device : int + Returned device ordinal + + See Also + -------- + :py:obj:`~.cudaDeviceGetPCIBusId`, :py:obj:`~.cuDeviceGetByPCIBusId` + """ + cdef int device = 0 + with nogil: + err = cyruntime.cudaDeviceGetByPCIBusId(&device, pciBusId) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, device) +{{endif}} + +{{if 'cudaDeviceGetPCIBusId' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetPCIBusId(int length, int device): + """ Returns a PCI Bus Id string for the device. + + Returns an ASCII string identifying the device `dev` in the NULL- + terminated string pointed to by `pciBusId`. `length` specifies the + maximum length of the string that may be returned. + + where `domain`, `bus`, `device`, and `function` are all hexadecimal + values. pciBusId should be large enough to store 13 characters + including the NULL-terminator. + + Parameters + ---------- + length : int + Maximum length of string to store in `name` + device : int + Device to get identifier string for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + pciBusId : bytes + Returned identifier string for the device in the following format + + See Also + -------- + :py:obj:`~.cudaDeviceGetByPCIBusId`, :py:obj:`~.cuDeviceGetPCIBusId` + """ + pypciBusId = b" " * length + cdef char* pciBusId = pypciBusId + with nogil: + err = cyruntime.cudaDeviceGetPCIBusId(pciBusId, length, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pypciBusId) +{{endif}} + +{{if 'cudaIpcGetEventHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaIpcGetEventHandle(event): + """ Gets an interprocess handle for a previously allocated event. + + Takes as input a previously allocated event. This event must have been + created with the :py:obj:`~.cudaEventInterprocess` and + :py:obj:`~.cudaEventDisableTiming` flags set. This opaque handle may be + copied into other processes and opened with + :py:obj:`~.cudaIpcOpenEventHandle` to allow efficient hardware + synchronization between GPU work in different processes. + + After the event has been been opened in the importing process, + :py:obj:`~.cudaEventRecord`, :py:obj:`~.cudaEventSynchronize`, + :py:obj:`~.cudaStreamWaitEvent` and :py:obj:`~.cudaEventQuery` may be + used in either process. Performing operations on the imported event + after the exported event has been freed with + :py:obj:`~.cudaEventDestroy` will result in undefined behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cudaDeviceGetAttribute` with + :py:obj:`~.cudaDevAttrIpcEventSupport` + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event allocated with :py:obj:`~.cudaEventInterprocess` and + :py:obj:`~.cudaEventDisableTiming` flags. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorMapBufferObjectFailed`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + handle : :py:obj:`~.cudaIpcEventHandle_t` + Pointer to a user allocated cudaIpcEventHandle in which to return + the opaque event handle + + See Also + -------- + :py:obj:`~.cudaEventCreate`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cuIpcGetEventHandle` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + cdef cudaIpcEventHandle_t handle = cudaIpcEventHandle_t() + with nogil: + err = cyruntime.cudaIpcGetEventHandle(handle._pvt_ptr, cyevent) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, handle) +{{endif}} + +{{if 'cudaIpcOpenEventHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaIpcOpenEventHandle(handle not None : cudaIpcEventHandle_t): + """ Opens an interprocess event handle for use in the current process. + + Opens an interprocess event handle exported from another process with + :py:obj:`~.cudaIpcGetEventHandle`. This function returns a + :py:obj:`~.cudaEvent_t` that behaves like a locally created event with + the :py:obj:`~.cudaEventDisableTiming` flag specified. This event must + be freed with :py:obj:`~.cudaEventDestroy`. + + Performing operations on the imported event after the exported event + has been freed with :py:obj:`~.cudaEventDestroy` will result in + undefined behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cudaDeviceGetAttribute` with + :py:obj:`~.cudaDevAttrIpcEventSupport` + + Parameters + ---------- + handle : :py:obj:`~.cudaIpcEventHandle_t` + Interprocess handle to open + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMapBufferObjectFailed`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorDeviceUninitialized` + event : :py:obj:`~.cudaEvent_t` + Returns the imported event + + See Also + -------- + :py:obj:`~.cudaEventCreate`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cuIpcOpenEventHandle` + """ + cdef cudaEvent_t event = cudaEvent_t() + with nogil: + err = cyruntime.cudaIpcOpenEventHandle(event._pvt_ptr, handle._pvt_ptr[0]) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, event) +{{endif}} + +{{if 'cudaIpcGetMemHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaIpcGetMemHandle(devPtr): + """ Gets an interprocess memory handle for an existing device memory allocation. + + Takes a pointer to the base of an existing device memory allocation + created with :py:obj:`~.cudaMalloc` and exports it for use in another + process. This is a lightweight operation and may be called multiple + times on an allocation without adverse effects. + + If a region of memory is freed with :py:obj:`~.cudaFree` and a + subsequent call to :py:obj:`~.cudaMalloc` returns memory with the same + device address, :py:obj:`~.cudaIpcGetMemHandle` will return a unique + handle for the new memory. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cudaDeviceGetAttribute` with + :py:obj:`~.cudaDevAttrIpcEventSupport` + + Parameters + ---------- + devPtr : Any + Base pointer to previously allocated device memory + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorMapBufferObjectFailed`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + handle : :py:obj:`~.cudaIpcMemHandle_t` + Pointer to user allocated :py:obj:`~.cudaIpcMemHandle` to return + the handle in. + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cuIpcGetMemHandle` + """ + cdef cudaIpcMemHandle_t handle = cudaIpcMemHandle_t() + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaIpcGetMemHandle(handle._pvt_ptr, cydevPtr) + _helper_input_void_ptr_free(&cydevPtrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, handle) +{{endif}} + +{{if 'cudaIpcOpenMemHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaIpcOpenMemHandle(handle not None : cudaIpcMemHandle_t, unsigned int flags): + """ Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process. + + Maps memory exported from another process with + :py:obj:`~.cudaIpcGetMemHandle` into the current device address space. + For contexts on different devices :py:obj:`~.cudaIpcOpenMemHandle` can + attempt to enable peer access between the devices as if the user called + :py:obj:`~.cudaDeviceEnablePeerAccess`. This behavior is controlled by + the :py:obj:`~.cudaIpcMemLazyEnablePeerAccess` flag. + :py:obj:`~.cudaDeviceCanAccessPeer` can determine if a mapping is + possible. + + :py:obj:`~.cudaIpcOpenMemHandle` can open handles to devices that may + not be visible in the process calling the API. + + Contexts that may open :py:obj:`~.cudaIpcMemHandles` are restricted in + the following way. :py:obj:`~.cudaIpcMemHandles` from each device in a + given process may only be opened by one context per device per other + process. + + If the memory handle has already been opened by the current context, + the reference count on the handle is incremented by 1 and the existing + device pointer is returned. + + Memory returned from :py:obj:`~.cudaIpcOpenMemHandle` must be freed + with :py:obj:`~.cudaIpcCloseMemHandle`. + + Calling :py:obj:`~.cudaFree` on an exported memory region before + calling :py:obj:`~.cudaIpcCloseMemHandle` in the importing context will + result in undefined behavior. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cudaDeviceGetAttribute` with + :py:obj:`~.cudaDevAttrIpcEventSupport` + + Parameters + ---------- + handle : :py:obj:`~.cudaIpcMemHandle_t` + :py:obj:`~.cudaIpcMemHandle` to open + flags : unsigned int + Flags for this operation. Must be specified as + :py:obj:`~.cudaIpcMemLazyEnablePeerAccess` + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMapBufferObjectFailed`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorDeviceUninitialized`, :py:obj:`~.cudaErrorTooManyPeers`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + devPtr : Any + Returned device pointer + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cuIpcOpenMemHandle` + + Notes + ----- + No guarantees are made about the address returned in `*devPtr`. + In particular, multiple processes may not receive the same address for the same `handle`. + """ + cdef void_ptr devPtr = 0 + with nogil: + err = cyruntime.cudaIpcOpenMemHandle(&devPtr, handle._pvt_ptr[0], flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, devPtr) +{{endif}} + +{{if 'cudaIpcCloseMemHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaIpcCloseMemHandle(devPtr): + """ Attempts to close memory mapped with cudaIpcOpenMemHandle. + + Decrements the reference count of the memory returnd by + :py:obj:`~.cudaIpcOpenMemHandle` by 1. When the reference count reaches + 0, this API unmaps the memory. The original allocation in the exporting + process as well as imported mappings in other processes will be + unaffected. + + Any resources used to enable peer access will be freed if this is the + last mapping using them. + + IPC functionality is restricted to devices with support for unified + addressing on Linux and Windows operating systems. IPC functionality on + Windows is supported for compatibility purposes but not recommended as + it comes with performance cost. Users can test their device for IPC + functionality by calling :py:obj:`~.cudaDeviceGetAttribute` with + :py:obj:`~.cudaDevAttrIpcEventSupport` + + Parameters + ---------- + devPtr : Any + Device pointer returned by :py:obj:`~.cudaIpcOpenMemHandle` + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMapBufferObjectFailed`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaIpcCloseMemHandle(cydevPtr) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceFlushGPUDirectRDMAWrites' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceFlushGPUDirectRDMAWrites(target not None : cudaFlushGPUDirectRDMAWritesTarget, scope not None : cudaFlushGPUDirectRDMAWritesScope): + """ Blocks until remote writes are visible to the specified scope. + + Blocks until remote writes to the target context via mappings created + through GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see + https://docs.nvidia.com/cuda/gpudirect-rdma for more information), are + visible to the specified scope. + + If the scope equals or lies within the scope indicated by + :py:obj:`~.cudaDevAttrGPUDirectRDMAWritesOrdering`, the call will be a + no-op and can be safely omitted for performance. This can be determined + by comparing the numerical values between the two enums, with smaller + scopes having smaller values. + + Users may query support for this API via + :py:obj:`~.cudaDevAttrGPUDirectRDMAFlushWritesOptions`. + + Parameters + ---------- + target : :py:obj:`~.cudaFlushGPUDirectRDMAWritesTarget` + The target of the operation, see + :py:obj:`~.cudaFlushGPUDirectRDMAWritesTarget` + scope : :py:obj:`~.cudaFlushGPUDirectRDMAWritesScope` + The scope of the operation, see + :py:obj:`~.cudaFlushGPUDirectRDMAWritesScope` + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotSupported`, + + See Also + -------- + :py:obj:`~.cuFlushGPUDirectRDMAWrites` + """ + cdef cyruntime.cudaFlushGPUDirectRDMAWritesTarget cytarget = int(target) + cdef cyruntime.cudaFlushGPUDirectRDMAWritesScope cyscope = int(scope) + with nogil: + err = cyruntime.cudaDeviceFlushGPUDirectRDMAWrites(cytarget, cyscope) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceRegisterAsyncNotification' in found_functions}} + +ctypedef struct cudaAsyncCallbackData_st: + cyruntime.cudaAsyncCallback callback + void *userData + +ctypedef cudaAsyncCallbackData_st cudaAsyncCallbackData + +@cython.show_performance_hints(False) +cdef void cudaAsyncNotificationCallbackWrapper(cyruntime.cudaAsyncNotificationInfo_t *info, void *data, cyruntime.cudaAsyncCallbackHandle_t handle) nogil: + cdef cudaAsyncCallbackData *cbData = data + with gil: + cbData.callback(info, cbData.userData, handle) + +@cython.embedsignature(True) +def cudaDeviceRegisterAsyncNotification(int device, callbackFunc, userData): + """ Registers a callback function to receive async notifications. + + Registers `callbackFunc` to receive async notifications. + + The `userData` parameter is passed to the callback function at async + notification time. Likewise, `callback` is also passed to the callback + function to distinguish between multiple registered callbacks. + + The callback function being registered should be designed to return + quickly (~10ms). Any long running tasks should be queued for execution + on an application thread. + + Callbacks may not call cudaDeviceRegisterAsyncNotification or + cudaDeviceUnregisterAsyncNotification. Doing so will result in + :py:obj:`~.cudaErrorNotPermitted`. Async notification callbacks execute + in an undefined order and may be serialized. + + Returns in `*callback` a handle representing the registered callback + instance. + + Parameters + ---------- + device : int + The device on which to register the callback + callbackFunc : :py:obj:`~.cudaAsyncCallback` + The function to register as a callback + userData : Any + A generic pointer to user data. This is passed into the callback + function. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorNotSupported` :py:obj:`~.cudaErrorInvalidDevice` :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorNotPermitted` :py:obj:`~.cudaErrorUnknown` + callback : :py:obj:`~.cudaAsyncCallbackHandle_t` + A handle representing the registered callback instance + + See Also + -------- + :py:obj:`~.cudaDeviceUnregisterAsyncNotification` + """ + cdef cyruntime.cudaAsyncCallback cycallbackFunc + if callbackFunc is None: + pcallbackFunc = 0 + elif isinstance(callbackFunc, (cudaAsyncCallback,)): + pcallbackFunc = int(callbackFunc) + else: + pcallbackFunc = int(cudaAsyncCallback(callbackFunc)) + cycallbackFunc = pcallbackFunc + cdef _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cudaAsyncCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (cudaError_t.cudaErrorMemoryAllocation, None) + cbData.callback = cycallbackFunc + cbData.userData = cyuserData + + cdef cudaAsyncCallbackHandle_t callback = cudaAsyncCallbackHandle_t() + with nogil: + err = cyruntime.cudaDeviceRegisterAsyncNotification(device, cudaAsyncNotificationCallbackWrapper, cbData, callback._pvt_ptr) + if err != cyruntime.cudaSuccess: + free(cbData) + else: + m_global._allocated[int(callback)] = cbData + _helper_input_void_ptr_free(&cyuserDataHelper) + + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, callback) +{{endif}} + +{{if 'cudaDeviceUnregisterAsyncNotification' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceUnregisterAsyncNotification(int device, callback): + """ Unregisters an async notification callback. + + Unregisters `callback` so that the corresponding callback function will + stop receiving async notifications. + + Parameters + ---------- + device : int + The device from which to remove `callback`. + callback : :py:obj:`~.cudaAsyncCallbackHandle_t` + The callback instance to unregister from receiving async + notifications. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorNotSupported` :py:obj:`~.cudaErrorInvalidDevice` :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorNotPermitted` :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaDeviceRegisterAsyncNotification` + """ + cdef cyruntime.cudaAsyncCallbackHandle_t cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (cudaAsyncCallbackHandle_t,)): + pcallback = int(callback) + else: + pcallback = int(cudaAsyncCallbackHandle_t(callback)) + cycallback = pcallback + with nogil: + err = cyruntime.cudaDeviceUnregisterAsyncNotification(device, cycallback) + if err == cyruntime.cudaSuccess: + free(m_global._allocated[pcallback]) + m_global._allocated.erase(pcallback) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetSharedMemConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetSharedMemConfig(): + """ Returns the shared memory configuration for the current device. + + [Deprecated] + + This function will return in `pConfig` the current size of shared + memory banks on the current device. On devices with configurable shared + memory banks, :py:obj:`~.cudaDeviceSetSharedMemConfig` can be used to + change this setting, so that all subsequent kernel launches will by + default use the new bank size. When + :py:obj:`~.cudaDeviceGetSharedMemConfig` is called on devices without + configurable shared memory, it will return the fixed bank size of the + hardware. + + The returned bank configurations can be either: + + - :py:obj:`~.cudaSharedMemBankSizeFourByte` - shared memory bank width + is four bytes. + + - :py:obj:`~.cudaSharedMemBankSizeEightByte` - shared memory bank width + is eight bytes. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pConfig : :py:obj:`~.cudaSharedMemConfig` + Returned cache configuration + + See Also + -------- + :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaDeviceSetSharedMemConfig`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuCtxGetSharedMemConfig` + """ + cdef cyruntime.cudaSharedMemConfig pConfig + with nogil: + err = cyruntime.cudaDeviceGetSharedMemConfig(&pConfig) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaSharedMemConfig(pConfig)) +{{endif}} + +{{if 'cudaDeviceSetSharedMemConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSetSharedMemConfig(config not None : cudaSharedMemConfig): + """ Sets the shared memory configuration for the current device. + + [Deprecated] + + On devices with configurable shared memory banks, this function will + set the shared memory bank size which is used for all subsequent kernel + launches. Any per-function setting of shared memory set via + :py:obj:`~.cudaFuncSetSharedMemConfig` will override the device wide + setting. + + Changing the shared memory configuration between launches may introduce + a device side synchronization point. + + Changing the shared memory bank size will not increase shared memory + usage or affect occupancy of kernels, but may have major effects on + performance. Larger bank sizes will allow for greater potential + bandwidth to shared memory, but will change what kinds of accesses to + shared memory will result in bank conflicts. + + This function will do nothing on devices with fixed shared memory bank + size. + + The supported bank configurations are: + + - :py:obj:`~.cudaSharedMemBankSizeDefault`: set bank width the device + default (currently, four bytes) + + - :py:obj:`~.cudaSharedMemBankSizeFourByte`: set shared memory bank + width to be four bytes natively. + + - :py:obj:`~.cudaSharedMemBankSizeEightByte`: set shared memory bank + width to be eight bytes natively. + + Parameters + ---------- + config : :py:obj:`~.cudaSharedMemConfig` + Requested cache configuration + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaDeviceGetSharedMemConfig`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuCtxSetSharedMemConfig` + """ + cdef cyruntime.cudaSharedMemConfig cyconfig = int(config) + with nogil: + err = cyruntime.cudaDeviceSetSharedMemConfig(cyconfig) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetLastError' in found_functions}} + +@cython.embedsignature(True) +def cudaGetLastError(): + """ Returns the last error from a runtime call. + + Returns the last error that has been produced by any of the runtime + calls in the same instance of the CUDA Runtime library in the host + thread and resets it to :py:obj:`~.cudaSuccess`. + + Note: Multiple instances of the CUDA Runtime library can be present in + an application when using a library that statically links the CUDA + Runtime. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMissingConfiguration`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorLaunchTimeout`, :py:obj:`~.cudaErrorLaunchOutOfResources`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidConfiguration`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidSymbol`, :py:obj:`~.cudaErrorUnmapBufferObjectFailed`, :py:obj:`~.cudaErrorInvalidDevicePointer`, :py:obj:`~.cudaErrorInvalidTexture`, :py:obj:`~.cudaErrorInvalidTextureBinding`, :py:obj:`~.cudaErrorInvalidChannelDescriptor`, :py:obj:`~.cudaErrorInvalidMemcpyDirection`, :py:obj:`~.cudaErrorInvalidFilterSetting`, :py:obj:`~.cudaErrorInvalidNormSetting`, :py:obj:`~.cudaErrorUnknown`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorInsufficientDriver`, :py:obj:`~.cudaErrorNoDevice`, :py:obj:`~.cudaErrorSetOnActiveProcess`, :py:obj:`~.cudaErrorStartupFailure`, :py:obj:`~.cudaErrorInvalidPtx`, :py:obj:`~.cudaErrorUnsupportedPtxVersion`, :py:obj:`~.cudaErrorNoKernelImageForDevice`, :py:obj:`~.cudaErrorJitCompilerNotFound`, :py:obj:`~.cudaErrorJitCompilationDisabled` + + See Also + -------- + :py:obj:`~.cudaPeekAtLastError`, :py:obj:`~.cudaGetErrorName`, :py:obj:`~.cudaGetErrorString`, :py:obj:`~.cudaError` + """ + with nogil: + err = cyruntime.cudaGetLastError() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaPeekAtLastError' in found_functions}} + +@cython.embedsignature(True) +def cudaPeekAtLastError(): + """ Returns the last error from a runtime call. + + Returns the last error that has been produced by any of the runtime + calls in the same instance of the CUDA Runtime library in the host + thread. This call does not reset the error to :py:obj:`~.cudaSuccess` + like :py:obj:`~.cudaGetLastError()`. + + Note: Multiple instances of the CUDA Runtime library can be present in + an application when using a library that statically links the CUDA + Runtime. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMissingConfiguration`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorLaunchTimeout`, :py:obj:`~.cudaErrorLaunchOutOfResources`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidConfiguration`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidSymbol`, :py:obj:`~.cudaErrorUnmapBufferObjectFailed`, :py:obj:`~.cudaErrorInvalidDevicePointer`, :py:obj:`~.cudaErrorInvalidTexture`, :py:obj:`~.cudaErrorInvalidTextureBinding`, :py:obj:`~.cudaErrorInvalidChannelDescriptor`, :py:obj:`~.cudaErrorInvalidMemcpyDirection`, :py:obj:`~.cudaErrorInvalidFilterSetting`, :py:obj:`~.cudaErrorInvalidNormSetting`, :py:obj:`~.cudaErrorUnknown`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorInsufficientDriver`, :py:obj:`~.cudaErrorNoDevice`, :py:obj:`~.cudaErrorSetOnActiveProcess`, :py:obj:`~.cudaErrorStartupFailure`, :py:obj:`~.cudaErrorInvalidPtx`, :py:obj:`~.cudaErrorUnsupportedPtxVersion`, :py:obj:`~.cudaErrorNoKernelImageForDevice`, :py:obj:`~.cudaErrorJitCompilerNotFound`, :py:obj:`~.cudaErrorJitCompilationDisabled` + + See Also + -------- + :py:obj:`~.cudaGetLastError`, :py:obj:`~.cudaGetErrorName`, :py:obj:`~.cudaGetErrorString`, :py:obj:`~.cudaError` + """ + with nogil: + err = cyruntime.cudaPeekAtLastError() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetErrorName' in found_functions}} + +@cython.embedsignature(True) +def cudaGetErrorName(error not None : cudaError_t): + """ Returns the string representation of an error code enum name. + + Returns a string containing the name of an error code in the enum. If + the error code is not recognized, "unrecognized error code" is + returned. + + Parameters + ---------- + error : :py:obj:`~.cudaError_t` + Error code to convert to string + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + bytes + `char*` pointer to a NULL-terminated string + + See Also + -------- + :py:obj:`~.cudaGetErrorString`, :py:obj:`~.cudaGetLastError`, :py:obj:`~.cudaPeekAtLastError`, :py:obj:`~.cudaError`, :py:obj:`~.cuGetErrorName` + """ + cdef cyruntime.cudaError_t cyerror = int(error) + with nogil: + err = cyruntime.cudaGetErrorName(cyerror) + return (cudaError_t.cudaSuccess, err) +{{endif}} + +{{if 'cudaGetErrorString' in found_functions}} + +@cython.embedsignature(True) +def cudaGetErrorString(error not None : cudaError_t): + """ Returns the description string for an error code. + + Returns the description string for an error code. If the error code is + not recognized, "unrecognized error code" is returned. + + Parameters + ---------- + error : :py:obj:`~.cudaError_t` + Error code to convert to string + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + bytes + `char*` pointer to a NULL-terminated string + + See Also + -------- + :py:obj:`~.cudaGetErrorName`, :py:obj:`~.cudaGetLastError`, :py:obj:`~.cudaPeekAtLastError`, :py:obj:`~.cudaError`, :py:obj:`~.cuGetErrorString` + """ + cdef cyruntime.cudaError_t cyerror = int(error) + with nogil: + err = cyruntime.cudaGetErrorString(cyerror) + return (cudaError_t.cudaSuccess, err) +{{endif}} + +{{if 'cudaGetDeviceCount' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDeviceCount(): + """ Returns the number of compute-capable devices. + + Returns in `*count` the number of devices with compute capability + greater or equal to 2.0 that are available for execution. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + count : int + Returns the number of devices with compute capability greater or + equal to 2.0 + + See Also + -------- + :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuDeviceGetCount` + """ + cdef int count = 0 + with nogil: + err = cyruntime.cudaGetDeviceCount(&count) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, count) +{{endif}} + +{{if 'cudaGetDeviceProperties_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDeviceProperties(int device): + """ Returns information about the compute-device. + + Returns in `*prop` the properties of device `dev`. The + :py:obj:`~.cudaDeviceProp` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.name[256]` is an ASCII string identifying the device. + + - :py:obj:`~.uuid` is a 16-byte unique identifier. + + - :py:obj:`~.totalGlobalMem` is the total amount of global memory + available on the device in bytes. + + - :py:obj:`~.sharedMemPerBlock` is the maximum amount of shared memory + available to a thread block in bytes. + + - :py:obj:`~.regsPerBlock` is the maximum number of 32-bit registers + available to a thread block. + + - :py:obj:`~.warpSize` is the warp size in threads. + + - :py:obj:`~.memPitch` is the maximum pitch in bytes allowed by the + memory copy functions that involve memory regions allocated through + :py:obj:`~.cudaMallocPitch()`. + + - :py:obj:`~.maxThreadsPerBlock` is the maximum number of threads per + block. + + - :py:obj:`~.maxThreadsDim[3]` contains the maximum size of each + dimension of a block. + + - :py:obj:`~.maxGridSize[3]` contains the maximum size of each + dimension of a grid. + + - :py:obj:`~.clockRate` is the clock frequency in kilohertz. + + - :py:obj:`~.totalConstMem` is the total amount of constant memory + available on the device in bytes. + + - :py:obj:`~.major`, :py:obj:`~.minor` are the major and minor revision + numbers defining the device's compute capability. + + - :py:obj:`~.textureAlignment` is the alignment requirement; texture + base addresses that are aligned to :py:obj:`~.textureAlignment` bytes + do not need an offset applied to texture fetches. + + - :py:obj:`~.texturePitchAlignment` is the pitch alignment requirement + for 2D texture references that are bound to pitched memory. + + - :py:obj:`~.deviceOverlap` is 1 if the device can concurrently copy + memory between host and device while executing a kernel, or 0 if not. + Deprecated, use instead asyncEngineCount. + + - :py:obj:`~.multiProcessorCount` is the number of multiprocessors on + the device. + + - :py:obj:`~.kernelExecTimeoutEnabled` is 1 if there is a run time + limit for kernels executed on the device, or 0 if not. + + - :py:obj:`~.integrated` is 1 if the device is an integrated + (motherboard) GPU and 0 if it is a discrete (card) component. + + - :py:obj:`~.canMapHostMemory` is 1 if the device can map host memory + into the CUDA address space for use with + :py:obj:`~.cudaHostAlloc()`/:py:obj:`~.cudaHostGetDevicePointer()`, + or 0 if not. + + - :py:obj:`~.computeMode` is the compute mode that the device is + currently in. Available modes are as follows: + + - cudaComputeModeDefault: Default mode - Device is not restricted and + multiple threads can use :py:obj:`~.cudaSetDevice()` with this + device. + + - cudaComputeModeProhibited: Compute-prohibited mode - No threads can + use :py:obj:`~.cudaSetDevice()` with this device. + + - cudaComputeModeExclusiveProcess: Compute-exclusive-process mode - + Many threads in one process will be able to use + :py:obj:`~.cudaSetDevice()` with this device. When an occupied + exclusive mode device is chosen with :py:obj:`~.cudaSetDevice`, all + subsequent non-device management runtime functions will return + :py:obj:`~.cudaErrorDevicesUnavailable`. + + - :py:obj:`~.maxTexture1D` is the maximum 1D texture size. + + - :py:obj:`~.maxTexture1DMipmap` is the maximum 1D mipmapped texture + texture size. + + - :py:obj:`~.maxTexture1DLinear` is the maximum 1D texture size for + textures bound to linear memory. + + - :py:obj:`~.maxTexture2D[2]` contains the maximum 2D texture + dimensions. + + - :py:obj:`~.maxTexture2DMipmap[2]` contains the maximum 2D mipmapped + texture dimensions. + + - :py:obj:`~.maxTexture2DLinear[3]` contains the maximum 2D texture + dimensions for 2D textures bound to pitch linear memory. + + - :py:obj:`~.maxTexture2DGather[2]` contains the maximum 2D texture + dimensions if texture gather operations have to be performed. + + - :py:obj:`~.maxTexture3D[3]` contains the maximum 3D texture + dimensions. + + - :py:obj:`~.maxTexture3DAlt[3]` contains the maximum alternate 3D + texture dimensions. + + - :py:obj:`~.maxTextureCubemap` is the maximum cubemap texture width or + height. + + - :py:obj:`~.maxTexture1DLayered[2]` contains the maximum 1D layered + texture dimensions. + + - :py:obj:`~.maxTexture2DLayered[3]` contains the maximum 2D layered + texture dimensions. + + - :py:obj:`~.maxTextureCubemapLayered[2]` contains the maximum cubemap + layered texture dimensions. + + - :py:obj:`~.maxSurface1D` is the maximum 1D surface size. + + - :py:obj:`~.maxSurface2D[2]` contains the maximum 2D surface + dimensions. + + - :py:obj:`~.maxSurface3D[3]` contains the maximum 3D surface + dimensions. + + - :py:obj:`~.maxSurface1DLayered[2]` contains the maximum 1D layered + surface dimensions. + + - :py:obj:`~.maxSurface2DLayered[3]` contains the maximum 2D layered + surface dimensions. + + - :py:obj:`~.maxSurfaceCubemap` is the maximum cubemap surface width or + height. + + - :py:obj:`~.maxSurfaceCubemapLayered[2]` contains the maximum cubemap + layered surface dimensions. + + - :py:obj:`~.surfaceAlignment` specifies the alignment requirements for + surfaces. + + - :py:obj:`~.concurrentKernels` is 1 if the device supports executing + multiple kernels within the same context simultaneously, or 0 if not. + It is not guaranteed that multiple kernels will be resident on the + device concurrently so this feature should not be relied upon for + correctness. + + - :py:obj:`~.ECCEnabled` is 1 if the device has ECC support turned on, + or 0 if not. + + - :py:obj:`~.pciBusID` is the PCI bus identifier of the device. + + - :py:obj:`~.pciDeviceID` is the PCI device (sometimes called slot) + identifier of the device. + + - :py:obj:`~.pciDomainID` is the PCI domain identifier of the device. + + - :py:obj:`~.tccDriver` is 1 if the device is using a TCC driver or 0 + if not. + + - :py:obj:`~.asyncEngineCount` is 1 when the device can concurrently + copy memory between host and device while executing a kernel. It is 2 + when the device can concurrently copy memory between host and device + in both directions and execute a kernel at the same time. It is 0 if + neither of these is supported. + + - :py:obj:`~.unifiedAddressing` is 1 if the device shares a unified + address space with the host and 0 otherwise. + + - :py:obj:`~.memoryClockRate` is the peak memory clock frequency in + kilohertz. + + - :py:obj:`~.memoryBusWidth` is the memory bus width in bits. + + - :py:obj:`~.l2CacheSize` is L2 cache size in bytes. + + - :py:obj:`~.persistingL2CacheMaxSize` is L2 cache's maximum persisting + lines size in bytes. + + - :py:obj:`~.maxThreadsPerMultiProcessor` is the number of maximum + resident threads per multiprocessor. + + - :py:obj:`~.streamPrioritiesSupported` is 1 if the device supports + stream priorities, or 0 if it is not supported. + + - :py:obj:`~.globalL1CacheSupported` is 1 if the device supports + caching of globals in L1 cache, or 0 if it is not supported. + + - :py:obj:`~.localL1CacheSupported` is 1 if the device supports caching + of locals in L1 cache, or 0 if it is not supported. + + - :py:obj:`~.sharedMemPerMultiprocessor` is the maximum amount of + shared memory available to a multiprocessor in bytes; this amount is + shared by all thread blocks simultaneously resident on a + multiprocessor. + + - :py:obj:`~.regsPerMultiprocessor` is the maximum number of 32-bit + registers available to a multiprocessor; this number is shared by all + thread blocks simultaneously resident on a multiprocessor. + + - :py:obj:`~.managedMemory` is 1 if the device supports allocating + managed memory on this system, or 0 if it is not supported. + + - :py:obj:`~.isMultiGpuBoard` is 1 if the device is on a multi-GPU + board (e.g. Gemini cards), and 0 if not; + + - :py:obj:`~.multiGpuBoardGroupID` is a unique identifier for a group + of devices associated with the same board. Devices on the same multi- + GPU board will share the same identifier. + + - :py:obj:`~.hostNativeAtomicSupported` is 1 if the link between the + device and the host supports native atomic operations, or 0 if it is + not supported. + + - :py:obj:`~.singleToDoublePrecisionPerfRatio` is the ratio of single + precision performance (in floating-point operations per second) to + double precision performance. + + - :py:obj:`~.pageableMemoryAccess` is 1 if the device supports + coherently accessing pageable memory without calling cudaHostRegister + on it, and 0 otherwise. + + - :py:obj:`~.concurrentManagedAccess` is 1 if the device can coherently + access managed memory concurrently with the CPU, and 0 otherwise. + + - :py:obj:`~.computePreemptionSupported` is 1 if the device supports + Compute Preemption, and 0 otherwise. + + - :py:obj:`~.canUseHostPointerForRegisteredMem` is 1 if the device can + access host registered memory at the same virtual address as the CPU, + and 0 otherwise. + + - :py:obj:`~.cooperativeLaunch` is 1 if the device supports launching + cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel`, and + 0 otherwise. + + - :py:obj:`~.cooperativeMultiDeviceLaunch` is 1 if the device supports + launching cooperative kernels via + :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice`, and 0 otherwise. + + - :py:obj:`~.sharedMemPerBlockOptin` is the per device maximum shared + memory per block usable by special opt in + + - :py:obj:`~.pageableMemoryAccessUsesHostPageTables` is 1 if the device + accesses pageable memory via the host's page tables, and 0 otherwise. + + - :py:obj:`~.directManagedMemAccessFromHost` is 1 if the host can + directly access managed memory on the device without migration, and 0 + otherwise. + + - :py:obj:`~.maxBlocksPerMultiProcessor` is the maximum number of + thread blocks that can reside on a multiprocessor. + + - :py:obj:`~.accessPolicyMaxWindowSize` is the maximum value of + :py:obj:`~.cudaAccessPolicyWindow.num_bytes`. + + - :py:obj:`~.reservedSharedMemPerBlock` is the shared memory reserved + by CUDA driver per block in bytes + + - :py:obj:`~.hostRegisterSupported` is 1 if the device supports host + memory registration via :py:obj:`~.cudaHostRegister`, and 0 + otherwise. + + - :py:obj:`~.sparseCudaArraySupported` is 1 if the device supports + sparse CUDA arrays and sparse CUDA mipmapped arrays, 0 otherwise + + - :py:obj:`~.hostRegisterReadOnlySupported` is 1 if the device supports + using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly + to register memory that must be mapped as read-only to the GPU + + - :py:obj:`~.timelineSemaphoreInteropSupported` is 1 if external + timeline semaphore interop is supported on the device, 0 otherwise + + - :py:obj:`~.memoryPoolsSupported` is 1 if the device supports using + the cudaMallocAsync and cudaMemPool family of APIs, 0 otherwise + + - :py:obj:`~.gpuDirectRDMASupported` is 1 if the device supports + GPUDirect RDMA APIs, 0 otherwise + + - :py:obj:`~.gpuDirectRDMAFlushWritesOptions` is a bitmask to be + interpreted according to the + :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum + + - :py:obj:`~.gpuDirectRDMAWritesOrdering` See the + :py:obj:`~.cudaGPUDirectRDMAWritesOrdering` enum for numerical values + + - :py:obj:`~.memoryPoolSupportedHandleTypes` is a bitmask of handle + types supported with mempool-based IPC + + - :py:obj:`~.deferredMappingCudaArraySupported` is 1 if the device + supports deferred mapping CUDA arrays and CUDA mipmapped arrays + + - :py:obj:`~.ipcEventSupported` is 1 if the device supports IPC Events, + and 0 otherwise + + - :py:obj:`~.unifiedFunctionPointers` is 1 if the device support + unified pointers, and 0 otherwise + + Parameters + ---------- + device : int + None + + Returns + ------- + cudaError_t + + prop : :py:obj:`~.cudaDeviceProp` + None + """ + cdef cudaDeviceProp prop = cudaDeviceProp() + with nogil: + err = cyruntime.cudaGetDeviceProperties(prop._pvt_ptr, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, prop) +{{endif}} + +{{if 'cudaDeviceGetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetAttribute(attr not None : cudaDeviceAttr, int device): + """ Returns information about the device. + + Returns in `*value` the integer value of the attribute `attr` on device + `device`. The supported attributes are: + + - :py:obj:`~.cudaDevAttrMaxThreadsPerBlock`: Maximum number of threads + per block + + - :py:obj:`~.cudaDevAttrMaxBlockDimX`: Maximum x-dimension of a block + + - :py:obj:`~.cudaDevAttrMaxBlockDimY`: Maximum y-dimension of a block + + - :py:obj:`~.cudaDevAttrMaxBlockDimZ`: Maximum z-dimension of a block + + - :py:obj:`~.cudaDevAttrMaxGridDimX`: Maximum x-dimension of a grid + + - :py:obj:`~.cudaDevAttrMaxGridDimY`: Maximum y-dimension of a grid + + - :py:obj:`~.cudaDevAttrMaxGridDimZ`: Maximum z-dimension of a grid + + - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock`: Maximum amount of + shared memory available to a thread block in bytes + + - :py:obj:`~.cudaDevAttrTotalConstantMemory`: Memory available on + device for constant variables in a CUDA C kernel in bytes + + - :py:obj:`~.cudaDevAttrWarpSize`: Warp size in threads + + - :py:obj:`~.cudaDevAttrMaxPitch`: Maximum pitch in bytes allowed by + the memory copy functions that involve memory regions allocated + through :py:obj:`~.cudaMallocPitch()` + + - :py:obj:`~.cudaDevAttrMaxTexture1DWidth`: Maximum 1D texture width + + - :py:obj:`~.cudaDevAttrMaxTexture1DLinearWidth`: Maximum width for a + 1D texture bound to linear memory + + - :py:obj:`~.cudaDevAttrMaxTexture1DMipmappedWidth`: Maximum mipmapped + 1D texture width + + - :py:obj:`~.cudaDevAttrMaxTexture2DWidth`: Maximum 2D texture width + + - :py:obj:`~.cudaDevAttrMaxTexture2DHeight`: Maximum 2D texture height + + - :py:obj:`~.cudaDevAttrMaxTexture2DLinearWidth`: Maximum width for a + 2D texture bound to linear memory + + - :py:obj:`~.cudaDevAttrMaxTexture2DLinearHeight`: Maximum height for a + 2D texture bound to linear memory + + - :py:obj:`~.cudaDevAttrMaxTexture2DLinearPitch`: Maximum pitch in + bytes for a 2D texture bound to linear memory + + - :py:obj:`~.cudaDevAttrMaxTexture2DMipmappedWidth`: Maximum mipmapped + 2D texture width + + - :py:obj:`~.cudaDevAttrMaxTexture2DMipmappedHeight`: Maximum mipmapped + 2D texture height + + - :py:obj:`~.cudaDevAttrMaxTexture3DWidth`: Maximum 3D texture width + + - :py:obj:`~.cudaDevAttrMaxTexture3DHeight`: Maximum 3D texture height + + - :py:obj:`~.cudaDevAttrMaxTexture3DDepth`: Maximum 3D texture depth + + - :py:obj:`~.cudaDevAttrMaxTexture3DWidthAlt`: Alternate maximum 3D + texture width, 0 if no alternate maximum 3D texture size is supported + + - :py:obj:`~.cudaDevAttrMaxTexture3DHeightAlt`: Alternate maximum 3D + texture height, 0 if no alternate maximum 3D texture size is + supported + + - :py:obj:`~.cudaDevAttrMaxTexture3DDepthAlt`: Alternate maximum 3D + texture depth, 0 if no alternate maximum 3D texture size is supported + + - :py:obj:`~.cudaDevAttrMaxTextureCubemapWidth`: Maximum cubemap + texture width or height + + - :py:obj:`~.cudaDevAttrMaxTexture1DLayeredWidth`: Maximum 1D layered + texture width + + - :py:obj:`~.cudaDevAttrMaxTexture1DLayeredLayers`: Maximum layers in a + 1D layered texture + + - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredWidth`: Maximum 2D layered + texture width + + - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredHeight`: Maximum 2D layered + texture height + + - :py:obj:`~.cudaDevAttrMaxTexture2DLayeredLayers`: Maximum layers in a + 2D layered texture + + - :py:obj:`~.cudaDevAttrMaxTextureCubemapLayeredWidth`: Maximum cubemap + layered texture width or height + + - :py:obj:`~.cudaDevAttrMaxTextureCubemapLayeredLayers`: Maximum layers + in a cubemap layered texture + + - :py:obj:`~.cudaDevAttrMaxSurface1DWidth`: Maximum 1D surface width + + - :py:obj:`~.cudaDevAttrMaxSurface2DWidth`: Maximum 2D surface width + + - :py:obj:`~.cudaDevAttrMaxSurface2DHeight`: Maximum 2D surface height + + - :py:obj:`~.cudaDevAttrMaxSurface3DWidth`: Maximum 3D surface width + + - :py:obj:`~.cudaDevAttrMaxSurface3DHeight`: Maximum 3D surface height + + - :py:obj:`~.cudaDevAttrMaxSurface3DDepth`: Maximum 3D surface depth + + - :py:obj:`~.cudaDevAttrMaxSurface1DLayeredWidth`: Maximum 1D layered + surface width + + - :py:obj:`~.cudaDevAttrMaxSurface1DLayeredLayers`: Maximum layers in a + 1D layered surface + + - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredWidth`: Maximum 2D layered + surface width + + - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredHeight`: Maximum 2D layered + surface height + + - :py:obj:`~.cudaDevAttrMaxSurface2DLayeredLayers`: Maximum layers in a + 2D layered surface + + - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapWidth`: Maximum cubemap + surface width + + - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapLayeredWidth`: Maximum cubemap + layered surface width + + - :py:obj:`~.cudaDevAttrMaxSurfaceCubemapLayeredLayers`: Maximum layers + in a cubemap layered surface + + - :py:obj:`~.cudaDevAttrMaxRegistersPerBlock`: Maximum number of 32-bit + registers available to a thread block + + - :py:obj:`~.cudaDevAttrClockRate`: Peak clock frequency in kilohertz + + - :py:obj:`~.cudaDevAttrTextureAlignment`: Alignment requirement; + texture base addresses aligned to :py:obj:`~.textureAlign` bytes do + not need an offset applied to texture fetches + + - :py:obj:`~.cudaDevAttrTexturePitchAlignment`: Pitch alignment + requirement for 2D texture references bound to pitched memory + + - :py:obj:`~.cudaDevAttrGpuOverlap`: 1 if the device can concurrently + copy memory between host and device while executing a kernel, or 0 if + not + + - :py:obj:`~.cudaDevAttrMultiProcessorCount`: Number of multiprocessors + on the device + + - :py:obj:`~.cudaDevAttrKernelExecTimeout`: 1 if there is a run time + limit for kernels executed on the device, or 0 if not + + - :py:obj:`~.cudaDevAttrIntegrated`: 1 if the device is integrated with + the memory subsystem, or 0 if not + + - :py:obj:`~.cudaDevAttrCanMapHostMemory`: 1 if the device can map host + memory into the CUDA address space, or 0 if not + + - :py:obj:`~.cudaDevAttrComputeMode`: Compute mode is the compute mode + that the device is currently in. Available modes are as follows: + + - :py:obj:`~.cudaComputeModeDefault`: Default mode - Device is not + restricted and multiple threads can use :py:obj:`~.cudaSetDevice()` + with this device. + + - :py:obj:`~.cudaComputeModeProhibited`: Compute-prohibited mode - No + threads can use :py:obj:`~.cudaSetDevice()` with this device. + + - :py:obj:`~.cudaComputeModeExclusiveProcess`: Compute-exclusive- + process mode - Many threads in one process will be able to use + :py:obj:`~.cudaSetDevice()` with this device. + + - :py:obj:`~.cudaDevAttrConcurrentKernels`: 1 if the device supports + executing multiple kernels within the same context simultaneously, or + 0 if not. It is not guaranteed that multiple kernels will be resident + on the device concurrently so this feature should not be relied upon + for correctness. + + - :py:obj:`~.cudaDevAttrEccEnabled`: 1 if error correction is enabled + on the device, 0 if error correction is disabled or not supported by + the device + + - :py:obj:`~.cudaDevAttrPciBusId`: PCI bus identifier of the device + + - :py:obj:`~.cudaDevAttrPciDeviceId`: PCI device (also known as slot) + identifier of the device + + - :py:obj:`~.cudaDevAttrTccDriver`: 1 if the device is using a TCC + driver. TCC is only available on Tesla hardware running Windows Vista + or later. + + - :py:obj:`~.cudaDevAttrMemoryClockRate`: Peak memory clock frequency + in kilohertz + + - :py:obj:`~.cudaDevAttrGlobalMemoryBusWidth`: Global memory bus width + in bits + + - :py:obj:`~.cudaDevAttrL2CacheSize`: Size of L2 cache in bytes. 0 if + the device doesn't have L2 cache. + + - :py:obj:`~.cudaDevAttrMaxThreadsPerMultiProcessor`: Maximum resident + threads per multiprocessor + + - :py:obj:`~.cudaDevAttrUnifiedAddressing`: 1 if the device shares a + unified address space with the host, or 0 if not + + - :py:obj:`~.cudaDevAttrComputeCapabilityMajor`: Major compute + capability version number + + - :py:obj:`~.cudaDevAttrComputeCapabilityMinor`: Minor compute + capability version number + + - :py:obj:`~.cudaDevAttrStreamPrioritiesSupported`: 1 if the device + supports stream priorities, or 0 if not + + - :py:obj:`~.cudaDevAttrGlobalL1CacheSupported`: 1 if device supports + caching globals in L1 cache, 0 if not + + - :py:obj:`~.cudaDevAttrLocalL1CacheSupported`: 1 if device supports + caching locals in L1 cache, 0 if not + + - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerMultiprocessor`: Maximum + amount of shared memory available to a multiprocessor in bytes; this + amount is shared by all thread blocks simultaneously resident on a + multiprocessor + + - :py:obj:`~.cudaDevAttrMaxRegistersPerMultiprocessor`: Maximum number + of 32-bit registers available to a multiprocessor; this number is + shared by all thread blocks simultaneously resident on a + multiprocessor + + - :py:obj:`~.cudaDevAttrManagedMemory`: 1 if device supports allocating + managed memory, 0 if not + + - :py:obj:`~.cudaDevAttrIsMultiGpuBoard`: 1 if device is on a multi-GPU + board, 0 if not + + - :py:obj:`~.cudaDevAttrMultiGpuBoardGroupID`: Unique identifier for a + group of devices on the same multi-GPU board + + - :py:obj:`~.cudaDevAttrHostNativeAtomicSupported`: 1 if the link + between the device and the host supports native atomic operations + + - :py:obj:`~.cudaDevAttrSingleToDoublePrecisionPerfRatio`: Ratio of + single precision performance (in floating-point operations per + second) to double precision performance + + - :py:obj:`~.cudaDevAttrPageableMemoryAccess`: 1 if the device supports + coherently accessing pageable memory without calling cudaHostRegister + on it, and 0 otherwise + + - :py:obj:`~.cudaDevAttrConcurrentManagedAccess`: 1 if the device can + coherently access managed memory concurrently with the CPU, and 0 + otherwise + + - :py:obj:`~.cudaDevAttrComputePreemptionSupported`: 1 if the device + supports Compute Preemption, 0 if not + + - :py:obj:`~.cudaDevAttrCanUseHostPointerForRegisteredMem`: 1 if the + device can access host registered memory at the same virtual address + as the CPU, and 0 otherwise + + - :py:obj:`~.cudaDevAttrCooperativeLaunch`: 1 if the device supports + launching cooperative kernels via + :py:obj:`~.cudaLaunchCooperativeKernel`, and 0 otherwise + + - :py:obj:`~.cudaDevAttrCooperativeMultiDeviceLaunch`: 1 if the device + supports launching cooperative kernels via + :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice`, and 0 otherwise + + - :py:obj:`~.cudaDevAttrCanFlushRemoteWrites`: 1 if the device supports + flushing of outstanding remote writes, and 0 otherwise + + - :py:obj:`~.cudaDevAttrHostRegisterSupported`: 1 if the device + supports host memory registration via :py:obj:`~.cudaHostRegister`, + and 0 otherwise + + - :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`: 1 if + the device accesses pageable memory via the host's page tables, and 0 + otherwise + + - :py:obj:`~.cudaDevAttrDirectManagedMemAccessFromHost`: 1 if the host + can directly access managed memory on the device without migration, + and 0 otherwise + + - :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`: Maximum per + block shared memory size on the device. This value can be opted into + when using :py:obj:`~.cudaFuncSetAttribute` + + - :py:obj:`~.cudaDevAttrMaxBlocksPerMultiprocessor`: Maximum number of + thread blocks that can reside on a multiprocessor + + - :py:obj:`~.cudaDevAttrMaxPersistingL2CacheSize`: Maximum L2 + persisting lines capacity setting in bytes + + - :py:obj:`~.cudaDevAttrMaxAccessPolicyWindowSize`: Maximum value of + :py:obj:`~.cudaAccessPolicyWindow.num_bytes` + + - :py:obj:`~.cudaDevAttrReservedSharedMemoryPerBlock`: Shared memory + reserved by CUDA driver per block in bytes + + - :py:obj:`~.cudaDevAttrSparseCudaArraySupported`: 1 if the device + supports sparse CUDA arrays and sparse CUDA mipmapped arrays. + + - :py:obj:`~.cudaDevAttrHostRegisterReadOnlySupported`: Device supports + using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly + to register memory that must be mapped as read-only to the GPU + + - :py:obj:`~.cudaDevAttrMemoryPoolsSupported`: 1 if the device supports + using the cudaMallocAsync and cudaMemPool family of APIs, and 0 + otherwise + + - :py:obj:`~.cudaDevAttrGPUDirectRDMASupported`: 1 if the device + supports GPUDirect RDMA APIs, and 0 otherwise + + - :py:obj:`~.cudaDevAttrGPUDirectRDMAFlushWritesOptions`: bitmask to be + interpreted according to the + :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum + + - :py:obj:`~.cudaDevAttrGPUDirectRDMAWritesOrdering`: see the + :py:obj:`~.cudaGPUDirectRDMAWritesOrdering` enum for numerical values + + - :py:obj:`~.cudaDevAttrMemoryPoolSupportedHandleTypes`: Bitmask of + handle types supported with mempool based IPC + + - :py:obj:`~.cudaDevAttrDeferredMappingCudaArraySupported` : 1 if the + device supports deferred mapping CUDA arrays and CUDA mipmapped + arrays. + + - :py:obj:`~.cudaDevAttrIpcEventSupport`: 1 if the device supports IPC + Events. + + - :py:obj:`~.cudaDevAttrNumaConfig`: NUMA configuration of a device: + value is of type :py:obj:`~.cudaDeviceNumaConfig` enum + + - :py:obj:`~.cudaDevAttrNumaId`: NUMA node ID of the GPU memory + + - :py:obj:`~.cudaDevAttrGpuPciDeviceId`: The combined 16-bit PCI device + ID and 16-bit PCI vendor ID. + + - :py:obj:`~.cudaDevAttrGpuPciSubsystemId`: The combined 16-bit PCI + subsystem ID and 16-bit PCI vendor subsystem ID. + + Parameters + ---------- + attr : :py:obj:`~.cudaDeviceAttr` + Device attribute to query + device : int + Device number to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` + value : int + Returned device attribute value + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuDeviceGetAttribute` + """ + cdef int value = 0 + cdef cyruntime.cudaDeviceAttr cyattr = int(attr) + with nogil: + err = cyruntime.cudaDeviceGetAttribute(&value, cyattr, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, value) +{{endif}} + +{{if 'cudaDeviceGetDefaultMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetDefaultMemPool(int device): + """ Returns the default mempool of a device. + + The default mempool of a device contains device memory from that + device. + + Parameters + ---------- + device : int + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorNotSupported` + memPool : :py:obj:`~.cudaMemPool_t` + None + + See Also + -------- + :py:obj:`~.cuDeviceGetDefaultMemPool`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaMemPoolTrimTo`, :py:obj:`~.cudaMemPoolGetAttribute`, :py:obj:`~.cudaDeviceSetMemPool`, :py:obj:`~.cudaMemPoolSetAttribute`, :py:obj:`~.cudaMemPoolSetAccess` + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + with nogil: + err = cyruntime.cudaDeviceGetDefaultMemPool(memPool._pvt_ptr, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memPool) +{{endif}} + +{{if 'cudaDeviceSetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSetMemPool(int device, memPool): + """ Sets the current memory pool of a device. + + The memory pool must be local to the specified device. Unless a mempool + is specified in the :py:obj:`~.cudaMallocAsync` call, + :py:obj:`~.cudaMallocAsync` allocates from the current mempool of the + provided stream's device. By default, a device's current memory pool is + its default memory pool. + + Parameters + ---------- + device : int + None + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorInvalidDevice` :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cuDeviceSetMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaMemPoolCreate`, :py:obj:`~.cudaMemPoolDestroy`, :py:obj:`~.cudaMallocFromPoolAsync` + + Notes + ----- + Use :py:obj:`~.cudaMallocFromPoolAsync` to specify asynchronous allocations from a device different than the one the stream runs on. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + with nogil: + err = cyruntime.cudaDeviceSetMemPool(device, cymemPool) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetMemPool' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetMemPool(int device): + """ Gets the current mempool for a device. + + Returns the last pool provided to :py:obj:`~.cudaDeviceSetMemPool` for + this device or the device's default memory pool if + :py:obj:`~.cudaDeviceSetMemPool` has never been called. By default the + current mempool is the default mempool for a device, otherwise the + returned pool must have been set with :py:obj:`~.cuDeviceSetMemPool` or + :py:obj:`~.cudaDeviceSetMemPool`. + + Parameters + ---------- + device : int + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorNotSupported` + memPool : :py:obj:`~.cudaMemPool_t` + None + + See Also + -------- + :py:obj:`~.cuDeviceGetMemPool`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceSetMemPool` + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + with nogil: + err = cyruntime.cudaDeviceGetMemPool(memPool._pvt_ptr, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memPool) +{{endif}} + +{{if 'cudaDeviceGetNvSciSyncAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags): + """ Return NvSciSync attributes that this device can support. + + Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this + CUDA device, `dev` can support. The returned `nvSciSyncAttrList` can be + used to create an NvSciSync that matches this device's capabilities. + + If NvSciSyncAttrKey_RequiredPerm field in `nvSciSyncAttrList` is + already set this API will return :py:obj:`~.cudaErrorInvalidValue`. + + The applications should set `nvSciSyncAttrList` to a valid + NvSciSyncAttrList failing which this API will return + :py:obj:`~.cudaErrorInvalidHandle`. + + The `flags` controls how applications intends to use the NvSciSync + created from the `nvSciSyncAttrList`. The valid flags are: + + - :py:obj:`~.cudaNvSciSyncAttrSignal`, specifies that the applications + intends to signal an NvSciSync on this CUDA device. + + - :py:obj:`~.cudaNvSciSyncAttrWait`, specifies that the applications + intends to wait on an NvSciSync on this CUDA device. + + At least one of these flags must be set, failing which the API returns + :py:obj:`~.cudaErrorInvalidValue`. Both the flags are orthogonal to one + another: a developer may set both these flags that allows to set both + wait and signal specific attributes in the same `nvSciSyncAttrList`. + + Note that this API updates the input `nvSciSyncAttrList` with values + equivalent to the following public attribute key-values: + NvSciSyncAttrKey_RequiredPerm is set to + + - NvSciSyncAccessPerm_SignalOnly if :py:obj:`~.cudaNvSciSyncAttrSignal` + is set in `flags`. + + - NvSciSyncAccessPerm_WaitOnly if :py:obj:`~.cudaNvSciSyncAttrWait` is + set in `flags`. + + - NvSciSyncAccessPerm_WaitSignal if both + :py:obj:`~.cudaNvSciSyncAttrWait` and + :py:obj:`~.cudaNvSciSyncAttrSignal` are set in `flags`. + NvSciSyncAttrKey_PrimitiveInfo is set to + + - NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid `device`. + + - NvSciSyncAttrValPrimitiveType_Syncpoint if `device` is a Tegra + device. + + - NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if `device` + is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is + returned in `cudaDeviceProp.uuid` from + :py:obj:`~.cudaDeviceGetProperties` for this `device`. + + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorDeviceUninitialized`, + :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidHandle`, + :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorNotSupported`, + :py:obj:`~.cudaErrorMemoryAllocation` + + Parameters + ---------- + nvSciSyncAttrList : Any + Return NvSciSync attributes supported. + device : int + Valid Cuda Device to get NvSciSync attributes for. + flags : int + flags describing NvSciSync usage. + + Returns + ------- + cudaError_t + + + See Also + -------- + :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef _HelperInputVoidPtrStruct cynvSciSyncAttrListHelper + cdef void* cynvSciSyncAttrList = _helper_input_void_ptr(nvSciSyncAttrList, &cynvSciSyncAttrListHelper) + with nogil: + err = cyruntime.cudaDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList, device, flags) + _helper_input_void_ptr_free(&cynvSciSyncAttrListHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetP2PAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetP2PAttribute(attr not None : cudaDeviceP2PAttr, int srcDevice, int dstDevice): + """ Queries attributes of the link between two devices. + + Returns in `*value` the value of the requested attribute `attrib` of + the link between `srcDevice` and `dstDevice`. The supported attributes + are: + + - :py:obj:`~.cudaDevP2PAttrPerformanceRank`: A relative value + indicating the performance of the link between two devices. Lower + value means better performance (0 being the value used for most + performant link). + + - :py:obj:`~.cudaDevP2PAttrAccessSupported`: 1 if peer access is + enabled. + + - :py:obj:`~.cudaDevP2PAttrNativeAtomicSupported`: 1 if native atomic + operations over the link are supported. + + - :py:obj:`~.cudaDevP2PAttrCudaArrayAccessSupported`: 1 if accessing + CUDA arrays over the link is supported. + + Returns :py:obj:`~.cudaErrorInvalidDevice` if `srcDevice` or + `dstDevice` are not valid or if they represent the same device. + + Returns :py:obj:`~.cudaErrorInvalidValue` if `attrib` is not valid or + if `value` is a null pointer. + + Parameters + ---------- + attrib : :py:obj:`~.cudaDeviceP2PAttr` + The requested attribute of the link between `srcDevice` and + `dstDevice`. + srcDevice : int + The source device of the target link. + dstDevice : int + The destination device of the target link. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` + value : int + Returned value of the requested attribute + + See Also + -------- + :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cudaDeviceDisablePeerAccess`, :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cuDeviceGetP2PAttribute` + """ + cdef int value = 0 + cdef cyruntime.cudaDeviceP2PAttr cyattr = int(attr) + with nogil: + err = cyruntime.cudaDeviceGetP2PAttribute(&value, cyattr, srcDevice, dstDevice) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, value) +{{endif}} + +{{if 'cudaChooseDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaChooseDevice(prop : Optional[cudaDeviceProp]): + """ Select compute-device which best matches criteria. + + Returns in `*device` the device which has properties that best match + `*prop`. + + Parameters + ---------- + prop : :py:obj:`~.cudaDeviceProp` + Desired device properties + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + device : int + Device with best match + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaChooseDevice(&device, cyprop_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, device) +{{endif}} + +{{if 'cudaInitDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags): + """ Initialize device to be used for GPU executions. + + This function will initialize the CUDA Runtime structures and primary + context on `device` when called, but the context will not be made + current to `device`. + + When :py:obj:`~.cudaInitDeviceFlagsAreValid` is set in `flags`, + deviceFlags are applied to the requested device. The values of + deviceFlags match those of the flags parameters in + :py:obj:`~.cudaSetDeviceFlags`. The effect may be verified by + :py:obj:`~.cudaGetDeviceFlags`. + + This function will return an error if the device is in + :py:obj:`~.cudaComputeModeExclusiveProcess` and is occupied by another + process or if the device is in :py:obj:`~.cudaComputeModeProhibited`. + + Parameters + ---------- + device : int + Device on which the runtime will initialize itself. + deviceFlags : unsigned int + Parameters for device operation. + flags : unsigned int + Flags for controlling the device initialization. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaSetDevice` :py:obj:`~.cuCtxSetCurrent` + """ + with nogil: + err = cyruntime.cudaInitDevice(device, deviceFlags, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaSetDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaSetDevice(int device): + """ Set device to be used for GPU executions. + + Sets `device` as the current device for the calling host thread. Valid + device id's are 0 to (:py:obj:`~.cudaGetDeviceCount()` - 1). + + Any device memory subsequently allocated from this host thread using + :py:obj:`~.cudaMalloc()`, :py:obj:`~.cudaMallocPitch()` or + :py:obj:`~.cudaMallocArray()` will be physically resident on `device`. + Any host memory allocated from this host thread using + :py:obj:`~.cudaMallocHost()` or :py:obj:`~.cudaHostAlloc()` or + :py:obj:`~.cudaHostRegister()` will have its lifetime associated with + `device`. Any streams or events created from this host thread will be + associated with `device`. Any kernels launched from this host thread + using the <<<>>> operator or :py:obj:`~.cudaLaunchKernel()` will be + executed on `device`. + + This call may be made from any host thread, to any device, and at any + time. This function will do no synchronization with the previous or new + device, and should only take significant time when it initializes the + runtime's context state. This call will bind the primary context of the + specified device to the calling thread and all the subsequent memory + allocations, stream and event creations, and kernel launches will be + associated with the primary context. This function will also + immediately initialize the runtime state on the primary context, and + the context will be current on `device` immediately. This function will + return an error if the device is in + :py:obj:`~.cudaComputeModeExclusiveProcess` and is occupied by another + process or if the device is in :py:obj:`~.cudaComputeModeProhibited`. + + It is not required to call :py:obj:`~.cudaInitDevice` before using this + function. + + Parameters + ---------- + device : int + Device on which the active host thread should execute the device + code. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorDeviceUnavailable`, + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuCtxSetCurrent` + """ + with nogil: + err = cyruntime.cudaSetDevice(device) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDevice(): + """ Returns which device is currently being used. + + Returns in `*device` the current device for the calling host thread. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorDeviceUnavailable`, + device : int + Returns the device on which the active host thread executes the + device code. + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cuCtxGetCurrent` + """ + cdef int device = 0 + with nogil: + err = cyruntime.cudaGetDevice(&device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, device) +{{endif}} + +{{if 'cudaSetDeviceFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaSetDeviceFlags(unsigned int flags): + """ Sets flags to be used for device executions. + + Records `flags` as the flags for the current device. If the current + device has been set and that device has already been initialized, the + previous flags are overwritten. If the current device has not been + initialized, it is initialized with the provided flags. If no device + has been made current to the calling thread, a default device is + selected and initialized with the provided flags. + + The three LSBs of the `flags` parameter can be used to control how the + CPU thread interacts with the OS scheduler when waiting for results + from the device. + + - :py:obj:`~.cudaDeviceScheduleAuto`: The default value if the `flags` + parameter is zero, uses a heuristic based on the number of active + CUDA contexts in the process `C` and the number of logical processors + in the system `P`. If `C` > `P`, then CUDA will yield to other OS + threads when waiting for the device, otherwise CUDA will not yield + while waiting for results and actively spin on the processor. + Additionally, on Tegra devices, :py:obj:`~.cudaDeviceScheduleAuto` + uses a heuristic based on the power profile of the platform and may + choose :py:obj:`~.cudaDeviceScheduleBlockingSync` for low-powered + devices. + + - :py:obj:`~.cudaDeviceScheduleSpin`: Instruct CUDA to actively spin + when waiting for results from the device. This can decrease latency + when waiting for the device, but may lower the performance of CPU + threads if they are performing work in parallel with the CUDA thread. + + - :py:obj:`~.cudaDeviceScheduleYield`: Instruct CUDA to yield its + thread when waiting for results from the device. This can increase + latency when waiting for the device, but can increase the performance + of CPU threads performing work in parallel with the device. + + - :py:obj:`~.cudaDeviceScheduleBlockingSync`: Instruct CUDA to block + the CPU thread on a synchronization primitive when waiting for the + device to finish work. + + - :py:obj:`~.cudaDeviceBlockingSync`: Instruct CUDA to block the CPU + thread on a synchronization primitive when waiting for the device to + finish work. :py:obj:`~.Deprecated:` This flag was deprecated as of + CUDA 4.0 and replaced with + :py:obj:`~.cudaDeviceScheduleBlockingSync`. + + - :py:obj:`~.cudaDeviceMapHost`: This flag enables allocating pinned + host memory that is accessible to the device. It is implicit for the + runtime but may be absent if a context is created using the driver + API. If this flag is not set, :py:obj:`~.cudaHostGetDevicePointer()` + will always return a failure code. + + - :py:obj:`~.cudaDeviceLmemResizeToMax`: Instruct CUDA to not reduce + local memory after resizing local memory for a kernel. This can + prevent thrashing by local memory allocations when launching many + kernels with high local memory usage at the cost of potentially + increased memory usage. :py:obj:`~.Deprecated:` This flag is + deprecated and the behavior enabled by this flag is now the default + and cannot be disabled. + + - :py:obj:`~.cudaDeviceSyncMemops`: Ensures that synchronous memory + operations initiated on this context will always synchronize. See + further documentation in the section titled "API Synchronization + behavior" to learn more about cases when synchronous memory + operations can exhibit asynchronous behavior. + + Parameters + ---------- + flags : unsigned int + Parameters for device operation + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGetDeviceFlags`, :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaSetValidDevices`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cuDevicePrimaryCtxSetFlags` + """ + with nogil: + err = cyruntime.cudaSetDeviceFlags(flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetDeviceFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDeviceFlags(): + """ Gets the flags for the current device. + + Returns in `flags` the flags for the current device. If there is a + current device for the calling thread, the flags for the device are + returned. If there is no current device, the flags for the first device + are returned, which may be the default flags. Compare to the behavior + of :py:obj:`~.cudaSetDeviceFlags`. + + Typically, the flags returned should match the behavior that will be + seen if the calling thread uses a device after this call, without any + change to the flags or current device inbetween by this or another + thread. Note that if the device is not initialized, it is possible for + another thread to change the flags for the current device before it is + initialized. Additionally, when using exclusive mode, if this thread + has not requested a specific device, it may use a device other than the + first device, contrary to the assumption made by this function. + + If a context has been created via the driver API and is current to the + calling thread, the flags for that context are always returned. + + Flags returned by this function may specifically include + :py:obj:`~.cudaDeviceMapHost` even though it is not accepted by + :py:obj:`~.cudaSetDeviceFlags` because it is implicit in runtime API + flags. The reason for this is that the current context may have been + created via the driver API in which case the flag is not implicit and + may be unset. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice` + flags : unsigned int + Pointer to store the device flags + + See Also + -------- + :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaSetDeviceFlags`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuDevicePrimaryCtxGetState` + """ + cdef unsigned int flags = 0 + with nogil: + err = cyruntime.cudaGetDeviceFlags(&flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, flags) +{{endif}} + +{{if 'cudaStreamCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamCreate(): + """ Create an asynchronous stream. + + Creates a new asynchronous stream on the context that is current to the + calling host thread. If no context is current to the calling host + thread, then the primary context for a device is selected, made current + to the calling thread, and initialized before creating a stream on it. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pStream : :py:obj:`~.cudaStream_t` + Pointer to new stream identifier + + See Also + -------- + :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cudaStreamGetDevice`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamCreate` + """ + cdef cudaStream_t pStream = cudaStream_t() + with nogil: + err = cyruntime.cudaStreamCreate(pStream._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pStream) +{{endif}} + +{{if 'cudaStreamCreateWithFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamCreateWithFlags(unsigned int flags): + """ Create an asynchronous stream. + + Creates a new asynchronous stream on the context that is current to the + calling host thread. If no context is current to the calling host + thread, then the primary context for a device is selected, made current + to the calling thread, and initialized before creating a stream on it. + The `flags` argument determines the behaviors of the stream. Valid + values for `flags` are + + - :py:obj:`~.cudaStreamDefault`: Default stream creation flag. + + - :py:obj:`~.cudaStreamNonBlocking`: Specifies that work running in the + created stream may run concurrently with work in stream 0 (the NULL + stream), and that the created stream should perform no implicit + synchronization with stream 0. + + Parameters + ---------- + flags : unsigned int + Parameters for stream creation + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pStream : :py:obj:`~.cudaStream_t` + Pointer to new stream identifier + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cudaStreamGetDevice`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamCreate` + """ + cdef cudaStream_t pStream = cudaStream_t() + with nogil: + err = cyruntime.cudaStreamCreateWithFlags(pStream._pvt_ptr, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pStream) +{{endif}} + +{{if 'cudaStreamCreateWithPriority' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamCreateWithPriority(unsigned int flags, int priority): + """ Create an asynchronous stream with the specified priority. + + Creates a stream with the specified priority and returns a handle in + `pStream`. The stream is created on the context that is current to the + calling host thread. If no context is current to the calling host + thread, then the primary context for a device is selected, made current + to the calling thread, and initialized before creating a stream on it. + This affects the scheduling priority of work in the stream. Priorities + provide a hint to preferentially run work with higher priority when + possible, but do not preempt already-running work or provide any other + functional guarantee on execution order. + + `priority` follows a convention where lower numbers represent higher + priorities. '0' represents default priority. The range of meaningful + numerical priorities can be queried using + :py:obj:`~.cudaDeviceGetStreamPriorityRange`. If the specified priority + is outside the numerical range returned by + :py:obj:`~.cudaDeviceGetStreamPriorityRange`, it will automatically be + clamped to the lowest or the highest number in the range. + + Parameters + ---------- + flags : unsigned int + Flags for stream creation. See + :py:obj:`~.cudaStreamCreateWithFlags` for a list of valid flags + that can be passed + priority : int + Priority of the stream. Lower numbers represent higher priorities. + See :py:obj:`~.cudaDeviceGetStreamPriorityRange` for more + information about the meaningful stream priorities that can be + passed. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pStream : :py:obj:`~.cudaStream_t` + Pointer to new stream identifier + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaDeviceGetStreamPriorityRange`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamCreateWithPriority` + + Notes + ----- + Stream priorities are supported only on GPUs with compute capability 3.5 or higher. + + In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream priorities have no effect on host-to-device and device-to-host memory operations. + """ + cdef cudaStream_t pStream = cudaStream_t() + with nogil: + err = cyruntime.cudaStreamCreateWithPriority(pStream._pvt_ptr, flags, priority) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pStream) +{{endif}} + +{{if 'cudaStreamGetPriority' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetPriority(hStream): + """ Query the priority of a stream. + + Query the priority of a stream. The priority is returned in in + `priority`. Note that if the stream was created with a priority outside + the meaningful numerical range returned by + :py:obj:`~.cudaDeviceGetStreamPriorityRange`, this function returns the + clamped priority. See :py:obj:`~.cudaStreamCreateWithPriority` for + details about priority clamping. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + priority : int + Pointer to a signed integer in which the stream's priority is + returned + + See Also + -------- + :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaDeviceGetStreamPriorityRange`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cudaStreamGetDevice`, :py:obj:`~.cuStreamGetPriority` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef int priority = 0 + with nogil: + err = cyruntime.cudaStreamGetPriority(cyhStream, &priority) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, priority) +{{endif}} + +{{if 'cudaStreamGetFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetFlags(hStream): + """ Query the flags of a stream. + + Query the flags of a stream. The flags are returned in `flags`. See + :py:obj:`~.cudaStreamCreateWithFlags` for a list of valid flags. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + flags : unsigned int + Pointer to an unsigned integer in which the stream's flags are + returned + + See Also + -------- + :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cudaStreamGetDevice`, :py:obj:`~.cuStreamGetFlags` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef unsigned int flags = 0 + with nogil: + err = cyruntime.cudaStreamGetFlags(cyhStream, &flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, flags) +{{endif}} + +{{if 'cudaStreamGetId' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetId(hStream): + """ Query the Id of a stream. + + Query the Id of a stream. The Id is returned in `streamId`. The Id is + unique for the life of the program. + + The stream handle `hStream` can refer to any of the following: + + - a stream created via any of the CUDA runtime APIs such as + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags` + and :py:obj:`~.cudaStreamCreateWithPriority`, or their driver API + equivalents such as :py:obj:`~.cuStreamCreate` or + :py:obj:`~.cuStreamCreateWithPriority`. Passing an invalid handle + will result in undefined behavior. + + - any of the special streams such as the NULL stream, + :py:obj:`~.cudaStreamLegacy` and :py:obj:`~.cudaStreamPerThread` + respectively. The driver API equivalents of these are also accepted + which are NULL, :py:obj:`~.CU_STREAM_LEGACY` and + :py:obj:`~.CU_STREAM_PER_THREAD`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + streamId : unsigned long long + Pointer to an unsigned long long in which the stream Id is returned + + See Also + -------- + :py:obj:`~.cudaStreamCreateWithPriority`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cuStreamGetId` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef unsigned long long streamId = 0 + with nogil: + err = cyruntime.cudaStreamGetId(cyhStream, &streamId) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, streamId) +{{endif}} + +{{if 'cudaStreamGetDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetDevice(hStream): + """ Query the device of a stream. + + Returns in `*device` the device of the stream. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Handle to the stream to be queried + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorDeviceUnavailable`, + device : int + Returns the device to which the stream belongs + + See Also + -------- + :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamGetPriority`, :py:obj:`~.cudaStreamGetFlags`, :py:obj:`~.cuStreamGetId` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef int device = 0 + with nogil: + err = cyruntime.cudaStreamGetDevice(cyhStream, &device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, device) +{{endif}} + +{{if 'cudaCtxResetPersistingL2Cache' in found_functions}} + +@cython.embedsignature(True) +def cudaCtxResetPersistingL2Cache(): + """ Resets all persisting lines in cache to normal status. + + Resets all persisting lines in cache to normal status. Takes effect on + function return. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + with nogil: + err = cyruntime.cudaCtxResetPersistingL2Cache() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamCopyAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamCopyAttributes(dst, src): + """ Copies attributes from source stream to destination stream. + + Copies attributes from source stream `src` to destination stream `dst`. + Both streams must have the same context. + + Parameters + ---------- + dst : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Destination stream + src : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Source stream For attributes see :py:obj:`~.cudaStreamAttrID` + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaStream_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaStream_t,driver.CUstream)): + psrc = int(src) + else: + psrc = int(cudaStream_t(src)) + cysrc = psrc + cdef cyruntime.cudaStream_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaStream_t,driver.CUstream)): + pdst = int(dst) + else: + pdst = int(cudaStream_t(dst)) + cydst = pdst + with nogil: + err = cyruntime.cudaStreamCopyAttributes(cydst, cysrc) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamGetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetAttribute(hStream, attr not None : cudaStreamAttrID): + """ Queries stream attribute. + + Queries attribute `attr` from `hStream` and stores it in corresponding + member of `value_out`. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + + attr : :py:obj:`~.cudaStreamAttrID` + + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + value_out : :py:obj:`~.cudaStreamAttrValue` + + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef cyruntime.cudaStreamAttrID cyattr = int(attr) + cdef cudaStreamAttrValue value_out = cudaStreamAttrValue() + with nogil: + err = cyruntime.cudaStreamGetAttribute(cyhStream, cyattr, value_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, value_out) +{{endif}} + +{{if 'cudaStreamSetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Optional[cudaStreamAttrValue]): + """ Sets stream attribute. + + Sets attribute `attr` on `hStream` from corresponding attribute of + `value`. The updated attribute will be applied to subsequent work + submitted to the stream. It will not affect previously submitted work. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + + attr : :py:obj:`~.cudaStreamAttrID` + + value : :py:obj:`~.cudaStreamAttrValue` + + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + 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 + with nogil: + err = cyruntime.cudaStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamDestroy' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamDestroy(stream): + """ Destroys and cleans up an asynchronous stream. + + Destroys and cleans up the asynchronous stream specified by `stream`. + + In case the device is still doing work in the stream `stream` when + :py:obj:`~.cudaStreamDestroy()` is called, the function will return + immediately and the resources associated with `stream` will be released + automatically once the device has completed all work in `stream`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cuStreamDestroy` + """ + 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 + with nogil: + err = cyruntime.cudaStreamDestroy(cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamWaitEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamWaitEvent(stream, event, unsigned int flags): + """ Make a compute stream wait on an event. + + Makes all future work submitted to `stream` wait for all work captured + in `event`. See :py:obj:`~.cudaEventRecord()` for details on what is + captured by an event. The synchronization will be performed efficiently + on the device when applicable. `event` may be from a different device + than `stream`. + + flags include: + + - :py:obj:`~.cudaEventWaitDefault`: Default event creation flag. + + - :py:obj:`~.cudaEventWaitExternal`: Event is captured in the graph as + an external event node when performing stream capture. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to wait + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait on + flags : unsigned int + Parameters for the operation(See above) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamWaitEvent` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + 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 + with nogil: + err = cyruntime.cudaStreamWaitEvent(cystream, cyevent, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamAddCallback' in found_functions}} + +ctypedef struct cudaStreamCallbackData_st: + cyruntime.cudaStreamCallback_t callback + void *userData + +ctypedef cudaStreamCallbackData_st cudaStreamCallbackData + +@cython.show_performance_hints(False) +cdef void cudaStreamRtCallbackWrapper(cyruntime.cudaStream_t stream, cyruntime.cudaError_t status, void *data) nogil: + cdef cudaStreamCallbackData *cbData = data + with gil: + cbData.callback(stream, status, cbData.userData) + free(cbData) + +@cython.embedsignature(True) +def cudaStreamAddCallback(stream, callback, userData, unsigned int flags): + """ Add a callback to a compute stream. + + Adds a callback to be called on the host after all currently enqueued + items in the stream have completed. For each cudaStreamAddCallback + call, a callback will be executed exactly once. The callback will block + later work in the stream until it is finished. + + The callback may be passed :py:obj:`~.cudaSuccess` or an error code. In + the event of a device error, all subsequently executed callbacks will + receive an appropriate :py:obj:`~.cudaError_t`. + + Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs + may result in :py:obj:`~.cudaErrorNotPermitted`. Callbacks must not + perform any synchronization that may depend on outstanding device work + or other callbacks that are not mandated to run earlier. Callbacks + without a mandated order (in independent streams) execute in undefined + order and may be serialized. + + For the purposes of Unified Memory, callback execution makes a number + of guarantees: + + - The callback stream is considered idle for the duration of the + callback. Thus, for example, a callback may always use memory + attached to the callback stream. + + - The start of execution of a callback has the same effect as + synchronizing an event recorded in the same stream immediately prior + to the callback. It thus synchronizes streams which have been + "joined" prior to the callback. + + - Adding device work to any stream does not have the effect of making + the stream active until all preceding callbacks have executed. Thus, + for example, a callback might use global attached memory even if work + has been added to another stream, if it has been properly ordered + with an event. + + - Completion of a callback does not cause a stream to become active + except as described above. The callback stream will remain idle if no + device work follows the callback, and will remain idle across + consecutive callbacks without device work in between. Thus, for + example, stream synchronization can be done by signaling from a + callback at the end of the stream. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to add callback to + callback : :py:obj:`~.cudaStreamCallback_t` + The function to call once preceding stream operations are complete + userData : Any + User specified data to be passed to the callback function + flags : unsigned int + Reserved for future use, must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cudaStreamAttachMemAsync`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cuStreamAddCallback` + + Notes + ----- + This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device error, consider using :py:obj:`~.cudaLaunchHostFunc`. Additionally, this function is not supported with :py:obj:`~.cudaStreamBeginCapture` and :py:obj:`~.cudaStreamEndCapture`, unlike :py:obj:`~.cudaLaunchHostFunc`. + """ + cdef cyruntime.cudaStreamCallback_t cycallback + if callback is None: + pcallback = 0 + elif isinstance(callback, (cudaStreamCallback_t,)): + pcallback = int(callback) + else: + pcallback = int(cudaStreamCallback_t(callback)) + cycallback = pcallback + 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 _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cudaStreamCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (cudaError_t.cudaErrorMemoryAllocation,) + cbData.callback = cycallback + cbData.userData = cyuserData + + with nogil: + err = cyruntime.cudaStreamAddCallback(cystream, cudaStreamRtCallbackWrapper, cbData, flags) + if err != cyruntime.cudaSuccess: + free(cbData) + _helper_input_void_ptr_free(&cyuserDataHelper) + + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamSynchronize' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamSynchronize(stream): + """ Waits for stream tasks to complete. + + Blocks until `stream` has completed all operations. If the + :py:obj:`~.cudaDeviceScheduleBlockingSync` flag was set for this + device, the host thread will block until the stream is finished with + all of its tasks. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamSynchronize` + """ + 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 + with nogil: + err = cyruntime.cudaStreamSynchronize(cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamQuery' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamQuery(stream): + """ Queries an asynchronous stream for completion status. + + Returns :py:obj:`~.cudaSuccess` if all operations in `stream` have + completed, or :py:obj:`~.cudaErrorNotReady` if not. + + For the purposes of Unified Memory, a return value of + :py:obj:`~.cudaSuccess` is equivalent to having called + :py:obj:`~.cudaStreamSynchronize()`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cuStreamQuery` + """ + 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 + with nogil: + err = cyruntime.cudaStreamQuery(cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamAttachMemAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamAttachMemAsync(stream, devPtr, size_t length, unsigned int flags): + """ Attach memory to a stream asynchronously. + + Enqueues an operation in `stream` to specify stream association of + `length` bytes of memory starting from `devPtr`. This function is a + stream-ordered operation, meaning that it is dependent on, and will + only take effect when, previous work in stream has completed. Any + previous association is automatically replaced. + + `devPtr` must point to an one of the following types of memories: + + - managed memory declared using the managed keyword or allocated with + :py:obj:`~.cudaMallocManaged`. + + - a valid host-accessible region of system-allocated pageable memory. + This type of memory may only be specified if the device associated + with the stream reports a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + + For managed allocations, `length` must be either zero or the entire + allocation's size. Both indicate that the entire allocation's stream + association is being changed. Currently, it is not possible to change + stream association for a portion of a managed allocation. + + For pageable allocations, `length` must be non-zero. + + The stream association is specified using `flags` which must be one of + :py:obj:`~.cudaMemAttachGlobal`, :py:obj:`~.cudaMemAttachHost` or + :py:obj:`~.cudaMemAttachSingle`. The default value for `flags` is + :py:obj:`~.cudaMemAttachSingle` If the :py:obj:`~.cudaMemAttachGlobal` + flag is specified, the memory can be accessed by any stream on any + device. If the :py:obj:`~.cudaMemAttachHost` flag is specified, the + program makes a guarantee that it won't access the memory on the device + from any stream on a device that has a zero value for the device + attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. If the + :py:obj:`~.cudaMemAttachSingle` flag is specified and `stream` is + associated with a device that has a zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`, the program makes a + guarantee that it will only access the memory on the device from + `stream`. It is illegal to attach singly to the NULL stream, because + the NULL stream is a virtual global stream and not a specific stream. + An error will be returned in this case. + + When memory is associated with a single stream, the Unified Memory + system will allow CPU access to this memory region so long as all + operations in `stream` have completed, regardless of whether other + streams are active. In effect, this constrains exclusive ownership of + the managed memory region by an active GPU to per-stream activity + instead of whole-GPU activity. + + Accessing memory on the device from streams that are not associated + with it will produce undefined results. No error checking is performed + by the Unified Memory system to ensure that kernels launched into other + streams do not access this region. + + It is a program's responsibility to order calls to + :py:obj:`~.cudaStreamAttachMemAsync` via events, synchronization or + other means to ensure legal access to memory at all times. Data + visibility and coherency will be changed appropriately for all kernels + which follow a stream-association change. + + If `stream` is destroyed while data is associated with it, the + association is removed and the association reverts to the default + visibility of the allocation as specified at + :py:obj:`~.cudaMallocManaged`. For managed variables, the default + association is always :py:obj:`~.cudaMemAttachGlobal`. Note that + destroying a stream is an asynchronous operation, and as a result, the + change to default association won't happen until all work in the stream + has completed. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to enqueue the attach operation + devPtr : Any + Pointer to memory (must be a pointer to managed memory or to a + valid host-accessible region of system-allocated memory) + length : size_t + Length of memory (defaults to zero) + flags : unsigned int + Must be one of :py:obj:`~.cudaMemAttachGlobal`, + :py:obj:`~.cudaMemAttachHost` or :py:obj:`~.cudaMemAttachSingle` + (defaults to :py:obj:`~.cudaMemAttachSingle`) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamCreateWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cuStreamAttachMemAsync` + """ + 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 _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaStreamAttachMemAsync(cystream, cydevPtr, length, flags) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamBeginCapture' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamBeginCapture(stream, mode not None : cudaStreamCaptureMode): + """ Begins graph capture on a stream. + + Begin graph capture on `stream`. When a stream is in capture mode, all + operations pushed into the stream will not be executed, but will + instead be captured into a graph, which will be returned via + :py:obj:`~.cudaStreamEndCapture`. Capture may not be initiated if + `stream` is :py:obj:`~.cudaStreamLegacy`. Capture must be ended on the + same stream in which it was initiated, and it may only be initiated if + the stream is not already in capture mode. The capture mode may be + queried via :py:obj:`~.cudaStreamIsCapturing`. A unique id representing + the capture sequence may be queried via + :py:obj:`~.cudaStreamGetCaptureInfo`. + + If `mode` is not :py:obj:`~.cudaStreamCaptureModeRelaxed`, + :py:obj:`~.cudaStreamEndCapture` must be called on this stream from the + same thread. + + 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`. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamEndCapture`, :py:obj:`~.cudaThreadExchangeStreamCaptureMode` + + Notes + ----- + Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + 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) + with nogil: + err = cyruntime.cudaStreamBeginCapture(cystream, cymode) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamBeginCaptureToGraph' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, mode not None : cudaStreamCaptureMode): + """ Begins graph capture on a stream to an existing graph. + + Begin graph capture on `stream`. When a stream is in capture mode, all + operations pushed into the stream will not be executed, but will + instead be captured into `graph`, which will be returned via + :py:obj:`~.cudaStreamEndCapture`. + + Capture may not be initiated if `stream` is + :py:obj:`~.cudaStreamLegacy`. Capture must be ended on the same stream + in which it was initiated, and it may only be initiated if the stream + is not already in capture mode. The capture mode may be queried via + :py:obj:`~.cudaStreamIsCapturing`. A unique id representing the capture + sequence may be queried via :py:obj:`~.cudaStreamGetCaptureInfo`. + + If `mode` is not :py:obj:`~.cudaStreamCaptureModeRelaxed`, + :py:obj:`~.cudaStreamEndCapture` must be called on this stream from the + same thread. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to initiate capture. + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to capture into. + dependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the first node captured in the stream. Can be NULL + if numDependencies is 0. + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional array of data associated with each dependency. + numDependencies : size_t + Number of dependencies. + 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`. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamEndCapture`, :py:obj:`~.cudaThreadExchangeStreamCaptureMode` + + Notes + ----- + Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.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.cudaGraphNode_t* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cyruntime.cudaGraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cyruntime.cudaGraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + cdef cyruntime.cudaStreamCaptureMode cymode = int(mode) + with nogil: + err = cyruntime.cudaStreamBeginCaptureToGraph(cystream, cygraph, cydependencies, cydependencyData, numDependencies, cymode) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaThreadExchangeStreamCaptureMode' in found_functions}} + +@cython.embedsignature(True) +def cudaThreadExchangeStreamCaptureMode(mode not None : cudaStreamCaptureMode): + """ Swaps the stream capture interaction mode for a thread. + + Sets the calling thread's stream capture interaction mode to the value + contained in `*mode`, and overwrites `*mode` with the previous mode for + the thread. To facilitate deterministic behavior across function or + module boundaries, callers are encouraged to use this API in a push-pop + fashion: + + **View CUDA Toolkit Documentation for a C++ code example** + + During stream capture (see :py:obj:`~.cudaStreamBeginCapture`), some + actions, such as a call to :py:obj:`~.cudaMalloc`, may be unsafe. In + the case of :py:obj:`~.cudaMalloc`, the operation is not enqueued + asynchronously to a stream, and is not observed by stream capture. + Therefore, if the sequence of operations captured via + :py:obj:`~.cudaStreamBeginCapture` depended on the allocation being + replayed whenever the graph is launched, the captured graph would be + invalid. + + Therefore, stream capture places restrictions on API calls that can be + made within or concurrently to a + :py:obj:`~.cudaStreamBeginCapture`-:py:obj:`~.cudaStreamEndCapture` + sequence. This behavior can be controlled via this API and flags to + :py:obj:`~.cudaStreamBeginCapture`. + + A thread's mode is one of the following: + + - `cudaStreamCaptureModeGlobal:` This is the default mode. If the local + thread has an ongoing capture sequence that was not initiated with + `cudaStreamCaptureModeRelaxed` at `cuStreamBeginCapture`, or if any + other thread has a concurrent capture sequence initiated with + `cudaStreamCaptureModeGlobal`, this thread is prohibited from + potentially unsafe API calls. + + - `cudaStreamCaptureModeThreadLocal:` If the local thread has an + ongoing capture sequence not initiated with + `cudaStreamCaptureModeRelaxed`, it is prohibited from potentially + unsafe API calls. Concurrent capture sequences in other threads are + ignored. + + - `cudaStreamCaptureModeRelaxed:` The local thread is not prohibited + from potentially unsafe API calls. Note that the thread is still + prohibited from API calls which necessarily conflict with stream + capture, for example, attempting :py:obj:`~.cudaEventQuery` on an + event that was last recorded inside a capture sequence. + + Parameters + ---------- + mode : :py:obj:`~.cudaStreamCaptureMode` + Pointer to mode value to swap with the current mode + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + mode : :py:obj:`~.cudaStreamCaptureMode` + Pointer to mode value to swap with the current mode + + See Also + -------- + :py:obj:`~.cudaStreamBeginCapture` + """ + cdef cyruntime.cudaStreamCaptureMode cymode = int(mode) + with nogil: + err = cyruntime.cudaThreadExchangeStreamCaptureMode(&cymode) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaStreamCaptureMode(cymode)) +{{endif}} + +{{if 'cudaStreamEndCapture' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamEndCapture(stream): + """ Ends capture on a stream, returning the captured graph. + + End capture on `stream`, returning the captured graph via `pGraph`. + Capture must have been initiated on `stream` via a call to + :py:obj:`~.cudaStreamBeginCapture`. If capture was invalidated, due to + a violation of the rules of stream capture, then a NULL graph will be + returned. + + If the `mode` argument to :py:obj:`~.cudaStreamBeginCapture` was not + :py:obj:`~.cudaStreamCaptureModeRelaxed`, this call must be from the + same thread as :py:obj:`~.cudaStreamBeginCapture`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorStreamCaptureWrongThread` + pGraph : :py:obj:`~.cudaGraph_t` + The captured graph + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaGraphDestroy` + """ + 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 cudaGraph_t pGraph = cudaGraph_t() + with nogil: + err = cyruntime.cudaStreamEndCapture(cystream, pGraph._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraph) +{{endif}} + +{{if 'cudaStreamIsCapturing' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamIsCapturing(stream): + """ Returns a stream's capture status. + + Return the capture status of `stream` via `pCaptureStatus`. After a + successful call, `*pCaptureStatus` will contain one of the following: + + - :py:obj:`~.cudaStreamCaptureStatusNone`: The stream is not capturing. + + - :py:obj:`~.cudaStreamCaptureStatusActive`: The stream is capturing. + + - :py:obj:`~.cudaStreamCaptureStatusInvalidated`: The stream was + capturing but an error has invalidated the capture sequence. The + capture sequence must be terminated with + :py:obj:`~.cudaStreamEndCapture` on the stream where it was initiated + in order to continue using `stream`. + + Note that, if this is called on :py:obj:`~.cudaStreamLegacy` (the "null + stream") while a blocking stream on the same device is capturing, it + will return :py:obj:`~.cudaErrorStreamCaptureImplicit` and + `*pCaptureStatus` is unspecified after the call. The blocking stream + capture is not invalidated. + + When a blocking stream is capturing, the legacy stream is in an + unusable state until the blocking stream capture is terminated. The + legacy stream is not supported for stream capture, but attempted use + would have an implicit dependency on the capturing stream(s). + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorStreamCaptureImplicit` + pCaptureStatus : :py:obj:`~.cudaStreamCaptureStatus` + Returns the stream's capture status + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamEndCapture` + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef cyruntime.cudaStreamCaptureStatus pCaptureStatus + with nogil: + err = cyruntime.cudaStreamIsCapturing(cystream, &pCaptureStatus) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaStreamCaptureStatus(pCaptureStatus)) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetCaptureInfo(stream): + """ Query a stream's capture state. + + Query stream state related to stream capture. + + If called on :py:obj:`~.cudaStreamLegacy` (the "null stream") while a + stream not created with :py:obj:`~.cudaStreamNonBlocking` is capturing, + returns :py:obj:`~.cudaErrorStreamCaptureImplicit`. + + Valid data (other than capture status) is returned only if both of the + following are true: + + - the call returns cudaSuccess + + - the returned capture status is + :py:obj:`~.cudaStreamCaptureStatusActive` + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorStreamCaptureImplicit` + captureStatus_out : :py:obj:`~.cudaStreamCaptureStatus` + Location to return the capture status of the stream; required + id_out : unsigned long long + Optional location to return an id for the capture sequence, which + is unique over the lifetime of the process + graph_out : :py:obj:`~.cudaGraph_t` + Optional location to return the graph being captured into. All + operations other than destroy and node removal are permitted on the + graph while the capture sequence is in progress. This API does not + transfer ownership of the graph, which is transferred or destroyed + at :py:obj:`~.cudaStreamEndCapture`. Note that the graph handle may + be invalidated before end of capture for certain errors. Nodes that + are or become unreachable from the original stream at + :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph + do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. + dependencies_out : list[:py:obj:`~.cudaGraphNode_t`] + Optional location to store a pointer to an array of nodes. The next + node to be captured in the stream will depend on this set of nodes, + absent operations such as event wait which modify this set. The + array pointer is valid until the next API call which operates on + the stream or until the capture is terminated. The node handles may + be copied out and are valid until they or the graph is destroyed. + The driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. + numDependencies_out : int + Optional location to store the size of the array returned in + dependencies_out. + + See Also + -------- + :py:obj:`~.cudaStreamGetCaptureInfo_v3`, :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamUpdateCaptureDependencies` + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef cyruntime.cudaStreamCaptureStatus captureStatus_out + cdef unsigned long long id_out = 0 + cdef cudaGraph_t graph_out = cudaGraph_t() + cdef const cyruntime.cudaGraphNode_t* cydependencies_out = NULL + pydependencies_out = [] + cdef size_t numDependencies_out = 0 + with nogil: + err = cyruntime.cudaStreamGetCaptureInfo(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) + if cudaError_t(err) == cudaError_t(0): + pydependencies_out = [cudaGraphNode_t() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None, None, None, None) + return (_cudaError_t_SUCCESS, cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) +{{endif}} + +{{if 'cudaStreamGetCaptureInfo_v3' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamGetCaptureInfo_v3(stream): + """ Query a stream's capture state (12.3+). + + Query stream state related to stream capture. + + If called on :py:obj:`~.cudaStreamLegacy` (the "null stream") while a + stream not created with :py:obj:`~.cudaStreamNonBlocking` is capturing, + returns :py:obj:`~.cudaErrorStreamCaptureImplicit`. + + Valid data (other than capture status) is returned only if both of the + following are true: + + - the call returns cudaSuccess + + - the returned capture status is + :py:obj:`~.cudaStreamCaptureStatusActive` + + If `edgeData_out` is non-NULL then `dependencies_out` must be as well. + If `dependencies_out` is non-NULL and `edgeData_out` is NULL, but there + is non-zero edge data for one or more of the current stream + dependencies, the call will return :py:obj:`~.cudaErrorLossyQuery`. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorStreamCaptureImplicit`, :py:obj:`~.cudaErrorLossyQuery` + captureStatus_out : :py:obj:`~.cudaStreamCaptureStatus` + Location to return the capture status of the stream; required + id_out : unsigned long long + Optional location to return an id for the capture sequence, which + is unique over the lifetime of the process + graph_out : :py:obj:`~.cudaGraph_t` + Optional location to return the graph being captured into. All + operations other than destroy and node removal are permitted on the + graph while the capture sequence is in progress. This API does not + transfer ownership of the graph, which is transferred or destroyed + at :py:obj:`~.cudaStreamEndCapture`. Note that the graph handle may + be invalidated before end of capture for certain errors. Nodes that + are or become unreachable from the original stream at + :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph + do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. + dependencies_out : list[:py:obj:`~.cudaGraphNode_t`] + Optional location to store a pointer to an array of nodes. The next + node to be captured in the stream will depend on this set of nodes, + absent operations such as event wait which modify this set. The + array pointer is valid until the next API call which operates on + the stream or until the capture is terminated. The node handles may + be copied out and are valid until they or the graph is destroyed. + The driver-owned array may also be passed directly to APIs that + operate on the graph (not the stream) without copying. + edgeData_out : list[:py:obj:`~.cudaGraphEdgeData`] + Optional location to store a pointer to an array of graph edge + data. This array parallels `dependencies_out`; the next node to be + added has an edge to `dependencies_out`[i] with annotation + `edgeData_out`[i] for each `i`. The array pointer is valid until + the next API call which operates on the stream or until the capture + is terminated. + numDependencies_out : int + Optional location to store the size of the array returned in + dependencies_out. + + See Also + -------- + :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamUpdateCaptureDependencies` + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef cyruntime.cudaStreamCaptureStatus captureStatus_out + cdef unsigned long long id_out = 0 + cdef cudaGraph_t graph_out = cudaGraph_t() + cdef const cyruntime.cudaGraphNode_t* cydependencies_out = NULL + pydependencies_out = [] + cdef const cyruntime.cudaGraphEdgeData* cyedgeData_out = NULL + pyedgeData_out = [] + cdef size_t numDependencies_out = 0 + with nogil: + err = cyruntime.cudaStreamGetCaptureInfo_v3(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) + if cudaError_t(err) == cudaError_t(0): + 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() 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) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream (11.3+). + + Modifies the dependency set of a capturing stream. The dependency set + is the set of nodes that the next captured node in the stream will + depend on. + + Valid flags are :py:obj:`~.cudaStreamAddCaptureDependencies` and + :py:obj:`~.cudaStreamSetCaptureDependencies`. These control whether the + set passed to the API is added to the existing set or replaces it. A + flags value of 0 defaults to + :py:obj:`~.cudaStreamAddCaptureDependencies`. + + Nodes that are removed from the dependency set via this API do not + result in :py:obj:`~.cudaErrorStreamCaptureUnjoined` if they are + unreachable from the stream at :py:obj:`~.cudaStreamEndCapture`. + + Returns :py:obj:`~.cudaErrorIllegalState` if the stream is not + capturing. + + This API is new in CUDA 11.3. Developers requiring compatibility across + minor versions of the CUDA driver to 11.0 should not use this API or + provide a fallback. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to update + dependencies : list[:py:obj:`~.cudaGraphNode_t`] + The set of dependencies to add + numDependencies : size_t + The size of the dependencies array + flags : unsigned int + See above + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorIllegalState` + + See Also + -------- + :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamGetCaptureInfo`, + """ + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef cyruntime.cudaGraphNode_t* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaStreamUpdateCaptureDependencies(cystream, cydependencies, numDependencies, flags) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): + """ Update the set of dependencies in a capturing stream (12.3+). + + Modifies the dependency set of a capturing stream. The dependency set + is the set of nodes that the next captured node in the stream will + depend on. + + Valid flags are :py:obj:`~.cudaStreamAddCaptureDependencies` and + :py:obj:`~.cudaStreamSetCaptureDependencies`. These control whether the + set passed to the API is added to the existing set or replaces it. A + flags value of 0 defaults to + :py:obj:`~.cudaStreamAddCaptureDependencies`. + + Nodes that are removed from the dependency set via this API do not + result in :py:obj:`~.cudaErrorStreamCaptureUnjoined` if they are + unreachable from the stream at :py:obj:`~.cudaStreamEndCapture`. + + Returns :py:obj:`~.cudaErrorIllegalState` if the stream is not + capturing. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to update + dependencies : list[:py:obj:`~.cudaGraphNode_t`] + The set of dependencies to add + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional array of data associated with each dependency. + numDependencies : size_t + The size of the dependencies array + flags : unsigned int + See above + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorIllegalState` + + See Also + -------- + :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamGetCaptureInfo`, + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef cyruntime.cudaGraphNode_t* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cyruntime.cudaGraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cyruntime.cudaGraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + with nogil: + err = cyruntime.cudaStreamUpdateCaptureDependencies_v2(cystream, cydependencies, cydependencyData, numDependencies, flags) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaEventCreate(): + """ Creates an event object. + + Creates an event object for the current device using + :py:obj:`~.cudaEventDefault`. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorMemoryAllocation` + event : :py:obj:`~.cudaEvent_t` + Newly created event + + See Also + -------- + cudaEventCreate (C++ API), :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cuEventCreate` + """ + cdef cudaEvent_t event = cudaEvent_t() + with nogil: + err = cyruntime.cudaEventCreate(event._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, event) +{{endif}} + +{{if 'cudaEventCreateWithFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaEventCreateWithFlags(unsigned int flags): + """ Creates an event object with the specified flags. + + Creates an event object for the current device with the specified + flags. Valid flags include: + + - :py:obj:`~.cudaEventDefault`: Default event creation flag. + + - :py:obj:`~.cudaEventBlockingSync`: Specifies that event should use + blocking synchronization. A host thread that uses + :py:obj:`~.cudaEventSynchronize()` to wait on an event created with + this flag will block until the event actually completes. + + - :py:obj:`~.cudaEventDisableTiming`: Specifies that the created event + does not need to record timing data. Events created with this flag + specified and the :py:obj:`~.cudaEventBlockingSync` flag not + specified will provide the best performance when used with + :py:obj:`~.cudaStreamWaitEvent()` and :py:obj:`~.cudaEventQuery()`. + + - :py:obj:`~.cudaEventInterprocess`: Specifies that the created event + may be used as an interprocess event by + :py:obj:`~.cudaIpcGetEventHandle()`. + :py:obj:`~.cudaEventInterprocess` must be specified along with + :py:obj:`~.cudaEventDisableTiming`. + + Parameters + ---------- + flags : unsigned int + Flags for new event + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorMemoryAllocation` + event : :py:obj:`~.cudaEvent_t` + Newly created event + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cuEventCreate` + """ + cdef cudaEvent_t event = cudaEvent_t() + with nogil: + err = cyruntime.cudaEventCreateWithFlags(event._pvt_ptr, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, event) +{{endif}} + +{{if 'cudaEventRecord' in found_functions}} + +@cython.embedsignature(True) +def cudaEventRecord(event, stream): + """ Records an event. + + Captures in `event` the contents of `stream` at the time of this call. + `event` and `stream` must be on the same CUDA context. Calls such as + :py:obj:`~.cudaEventQuery()` or :py:obj:`~.cudaStreamWaitEvent()` will + then examine or wait for completion of the work that was captured. Uses + of `stream` after this call do not modify `event`. See note on default + stream behavior for what is captured in the default case. + + :py:obj:`~.cudaEventRecord()` can be called multiple times on the same + event and will overwrite the previously captured state. Other APIs such + as :py:obj:`~.cudaStreamWaitEvent()` use the most recently captured + state at the time of the API call, and are not affected by later calls + to :py:obj:`~.cudaEventRecord()`. Before the first call to + :py:obj:`~.cudaEventRecord()`, an event represents an empty set of + work, so for example :py:obj:`~.cudaEventQuery()` would return + :py:obj:`~.cudaSuccess`. + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to record event + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure` + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cuEventRecord` + """ + 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.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + with nogil: + err = cyruntime.cudaEventRecord(cyevent, cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventRecordWithFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaEventRecordWithFlags(event, stream, unsigned int flags): + """ Records an event. + + Captures in `event` the contents of `stream` at the time of this call. + `event` and `stream` must be on the same CUDA context. Calls such as + :py:obj:`~.cudaEventQuery()` or :py:obj:`~.cudaStreamWaitEvent()` will + then examine or wait for completion of the work that was captured. Uses + of `stream` after this call do not modify `event`. See note on default + stream behavior for what is captured in the default case. + + :py:obj:`~.cudaEventRecordWithFlags()` can be called multiple times on + the same event and will overwrite the previously captured state. Other + APIs such as :py:obj:`~.cudaStreamWaitEvent()` use the most recently + captured state at the time of the API call, and are not affected by + later calls to :py:obj:`~.cudaEventRecordWithFlags()`. Before the first + call to :py:obj:`~.cudaEventRecordWithFlags()`, an event represents an + empty set of work, so for example :py:obj:`~.cudaEventQuery()` would + return :py:obj:`~.cudaSuccess`. + + flags include: + + - :py:obj:`~.cudaEventRecordDefault`: Default event creation flag. + + - :py:obj:`~.cudaEventRecordExternal`: Event is captured in the graph + as an external event node when performing stream capture. + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to record + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to record event + flags : unsigned int + Parameters for the operation(See above) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure` + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cuEventRecord`, + """ + 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.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + with nogil: + err = cyruntime.cudaEventRecordWithFlags(cyevent, cystream, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventQuery' in found_functions}} + +@cython.embedsignature(True) +def cudaEventQuery(event): + """ Queries an event's status. + + Queries the status of all work currently captured by `event`. See + :py:obj:`~.cudaEventRecord()` for details on what is captured by an + event. + + Returns :py:obj:`~.cudaSuccess` if all captured work has been + completed, or :py:obj:`~.cudaErrorNotReady` if any captured work is + incomplete. + + For the purposes of Unified Memory, a return value of + :py:obj:`~.cudaSuccess` is equivalent to having called + :py:obj:`~.cudaEventSynchronize()`. + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure` + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cuEventQuery` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + with nogil: + err = cyruntime.cudaEventQuery(cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventSynchronize' in found_functions}} + +@cython.embedsignature(True) +def cudaEventSynchronize(event): + """ Waits for an event to complete. + + Waits until the completion of all work currently captured in `event`. + See :py:obj:`~.cudaEventRecord()` for details on what is captured by an + event. + + Waiting for an event that was created with the + :py:obj:`~.cudaEventBlockingSync` flag will cause the calling CPU + thread to block until the event has been completed by the device. If + the :py:obj:`~.cudaEventBlockingSync` flag has not been set, then the + CPU thread will busy-wait until the event has been completed by the + device. + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to wait for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure` + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cuEventSynchronize` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + with nogil: + err = cyruntime.cudaEventSynchronize(cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventDestroy' in found_functions}} + +@cython.embedsignature(True) +def cudaEventDestroy(event): + """ Destroys an event object. + + Destroys the event specified by `event`. + + An event may be destroyed before it is complete (i.e., while + :py:obj:`~.cudaEventQuery()` would return + :py:obj:`~.cudaErrorNotReady`). In this case, the call does not block + on completion of the event, and any associated resources will + automatically be released asynchronously at completion. + + Parameters + ---------- + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to destroy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure` + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cudaEventElapsedTime`, :py:obj:`~.cuEventDestroy` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + with nogil: + err = cyruntime.cudaEventDestroy(cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaEventElapsedTime' in found_functions}} + +@cython.embedsignature(True) +def cudaEventElapsedTime(start, end): + """ Computes the elapsed time between events. + + Computes the elapsed time between two events (in milliseconds with a + resolution of around 0.5 microseconds). + + If either event was last recorded in a non-NULL stream, the resulting + time may be greater than expected (even if both used the same stream + handle). This happens because the :py:obj:`~.cudaEventRecord()` + operation takes place asynchronously and there is no guarantee that the + measured latency is actually just between the two events. Any number of + other different stream operations could execute in between the two + measured events, thus altering the timing in a significant way. + + If :py:obj:`~.cudaEventRecord()` has not been called on either event, + then :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. If + :py:obj:`~.cudaEventRecord()` has been called on both events but one or + both of them has not yet been completed (that is, + :py:obj:`~.cudaEventQuery()` would return :py:obj:`~.cudaErrorNotReady` + on at least one of the events), :py:obj:`~.cudaErrorNotReady` is + returned. If either event was created with the + :py:obj:`~.cudaEventDisableTiming` flag, then this function will return + :py:obj:`~.cudaErrorInvalidResourceHandle`. + + Parameters + ---------- + start : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Starting event + end : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Ending event + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorUnknown` + ms : float + Time between `start` and `end` in ms + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cuEventElapsedTime` + """ + cdef cyruntime.cudaEvent_t cyend + if end is None: + pend = 0 + elif isinstance(end, (cudaEvent_t,driver.CUevent)): + pend = int(end) + else: + pend = int(cudaEvent_t(end)) + cyend = pend + cdef cyruntime.cudaEvent_t cystart + if start is None: + pstart = 0 + elif isinstance(start, (cudaEvent_t,driver.CUevent)): + pstart = int(start) + else: + pstart = int(cudaEvent_t(start)) + cystart = pstart + cdef float ms = 0 + with nogil: + err = cyruntime.cudaEventElapsedTime(&ms, cystart, cyend) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ms) +{{endif}} + +{{if 'cudaEventElapsedTime_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaEventElapsedTime_v2(start, end): + """ Computes the elapsed time between events. + + Computes the elapsed time between two events (in milliseconds with a + resolution of around 0.5 microseconds). Note this API is not guaranteed + to return the latest errors for pending work. As such this API is + intended to serve as a elapsed time calculation only and polling for + completion on the events to be compared should be done with + :py:obj:`~.cudaEventQuery` instead. + + If either event was last recorded in a non-NULL stream, the resulting + time may be greater than expected (even if both used the same stream + handle). This happens because the :py:obj:`~.cudaEventRecord()` + operation takes place asynchronously and there is no guarantee that the + measured latency is actually just between the two events. Any number of + other different stream operations could execute in between the two + measured events, thus altering the timing in a significant way. + + If :py:obj:`~.cudaEventRecord()` has not been called on either event, + then :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. If + :py:obj:`~.cudaEventRecord()` has been called on both events but one or + both of them has not yet been completed (that is, + :py:obj:`~.cudaEventQuery()` would return :py:obj:`~.cudaErrorNotReady` + on at least one of the events), :py:obj:`~.cudaErrorNotReady` is + returned. If either event was created with the + :py:obj:`~.cudaEventDisableTiming` flag, then this function will return + :py:obj:`~.cudaErrorInvalidResourceHandle`. + + Parameters + ---------- + start : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Starting event + end : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Ending event + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotReady`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorUnknown` + ms : float + Time between `start` and `end` in ms + + See Also + -------- + :py:obj:`~.cudaEventCreate (C API)`, :py:obj:`~.cudaEventCreateWithFlags`, :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy`, :py:obj:`~.cudaEventRecord`, :py:obj:`~.cuEventElapsedTime` + """ + cdef cyruntime.cudaEvent_t cyend + if end is None: + pend = 0 + elif isinstance(end, (cudaEvent_t,driver.CUevent)): + pend = int(end) + else: + pend = int(cudaEvent_t(end)) + cyend = pend + cdef cyruntime.cudaEvent_t cystart + if start is None: + pstart = 0 + elif isinstance(start, (cudaEvent_t,driver.CUevent)): + pstart = int(start) + else: + pstart = int(cudaEvent_t(start)) + cystart = pstart + cdef float ms = 0 + with nogil: + err = cyruntime.cudaEventElapsedTime_v2(&ms, cystart, cyend) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ms) +{{endif}} + +{{if 'cudaImportExternalMemory' in found_functions}} + +@cython.embedsignature(True) +def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDesc]): + """ Imports an external memory object. + + Imports an externally allocated memory object and returns a handle to + that in `extMem_out`. + + The properties of the handle being imported must be described in + `memHandleDesc`. The :py:obj:`~.cudaExternalMemoryHandleDesc` structure + is defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaExternalMemoryHandleDesc.type` specifies the type + of handle being imported. :py:obj:`~.cudaExternalMemoryHandleType` is + defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + 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 + 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. + + 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. + + 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 + 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 + 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 + 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. + + 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 + 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 + application must use :py:obj:`~.cudaWaitExternalSemaphoresAsync` or + :py:obj:`~.cudaSignalExternalSemaphoresAsync` as approprriate barriers + to maintain coherence between CUDA and the other drivers. See + :py:obj:`~.cudaExternalSemaphoreWaitSkipNvSciBufMemSync` and + :py:obj:`~.cudaExternalSemaphoreSignalSkipNvSciBufMemSync` for memory + synchronization. + + The size of the memory object must be specified in + :py:obj:`~.cudaExternalMemoryHandleDesc.size`. + + Specifying the flag :py:obj:`~.cudaExternalMemoryDedicated` in + :py:obj:`~.cudaExternalMemoryHandleDesc.flags` indicates that the + resource is a dedicated resource. The definition of what a dedicated + resource is outside the scope of this extension. This flag must be set + if :py:obj:`~.cudaExternalMemoryHandleDesc.type` is one of the + following: :py:obj:`~.cudaExternalMemoryHandleTypeD3D12Resource` + :py:obj:`~.cudaExternalMemoryHandleTypeD3D11Resource` + :py:obj:`~.cudaExternalMemoryHandleTypeD3D11ResourceKmt` + + Parameters + ---------- + memHandleDesc : :py:obj:`~.cudaExternalMemoryHandleDesc` + Memory import handle descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorOperatingSystem` + extMem_out : :py:obj:`~.cudaExternalMemory_t` + Returned handle to an external memory object + + See Also + -------- + :py:obj:`~.cudaDestroyExternalMemory`, :py:obj:`~.cudaExternalMemoryGetMappedBuffer`, :py:obj:`~.cudaExternalMemoryGetMappedMipmappedArray` + + Notes + ----- + If the Vulkan memory imported into CUDA is mapped on the CPU then the application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges as well as appropriate Vulkan pipeline barriers to maintain coherence between CPU and GPU. For more information on these APIs, please refer to "Synchronization + 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 + with nogil: + err = cyruntime.cudaImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, extMem_out) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedBuffer' in found_functions}} + +@cython.embedsignature(True) +def cudaExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[cudaExternalMemoryBufferDesc]): + """ Maps a buffer onto an imported memory object. + + Maps a buffer onto an imported memory object and returns a device + pointer in `devPtr`. + + The properties of the buffer being mapped must be described in + `bufferDesc`. The :py:obj:`~.cudaExternalMemoryBufferDesc` structure is + defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaExternalMemoryBufferDesc.offset` is the offset in + the memory object where the buffer's base address is. + :py:obj:`~.cudaExternalMemoryBufferDesc.size` is the size of the + buffer. :py:obj:`~.cudaExternalMemoryBufferDesc.flags` must be zero. + + The offset and size have to be suitably aligned to match the + requirements of the external API. Mapping two buffers whose ranges + overlap may or may not result in the same virtual address being + returned for the overlapped portion. In such cases, the application + must ensure that all accesses to that region from the GPU are volatile. + Otherwise writes made via one address are not guaranteed to be visible + via the other address, even if they're issued by the same thread. It is + recommended that applications map the combined range instead of mapping + separate buffers and then apply the appropriate offsets to the returned + pointer to derive the individual buffers. + + The returned pointer `devPtr` must be freed using :py:obj:`~.cudaFree`. + + Parameters + ---------- + extMem : :py:obj:`~.cudaExternalMemory_t` + Handle to external memory object + bufferDesc : :py:obj:`~.cudaExternalMemoryBufferDesc` + Buffer descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + devPtr : Any + Returned device pointer to buffer + + See Also + -------- + :py:obj:`~.cudaImportExternalMemory`, :py:obj:`~.cudaDestroyExternalMemory`, :py:obj:`~.cudaExternalMemoryGetMappedMipmappedArray` + """ + cdef cyruntime.cudaExternalMemory_t cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (cudaExternalMemory_t,)): + pextMem = int(extMem) + else: + 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 + with nogil: + err = cyruntime.cudaExternalMemoryGetMappedBuffer(&devPtr, cyextMem, cybufferDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, devPtr) +{{endif}} + +{{if 'cudaExternalMemoryGetMappedMipmappedArray' in found_functions}} + +@cython.embedsignature(True) +def cudaExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[cudaExternalMemoryMipmappedArrayDesc]): + """ Maps a CUDA mipmapped array onto an external memory object. + + Maps a CUDA mipmapped array onto an external object and returns a + handle to it in `mipmap`. + + The properties of the CUDA mipmapped array being mapped must be + described in `mipmapDesc`. The structure + :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc` is defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.offset` is the + offset in the memory object where the base level of the mipmap chain + is. :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.formatDesc` + describes the format of the data. + :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.extent` specifies the + dimensions of the base level of the mipmap chain. + :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.flags` are flags + associated with CUDA mipmapped arrays. For further details, please + refer to the documentation for :py:obj:`~.cudaMalloc3DArray`. Note that + if the mipmapped array is bound as a color target in the graphics API, + then the flag :py:obj:`~.cudaArrayColorAttachment` must be specified in + :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.flags`. + :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.numLevels` specifies + the total number of levels in the mipmap chain. + + The returned CUDA mipmapped array must be freed using + :py:obj:`~.cudaFreeMipmappedArray`. + + Parameters + ---------- + extMem : :py:obj:`~.cudaExternalMemory_t` + Handle to external memory object + mipmapDesc : :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc` + CUDA array descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + mipmap : :py:obj:`~.cudaMipmappedArray_t` + Returned CUDA mipmapped array + + See Also + -------- + :py:obj:`~.cudaImportExternalMemory`, :py:obj:`~.cudaDestroyExternalMemory`, :py:obj:`~.cudaExternalMemoryGetMappedBuffer` + + Notes + ----- + If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, then :py:obj:`~.cudaExternalMemoryMipmappedArrayDesc.numLevels` must not be greater than 1. + """ + cdef cyruntime.cudaExternalMemory_t cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (cudaExternalMemory_t,)): + pextMem = int(extMem) + else: + 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 + with nogil: + err = cyruntime.cudaExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, mipmap) +{{endif}} + +{{if 'cudaDestroyExternalMemory' in found_functions}} + +@cython.embedsignature(True) +def cudaDestroyExternalMemory(extMem): + """ Destroys an external memory object. + + Destroys the specified external memory object. Any existing buffers and + CUDA mipmapped arrays mapped onto this object must no longer be used + and must be explicitly freed using :py:obj:`~.cudaFree` and + :py:obj:`~.cudaFreeMipmappedArray` respectively. + + Parameters + ---------- + extMem : :py:obj:`~.cudaExternalMemory_t` + External memory object to be destroyed + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaImportExternalMemory`, :py:obj:`~.cudaExternalMemoryGetMappedBuffer`, :py:obj:`~.cudaExternalMemoryGetMappedMipmappedArray` + """ + cdef cyruntime.cudaExternalMemory_t cyextMem + if extMem is None: + pextMem = 0 + elif isinstance(extMem, (cudaExternalMemory_t,)): + pextMem = int(extMem) + else: + pextMem = int(cudaExternalMemory_t(extMem)) + cyextMem = pextMem + with nogil: + err = cyruntime.cudaDestroyExternalMemory(cyextMem) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaImportExternalSemaphore' in found_functions}} + +@cython.embedsignature(True) +def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHandleDesc]): + """ Imports an external semaphore. + + Imports an externally allocated synchronization object and returns a + handle to that in `extSem_out`. + + The properties of the handle being imported must be described in + `semHandleDesc`. The :py:obj:`~.cudaExternalSemaphoreHandleDesc` is + defined as follows: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` specifies the + type of handle being imported. + :py:obj:`~.cudaExternalSemaphoreHandleType` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueFd`, then + :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 + after it is imported results in undefined behavior. + + 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 + 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. + + 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. + + 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 + 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 + 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` + 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. + + 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 + 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 + 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:`~.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 + NULL, then it must name a valid synchronization object. + + Parameters + ---------- + semHandleDesc : :py:obj:`~.cudaExternalSemaphoreHandleDesc` + Semaphore import handle descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorOperatingSystem` + extSem_out : :py:obj:`~.cudaExternalSemaphore_t` + Returned handle to an external semaphore + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, extSem_out) +{{endif}} + +{{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreSignalParams] | list[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): + """ Signals a set of external semaphore objects. + + Enqueues a signal operation on a set of externally allocated semaphore + object in the specified stream. The operations will be executed when + all prior operations in the stream complete. + + The exact semantics of signaling a semaphore depends on the type of the + object. + + If the semaphore object is any one of the following types: + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueFd`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt` then + signaling the semaphore will set it to the signaled state. + + If the semaphore object is any one of the following types: + :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D12Fence`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D11Fence`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32` then + the semaphore will be set to the value specified in + :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 + object to order operations with those currently submitted in `stream`. + Such an update will overwrite previous contents of + :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 + :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`. This ensures that any + subsequent accesses made by other importers of the same set of NvSciBuf + memory object(s) are coherent. These operations can be skipped by + specifying the flag + :py:obj:`~.cudaExternalSemaphoreSignalSkipNvSciBufMemSync`, which can + be used as a performance optimization when data coherency is not + required. But specifying this flag in scenarios where data coherency is + required results in undefined behavior. Also, for semaphore object of + the type :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync`, if the + NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags + in :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` to + cudaNvSciSyncAttrSignal, this API will return cudaErrorNotSupported. + + :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 + semaphore object must have value of + NvSciSyncAttrKey_RequireDeterministicFences key set to true. + Deterministic fences allow users to enqueue a wait over the semaphore + object even before corresponding signal is enqueued. For such a + semaphore object, CUDA guarantees that each signal operation will + increment the fence value by '1'. Users are expected to track count of + signals enqueued on the semaphore object and insert waits accordingly. + When such a semaphore object is signaled from multiple streams, due to + concurrent stream execution, it is possible that the order in which the + semaphore gets signaled is indeterministic. This could lead to waiters + of the semaphore getting unblocked incorrectly. Users are expected to + handle such situations, either by not using the same semaphore object + with deterministic fence support enabled in different streams or by + adding explicit dependency amongst such streams so that the semaphore + is signaled in order. + + If the semaphore object is any one of the following types: + :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutex`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutexKmt`, then the + keyed mutex will be released with the key specified in + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.keyedmutex.key`. + + Parameters + ---------- + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] + Set of external semaphores to be signaled + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreSignalParams`] + Array of semaphore parameters + numExtSems : unsigned int + Number of semaphores to signal + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue the signal operations in + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + 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 + paramsArray = [] if paramsArray is None else paramsArray + if not all(isinstance(_x, (cudaExternalSemaphoreSignalParams,)) for _x in paramsArray): + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreSignalParams,] or list[cyruntime.cudaExternalSemaphoreSignalParams,]") + extSemArray = [] if extSemArray is None else extSemArray + if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") + cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL + if len(extSemArray) > 1: + cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) + if cyextSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(extSemArray)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + else: + for idx in range(len(extSemArray)): + cyextSemArray[idx] = (extSemArray[idx])._pvt_ptr[0] + elif len(extSemArray) == 1: + cyextSemArray = (extSemArray[0])._pvt_ptr + cdef cyruntime.cudaExternalSemaphoreSignalParams* cyparamsArray = NULL + if len(paramsArray) > 1: + cyparamsArray = calloc(len(paramsArray), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + if cyparamsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreSignalParams))) + for idx in range(len(paramsArray)): + string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + elif len(paramsArray) == 1: + cyparamsArray = (paramsArray[0])._pvt_ptr + if numExtSems > len(extSemArray): raise RuntimeError("List is too small: " + str(len(extSemArray)) + " < " + str(numExtSems)) + if numExtSems > len(paramsArray): raise RuntimeError("List is too small: " + str(len(paramsArray)) + " < " + str(numExtSems)) + with nogil: + err = cyruntime.cudaSignalExternalSemaphoresAsync(cyextSemArray, cyparamsArray, numExtSems, cystream) + if len(extSemArray) > 1 and cyextSemArray is not NULL: + free(cyextSemArray) + if len(paramsArray) > 1 and cyparamsArray is not NULL: + free(cyparamsArray) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreWaitParams] | list[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): + """ Waits on a set of external semaphore objects. + + Enqueues a wait operation on a set of externally allocated semaphore + object in the specified stream. The operations will be executed when + all prior operations in the stream complete. + + The exact semantics of waiting on a semaphore depends on the type of + the object. + + If the semaphore object is any one of the following types: + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueFd`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt` then waiting + on the semaphore will wait until the semaphore reaches the signaled + state. The semaphore will then be reset to the unsignaled state. + Therefore for every signal operation, there can only be one wait + operation. + + If the semaphore object is any one of the following types: + :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D12Fence`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D11Fence`, + :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`, + :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`. + + 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 + 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 + subsequent accesses made by other importers of the same set of NvSciBuf + memory object(s) are coherent. These operations can be skipped by + specifying the flag + :py:obj:`~.cudaExternalSemaphoreWaitSkipNvSciBufMemSync`, which can be + used as a performance optimization when data coherency is not required. + But specifying this flag in scenarios where data coherency is required + results in undefined behavior. Also, for semaphore object of the type + :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync`, if the + NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags + in :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` to + cudaNvSciSyncAttrWait, this API will return cudaErrorNotSupported. + + If the semaphore object is any one of the following types: + :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` + or until the timeout specified by + :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 + used to specify infinite timeout + + Parameters + ---------- + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] + External semaphores to be waited on + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreWaitParams`] + Array of semaphore parameters + numExtSems : unsigned int + Number of semaphores to wait on + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue the wait operations in + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle` :py:obj:`~.cudaErrorTimeout` + + See Also + -------- + :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync` + """ + 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 + paramsArray = [] if paramsArray is None else paramsArray + if not all(isinstance(_x, (cudaExternalSemaphoreWaitParams,)) for _x in paramsArray): + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreWaitParams,] or list[cyruntime.cudaExternalSemaphoreWaitParams,]") + extSemArray = [] if extSemArray is None else extSemArray + if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") + cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL + if len(extSemArray) > 1: + cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) + if cyextSemArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(extSemArray)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphore_t))) + else: + for idx in range(len(extSemArray)): + cyextSemArray[idx] = (extSemArray[idx])._pvt_ptr[0] + elif len(extSemArray) == 1: + cyextSemArray = (extSemArray[0])._pvt_ptr + cdef cyruntime.cudaExternalSemaphoreWaitParams* cyparamsArray = NULL + if len(paramsArray) > 1: + cyparamsArray = calloc(len(paramsArray), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + if cyparamsArray is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(paramsArray)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreWaitParams))) + for idx in range(len(paramsArray)): + string.memcpy(&cyparamsArray[idx], (paramsArray[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + elif len(paramsArray) == 1: + cyparamsArray = (paramsArray[0])._pvt_ptr + if numExtSems > len(extSemArray): raise RuntimeError("List is too small: " + str(len(extSemArray)) + " < " + str(numExtSems)) + if numExtSems > len(paramsArray): raise RuntimeError("List is too small: " + str(len(paramsArray)) + " < " + str(numExtSems)) + with nogil: + err = cyruntime.cudaWaitExternalSemaphoresAsync(cyextSemArray, cyparamsArray, numExtSems, cystream) + if len(extSemArray) > 1 and cyextSemArray is not NULL: + free(cyextSemArray) + if len(paramsArray) > 1 and cyparamsArray is not NULL: + free(cyparamsArray) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDestroyExternalSemaphore' in found_functions}} + +@cython.embedsignature(True) +def cudaDestroyExternalSemaphore(extSem): + """ Destroys an external semaphore. + + Destroys an external semaphore object and releases any references to + the underlying resource. Any outstanding signals or waits must have + completed before the semaphore is destroyed. + + Parameters + ---------- + extSem : :py:obj:`~.cudaExternalSemaphore_t` + External semaphore to be destroyed + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef cyruntime.cudaExternalSemaphore_t cyextSem + if extSem is None: + pextSem = 0 + elif isinstance(extSem, (cudaExternalSemaphore_t,)): + pextSem = int(extSem) + else: + pextSem = int(cudaExternalSemaphore_t(extSem)) + cyextSem = pextSem + with nogil: + err = cyruntime.cudaDestroyExternalSemaphore(cyextSem) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFuncSetCacheConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaFuncSetCacheConfig(func, cacheConfig not None : cudaFuncCache): + """ Sets the preferred cache configuration for a device function. + + On devices where the L1 cache and shared memory use the same hardware + resources, this sets through `cacheConfig` the preferred cache + configuration for the function specified via `func`. This is only a + preference. The runtime will use the requested configuration if + 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 + `__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 + + This setting does nothing on devices where the size of the L1 cache and + shared memory are fixed. + + Launching a kernel with a different preference than the most recent + preference setting may insert a device-side synchronization point. + + The supported cache configurations are: + + - :py:obj:`~.cudaFuncCachePreferNone`: no preference for shared memory + or L1 (default) + + - :py:obj:`~.cudaFuncCachePreferShared`: prefer larger shared memory + and smaller L1 cache + + - :py:obj:`~.cudaFuncCachePreferL1`: prefer larger L1 cache and smaller + shared memory + + - :py:obj:`~.cudaFuncCachePreferEqual`: prefer equal size L1 cache and + shared memory + + Parameters + ---------- + func : Any + Device function symbol + cacheConfig : :py:obj:`~.cudaFuncCache` + Requested cache configuration + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`2 + + See Also + -------- + cudaFuncSetCacheConfig (C++ API), :py:obj:`~.cudaFuncGetAttributes (C API)`, :py:obj:`~.cudaLaunchKernel (C API)`, :py:obj:`~.cuFuncSetCacheConfig` + + Notes + ----- + This API does not accept a :py:obj:`~.cudaKernel_t` casted as void*. If cache config modification is required for a :py:obj:`~.cudaKernel_t` (or a global function), it can be replaced with a call to :py:obj:`~.cudaFuncSetAttributes` with the attribute :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout` to specify a more granular L1 cache and shared memory split configuration. + """ + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + cdef cyruntime.cudaFuncCache cycacheConfig = int(cacheConfig) + with nogil: + err = cyruntime.cudaFuncSetCacheConfig(cyfunc, cycacheConfig) + _helper_input_void_ptr_free(&cyfuncHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFuncGetAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaFuncGetAttributes(func): + """ Find out attributes for a given function. + + This function obtains the attributes of a function specified via + `func`. `func` is a device function symbol and must be declared as 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 + + Note that some function attributes such as + :py:obj:`~.maxThreadsPerBlock` may vary based on the device that is + currently being used. + + Parameters + ---------- + func : Any + Device function symbol + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`2 + attr : :py:obj:`~.cudaFuncAttributes` + Return pointer to function's attributes + + See Also + -------- + :py:obj:`~.cudaFuncSetCacheConfig (C API)`, cudaFuncGetAttributes (C++ API), :py:obj:`~.cudaLaunchKernel (C API)`, :py:obj:`~.cuFuncGetAttribute` + """ + cdef cudaFuncAttributes attr = cudaFuncAttributes() + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + with nogil: + err = cyruntime.cudaFuncGetAttributes(attr._pvt_ptr, cyfunc) + _helper_input_void_ptr_free(&cyfuncHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, attr) +{{endif}} + +{{if 'cudaFuncSetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): + """ Set attributes for a given function. + + 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 + `__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: + + - :py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize` - The + requested maximum size in bytes of dynamically-allocated shared + memory. The sum of this value and the function attribute + :py:obj:`~.sharedSizeBytes` cannot exceed the device attribute + :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`. The maximal size + of requestable dynamic shared memory may differ by GPU architecture. + + - :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout` - On + devices where the L1 cache and shared memory use the same hardware + resources, this sets the shared memory carveout preference, in + percent of the total shared memory. See + :py:obj:`~.cudaDevAttrMaxSharedMemoryPerMultiprocessor`. This is only + a hint, and the driver can choose a different ratio if required to + execute the function. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterWidth`: The required + cluster width in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterHeight`: The required + cluster height in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterDepth`: The required + cluster depth in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeNonPortableClusterSizeAllowed`: Indicates + whether the function can be launched with non-portable cluster size. + 1 is allowed, 0 is disallowed. + + - :py:obj:`~.cudaFuncAttributeClusterSchedulingPolicyPreference`: The + block scheduling policy of a function. The value type is + :py:obj:`~.cudaClusterSchedulingPolicy`. + + cudaLaunchKernel (C++ API), cudaFuncSetCacheConfig (C++ API), + :py:obj:`~.cudaFuncGetAttributes (C API)`, + + Parameters + ---------- + func : Any + Function to get attributes of + attr : :py:obj:`~.cudaFuncAttribute` + Attribute to set + value : int + Value to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue` + """ + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + cdef cyruntime.cudaFuncAttribute cyattr = int(attr) + with nogil: + err = cyruntime.cudaFuncSetAttribute(cyfunc, cyattr, value) + _helper_input_void_ptr_free(&cyfuncHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaLaunchHostFunc' in found_functions}} + +ctypedef struct cudaStreamHostCallbackData_st: + cyruntime.cudaHostFn_t callback + void *userData + +ctypedef cudaStreamHostCallbackData_st cudaStreamHostCallbackData + +@cython.show_performance_hints(False) +cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil: + cdef cudaStreamHostCallbackData *cbData = data + with gil: + cbData.callback(cbData.userData) + free(cbData) + +@cython.embedsignature(True) +def cudaLaunchHostFunc(stream, fn, userData): + """ Enqueues a host function call in a stream. + + Enqueues a host function to run in a stream. The function will be + called after currently enqueued work and will block work added after + it. + + The host function must not make any CUDA API calls. Attempting to use a + CUDA API may result in :py:obj:`~.cudaErrorNotPermitted`, but this is + not required. The host function must not perform any synchronization + that may depend on outstanding CUDA work not mandated to run earlier. + Host functions without a mandated order (such as in independent + streams) execute in undefined order and may be serialized. + + For the purposes of Unified Memory, execution makes a number of + guarantees: + + - The stream is considered idle for the duration of the function's + execution. Thus, for example, the function may always use memory + attached to the stream it was enqueued in. + + - The start of execution of the function has the same effect as + synchronizing an event recorded in the same stream immediately prior + to the function. It thus synchronizes streams which have been + "joined" prior to the function. + + - Adding device work to any stream does not have the effect of making + the stream active until all preceding host functions and stream + callbacks have executed. Thus, for example, a function might use + global attached memory even if work has been added to another stream, + if the work has been ordered behind the function call with an event. + + - Completion of the function does not cause a stream to become active + except as described above. The stream will remain idle if no device + work follows the function, and will remain idle across consecutive + host functions or stream callbacks without device work in between. + Thus, for example, stream synchronization can be done by signaling + from a host function at the end of the stream. + + Note that, in constrast to :py:obj:`~.cuStreamAddCallback`, the + function will not be called in the event of an error in the CUDA + context. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue function call in + fn : :py:obj:`~.cudaHostFn_t` + The function to call once preceding stream operations are complete + userData : Any + User-specified data to be passed to the function + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamQuery`, :py:obj:`~.cudaStreamSynchronize`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaStreamDestroy`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cudaStreamAttachMemAsync`, :py:obj:`~.cudaStreamAddCallback`, :py:obj:`~.cuLaunchHostFunc` + """ + cdef cyruntime.cudaHostFn_t cyfn + if fn is None: + pfn = 0 + elif isinstance(fn, (cudaHostFn_t,)): + pfn = int(fn) + else: + pfn = int(cudaHostFn_t(fn)) + cyfn = pfn + 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 _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + + cdef cudaStreamHostCallbackData *cbData = NULL + cbData = malloc(sizeof(cbData[0])) + if cbData == NULL: + return (cudaError_t.cudaErrorMemoryAllocation,) + cbData.callback = cyfn + cbData.userData = cyuserData + + with nogil: + err = cyruntime.cudaLaunchHostFunc(cystream, cudaStreamRtHostCallbackWrapper, cbData) + if err != cyruntime.cudaSuccess: + free(cbData) + _helper_input_void_ptr_free(&cyuserDataHelper) + + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFuncSetSharedMemConfig' in found_functions}} + +@cython.embedsignature(True) +def cudaFuncSetSharedMemConfig(func, config not None : cudaSharedMemConfig): + """ Sets the shared memory configuration for a device function. + + [Deprecated] + + On devices with configurable shared memory banks, this function will + force all subsequent launches of the specified device function to have + the given shared memory bank size configuration. On any given launch of + the function, the shared memory configuration of the device will be + temporarily changed if needed to suit the function's preferred + configuration. Changes in shared memory configuration between + subsequent launches of functions, may introduce a device side + synchronization point. + + Any per-function setting of shared memory bank size set via + :py:obj:`~.cudaFuncSetSharedMemConfig` will override the device wide + setting set by :py:obj:`~.cudaDeviceSetSharedMemConfig`. + + Changing the shared memory bank size will not increase shared memory + usage or affect occupancy of kernels, but may have major effects on + performance. Larger bank sizes will allow for greater potential + bandwidth to shared memory, but will change what kinds of accesses to + shared memory will result in bank conflicts. + + This function will do nothing on devices with fixed shared memory bank + size. + + For templated functions, pass the function symbol as follows: + func_name + + The supported bank configurations are: + + - :py:obj:`~.cudaSharedMemBankSizeDefault`: use the device's shared + memory configuration when launching this function. + + - :py:obj:`~.cudaSharedMemBankSizeFourByte`: set shared memory bank + width to be four bytes natively when launching this function. + + - :py:obj:`~.cudaSharedMemBankSizeEightByte`: set shared memory bank + width to be eight bytes natively when launching this function. + + Parameters + ---------- + func : Any + Device function symbol + config : :py:obj:`~.cudaSharedMemConfig` + Requested shared memory configuration + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue`,2 + + See Also + -------- + :py:obj:`~.cudaDeviceSetSharedMemConfig`, :py:obj:`~.cudaDeviceGetSharedMemConfig`, :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuFuncSetSharedMemConfig` + """ + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + cdef cyruntime.cudaSharedMemConfig cyconfig = int(config) + with nogil: + err = cyruntime.cudaFuncSetSharedMemConfig(cyfunc, cyconfig) + _helper_input_void_ptr_free(&cyfuncHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + +@cython.embedsignature(True) +def cudaOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dynamicSMemSize): + """ Returns occupancy for a device function. + + Returns in `*numBlocks` the maximum number of active blocks per + streaming multiprocessor for the device function. + + Parameters + ---------- + func : Any + Kernel function for which occupancy is calculated + blockSize : int + Block size the kernel is intended to be launched with + dynamicSMemSize : size_t + Per-block dynamic shared memory usage intended, in bytes + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown`, + numBlocks : int + Returned occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` + """ + cdef int numBlocks = 0 + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + with nogil: + err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc, blockSize, dynamicSMemSize) + _helper_input_void_ptr_free(&cyfuncHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, numBlocks) +{{endif}} + +{{if 'cudaOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + +@cython.embedsignature(True) +def cudaOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize): + """ Returns dynamic shared memory available per block when launching `numBlocks` blocks on SM. + + Returns in `*dynamicSmemSize` the maximum size of dynamic shared memory + to allow `numBlocks` blocks per SM. + + Parameters + ---------- + func : Any + Kernel function for which occupancy is calculated + numBlocks : int + Number of blocks to fit on SM + blockSize : int + Size of the block + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown`, + dynamicSmemSize : int + Returned maximum dynamic shared memory + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), :py:obj:`~.cudaOccupancyAvailableDynamicSMemPerBlock` + """ + cdef size_t dynamicSmemSize = 0 + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + with nogil: + err = cyruntime.cudaOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc, numBlocks, blockSize) + _helper_input_void_ptr_free(&cyfuncHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, dynamicSmemSize) +{{endif}} + +{{if 'cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, size_t dynamicSMemSize, unsigned int flags): + """ Returns occupancy for a device function with the specified flags. + + Returns in `*numBlocks` the maximum number of active blocks per + streaming multiprocessor for the device function. + + The `flags` parameter controls how special cases are handled. Valid + flags include: + + - :py:obj:`~.cudaOccupancyDefault`: keeps the default behavior as + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` + + - :py:obj:`~.cudaOccupancyDisableCachingOverride`: This flag suppresses + the default behavior on platform where global caching affects + occupancy. On such platforms, if caching is enabled, but per-block SM + resource usage would result in zero occupancy, the occupancy + calculator will calculate the occupancy as if caching is disabled. + Setting this flag makes the occupancy calculator to return 0 in such + cases. More information can be found about this feature in the + "Unified L1/Texture Cache" section of the Maxwell tuning guide. + + Parameters + ---------- + func : Any + Kernel function for which occupancy is calculated + blockSize : int + Block size the kernel is intended to be launched with + dynamicSMemSize : size_t + Per-block dynamic shared memory usage intended, in bytes + flags : unsigned int + Requested behavior for the occupancy calculator + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown`, + numBlocks : int + Returned occupancy + + See Also + -------- + :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` + """ + cdef int numBlocks = 0 + cdef _HelperInputVoidPtrStruct cyfuncHelper + cdef void* cyfunc = _helper_input_void_ptr(func, &cyfuncHelper) + with nogil: + err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc, blockSize, dynamicSMemSize, flags) + _helper_input_void_ptr_free(&cyfuncHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, numBlocks) +{{endif}} + +{{if 'cudaMallocManaged' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocManaged(size_t size, unsigned int flags): + """ Allocates memory that will be automatically managed by the Unified Memory system. + + Allocates `size` bytes of managed memory on the device and returns in + `*devPtr` a pointer to the allocated memory. If the device doesn't + support allocating managed memory, :py:obj:`~.cudaErrorNotSupported` is + returned. Support for managed memory can be queried using the device + attribute :py:obj:`~.cudaDevAttrManagedMemory`. The allocated memory is + suitably aligned for any kind of variable. The memory is not cleared. + If `size` is 0, :py:obj:`~.cudaMallocManaged` returns + :py:obj:`~.cudaErrorInvalidValue`. The pointer is valid on the CPU and + on all GPUs in the system that support managed memory. All accesses to + this pointer must obey the Unified Memory programming model. + + `flags` specifies the default stream association for this allocation. + `flags` must be one of :py:obj:`~.cudaMemAttachGlobal` or + :py:obj:`~.cudaMemAttachHost`. The default value for `flags` is + :py:obj:`~.cudaMemAttachGlobal`. If :py:obj:`~.cudaMemAttachGlobal` is + specified, then this memory is accessible from any stream on any + device. If :py:obj:`~.cudaMemAttachHost` is specified, then the + allocation should not be accessed from devices that have a zero value + for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`; an explicit call to + :py:obj:`~.cudaStreamAttachMemAsync` will be required to enable access + on such devices. + + If the association is later changed via + :py:obj:`~.cudaStreamAttachMemAsync` to a single stream, the default + association, as specifed during :py:obj:`~.cudaMallocManaged`, is + restored when that stream is destroyed. For managed variables, the + default association is always :py:obj:`~.cudaMemAttachGlobal`. Note + that destroying a stream is an asynchronous operation, and as a result, + the change to default association won't happen until all work in the + stream has completed. + + Memory allocated with :py:obj:`~.cudaMallocManaged` should be released + with :py:obj:`~.cudaFree`. + + Device memory oversubscription is possible for GPUs that have a non- + zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Managed memory on such + GPUs may be evicted from device memory to host memory at any time by + the Unified Memory driver in order to make room for other allocations. + + In a system where all GPUs have a non-zero value for the device + attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess`, managed + memory may not be populated when this API returns and instead may be + populated on access. In such systems, managed memory can migrate to any + processor's memory at any time. The Unified Memory driver will employ + heuristics to maintain data locality and prevent excessive page faults + to the extent possible. The application can also guide the driver about + memory usage patterns via :py:obj:`~.cudaMemAdvise`. The application + can also explicitly migrate memory to a desired processor's memory via + :py:obj:`~.cudaMemPrefetchAsync`. + + In a multi-GPU system where all of the GPUs have a zero value for the + device attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess` and all + the GPUs have peer-to-peer support with each other, the physical + storage for managed memory is created on the GPU which is active at the + time :py:obj:`~.cudaMallocManaged` is called. All other GPUs will + reference the data at reduced bandwidth via peer mappings over the PCIe + bus. The Unified Memory driver does not migrate memory among such GPUs. + + In a multi-GPU system where not all GPUs have peer-to-peer support with + each other and where the value of the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` is zero for at least one + of those GPUs, the location chosen for physical storage of managed + memory is system-dependent. + + - On Linux, the location chosen will be device memory as long as the + current set of active contexts are on devices that either have peer- + to-peer support with each other or have a non-zero value for the + device attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. If + there is an active context on a GPU that does not have a non-zero + value for that device attribute and it does not have peer-to-peer + support with the other devices that have active contexts on them, + then the location for physical storage will be 'zero-copy' or host + memory. Note that this means that managed memory that is located in + device memory is migrated to host memory if a new context is created + on a GPU that doesn't have a non-zero value for the device attribute + and does not support peer-to-peer with at least one of the other + devices that has an active context. This in turn implies that context + creation may fail if there is insufficient host memory to migrate all + managed allocations. + + - On Windows, the physical storage is always created in 'zero-copy' or + host memory. All GPUs will reference the data at reduced bandwidth + over the PCIe bus. In these circumstances, use of the environment + variable CUDA_VISIBLE_DEVICES is recommended to restrict CUDA to only + use those GPUs that have peer-to-peer support. Alternatively, users + can also set CUDA_MANAGED_FORCE_DEVICE_ALLOC to a non-zero value to + force the driver to always use device memory for physical storage. + When this environment variable is set to a non-zero value, all + devices used in that process that support managed memory have to be + peer-to-peer compatible with each other. The error + :py:obj:`~.cudaErrorInvalidDevice` will be returned if a device that + supports managed memory is used and it is not peer-to-peer compatible + with any of the other managed memory supporting devices that were + previously used in that process, even if :py:obj:`~.cudaDeviceReset` + has been called on those devices. These environment variables are + described in the CUDA programming guide under the "CUDA environment + variables" section. + + Parameters + ---------- + size : size_t + Requested allocation size in bytes + flags : unsigned int + Must be either :py:obj:`~.cudaMemAttachGlobal` or + :py:obj:`~.cudaMemAttachHost` (defaults to + :py:obj:`~.cudaMemAttachGlobal`) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + devPtr : Any + Pointer to allocated device memory + + See Also + -------- + :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cudaDeviceGetAttribute`, :py:obj:`~.cudaStreamAttachMemAsync`, :py:obj:`~.cuMemAllocManaged` + """ + cdef void_ptr devPtr = 0 + with nogil: + err = cyruntime.cudaMallocManaged(&devPtr, size, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, devPtr) +{{endif}} + +{{if 'cudaMalloc' in found_functions}} + +@cython.embedsignature(True) +def cudaMalloc(size_t size): + """ Allocate memory on the device. + + Allocates `size` bytes of linear memory on the device and returns in + `*devPtr` a pointer to the allocated memory. The allocated memory is + suitably aligned for any kind of variable. The memory is not cleared. + :py:obj:`~.cudaMalloc()` returns :py:obj:`~.cudaErrorMemoryAllocation` + in case of failure. + + The device version of :py:obj:`~.cudaFree` cannot be used with a + `*devPtr` allocated using the host API, and vice versa. + + Parameters + ---------- + size : size_t + Requested allocation size in bytes + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + devPtr : Any + Pointer to allocated device memory + + See Also + -------- + :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemAlloc` + """ + cdef void_ptr devPtr = 0 + with nogil: + err = cyruntime.cudaMalloc(&devPtr, size) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, devPtr) +{{endif}} + +{{if 'cudaMallocHost' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocHost(size_t size): + """ Allocates page-locked memory on the host. + + Allocates `size` bytes of host memory that is page-locked and + accessible to the device. The driver tracks the virtual memory ranges + allocated with this function and automatically accelerates calls to + functions such as :py:obj:`~.cudaMemcpy`*(). Since the memory can be + accessed directly by the device, it can be read or written with much + higher bandwidth than pageable memory obtained with functions such as + :py:obj:`~.malloc()`. + + On systems where :py:obj:`~.pageableMemoryAccessUsesHostPageTables` is + true, :py:obj:`~.cudaMallocHost` may not page-lock the allocated + memory. + + Page-locking excessive amounts of memory with + :py:obj:`~.cudaMallocHost()` may degrade system performance, since it + reduces the amount of memory available to the system for paging. As a + result, this function is best used sparingly to allocate staging areas + for data exchange between host and device. + + Parameters + ---------- + size : size_t + Requested allocation size in bytes + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + ptr : Any + Pointer to allocated host memory + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, cudaMallocHost (C++ API), :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemAllocHost` + """ + cdef void_ptr ptr = 0 + with nogil: + err = cyruntime.cudaMallocHost(&ptr, size) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ptr) +{{endif}} + +{{if 'cudaMallocPitch' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocPitch(size_t width, size_t height): + """ Allocates pitched memory on the device. + + Allocates at least `width` (in bytes) * `height` bytes of linear memory + on the device and returns in `*devPtr` a pointer to the allocated + memory. The function may pad the allocation to ensure that + corresponding pointers in any given row will continue to meet the + alignment requirements for coalescing as the address is updated from + row to row. The pitch returned in `*pitch` by + :py:obj:`~.cudaMallocPitch()` is the width in bytes of the allocation. + The intended usage of `pitch` is as a separate parameter of the + allocation, used to compute addresses within the 2D array. Given the + row and column of an array element of type `T`, the address is computed + as: + + **View CUDA Toolkit Documentation for a C++ code example** + + For allocations of 2D arrays, it is recommended that programmers + consider performing pitch allocations using + :py:obj:`~.cudaMallocPitch()`. Due to pitch alignment restrictions in + the hardware, this is especially true if the application will be + performing 2D memory copies between different regions of device memory + (whether linear memory or CUDA arrays). + + Parameters + ---------- + width : size_t + Requested pitched allocation width (in bytes) + height : size_t + Requested pitched allocation height + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + devPtr : Any + Pointer to allocated pitched device memory + pitch : int + Pitch for allocation + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemAllocPitch` + """ + cdef void_ptr devPtr = 0 + cdef size_t pitch = 0 + with nogil: + err = cyruntime.cudaMallocPitch(&devPtr, &pitch, width, height) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, devPtr, pitch) +{{endif}} + +{{if 'cudaMallocArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocArray(desc : Optional[cudaChannelFormatDesc], size_t width, size_t height, unsigned int flags): + """ Allocate an array on the device. + + Allocates a CUDA array according to the + :py:obj:`~.cudaChannelFormatDesc` structure `desc` and returns a handle + to the new CUDA array in `*array`. + + The :py:obj:`~.cudaChannelFormatDesc` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaChannelFormatKind` is one of + :py:obj:`~.cudaChannelFormatKindSigned`, + :py:obj:`~.cudaChannelFormatKindUnsigned`, or + :py:obj:`~.cudaChannelFormatKindFloat`. + + The `flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.cudaArrayDefault`: This flag's value is defined to be 0 + and provides default array allocation + + - :py:obj:`~.cudaArraySurfaceLoadStore`: Allocates an array that can be + read from or written to using a surface reference + + - :py:obj:`~.cudaArrayTextureGather`: This flag indicates that texture + gather operations will be performed on the array. + + - :py:obj:`~.cudaArraySparse`: Allocates a CUDA array without physical + backing memory. The subregions within this sparse array can later be + mapped onto a physical memory allocation by calling + :py:obj:`~.cuMemMapArrayAsync`. The physical backing memory must be + allocated via :py:obj:`~.cuMemCreate`. + + - :py:obj:`~.cudaArrayDeferredMapping`: Allocates a CUDA array without + physical backing memory. The entire array can later be mapped onto a + physical memory allocation by calling :py:obj:`~.cuMemMapArrayAsync`. + The physical backing memory must be allocated via + :py:obj:`~.cuMemCreate`. + + `width` and `height` must meet certain size requirements. See + :py:obj:`~.cudaMalloc3DArray()` for more details. + + Parameters + ---------- + desc : :py:obj:`~.cudaChannelFormatDesc` + Requested channel format + width : size_t + Requested array allocation width + height : size_t + Requested array allocation height + flags : unsigned int + Requested properties of allocated array + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + array : :py:obj:`~.cudaArray_t` + Pointer to allocated array in device memory + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaMallocArray(array._pvt_ptr, cydesc_ptr, width, height, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, array) +{{endif}} + +{{if 'cudaFree' in found_functions}} + +@cython.embedsignature(True) +def cudaFree(devPtr): + """ Frees memory on the device. + + Frees the memory space pointed to by `devPtr`, which must have been + returned by a previous call to one of the following memory allocation + APIs - :py:obj:`~.cudaMalloc()`, :py:obj:`~.cudaMallocPitch()`, + :py:obj:`~.cudaMallocManaged()`, :py:obj:`~.cudaMallocAsync()`, + :py:obj:`~.cudaMallocFromPoolAsync()`. + + Note - This API will not perform any implicit synchronization when the + pointer was allocated with :py:obj:`~.cudaMallocAsync` or + :py:obj:`~.cudaMallocFromPoolAsync`. Callers must ensure that all + accesses to these pointer have completed before invoking + :py:obj:`~.cudaFree`. For best performance and memory reuse, users + should use :py:obj:`~.cudaFreeAsync` to free memory allocated via the + stream ordered memory allocator. For all other pointers, this API may + perform implicit synchronization. + + If :py:obj:`~.cudaFree`(`devPtr`) has already been called before, an + error is returned. If `devPtr` is 0, no operation is performed. + :py:obj:`~.cudaFree()` returns :py:obj:`~.cudaErrorValue` in case of + failure. + + The device version of :py:obj:`~.cudaFree` cannot be used with a + `*devPtr` allocated using the host API, and vice versa. + + Parameters + ---------- + devPtr : Any + Device pointer to memory to free + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaMallocFromPoolAsync` :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaFreeAsync` :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFree` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaFree(cydevPtr) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFreeHost' in found_functions}} + +@cython.embedsignature(True) +def cudaFreeHost(ptr): + """ Frees page-locked memory. + + Frees the memory space pointed to by `hostPtr`, which must have been + returned by a previous call to :py:obj:`~.cudaMallocHost()` or + :py:obj:`~.cudaHostAlloc()`. + + Parameters + ---------- + ptr : Any + Pointer to memory to free + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFreeHost` + """ + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaFreeHost(cyptr) + _helper_input_void_ptr_free(&cyptrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFreeArray' in found_functions}} + +@cython.embedsignature(True) +def cudaFreeArray(array): + """ Frees an array on the device. + + Frees the CUDA array `array`, which must have been returned by a + previous call to :py:obj:`~.cudaMallocArray()`. If `devPtr` is 0, no + operation is performed. + + Parameters + ---------- + array : :py:obj:`~.cudaArray_t` + Pointer to array to free + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuArrayDestroy` + """ + cdef cyruntime.cudaArray_t cyarray + if array is None: + parray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + else: + parray = int(cudaArray_t(array)) + cyarray = parray + with nogil: + err = cyruntime.cudaFreeArray(cyarray) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaFreeMipmappedArray' in found_functions}} + +@cython.embedsignature(True) +def cudaFreeMipmappedArray(mipmappedArray): + """ Frees a mipmapped array on the device. + + Frees the CUDA mipmapped array `mipmappedArray`, which must have been + returned by a previous call to :py:obj:`~.cudaMallocMipmappedArray()`. + If `devPtr` is 0, no operation is performed. + + Parameters + ---------- + mipmappedArray : :py:obj:`~.cudaMipmappedArray_t` + Pointer to mipmapped array to free + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMipmappedArrayDestroy` + """ + cdef cyruntime.cudaMipmappedArray_t cymipmappedArray + if mipmappedArray is None: + pmipmappedArray = 0 + elif isinstance(mipmappedArray, (cudaMipmappedArray_t,)): + pmipmappedArray = int(mipmappedArray) + else: + pmipmappedArray = int(cudaMipmappedArray_t(mipmappedArray)) + cymipmappedArray = pmipmappedArray + with nogil: + err = cyruntime.cudaFreeMipmappedArray(cymipmappedArray) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaHostAlloc' in found_functions}} + +@cython.embedsignature(True) +def cudaHostAlloc(size_t size, unsigned int flags): + """ Allocates page-locked memory on the host. + + Allocates `size` bytes of host memory that is page-locked and + accessible to the device. The driver tracks the virtual memory ranges + allocated with this function and automatically accelerates calls to + functions such as :py:obj:`~.cudaMemcpy()`. Since the memory can be + accessed directly by the device, it can be read or written with much + higher bandwidth than pageable memory obtained with functions such as + :py:obj:`~.malloc()`. Allocating excessive amounts of pinned memory may + degrade system performance, since it reduces the amount of memory + available to the system for paging. As a result, this function is best + used sparingly to allocate staging areas for data exchange between host + and device. + + The `flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.cudaHostAllocDefault`: This flag's value is defined to be + 0 and causes :py:obj:`~.cudaHostAlloc()` to emulate + :py:obj:`~.cudaMallocHost()`. + + - :py:obj:`~.cudaHostAllocPortable`: The memory returned by this call + will be considered as pinned memory by all CUDA contexts, not just + the one that performed the allocation. + + - :py:obj:`~.cudaHostAllocMapped`: Maps the allocation into the CUDA + address space. The device pointer to the memory may be obtained by + calling :py:obj:`~.cudaHostGetDevicePointer()`. + + - :py:obj:`~.cudaHostAllocWriteCombined`: Allocates the memory as + write-combined (WC). WC memory can be transferred across the PCI + Express bus more quickly on some system configurations, but cannot be + read efficiently by most CPUs. WC memory is a good option for buffers + that will be written by the CPU and read by the device via mapped + pinned memory or host->device transfers. + + All of these flags are orthogonal to one another: a developer may + allocate memory that is portable, mapped and/or write-combined with no + restrictions. + + In order for the :py:obj:`~.cudaHostAllocMapped` flag to have any + effect, the CUDA context must support the :py:obj:`~.cudaDeviceMapHost` + flag, which can be checked via :py:obj:`~.cudaGetDeviceFlags()`. The + :py:obj:`~.cudaDeviceMapHost` flag is implicitly set for contexts + created via the runtime API. + + The :py:obj:`~.cudaHostAllocMapped` flag may be specified on CUDA + contexts for devices that do not support mapped pinned memory. The + failure is deferred to :py:obj:`~.cudaHostGetDevicePointer()` because + the memory may be mapped into other CUDA contexts via the + :py:obj:`~.cudaHostAllocPortable` flag. + + Memory allocated by this function must be freed with + :py:obj:`~.cudaFreeHost()`. + + Parameters + ---------- + size : size_t + Requested allocation size in bytes + flags : unsigned int + Requested properties of allocated memory + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + pHost : Any + Device pointer to allocated memory + + See Also + -------- + :py:obj:`~.cudaSetDeviceFlags`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaGetDeviceFlags`, :py:obj:`~.cuMemHostAlloc` + """ + cdef void_ptr pHost = 0 + with nogil: + err = cyruntime.cudaHostAlloc(&pHost, size, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pHost) +{{endif}} + +{{if 'cudaHostRegister' in found_functions}} + +@cython.embedsignature(True) +def cudaHostRegister(ptr, size_t size, unsigned int flags): + """ Registers an existing host memory range for use by CUDA. + + Page-locks the memory range specified by `ptr` and `size` and maps it + for the device(s) as specified by `flags`. This memory range also is + added to the same tracking mechanism as :py:obj:`~.cudaHostAlloc()` to + automatically accelerate calls to functions such as + :py:obj:`~.cudaMemcpy()`. Since the memory can be accessed directly by + the device, it can be read or written with much higher bandwidth than + pageable memory that has not been registered. Page-locking excessive + amounts of memory may degrade system performance, since it reduces the + amount of memory available to the system for paging. As a result, this + function is best used sparingly to register staging areas for data + exchange between host and device. + + On systems where :py:obj:`~.pageableMemoryAccessUsesHostPageTables` is + true, :py:obj:`~.cudaHostRegister` will not page-lock the memory range + specified by `ptr` but only populate unpopulated pages. + + :py:obj:`~.cudaHostRegister` is supported only on I/O coherent devices + that have a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrHostRegisterSupported`. + + The `flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.cudaHostRegisterDefault`: On a system with unified virtual + addressing, the memory will be both mapped and portable. On a system + with no unified virtual addressing, the memory will be neither mapped + nor portable. + + - :py:obj:`~.cudaHostRegisterPortable`: The memory returned by this + call will be considered as pinned memory by all CUDA contexts, not + just the one that performed the allocation. + + - :py:obj:`~.cudaHostRegisterMapped`: Maps the allocation into the CUDA + address space. The device pointer to the memory may be obtained by + calling :py:obj:`~.cudaHostGetDevicePointer()`. + + - :py:obj:`~.cudaHostRegisterIoMemory`: The passed memory pointer is + treated as pointing to some memory-mapped I/O space, e.g. belonging + to a third-party PCIe device, and it will marked as non cache- + coherent and contiguous. + + - :py:obj:`~.cudaHostRegisterReadOnly`: The passed memory pointer is + treated as pointing to memory that is considered read-only by the + device. On platforms without + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, this + flag is required in order to register memory mapped to the CPU as + read-only. Support for the use of this flag can be queried from the + device attribute + :py:obj:`~.cudaDevAttrHostRegisterReadOnlySupported`. Using this flag + with a current context associated with a device that does not have + this attribute set will cause :py:obj:`~.cudaHostRegister` to error + with cudaErrorNotSupported. + + All of these flags are orthogonal to one another: a developer may page- + lock memory that is portable or mapped with no restrictions. + + The CUDA context must have been created with the + :py:obj:`~.cudaMapHost` flag in order for the + :py:obj:`~.cudaHostRegisterMapped` flag to have any effect. + + The :py:obj:`~.cudaHostRegisterMapped` flag may be specified on CUDA + contexts for devices that do not support mapped pinned memory. The + failure is deferred to :py:obj:`~.cudaHostGetDevicePointer()` because + the memory may be mapped into other CUDA contexts via the + :py:obj:`~.cudaHostRegisterPortable` flag. + + For devices that have a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrCanUseHostPointerForRegisteredMem`, the memory + can also be accessed from the device using the host pointer `ptr`. The + device pointer returned by :py:obj:`~.cudaHostGetDevicePointer()` may + or may not match the original host pointer `ptr` and depends on the + devices visible to the application. If all devices visible to the + application have a non-zero value for the device attribute, the device + pointer returned by :py:obj:`~.cudaHostGetDevicePointer()` will match + the original pointer `ptr`. If any device visible to the application + has a zero value for the device attribute, the device pointer returned + by :py:obj:`~.cudaHostGetDevicePointer()` will not match the original + host pointer `ptr`, but it will be suitable for use on all devices + provided Unified Virtual Addressing is enabled. In such systems, it is + valid to access the memory using either pointer on devices that have a + non-zero value for the device attribute. Note however that such devices + should access the memory using only of the two pointers and not both. + + The memory page-locked by this function must be unregistered with + :py:obj:`~.cudaHostUnregister()`. + + Parameters + ---------- + ptr : Any + Host pointer to memory to page-lock + size : size_t + Size in bytes of the address range to page-lock in bytes + flags : unsigned int + Flags for allocation request + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorHostMemoryAlreadyRegistered`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cudaHostGetFlags`, :py:obj:`~.cudaHostGetDevicePointer`, :py:obj:`~.cuMemHostRegister` + """ + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaHostRegister(cyptr, size, flags) + _helper_input_void_ptr_free(&cyptrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaHostUnregister' in found_functions}} + +@cython.embedsignature(True) +def cudaHostUnregister(ptr): + """ Unregisters a memory range that was registered with cudaHostRegister. + + Unmaps the memory range whose base address is specified by `ptr`, and + makes it pageable again. + + The base address must be the same one specified to + :py:obj:`~.cudaHostRegister()`. + + Parameters + ---------- + ptr : Any + Host pointer to memory to unregister + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorHostMemoryNotRegistered` + + See Also + -------- + :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cuMemHostUnregister` + """ + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaHostUnregister(cyptr) + _helper_input_void_ptr_free(&cyptrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaHostGetDevicePointer' in found_functions}} + +@cython.embedsignature(True) +def cudaHostGetDevicePointer(pHost, unsigned int flags): + """ Passes back device pointer of mapped host memory allocated by cudaHostAlloc or registered by cudaHostRegister. + + Passes back the device pointer corresponding to the mapped, pinned host + buffer allocated by :py:obj:`~.cudaHostAlloc()` or registered by + :py:obj:`~.cudaHostRegister()`. + + :py:obj:`~.cudaHostGetDevicePointer()` will fail if the + :py:obj:`~.cudaDeviceMapHost` flag was not specified before deferred + context creation occurred, or if called on a device that does not + support mapped, pinned memory. + + For devices that have a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrCanUseHostPointerForRegisteredMem`, the memory + can also be accessed from the device using the host pointer `pHost`. + The device pointer returned by :py:obj:`~.cudaHostGetDevicePointer()` + may or may not match the original host pointer `pHost` and depends on + the devices visible to the application. If all devices visible to the + application have a non-zero value for the device attribute, the device + pointer returned by :py:obj:`~.cudaHostGetDevicePointer()` will match + the original pointer `pHost`. If any device visible to the application + has a zero value for the device attribute, the device pointer returned + by :py:obj:`~.cudaHostGetDevicePointer()` will not match the original + host pointer `pHost`, but it will be suitable for use on all devices + provided Unified Virtual Addressing is enabled. In such systems, it is + valid to access the memory using either pointer on devices that have a + non-zero value for the device attribute. Note however that such devices + should access the memory using only of the two pointers and not both. + + `flags` provides for future releases. For now, it must be set to 0. + + Parameters + ---------- + pHost : Any + Requested host pointer mapping + flags : unsigned int + Flags for extensions (must be 0 for now) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + pDevice : Any + Returned device pointer for mapped memory + + See Also + -------- + :py:obj:`~.cudaSetDeviceFlags`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer` + """ + cdef void_ptr pDevice = 0 + cdef _HelperInputVoidPtrStruct cypHostHelper + cdef void* cypHost = _helper_input_void_ptr(pHost, &cypHostHelper) + with nogil: + err = cyruntime.cudaHostGetDevicePointer(&pDevice, cypHost, flags) + _helper_input_void_ptr_free(&cypHostHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pDevice) +{{endif}} + +{{if 'cudaHostGetFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaHostGetFlags(pHost): + """ Passes back flags used to allocate pinned host memory allocated by cudaHostAlloc. + + :py:obj:`~.cudaHostGetFlags()` will fail if the input pointer does not + reside in an address range allocated by :py:obj:`~.cudaHostAlloc()`. + + Parameters + ---------- + pHost : Any + Host pointer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pFlags : unsigned int + Returned flags word + + See Also + -------- + :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetFlags` + """ + cdef unsigned int pFlags = 0 + cdef _HelperInputVoidPtrStruct cypHostHelper + cdef void* cypHost = _helper_input_void_ptr(pHost, &cypHostHelper) + with nogil: + err = cyruntime.cudaHostGetFlags(&pFlags, cypHost) + _helper_input_void_ptr_free(&cypHostHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pFlags) +{{endif}} + +{{if 'cudaMalloc3D' in found_functions}} + +@cython.embedsignature(True) +def cudaMalloc3D(extent not None : cudaExtent): + """ Allocates logical 1D, 2D, or 3D memory objects on the device. + + Allocates at least `width` * `height` * `depth` bytes of linear memory + on the device and returns a :py:obj:`~.cudaPitchedPtr` in which `ptr` + is a pointer to the allocated memory. The function may pad the + allocation to ensure hardware alignment requirements are met. The pitch + returned in the `pitch` field of `pitchedDevPtr` is the width in bytes + of the allocation. + + The returned :py:obj:`~.cudaPitchedPtr` contains additional fields + `xsize` and `ysize`, the logical width and height of the allocation, + which are equivalent to the `width` and `height` `extent` parameters + provided by the programmer during allocation. + + For allocations of 2D and 3D objects, it is highly recommended that + programmers perform allocations using :py:obj:`~.cudaMalloc3D()` or + :py:obj:`~.cudaMallocPitch()`. Due to alignment restrictions in the + hardware, this is especially true if the application will be performing + memory copies involving 2D or 3D objects (whether linear memory or CUDA + arrays). + + Parameters + ---------- + extent : :py:obj:`~.cudaExtent` + Requested allocation size (`width` field in bytes) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + pitchedDevPtr : :py:obj:`~.cudaPitchedPtr` + Pointer to allocated pitched device memory + + See Also + -------- + :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaPitchedPtr`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuMemAllocPitch` + """ + cdef cudaPitchedPtr pitchedDevPtr = cudaPitchedPtr() + with nogil: + err = cyruntime.cudaMalloc3D(pitchedDevPtr._pvt_ptr, extent._pvt_ptr[0]) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pitchedDevPtr) +{{endif}} + +{{if 'cudaMalloc3DArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMalloc3DArray(desc : Optional[cudaChannelFormatDesc], extent not None : cudaExtent, unsigned int flags): + """ Allocate an array on the device. + + Allocates a CUDA array according to the + :py:obj:`~.cudaChannelFormatDesc` structure `desc` and returns a handle + to the new CUDA array in `*array`. + + The :py:obj:`~.cudaChannelFormatDesc` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaChannelFormatKind` is one of + :py:obj:`~.cudaChannelFormatKindSigned`, + :py:obj:`~.cudaChannelFormatKindUnsigned`, or + :py:obj:`~.cudaChannelFormatKindFloat`. + + :py:obj:`~.cudaMalloc3DArray()` can allocate the following: + + - A 1D array is allocated if the height and depth extents are both + zero. + + - A 2D array is allocated if only the depth extent is zero. + + - A 3D array is allocated if all three extents are non-zero. + + - A 1D layered CUDA array is allocated if only the height extent is + zero and the cudaArrayLayered flag is set. Each layer is a 1D array. + The number of layers is determined by the depth extent. + + - A 2D layered CUDA array is allocated if all three extents are non- + zero and the cudaArrayLayered flag is set. Each layer is a 2D array. + The number of layers is determined by the depth extent. + + - A cubemap CUDA array is allocated if all three extents are non-zero + and the cudaArrayCubemap flag is set. Width must be equal to height, + and depth must be six. A cubemap is a special type of 2D layered CUDA + array, where the six layers represent the six faces of a cube. The + order of the six layers in memory is the same as that listed in + :py:obj:`~.cudaGraphicsCubeFace`. + + - A cubemap layered CUDA array is allocated if all three extents are + non-zero, and both, cudaArrayCubemap and cudaArrayLayered flags are + set. Width must be equal to height, and depth must be a multiple of + six. A cubemap layered CUDA array is a special type of 2D layered + CUDA array that consists of a collection of cubemaps. The first six + layers represent the first cubemap, the next six layers form the + second cubemap, and so on. + + The `flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.cudaArrayDefault`: This flag's value is defined to be 0 + and provides default array allocation + + - :py:obj:`~.cudaArrayLayered`: Allocates a layered CUDA array, with + the depth extent indicating the number of layers + + - :py:obj:`~.cudaArrayCubemap`: Allocates a cubemap CUDA array. Width + must be equal to height, and depth must be six. If the + cudaArrayLayered flag is also set, depth must be a multiple of six. + + - :py:obj:`~.cudaArraySurfaceLoadStore`: Allocates a CUDA array that + could be read from or written to using a surface reference. + + - :py:obj:`~.cudaArrayTextureGather`: This flag indicates that texture + gather operations will be performed on the CUDA array. Texture gather + can only be performed on 2D CUDA arrays. + + - :py:obj:`~.cudaArraySparse`: Allocates a CUDA array without physical + backing memory. The subregions within this sparse array can later be + mapped onto a physical memory allocation by calling + :py:obj:`~.cuMemMapArrayAsync`. This flag can only be used for + creating 2D, 3D or 2D layered sparse CUDA arrays. The physical + backing memory must be allocated via :py:obj:`~.cuMemCreate`. + + - :py:obj:`~.cudaArrayDeferredMapping`: Allocates a CUDA array without + physical backing memory. The entire array can later be mapped onto a + physical memory allocation by calling :py:obj:`~.cuMemMapArrayAsync`. + The physical backing memory must be allocated via + :py:obj:`~.cuMemCreate`. + + The width, height and depth extents must meet certain size requirements + as listed in the following table. All values are specified in elements. + + Note that 2D CUDA arrays have different size requirements if the + :py:obj:`~.cudaArrayTextureGather` flag is set. In that case, the valid + range for (width, height, depth) is ((1,maxTexture2DGather[0]), + (1,maxTexture2DGather[1]), 0). + + **View CUDA Toolkit Documentation for a table example** + + Parameters + ---------- + desc : :py:obj:`~.cudaChannelFormatDesc` + Requested channel format + extent : :py:obj:`~.cudaExtent` + Requested allocation size (`width` field in elements) + flags : unsigned int + Flags for extensions + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + array : :py:obj:`~.cudaArray_t` + Pointer to allocated array in device memory + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaMalloc3DArray(array._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, array) +{{endif}} + +{{if 'cudaMallocMipmappedArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocMipmappedArray(desc : Optional[cudaChannelFormatDesc], extent not None : cudaExtent, unsigned int numLevels, unsigned int flags): + """ Allocate a mipmapped array on the device. + + Allocates a CUDA mipmapped array according to the + :py:obj:`~.cudaChannelFormatDesc` structure `desc` and returns a handle + to the new CUDA mipmapped array in `*mipmappedArray`. `numLevels` + specifies the number of mipmap levels to be allocated. This value is + clamped to the range [1, 1 + floor(log2(max(width, height, depth)))]. + + The :py:obj:`~.cudaChannelFormatDesc` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaChannelFormatKind` is one of + :py:obj:`~.cudaChannelFormatKindSigned`, + :py:obj:`~.cudaChannelFormatKindUnsigned`, or + :py:obj:`~.cudaChannelFormatKindFloat`. + + :py:obj:`~.cudaMallocMipmappedArray()` can allocate the following: + + - A 1D mipmapped array is allocated if the height and depth extents are + both zero. + + - A 2D mipmapped array is allocated if only the depth extent is zero. + + - A 3D mipmapped array is allocated if all three extents are non-zero. + + - A 1D layered CUDA mipmapped array is allocated if only the height + extent is zero and the cudaArrayLayered flag is set. Each layer is a + 1D mipmapped array. The number of layers is determined by the depth + extent. + + - A 2D layered CUDA mipmapped array is allocated if all three extents + are non-zero and the cudaArrayLayered flag is set. Each layer is a 2D + mipmapped array. The number of layers is determined by the depth + extent. + + - A cubemap CUDA mipmapped array is allocated if all three extents are + non-zero and the cudaArrayCubemap flag is set. Width must be equal to + height, and depth must be six. The order of the six layers in memory + is the same as that listed in :py:obj:`~.cudaGraphicsCubeFace`. + + - A cubemap layered CUDA mipmapped array is allocated if all three + extents are non-zero, and both, cudaArrayCubemap and cudaArrayLayered + flags are set. Width must be equal to height, and depth must be a + multiple of six. A cubemap layered CUDA mipmapped array is a special + type of 2D layered CUDA mipmapped array that consists of a collection + of cubemap mipmapped arrays. The first six layers represent the first + cubemap mipmapped array, the next six layers form the second cubemap + mipmapped array, and so on. + + The `flags` parameter enables different options to be specified that + affect the allocation, as follows. + + - :py:obj:`~.cudaArrayDefault`: This flag's value is defined to be 0 + and provides default mipmapped array allocation + + - :py:obj:`~.cudaArrayLayered`: Allocates a layered CUDA mipmapped + array, with the depth extent indicating the number of layers + + - :py:obj:`~.cudaArrayCubemap`: Allocates a cubemap CUDA mipmapped + array. Width must be equal to height, and depth must be six. If the + cudaArrayLayered flag is also set, depth must be a multiple of six. + + - :py:obj:`~.cudaArraySurfaceLoadStore`: This flag indicates that + individual mipmap levels of the CUDA mipmapped array will be read + from or written to using a surface reference. + + - :py:obj:`~.cudaArrayTextureGather`: This flag indicates that texture + gather operations will be performed on the CUDA array. Texture gather + can only be performed on 2D CUDA mipmapped arrays, and the gather + operations are performed only on the most detailed mipmap level. + + - :py:obj:`~.cudaArraySparse`: Allocates a CUDA mipmapped array without + physical backing memory. The subregions within this sparse array can + later be mapped onto a physical memory allocation by calling + :py:obj:`~.cuMemMapArrayAsync`. This flag can only be used for + creating 2D, 3D or 2D layered sparse CUDA mipmapped arrays. The + physical backing memory must be allocated via + :py:obj:`~.cuMemCreate`. + + - :py:obj:`~.cudaArrayDeferredMapping`: Allocates a CUDA mipmapped + array without physical backing memory. The entire array can later be + mapped onto a physical memory allocation by calling + :py:obj:`~.cuMemMapArrayAsync`. The physical backing memory must be + allocated via :py:obj:`~.cuMemCreate`. + + The width, height and depth extents must meet certain size requirements + as listed in the following table. All values are specified in elements. + + **View CUDA Toolkit Documentation for a table example** + + Parameters + ---------- + desc : :py:obj:`~.cudaChannelFormatDesc` + Requested channel format + extent : :py:obj:`~.cudaExtent` + Requested allocation size (`width` field in elements) + numLevels : unsigned int + Number of mipmap levels to allocate + flags : unsigned int + Flags for extensions + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + mipmappedArray : :py:obj:`~.cudaMipmappedArray_t` + Pointer to allocated mipmapped array in device memory + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaMallocMipmappedArray(mipmappedArray._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], numLevels, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, mipmappedArray) +{{endif}} + +{{if 'cudaGetMipmappedArrayLevel' in found_functions}} + +@cython.embedsignature(True) +def cudaGetMipmappedArrayLevel(mipmappedArray, unsigned int level): + """ Gets a mipmap level of a CUDA mipmapped array. + + Returns in `*levelArray` a CUDA array that represents a single mipmap + level of the CUDA mipmapped array `mipmappedArray`. + + If `level` is greater than the maximum number of levels in this + mipmapped array, :py:obj:`~.cudaErrorInvalidValue` is returned. + + If `mipmappedArray` is NULL, :py:obj:`~.cudaErrorInvalidResourceHandle` + is returned. + + Parameters + ---------- + mipmappedArray : :py:obj:`~.cudaMipmappedArray_const_t` + CUDA mipmapped array + level : unsigned int + Mipmap level + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorInvalidResourceHandle` + levelArray : :py:obj:`~.cudaArray_t` + Returned mipmap level CUDA array + + See Also + -------- + :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:`~.cuMipmappedArrayGetLevel` + """ + cdef cyruntime.cudaMipmappedArray_const_t cymipmappedArray + if mipmappedArray is None: + pmipmappedArray = 0 + elif isinstance(mipmappedArray, (cudaMipmappedArray_const_t,)): + pmipmappedArray = int(mipmappedArray) + else: + pmipmappedArray = int(cudaMipmappedArray_const_t(mipmappedArray)) + cymipmappedArray = pmipmappedArray + cdef cudaArray_t levelArray = cudaArray_t() + with nogil: + err = cyruntime.cudaGetMipmappedArrayLevel(levelArray._pvt_ptr, cymipmappedArray, level) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, levelArray) +{{endif}} + +{{if 'cudaMemcpy3D' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy3D(p : Optional[cudaMemcpy3DParms]): + """ Copies data between 3D objects. + + **View CUDA Toolkit Documentation for a C++ code example** + + :py:obj:`~.cudaMemcpy3D()` copies data betwen two 3D objects. The + source and destination objects may be in either host memory, device + memory, or a CUDA array. The source, destination, extent, and kind of + copy performed is specified by the :py:obj:`~.cudaMemcpy3DParms` struct + which should be initialized to zero before use: + + **View CUDA Toolkit Documentation for a C++ code example** + + The struct passed to :py:obj:`~.cudaMemcpy3D()` must specify one of + `srcArray` or `srcPtr` and one of `dstArray` or `dstPtr`. Passing more + than one non-zero source or destination will cause + :py:obj:`~.cudaMemcpy3D()` to return an error. + + The `srcPos` and `dstPos` fields are optional offsets into the source + and destination objects and are defined in units of each object's + elements. The element for a host or device pointer is assumed to be + unsigned char. + + The `extent` field defines the dimensions of the transferred area in + elements. If a CUDA array is participating in the copy, the extent is + defined in terms of that array's elements. If no CUDA array is + participating in the copy then the extents are defined in elements of + unsigned char. + + The `kind` field defines the direction of the copy. It must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. For :py:obj:`~.cudaMemcpyHostToHost` or + :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` passed as kind and cudaArray type + passed as source or destination, if the kind implies cudaArray type to + be present on the host, :py:obj:`~.cudaMemcpy3D()` will disregard that + implication and silently correct the kind based on the fact that + cudaArray type can only be present on the device. + + If the source and destination are both arrays, + :py:obj:`~.cudaMemcpy3D()` will return an error if they do not have the + same element size. + + The source and destination object may not overlap. If overlapping + source and destination objects are specified, undefined behavior will + result. + + The source object must entirely contain the region defined by `srcPos` + and `extent`. The destination object must entirely contain the region + defined by `dstPos` and `extent`. + + :py:obj:`~.cudaMemcpy3D()` returns an error if the pitch of `srcPtr` or + `dstPtr` exceeds the maximum allowed. The pitch of a + :py:obj:`~.cudaPitchedPtr` allocated with :py:obj:`~.cudaMalloc3D()` + will always be valid. + + Parameters + ---------- + p : :py:obj:`~.cudaMemcpy3DParms` + 3D memory copy parameters + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaMemcpy3D(cyp_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy3DPeer' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy3DPeer(p : Optional[cudaMemcpy3DPeerParms]): + """ Copies memory between devices. + + Perform a 3D memory copy according to the parameters specified in `p`. + See the definition of the :py:obj:`~.cudaMemcpy3DPeerParms` structure + for documentation of its parameters. + + Note that this function is synchronous with respect to the host only if + the source or destination of the transfer is host memory. Note also + that this copy is serialized with respect to all pending and future + asynchronous work in to the current device, the copy's source device, + and the copy's destination device (use + :py:obj:`~.cudaMemcpy3DPeerAsync` to avoid this synchronization). + + Parameters + ---------- + p : :py:obj:`~.cudaMemcpy3DPeerParms` + Parameters for the memory copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidPitchValue` + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaMemcpy3DPeer(cyp_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy3DAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy3DAsync(p : Optional[cudaMemcpy3DParms], stream): + """ Copies data between 3D objects. + + **View CUDA Toolkit Documentation for a C++ code example** + + :py:obj:`~.cudaMemcpy3DAsync()` copies data betwen two 3D objects. The + source and destination objects may be in either host memory, device + memory, or a CUDA array. The source, destination, extent, and kind of + copy performed is specified by the :py:obj:`~.cudaMemcpy3DParms` struct + which should be initialized to zero before use: + + **View CUDA Toolkit Documentation for a C++ code example** + + The struct passed to :py:obj:`~.cudaMemcpy3DAsync()` must specify one + of `srcArray` or `srcPtr` and one of `dstArray` or `dstPtr`. Passing + more than one non-zero source or destination will cause + :py:obj:`~.cudaMemcpy3DAsync()` to return an error. + + The `srcPos` and `dstPos` fields are optional offsets into the source + and destination objects and are defined in units of each object's + elements. The element for a host or device pointer is assumed to be + unsigned char. For CUDA arrays, positions must be in the range [0, + 2048) for any dimension. + + The `extent` field defines the dimensions of the transferred area in + elements. If a CUDA array is participating in the copy, the extent is + defined in terms of that array's elements. If no CUDA array is + participating in the copy then the extents are defined in elements of + unsigned char. + + The `kind` field defines the direction of the copy. It must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. For :py:obj:`~.cudaMemcpyHostToHost` or + :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` passed as kind and cudaArray type + passed as source or destination, if the kind implies cudaArray type to + be present on the host, :py:obj:`~.cudaMemcpy3DAsync()` will disregard + that implication and silently correct the kind based on the fact that + cudaArray type can only be present on the device. + + If the source and destination are both arrays, + :py:obj:`~.cudaMemcpy3DAsync()` will return an error if they do not + have the same element size. + + The source and destination object may not overlap. If overlapping + source and destination objects are specified, undefined behavior will + result. + + The source object must lie entirely within the region defined by + `srcPos` and `extent`. The destination object must lie entirely within + the region defined by `dstPos` and `extent`. + + :py:obj:`~.cudaMemcpy3DAsync()` returns an error if the pitch of + `srcPtr` or `dstPtr` exceeds the maximum allowed. The pitch of a + :py:obj:`~.cudaPitchedPtr` allocated with :py:obj:`~.cudaMalloc3D()` + will always be valid. + + :py:obj:`~.cudaMemcpy3DAsync()` is asynchronous with respect to the + host, so the call may return before the copy is complete. The copy can + optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + p : :py:obj:`~.cudaMemcpy3DParms` + 3D memory copy parameters + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemcpy3D`, :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:`~.cuMemcpy3DAsync` + """ + 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.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),) +{{endif}} + +{{if 'cudaMemcpy3DPeerAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy3DPeerAsync(p : Optional[cudaMemcpy3DPeerParms], stream): + """ Copies memory between devices asynchronously. + + Perform a 3D memory copy according to the parameters specified in `p`. + See the definition of the :py:obj:`~.cudaMemcpy3DPeerParms` structure + for documentation of its parameters. + + Parameters + ---------- + p : :py:obj:`~.cudaMemcpy3DPeerParms` + Parameters for the memory copy + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidPitchValue` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpy3DPeerAsync` + """ + 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.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),) +{{endif}} + +{{if 'cudaMemGetInfo' in found_functions}} + +@cython.embedsignature(True) +def cudaMemGetInfo(): + """ Gets free and total device memory. + + Returns in `*total` the total amount of memory available to the the + current context. Returns in `*free` the amount of memory on the device + that is free according to the OS. CUDA is not guaranteed to be able to + allocate all of the memory that the OS reports as free. In a multi- + tenet situation, free estimate returned is prone to race condition + where a new allocation/free done by a different process or a different + thread in the same process between the time when free memory was + estimated and reported, will result in deviation in free value reported + and actual free memory. + + The integrated GPU on Tegra shares memory with CPU and other component + of the SoC. The free and total values returned by the API excludes the + SWAP memory space maintained by the OS on some platforms. The OS may + move some of the memory pages into swap area as the GPU or CPU allocate + or access memory. See Tegra app note on how to calculate total and free + memory on Tegra. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorLaunchFailure` + free : int + Returned free memory in bytes + total : int + Returned total memory in bytes + + See Also + -------- + :py:obj:`~.cuMemGetInfo` + """ + cdef size_t free = 0 + cdef size_t total = 0 + with nogil: + err = cyruntime.cudaMemGetInfo(&free, &total) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, free, total) +{{endif}} + +{{if 'cudaArrayGetInfo' in found_functions}} + +@cython.embedsignature(True) +def cudaArrayGetInfo(array): + """ Gets info about the specified cudaArray. + + Returns in `*desc`, `*extent` and `*flags` respectively, the type, + shape and flags of `array`. + + Any of `*desc`, `*extent` and `*flags` may be specified as NULL. + + Parameters + ---------- + array : :py:obj:`~.cudaArray_t` + The :py:obj:`~.cudaArray` to get info for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + desc : :py:obj:`~.cudaChannelFormatDesc` + Returned array type + extent : :py:obj:`~.cudaExtent` + Returned array shape. 2D arrays will have depth of zero + flags : unsigned int + Returned array flags + + See Also + -------- + :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuArray3DGetDescriptor` + """ + cdef cyruntime.cudaArray_t cyarray + if array is None: + parray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + else: + parray = int(cudaArray_t(array)) + cyarray = parray + cdef cudaChannelFormatDesc desc = cudaChannelFormatDesc() + cdef cudaExtent extent = cudaExtent() + cdef unsigned int flags = 0 + with nogil: + err = cyruntime.cudaArrayGetInfo(desc._pvt_ptr, extent._pvt_ptr, &flags, cyarray) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None, None) + return (_cudaError_t_SUCCESS, desc, extent, flags) +{{endif}} + +{{if 'cudaArrayGetPlane' in found_functions}} + +@cython.embedsignature(True) +def cudaArrayGetPlane(hArray, unsigned int planeIdx): + """ Gets a CUDA array plane from a CUDA array. + + Returns in `pPlaneArray` a CUDA array that represents a single format + plane of the CUDA array `hArray`. + + If `planeIdx` is greater than the maximum number of planes in this + array or if the array does not have a multi-planar format e.g: + :py:obj:`~.cudaChannelFormatKindNV12`, then + :py:obj:`~.cudaErrorInvalidValue` is returned. + + Note that if the `hArray` has format + :py:obj:`~.cudaChannelFormatKindNV12`, then passing in 0 for `planeIdx` + returns a CUDA array of the same size as `hArray` but with one 8-bit + channel and :py:obj:`~.cudaChannelFormatKindUnsigned` as its format + kind. If 1 is passed for `planeIdx`, then the returned CUDA array has + half the height and width of `hArray` with two 8-bit channels and + :py:obj:`~.cudaChannelFormatKindUnsigned` as its format kind. + + Parameters + ---------- + hArray : :py:obj:`~.cudaArray_t` + CUDA array + planeIdx : unsigned int + Plane index + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` :py:obj:`~.cudaErrorInvalidResourceHandle` + pPlaneArray : :py:obj:`~.cudaArray_t` + Returned CUDA array referenced by the `planeIdx` + + See Also + -------- + :py:obj:`~.cuArrayGetPlane` + """ + cdef cyruntime.cudaArray_t cyhArray + if hArray is None: + phArray = 0 + elif isinstance(hArray, (cudaArray_t,)): + phArray = int(hArray) + else: + phArray = int(cudaArray_t(hArray)) + cyhArray = phArray + cdef cudaArray_t pPlaneArray = cudaArray_t() + with nogil: + err = cyruntime.cudaArrayGetPlane(pPlaneArray._pvt_ptr, cyhArray, planeIdx) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pPlaneArray) +{{endif}} + +{{if 'cudaArrayGetMemoryRequirements' in found_functions}} + +@cython.embedsignature(True) +def cudaArrayGetMemoryRequirements(array, int device): + """ Returns the memory requirements of a CUDA array. + + Returns the memory requirements of a CUDA array in `memoryRequirements` + If the CUDA array is not allocated with flag + :py:obj:`~.cudaArrayDeferredMapping` :py:obj:`~.cudaErrorInvalidValue` + will be returned. + + The returned value in :py:obj:`~.cudaArrayMemoryRequirements.size` + represents the total size of the CUDA array. The returned value in + :py:obj:`~.cudaArrayMemoryRequirements.alignment` represents the + alignment necessary for mapping the CUDA array. + + Parameters + ---------- + array : :py:obj:`~.cudaArray_t` + CUDA array to get the memory requirements of + device : int + Device to get the memory requirements for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + memoryRequirements : :py:obj:`~.cudaArrayMemoryRequirements` + Pointer to :py:obj:`~.cudaArrayMemoryRequirements` + + See Also + -------- + :py:obj:`~.cudaMipmappedArrayGetMemoryRequirements` + """ + cdef cyruntime.cudaArray_t cyarray + if array is None: + parray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + else: + parray = int(cudaArray_t(array)) + cyarray = parray + cdef cudaArrayMemoryRequirements memoryRequirements = cudaArrayMemoryRequirements() + with nogil: + err = cyruntime.cudaArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cyarray, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memoryRequirements) +{{endif}} + +{{if 'cudaMipmappedArrayGetMemoryRequirements' in found_functions}} + +@cython.embedsignature(True) +def cudaMipmappedArrayGetMemoryRequirements(mipmap, int device): + """ Returns the memory requirements of a CUDA mipmapped array. + + Returns the memory requirements of a CUDA mipmapped array in + `memoryRequirements` If the CUDA mipmapped array is not allocated with + flag :py:obj:`~.cudaArrayDeferredMapping` + :py:obj:`~.cudaErrorInvalidValue` will be returned. + + The returned value in :py:obj:`~.cudaArrayMemoryRequirements.size` + represents the total size of the CUDA mipmapped array. The returned + value in :py:obj:`~.cudaArrayMemoryRequirements.alignment` represents + the alignment necessary for mapping the CUDA mipmapped array. + + Parameters + ---------- + mipmap : :py:obj:`~.cudaMipmappedArray_t` + CUDA mipmapped array to get the memory requirements of + device : int + Device to get the memory requirements for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + memoryRequirements : :py:obj:`~.cudaArrayMemoryRequirements` + Pointer to :py:obj:`~.cudaArrayMemoryRequirements` + + See Also + -------- + :py:obj:`~.cudaArrayGetMemoryRequirements` + """ + cdef cyruntime.cudaMipmappedArray_t cymipmap + if mipmap is None: + pmipmap = 0 + elif isinstance(mipmap, (cudaMipmappedArray_t,)): + pmipmap = int(mipmap) + else: + pmipmap = int(cudaMipmappedArray_t(mipmap)) + cymipmap = pmipmap + cdef cudaArrayMemoryRequirements memoryRequirements = cudaArrayMemoryRequirements() + with nogil: + err = cyruntime.cudaMipmappedArrayGetMemoryRequirements(memoryRequirements._pvt_ptr, cymipmap, device) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memoryRequirements) +{{endif}} + +{{if 'cudaArrayGetSparseProperties' in found_functions}} + +@cython.embedsignature(True) +def cudaArrayGetSparseProperties(array): + """ Returns the layout properties of a sparse CUDA array. + + Returns the layout properties of a sparse CUDA array in + `sparseProperties`. If the CUDA array is not allocated with flag + :py:obj:`~.cudaArraySparse` :py:obj:`~.cudaErrorInvalidValue` will be + returned. + + If the returned value in :py:obj:`~.cudaArraySparseProperties.flags` + contains :py:obj:`~.cudaArraySparsePropertiesSingleMipTail`, then + :py:obj:`~.cudaArraySparseProperties.miptailSize` represents the total + size of the array. Otherwise, it will be zero. Also, the returned value + in :py:obj:`~.cudaArraySparseProperties.miptailFirstLevel` is always + zero. Note that the `array` must have been allocated using + :py:obj:`~.cudaMallocArray` or :py:obj:`~.cudaMalloc3DArray`. For CUDA + arrays obtained using :py:obj:`~.cudaMipmappedArrayGetLevel`, + :py:obj:`~.cudaErrorInvalidValue` will be returned. Instead, + :py:obj:`~.cudaMipmappedArrayGetSparseProperties` must be used to + obtain the sparse properties of the entire CUDA mipmapped array to + which `array` belongs to. + + Parameters + ---------- + array : :py:obj:`~.cudaArray_t` + The CUDA array to get the sparse properties of + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + sparseProperties : :py:obj:`~.cudaArraySparseProperties` + Pointer to return the :py:obj:`~.cudaArraySparseProperties` + + See Also + -------- + :py:obj:`~.cudaMipmappedArrayGetSparseProperties`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cyruntime.cudaArray_t cyarray + if array is None: + parray = 0 + elif isinstance(array, (cudaArray_t,)): + parray = int(array) + else: + parray = int(cudaArray_t(array)) + cyarray = parray + cdef cudaArraySparseProperties sparseProperties = cudaArraySparseProperties() + with nogil: + err = cyruntime.cudaArrayGetSparseProperties(sparseProperties._pvt_ptr, cyarray) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, sparseProperties) +{{endif}} + +{{if 'cudaMipmappedArrayGetSparseProperties' in found_functions}} + +@cython.embedsignature(True) +def cudaMipmappedArrayGetSparseProperties(mipmap): + """ Returns the layout properties of a sparse CUDA mipmapped array. + + Returns the sparse array layout properties in `sparseProperties`. If + the CUDA mipmapped array is not allocated with flag + :py:obj:`~.cudaArraySparse` :py:obj:`~.cudaErrorInvalidValue` will be + returned. + + For non-layered CUDA mipmapped arrays, + :py:obj:`~.cudaArraySparseProperties.miptailSize` returns the size of + the mip tail region. The mip tail region includes all mip levels whose + width, height or depth is less than that of the tile. For layered CUDA + mipmapped arrays, if :py:obj:`~.cudaArraySparseProperties.flags` + contains :py:obj:`~.cudaArraySparsePropertiesSingleMipTail`, then + :py:obj:`~.cudaArraySparseProperties.miptailSize` specifies the size of + the mip tail of all layers combined. Otherwise, + :py:obj:`~.cudaArraySparseProperties.miptailSize` specifies mip tail + size per layer. The returned value of + :py:obj:`~.cudaArraySparseProperties.miptailFirstLevel` is valid only + if :py:obj:`~.cudaArraySparseProperties.miptailSize` is non-zero. + + Parameters + ---------- + mipmap : :py:obj:`~.cudaMipmappedArray_t` + The CUDA mipmapped array to get the sparse properties of + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + sparseProperties : :py:obj:`~.cudaArraySparseProperties` + Pointer to return :py:obj:`~.cudaArraySparseProperties` + + See Also + -------- + :py:obj:`~.cudaArrayGetSparseProperties`, :py:obj:`~.cuMemMapArrayAsync` + """ + cdef cyruntime.cudaMipmappedArray_t cymipmap + if mipmap is None: + pmipmap = 0 + elif isinstance(mipmap, (cudaMipmappedArray_t,)): + pmipmap = int(mipmap) + else: + pmipmap = int(cudaMipmappedArray_t(mipmap)) + cymipmap = pmipmap + cdef cudaArraySparseProperties sparseProperties = cudaArraySparseProperties() + with nogil: + err = cyruntime.cudaMipmappedArrayGetSparseProperties(sparseProperties._pvt_ptr, cymipmap) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, sparseProperties) +{{endif}} + +{{if 'cudaMemcpy' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy(dst, src, size_t count, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + Copies `count` bytes from the memory area pointed to by `src` to the + memory area pointed to by `dst`, where `kind` specifies the direction + of the copy, and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. Calling :py:obj:`~.cudaMemcpy()` with dst + and src pointers that do not match the direction of the copy results in + an undefined behavior. + + \note_sync + + Parameters + ---------- + dst : Any + Destination memory address + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpy` + """ + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy(cydst, cysrc, count, cykind) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyPeer' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyPeer(dst, int dstDevice, src, int srcDevice, size_t count): + """ Copies memory between two devices. + + Copies memory from one device to memory on another device. `dst` is the + base device pointer of the destination memory and `dstDevice` is the + destination device. `src` is the base device pointer of the source + memory and `srcDevice` is the source device. `count` specifies the + number of bytes to copy. + + Note that this function is asynchronous with respect to the host, but + serialized with respect all pending and future asynchronous work in to + the current device, `srcDevice`, and `dstDevice` (use + :py:obj:`~.cudaMemcpyPeerAsync` to avoid this synchronization). + + Parameters + ---------- + dst : Any + Destination device pointer + dstDevice : int + Destination device + src : Any + Source device pointer + srcDevice : int + Source device + count : size_t + Size of memory copy in bytes + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpyPeer` + """ + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + with nogil: + err = cyruntime.cudaMemcpyPeer(cydst, dstDevice, cysrc, srcDevice, count) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2D' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2D(dst, size_t dpitch, src, size_t spitch, size_t width, size_t height, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the memory + area pointed to by `src` to the memory area pointed to by `dst`, where + `kind` specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `dpitch` and `spitch` are the widths in + memory in bytes of the 2D arrays pointed to by `dst` and `src`, + including any padding added to the end of each row. The memory areas + may not overlap. `width` must not exceed either `dpitch` or `spitch`. + Calling :py:obj:`~.cudaMemcpy2D()` with `dst` and `src` pointers that + do not match the direction of the copy results in an undefined + behavior. :py:obj:`~.cudaMemcpy2D()` returns an error if `dpitch` or + `spitch` exceeds the maximum allowed. + + Parameters + ---------- + dst : Any + Destination memory address + dpitch : size_t + Pitch of destination memory + src : Any + Source memory address + spitch : size_t + Pitch of source memory + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` + """ + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2D(cydst, dpitch, cysrc, spitch, width, height, cykind) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2DToArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DToArray(dst, size_t wOffset, size_t hOffset, src, size_t spitch, size_t width, size_t height, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the memory + area pointed to by `src` to the CUDA array `dst` starting at `hOffset` + rows and `wOffset` bytes from the upper left corner, where `kind` + specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `spitch` is the width in memory in bytes of + the 2D array pointed to by `src`, including any padding added to the + end of each row. `wOffset` + `width` must not exceed the width of the + CUDA array `dst`. `width` must not exceed `spitch`. + :py:obj:`~.cudaMemcpy2DToArray()` returns an error if `spitch` exceeds + the maximum allowed. + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffset : size_t + Destination starting X offset (columns in bytes) + hOffset : size_t + Destination starting Y offset (rows) + src : Any + Source memory address + spitch : size_t + Pitch of source memory + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` + """ + cdef cyruntime.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DToArray(cydst, wOffset, hOffset, cysrc, spitch, width, height, cykind) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2DFromArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DFromArray(dst, size_t dpitch, src, size_t wOffset, size_t hOffset, size_t width, size_t height, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the CUDA + array `src` starting at `hOffset` rows and `wOffset` bytes from the + upper left corner to the memory area pointed to by `dst`, where `kind` + specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `dpitch` is the width in memory in bytes of + the 2D array pointed to by `dst`, including any padding added to the + end of each row. `wOffset` + `width` must not exceed the width of the + CUDA array `src`. `width` must not exceed `dpitch`. + :py:obj:`~.cudaMemcpy2DFromArray()` returns an error if `dpitch` + exceeds the maximum allowed. + + Parameters + ---------- + dst : Any + Destination memory address + dpitch : size_t + Pitch of destination memory + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffset : size_t + Source starting X offset (columns in bytes) + hOffset : size_t + Source starting Y offset (rows) + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` + """ + cdef cyruntime.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DFromArray(cydst, dpitch, cysrc, wOffset, hOffset, width, height, cykind) + _helper_input_void_ptr_free(&cydstHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2DArrayToArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DArrayToArray(dst, size_t wOffsetDst, size_t hOffsetDst, src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the CUDA + array `src` starting at `hOffsetSrc` rows and `wOffsetSrc` bytes from + the upper left corner to the CUDA array `dst` starting at `hOffsetDst` + rows and `wOffsetDst` bytes from the upper left corner, where `kind` + specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `wOffsetDst` + `width` must not exceed the + width of the CUDA array `dst`. `wOffsetSrc` + `width` must not exceed + the width of the CUDA array `src`. + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffsetDst : size_t + Destination starting X offset (columns in bytes) + hOffsetDst : size_t + Destination starting Y offset (rows) + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffsetSrc : size_t + Source starting X offset (columns in bytes) + hOffsetSrc : size_t + Source starting Y offset (rows) + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` + """ + cdef cyruntime.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef cyruntime.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DArrayToArray(cydst, wOffsetDst, hOffsetDst, cysrc, wOffsetSrc, hOffsetSrc, width, height, cykind) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyAsync(dst, src, size_t count, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + Copies `count` bytes from the memory area pointed to by `src` to the + memory area pointed to by `dst`, where `kind` specifies the direction + of the copy, and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + The memory areas may not overlap. Calling :py:obj:`~.cudaMemcpyAsync()` + with `dst` and `src` pointers that do not match the direction of the + copy results in an undefined behavior. + + :py:obj:`~.cudaMemcpyAsync()` is asynchronous with respect to the host, + so the call may return before the copy is complete. The copy can + optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and the `stream` is non-zero, the + copy may overlap with operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + dst : Any + Destination memory address + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyAsync`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemcpyDtoDAsync` + """ + 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 _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyAsync(cydst, cysrc, count, cykind, cystream) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyPeerAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, stream): + """ Copies memory between two devices asynchronously. + + Copies memory from one device to memory on another device. `dst` is the + base device pointer of the destination memory and `dstDevice` is the + destination device. `src` is the base device pointer of the source + memory and `srcDevice` is the source device. `count` specifies the + number of bytes to copy. + + Note that this function is asynchronous with respect to the host and + all work on other devices. + + Parameters + ---------- + dst : Any + Destination device pointer + dstDevice : int + Destination device + src : Any + Source device pointer + srcDevice : int + Source device + count : size_t + Size of memory copy in bytes + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpyPeerAsync` + """ + 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 _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + with nogil: + err = cyruntime.cudaMemcpyPeerAsync(cydst, dstDevice, cysrc, srcDevice, count, cystream) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyBatchAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyBatchAsync(dsts : Optional[tuple[Any] | list[Any]], srcs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, attrs : Optional[tuple[cudaMemcpyAttributes] | list[cudaMemcpyAttributes]], attrsIdxs : tuple[int] | list[int], size_t numAttrs, stream): + """ Performs a batch of memory copies asynchronously. + + Performs a batch of memory copies. The batch as a whole executes in + stream order but copies within a batch are not guaranteed to execute in + any specific order. This API only supports pointer-to-pointer copies. + For copies involving CUDA arrays, please see + :py:obj:`~.cudaMemcpy3DBatchAsync`. + + Performs memory copies from source buffers specified in `srcs` to + destination buffers specified in `dsts`. The size of each copy is + specified in `sizes`. All three arrays must be of the same length as + specified by `count`. Since there are no ordering guarantees for copies + within a batch, specifying any dependent copies within a batch will + result in undefined behavior. + + Every copy in the batch has to be associated with a set of attributes + specified in the `attrs` array. Each entry in this array can apply to + more than one copy. This can be done by specifying in the `attrsIdxs` + array, the index of the first copy that the corresponding entry in the + `attrs` array applies to. Both `attrs` and `attrsIdxs` must be of the + same length as specified by `numAttrs`. For example, if a batch has 10 + copies listed in dst/src/sizes, the first 6 of which have one set of + attributes and the remaining 4 another, then `numAttrs` will be 2, + `attrsIdxs` will be {0, 6} and `attrs` will contains the two sets of + attributes. Note that the first entry in `attrsIdxs` must always be 0. + Also, each entry must be greater than the previous entry and the last + entry should be less than `count`. Furthermore, `numAttrs` must be + lesser than or equal to `count`. + + The :py:obj:`~.cudaMemcpyAttributes.srcAccessOrder` indicates the + source access ordering to be observed for copies associated with the + attribute. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderStream`, then the source will be + accessed in stream order. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderDuringApiCall` then it 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. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderAny` then it 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. Each memcpy operation in the batch must have a valid + :py:obj:`~.cudaMemcpyAttributes` corresponding to it including the + appropriate srcAccessOrder setting, otherwise the API will return + :py:obj:`~.cudaErrorInvalidValue`. + + The :py:obj:`~.cudaMemcpyAttributes.srcLocHint` and + :py:obj:`~.cudaMemcpyAttributes.dstLocHint` allows applications to + specify hint locations for operands of a copy when the operand doesn't + have a fixed location. That is, these hints are only applicable 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. For other cases, + these hints are ignored. + + The :py:obj:`~.cudaMemcpyAttributes.flags` field can be used to specify + certain flags for copies. Setting the + :py:obj:`~.cudaMemcpyFlagPreferOverlapWithCompute` flag indicates that + the associated copies should preferably overlap with any compute work. + Note that this flag is a hint and can be ignored depending on the + platform and other parameters of the copy. + + If any error is encountered while parsing the batch, the index within + the batch where the error was encountered will be returned in + `failIdx`. + + Parameters + ---------- + dsts : list[Any] + Array of destination pointers. + srcs : list[Any] + Array of memcpy source pointers. + sizes : list[int] + Array of sizes for memcpy operations. + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays + attrs : list[:py:obj:`~.cudaMemcpyAttributes`] + Array of memcpy attributes. + attrsIdxs : list[int] + Array of indices to specify which copies each entry in the `attrs` + array applies to. The attributes specified in attrs[k] will be + applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] + - 1. Also attrs[numAttrs-1] will apply to copies starting from + attrsIdxs[numAttrs-1] through count - 1. + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be legacy NULL + stream. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + failIdx : int + Pointer to a location to return the index of the copy where a + failure was encountered. The value will be SIZE_MAX if the error + doesn't pertain to any specific copy. + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + if not all(isinstance(_x, (int)) for _x in attrsIdxs): + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") + attrs = [] if attrs is None else attrs + if not all(isinstance(_x, (cudaMemcpyAttributes,)) for _x in attrs): + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cyruntime.cudaMemcpyAttributes,] or list[cyruntime.cudaMemcpyAttributes,]") + if not all(isinstance(_x, (int)) for _x in sizes): + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") + srcs = [] if srcs is None else srcs + dsts = [] if dsts is None else dsts + pylist = [_HelperInputVoidPtr(pydsts) for pydsts in dsts] + cdef _InputVoidPtrPtrHelper voidStarHelperdsts = _InputVoidPtrPtrHelper(pylist) + cdef void** cydsts_ptr = voidStarHelperdsts.cptr + pylist = [_HelperInputVoidPtr(pysrcs) for pysrcs in srcs] + cdef _InputVoidPtrPtrHelper voidStarHelpersrcs = _InputVoidPtrPtrHelper(pylist) + cdef void** cysrcs_ptr = voidStarHelpersrcs.cptr + cdef vector[size_t] cysizes = sizes + if count > len(dsts): raise RuntimeError("List is too small: " + str(len(dsts)) + " < " + str(count)) + if count > len(srcs): raise RuntimeError("List is too small: " + str(len(srcs)) + " < " + str(count)) + if count > len(sizes): raise RuntimeError("List is too small: " + str(len(sizes)) + " < " + str(count)) + cdef cyruntime.cudaMemcpyAttributes* cyattrs = NULL + if len(attrs) > 1: + cyattrs = calloc(len(attrs), sizeof(cyruntime.cudaMemcpyAttributes)) + if cyattrs is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(attrs)) + 'x' + str(sizeof(cyruntime.cudaMemcpyAttributes))) + for idx in range(len(attrs)): + string.memcpy(&cyattrs[idx], (attrs[idx])._pvt_ptr, sizeof(cyruntime.cudaMemcpyAttributes)) + elif len(attrs) == 1: + cyattrs = (attrs[0])._pvt_ptr + cdef vector[size_t] cyattrsIdxs = attrsIdxs + if numAttrs > len(attrs): raise RuntimeError("List is too small: " + str(len(attrs)) + " < " + str(numAttrs)) + if numAttrs > len(attrsIdxs): raise RuntimeError("List is too small: " + str(len(attrsIdxs)) + " < " + str(numAttrs)) + cdef size_t failIdx = 0 + with nogil: + err = cyruntime.cudaMemcpyBatchAsync(cydsts_ptr, cysrcs_ptr, cysizes.data(), count, cyattrs, cyattrsIdxs.data(), numAttrs, &failIdx, cystream) + if len(attrs) > 1 and cyattrs is not NULL: + free(cyattrs) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, failIdx) +{{endif}} + +{{if 'cudaMemcpy3DBatchAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBatchOp] | list[cudaMemcpy3DBatchOp]], unsigned long long flags, stream): + """ Performs a batch of 3D memory copies asynchronously. + + Performs a batch of memory copies. The batch as a whole executes in + stream order but copies within a batch are not guaranteed to execute in + any specific order. Note that this means specifying any dependent + copies within a batch will result in undefined behavior. + + Performs memory copies as specified in the `opList` array. The length + of this array is specified in `numOps`. Each entry in this array + describes a copy operation. This includes among other things, the + source and destination operands for the copy as specified in + :py:obj:`~.cudaMemcpy3DBatchOp.src` and + :py:obj:`~.cudaMemcpy3DBatchOp.dst` respectively. The source and + destination operands of a copy can either be a pointer or a CUDA array. + The width, height and depth of a copy is specified in + :py:obj:`~.cudaMemcpy3DBatchOp.extent`. The width, height and depth of + a copy are specified in elements and must not be zero. For pointer-to- + pointer copies, the element size is considered to be 1. For pointer to + CUDA array or vice versa copies, the element size is determined by 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:`~.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 + pointer where the copy should begin. 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 + equal to the height of the copy specified in + :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 + 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. + + The :py:obj:`~.cudaMemcpyAttributes.srcAccessOrder` indicates the + source access ordering to be observed for copies associated with the + attribute. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderStream`, then the source will be + accessed in stream order. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderDuringApiCall` then it 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. If the source access order is set to + :py:obj:`~.cudaMemcpySrcAccessOrderAny` then it 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. Each memcopy operation in `opList` must have a valid + srcAccessOrder setting, otherwise this API will return + :py:obj:`~.cudaErrorInvalidValue`. + + The :py:obj:`~.cudaMemcpyAttributes.flags` field can be used to specify + certain flags for copies. Setting the + :py:obj:`~.cudaMemcpyFlagPreferOverlapWithCompute` flag indicates that + the associated copies should preferably overlap with any compute work. + Note that this flag is a hint and can be ignored depending on the + platform and other parameters of the copy. + + If any error is encountered while parsing the batch, the index within + the batch where the error was encountered will be returned in + `failIdx`. + + Parameters + ---------- + numOps : size_t + Total number of memcpy operations. + opList : list[:py:obj:`~.cudaMemcpy3DBatchOp`] + Array of size `numOps` containing the actual memcpy operations. + flags : unsigned long long + Flags for future use, must be zero now. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream to enqueue the operations in. Must not be default NULL + stream. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` :py:obj:`~.cudaErrorInvalidValue` + failIdx : int + Pointer to a location to return the index of the copy where a + failure was encountered. The value will be SIZE_MAX if the error + doesn't pertain to any specific copy. + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + opList = [] if opList is None else opList + if not all(isinstance(_x, (cudaMemcpy3DBatchOp,)) for _x in opList): + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cyruntime.cudaMemcpy3DBatchOp,] or list[cyruntime.cudaMemcpy3DBatchOp,]") + if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) + cdef cyruntime.cudaMemcpy3DBatchOp* cyopList = NULL + if len(opList) > 1: + cyopList = calloc(len(opList), sizeof(cyruntime.cudaMemcpy3DBatchOp)) + if cyopList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(opList)) + 'x' + str(sizeof(cyruntime.cudaMemcpy3DBatchOp))) + for idx in range(len(opList)): + string.memcpy(&cyopList[idx], (opList[idx])._pvt_ptr, sizeof(cyruntime.cudaMemcpy3DBatchOp)) + elif len(opList) == 1: + cyopList = (opList[0])._pvt_ptr + cdef size_t failIdx = 0 + with nogil: + err = cyruntime.cudaMemcpy3DBatchAsync(numOps, cyopList, &failIdx, flags, cystream) + if len(opList) > 1 and cyopList is not NULL: + free(cyopList) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, failIdx) +{{endif}} + +{{if 'cudaMemcpy2DAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DAsync(dst, size_t dpitch, src, size_t spitch, size_t width, size_t height, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the memory + area pointed to by `src` to the memory area pointed to by `dst`, where + `kind` specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `dpitch` and `spitch` are the widths in + memory in bytes of the 2D arrays pointed to by `dst` and `src`, + including any padding added to the end of each row. The memory areas + may not overlap. `width` must not exceed either `dpitch` or `spitch`. + + Calling :py:obj:`~.cudaMemcpy2DAsync()` with `dst` and `src` pointers + that do not match the direction of the copy results in an undefined + behavior. :py:obj:`~.cudaMemcpy2DAsync()` returns an error if `dpitch` + or `spitch` is greater than the maximum allowed. + + :py:obj:`~.cudaMemcpy2DAsync()` is asynchronous with respect to the + host, so the call may return before the copy is complete. The copy can + optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + dst : Any + Destination memory address + dpitch : size_t + Pitch of destination memory + src : Any + Source memory address + spitch : size_t + Pitch of source memory + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :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:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2DAsync` + """ + 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 _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DAsync(cydst, dpitch, cysrc, spitch, width, height, cykind, cystream) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2DToArrayAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t spitch, size_t width, size_t height, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the memory + area pointed to by `src` to the CUDA array `dst` starting at `hOffset` + rows and `wOffset` bytes from the upper left corner, where `kind` + specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `spitch` is the width in memory in bytes of + the 2D array pointed to by `src`, including any padding added to the + end of each row. `wOffset` + `width` must not exceed the width of the + CUDA array `dst`. `width` must not exceed `spitch`. + :py:obj:`~.cudaMemcpy2DToArrayAsync()` returns an error if `spitch` + exceeds the maximum allowed. + + :py:obj:`~.cudaMemcpy2DToArrayAsync()` is asynchronous with respect to + the host, so the call may return before the copy is complete. The copy + can optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + :py:obj:`~.cudaMemcpy2DFromArrayAsync`, + :py:obj:`~.cudaMemcpyToSymbolAsync`, + :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2DAsync` + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffset : size_t + Destination starting X offset (columns in bytes) + hOffset : size_t + Destination starting Y offset (rows) + src : Any + Source memory address + spitch : size_t + Pitch of source memory + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :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`, + """ + 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.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DToArrayAsync(cydst, wOffset, hOffset, cysrc, spitch, width, height, cykind, cystream) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpy2DFromArrayAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpy2DFromArrayAsync(dst, size_t dpitch, src, size_t wOffset, size_t hOffset, size_t width, size_t height, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + Copies a matrix (`height` rows of `width` bytes each) from the CUDA + array `src` starting at `hOffset` rows and `wOffset` bytes from the + upper left corner to the memory area pointed to by `dst`, where `kind` + specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. `dpitch` is the width in memory in bytes of + the 2D array pointed to by `dst`, including any padding added to the + end of each row. `wOffset` + `width` must not exceed the width of the + CUDA array `src`. `width` must not exceed `dpitch`. + :py:obj:`~.cudaMemcpy2DFromArrayAsync()` returns an error if `dpitch` + exceeds the maximum allowed. + + :py:obj:`~.cudaMemcpy2DFromArrayAsync()` is asynchronous with respect + to the host, so the call may return before the copy is complete. The + copy can optionally be associated to a stream by passing a non-zero + `stream` argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + :py:obj:`~.cudaMemcpyToSymbolAsync`, + :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2DAsync` + + Parameters + ---------- + dst : Any + Destination memory address + dpitch : size_t + Pitch of destination memory + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffset : size_t + Source starting X offset (columns in bytes) + hOffset : size_t + Source starting Y offset (rows) + width : size_t + Width of matrix transfer (columns in bytes) + height : size_t + Height of matrix transfer (rows) + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidPitchValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :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`, + """ + 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.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpy2DFromArrayAsync(cydst, dpitch, cysrc, wOffset, hOffset, width, height, cykind, cystream) + _helper_input_void_ptr_free(&cydstHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemset' in found_functions}} + +@cython.embedsignature(True) +def cudaMemset(devPtr, int value, size_t count): + """ Initializes or sets device memory to a value. + + Fills the first `count` bytes of the memory area pointed to by `devPtr` + with the constant byte value `value`. + + Note that this function is asynchronous with respect to the host unless + `devPtr` refers to pinned host memory. + + Parameters + ---------- + devPtr : Any + Pointer to device memory + value : int + Value to set for each byte of specified memory + count : size_t + Size in bytes to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemset(cydevPtr, value, count) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemset2D' in found_functions}} + +@cython.embedsignature(True) +def cudaMemset2D(devPtr, size_t pitch, int value, size_t width, size_t height): + """ Initializes or sets device memory to a value. + + Sets to the specified value `value` a matrix (`height` rows of `width` + bytes each) pointed to by `dstPtr`. `pitch` is the width in bytes of + the 2D array pointed to by `dstPtr`, including any padding added to the + end of each row. This function performs fastest when the pitch is one + that has been passed back by :py:obj:`~.cudaMallocPitch()`. + + Note that this function is asynchronous with respect to the host unless + `devPtr` refers to pinned host memory. + + Parameters + ---------- + devPtr : Any + Pointer to 2D device memory + pitch : size_t + Pitch in bytes of 2D device memory(Unused if `height` is 1) + value : int + Value to set for each byte of specified memory + width : size_t + Width of matrix set (columns in bytes) + height : size_t + Height of matrix set (rows) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemset2D(cydevPtr, pitch, value, width, height) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemset3D' in found_functions}} + +@cython.embedsignature(True) +def cudaMemset3D(pitchedDevPtr not None : cudaPitchedPtr, int value, extent not None : cudaExtent): + """ Initializes or sets device memory to a value. + + Initializes each element of a 3D array to the specified value `value`. + The object to initialize is defined by `pitchedDevPtr`. The `pitch` + field of `pitchedDevPtr` is the width in memory in bytes of the 3D + array pointed to by `pitchedDevPtr`, including any padding added to the + end of each row. The `xsize` field specifies the logical width of each + row in bytes, while the `ysize` field specifies the height of each 2D + slice in rows. The `pitch` field of `pitchedDevPtr` is ignored when + `height` and `depth` are both equal to 1. + + The extents of the initialized region are specified as a `width` in + bytes, a `height` in rows, and a `depth` in slices. + + Extents with `width` greater than or equal to the `xsize` of + `pitchedDevPtr` may perform significantly faster than extents narrower + than the `xsize`. Secondarily, extents with `height` equal to the + `ysize` of `pitchedDevPtr` will perform faster than when the `height` + is shorter than the `ysize`. + + This function performs fastest when the `pitchedDevPtr` has been + allocated by :py:obj:`~.cudaMalloc3D()`. + + Note that this function is asynchronous with respect to the host unless + `pitchedDevPtr` refers to pinned host memory. + + Parameters + ---------- + pitchedDevPtr : :py:obj:`~.cudaPitchedPtr` + Pointer to pitched device memory + value : int + Value to set for each byte of specified memory + extent : :py:obj:`~.cudaExtent` + Size parameters for where to set device memory (`width` field in + bytes) + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.make_cudaPitchedPtr`, :py:obj:`~.make_cudaExtent` + """ + with nogil: + err = cyruntime.cudaMemset3D(pitchedDevPtr._pvt_ptr[0], value, extent._pvt_ptr[0]) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemsetAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemsetAsync(devPtr, int value, size_t count, stream): + """ Initializes or sets device memory to a value. + + Fills the first `count` bytes of the memory area pointed to by `devPtr` + with the constant byte value `value`. + + :py:obj:`~.cudaMemsetAsync()` is asynchronous with respect to the host, + so the call may return before the memset is complete. The operation can + optionally be associated to a stream by passing a non-zero `stream` + argument. If `stream` is non-zero, the operation may overlap with + operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + devPtr : Any + Pointer to device memory + value : int + Value to set for each byte of specified memory + count : size_t + Size in bytes to set + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cuMemsetD8Async`, :py:obj:`~.cuMemsetD16Async`, :py:obj:`~.cuMemsetD32Async` + """ + 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 _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemsetAsync(cydevPtr, value, count, cystream) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemset2DAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemset2DAsync(devPtr, size_t pitch, int value, size_t width, size_t height, stream): + """ Initializes or sets device memory to a value. + + Sets to the specified value `value` a matrix (`height` rows of `width` + bytes each) pointed to by `dstPtr`. `pitch` is the width in bytes of + the 2D array pointed to by `dstPtr`, including any padding added to the + end of each row. This function performs fastest when the pitch is one + that has been passed back by :py:obj:`~.cudaMallocPitch()`. + + :py:obj:`~.cudaMemset2DAsync()` is asynchronous with respect to the + host, so the call may return before the memset is complete. The + operation can optionally be associated to a stream by passing a non- + zero `stream` argument. If `stream` is non-zero, the operation may + overlap with operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + devPtr : Any + Pointer to 2D device memory + pitch : size_t + Pitch in bytes of 2D device memory(Unused if `height` is 1) + value : int + Value to set for each byte of specified memory + width : size_t + Width of matrix set (columns in bytes) + height : size_t + Height of matrix set (rows) + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cuMemsetD2D8Async`, :py:obj:`~.cuMemsetD2D16Async`, :py:obj:`~.cuMemsetD2D32Async` + """ + 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 _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemset2DAsync(cydevPtr, pitch, value, width, height, cystream) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemset3DAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemset3DAsync(pitchedDevPtr not None : cudaPitchedPtr, int value, extent not None : cudaExtent, stream): + """ Initializes or sets device memory to a value. + + Initializes each element of a 3D array to the specified value `value`. + The object to initialize is defined by `pitchedDevPtr`. The `pitch` + field of `pitchedDevPtr` is the width in memory in bytes of the 3D + array pointed to by `pitchedDevPtr`, including any padding added to the + end of each row. The `xsize` field specifies the logical width of each + row in bytes, while the `ysize` field specifies the height of each 2D + slice in rows. The `pitch` field of `pitchedDevPtr` is ignored when + `height` and `depth` are both equal to 1. + + The extents of the initialized region are specified as a `width` in + bytes, a `height` in rows, and a `depth` in slices. + + Extents with `width` greater than or equal to the `xsize` of + `pitchedDevPtr` may perform significantly faster than extents narrower + than the `xsize`. Secondarily, extents with `height` equal to the + `ysize` of `pitchedDevPtr` will perform faster than when the `height` + is shorter than the `ysize`. + + This function performs fastest when the `pitchedDevPtr` has been + allocated by :py:obj:`~.cudaMalloc3D()`. + + :py:obj:`~.cudaMemset3DAsync()` is asynchronous with respect to the + host, so the call may return before the memset is complete. The + operation can optionally be associated to a stream by passing a non- + zero `stream` argument. If `stream` is non-zero, the operation may + overlap with operations in other streams. + + The device version of this function only handles device to device + copies and cannot be given local or shared pointers. + + Parameters + ---------- + pitchedDevPtr : :py:obj:`~.cudaPitchedPtr` + Pointer to pitched device memory + value : int + Value to set for each byte of specified memory + extent : :py:obj:`~.cudaExtent` + Size parameters for where to set device memory (`width` field in + bytes) + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.make_cudaPitchedPtr`, :py:obj:`~.make_cudaExtent` + """ + 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 + with nogil: + err = cyruntime.cudaMemset3DAsync(pitchedDevPtr._pvt_ptr[0], value, extent._pvt_ptr[0], cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPrefetchAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPrefetchAsync(devPtr, size_t count, int dstDevice, stream): + """ Prefetches memory to the specified destination device. + + Prefetches memory to the specified destination device. `devPtr` is the + base device pointer of the memory to be prefetched and `dstDevice` is + the destination device. `count` specifies the number of bytes to copy. + `stream` is the stream in which the operation is enqueued. The memory + range must refer to managed memory allocated via + :py:obj:`~.cudaMallocManaged` or declared via managed variables, or it + may also refer to system-allocated memory on systems with non-zero + cudaDevAttrPageableMemoryAccess. + + Passing in cudaCpuDeviceId for `dstDevice` will prefetch the data to + host memory. If `dstDevice` is a GPU, then the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` must be non-zero. + Additionally, `stream` must be associated with a device that has a non- + zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. + + The start address and end address of the memory range will be rounded + down and rounded up respectively to be aligned to CPU page size before + the prefetch operation is enqueued in the stream. + + If no physical memory has been allocated for this region, then this + memory region will be populated and mapped on the destination device. + If there's insufficient memory to prefetch the desired region, the + Unified Memory driver may evict pages from other + :py:obj:`~.cudaMallocManaged` allocations to host memory in order to + make room. Device memory allocated using :py:obj:`~.cudaMalloc` or + :py:obj:`~.cudaMallocArray` will not be evicted. + + By default, any mappings to the previous location of the migrated pages + are removed and mappings for the new location are only setup on + `dstDevice`. The exact behavior however also depends on the settings + applied to this memory range via :py:obj:`~.cudaMemAdvise` as described + below: + + If :py:obj:`~.cudaMemAdviseSetReadMostly` was set on any subset of this + memory range, then that subset will create a read-only copy of the + pages on `dstDevice`. + + If :py:obj:`~.cudaMemAdviseSetPreferredLocation` was called on any + subset of this memory range, then the pages will be migrated to + `dstDevice` even if `dstDevice` is not the preferred location of any + pages in the memory range. + + If :py:obj:`~.cudaMemAdviseSetAccessedBy` was called on any subset of + this memory range, then mappings to those pages from all the + appropriate processors are updated to refer to the new location if + establishing such a mapping is possible. Otherwise, those mappings are + cleared. + + Note that this API is not required for functionality and only serves to + improve performance by allowing the application to migrate data to a + suitable location before it is accessed. Memory accesses to this range + are always coherent and are allowed even when the data is actively + being migrated. + + Note that this function is asynchronous with respect to the host and + all work on other devices. + + Parameters + ---------- + devPtr : Any + Pointer to be prefetched + count : size_t + Size in bytes + dstDevice : int + Destination device to prefetch to + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue prefetch operation + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cudaMemAdvise_v2` :py:obj:`~.cuMemPrefetchAsync` + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemPrefetchAsync(cydevPtr, count, dstDevice, cystream) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPrefetchAsync_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPrefetchAsync_v2(devPtr, size_t count, location not None : cudaMemLocation, unsigned int flags, stream): + """ Prefetches memory to the specified destination location. + + Prefetches memory to the specified destination location. `devPtr` is + the base device pointer of the memory to be prefetched and `location` + specifies the destination location. `count` specifies the number of + bytes to copy. `stream` is the stream in which the operation is + enqueued. The memory range must refer to managed memory allocated via + :py:obj:`~.cudaMallocManaged` or declared via managed variables, or it + may also refer to system-allocated memory on systems with non-zero + cudaDevAttrPageableMemoryAccess. + + Specifying :py:obj:`~.cudaMemLocationTypeDevice` for + :py:obj:`~.cudaMemLocation.type` will prefetch memory to GPU specified + by device ordinal :py:obj:`~.cudaMemLocation.id` which must have non- + zero value for the device attribute + :py:obj:`~.concurrentManagedAccess`. Additionally, `stream` must be + associated with a device that has a non-zero value for the device + attribute :py:obj:`~.concurrentManagedAccess`. Specifying + :py:obj:`~.cudaMemLocationTypeHost` as :py:obj:`~.cudaMemLocation.type` + will prefetch data to host memory. Applications can request prefetching + memory to a specific host NUMA node by specifying + :py:obj:`~.cudaMemLocationTypeHostNuma` for + :py:obj:`~.cudaMemLocation.type` and a valid host NUMA node id in + :py:obj:`~.cudaMemLocation.id` Users can also request prefetching + memory to the host NUMA node closest to the current thread's CPU by + specifying :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` for + :py:obj:`~.cudaMemLocation.type`. Note when + :py:obj:`~.cudaMemLocation.type` is etiher + :py:obj:`~.cudaMemLocationTypeHost` OR + :py:obj:`~.cudaMemLocationTypeHostNumaCurrent`, + :py:obj:`~.cudaMemLocation.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 + the prefetch operation is enqueued in the stream. + + If no physical memory has been allocated for this region, then this + memory region will be populated and mapped on the destination device. + If there's insufficient memory to prefetch the desired region, the + Unified Memory driver may evict pages from other + :py:obj:`~.cudaMallocManaged` allocations to host memory in order to + make room. Device memory allocated using :py:obj:`~.cudaMalloc` or + :py:obj:`~.cudaMallocArray` will not be evicted. + + By default, any mappings to the previous location of the migrated pages + are removed and mappings for the new location are only setup on the + destination location. The exact behavior however also depends on the + settings applied to this memory range via :py:obj:`~.cuMemAdvise` as + described below: + + If :py:obj:`~.cudaMemAdviseSetReadMostly` was set on any subset of this + memory range, then that subset will create a read-only copy of the + pages on destination location. If however the destination location is a + host NUMA node, then any pages of that subset that are already in + another host NUMA node will be transferred to the destination. + + If :py:obj:`~.cudaMemAdviseSetPreferredLocation` was called on any + subset of this memory range, then the pages will be migrated to + `location` even if `location` is not the preferred location of any + pages in the memory range. + + If :py:obj:`~.cudaMemAdviseSetAccessedBy` was called on any subset of + this memory range, then mappings to those pages from all the + appropriate processors are updated to refer to the new location if + establishing such a mapping is possible. Otherwise, those mappings are + cleared. + + Note that this API is not required for functionality and only serves to + improve performance by allowing the application to migrate data to a + suitable location before it is accessed. Memory accesses to this range + are always coherent and are allowed even when the data is actively + being migrated. + + Note that this function is asynchronous with respect to the host and + all work on other devices. + + Parameters + ---------- + devPtr : Any + Pointer to be prefetched + count : size_t + Size in bytes + location : :py:obj:`~.cudaMemLocation` + location to prefetch to + flags : unsigned int + flags for future use, must be zero now. + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue prefetch operation + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cudaMemAdvise_v2` :py:obj:`~.cuMemPrefetchAsync` + """ + cdef cyruntime.cudaStream_t cystream + if stream is None: + pstream = 0 + elif isinstance(stream, (cudaStream_t,driver.CUstream)): + pstream = int(stream) + else: + pstream = int(cudaStream_t(stream)) + cystream = pstream + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemPrefetchAsync_v2(cydevPtr, count, location._pvt_ptr[0], flags, cystream) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemAdvise' in found_functions}} + +@cython.embedsignature(True) +def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, int device): + """ Advise about the usage of a given memory range. + + Advise the Unified Memory subsystem about the usage pattern for the + memory range starting at `devPtr` with a size of `count` bytes. The + start address and end address of the memory range will be rounded down + and rounded up respectively to be aligned to CPU page size before the + advice is applied. The memory range must refer to managed memory + allocated via :py:obj:`~.cudaMallocManaged` or declared via managed + variables. The memory range could also refer to system-allocated + pageable memory provided it represents a valid, host-accessible region + of memory and all additional constraints imposed by `advice` as + outlined below are also satisfied. Specifying an invalid system- + allocated pageable memory range results in an error being returned. + + The `advice` parameter can take the following values: + + - :py:obj:`~.cudaMemAdviseSetReadMostly`: This implies that the data is + mostly going to be read from and only occasionally written to. Any + read accesses from any processor to this region will create a read- + only copy of at least the accessed pages in that processor's memory. + Additionally, if :py:obj:`~.cudaMemPrefetchAsync` is called on this + region, it will create a read-only copy of the data on the + destination processor. If any processor writes to this region, all + copies of the corresponding page will be invalidated except for the + one where the write occurred. The `device` argument is ignored for + this advice. Note that for a page to be read-duplicated, the + accessing processor must either be the CPU or a GPU that has a non- + zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Also, if a context is + created on a device that does not have the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` set, then read- + duplication will not occur until all such contexts are destroyed. If + the memory region refers to valid system-allocated pageable memory, + then the accessing device must have a non-zero value for the device + attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess` for a read-only + copy to be created on that device. Note however that if the accessing + device also has a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + setting this advice will not create a read-only copy when that device + accesses this memory region. + + - :py:obj:`~.cudaMemAdviceUnsetReadMostly`: Undoes the effect of + :py:obj:`~.cudaMemAdviceReadMostly` and also prevents the Unified + Memory driver from attempting heuristic read-duplication on the + memory range. Any read-duplicated copies of the data will be + collapsed into a single copy. The location for the collapsed copy + will be the preferred location if the page has a preferred location + and one of the read-duplicated copies was resident at that location. + Otherwise, the location chosen is arbitrary. + + - :py:obj:`~.cudaMemAdviseSetPreferredLocation`: This advice sets the + preferred location for the data to be the memory belonging to + `device`. Passing in cudaCpuDeviceId for `device` sets the preferred + location as host memory. If `device` is a GPU, then it must have a + non-zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Setting the preferred + location does not cause data to migrate to that location immediately. + Instead, it guides the migration policy when a fault occurs on that + memory region. If the data is already in its preferred location and + the faulting processor can establish a mapping without requiring the + data to be migrated, then data migration will be avoided. On the + other hand, if the data is not in its preferred location or if a + direct mapping cannot be established, then it will be migrated to the + processor accessing it. It is important to note that setting the + preferred location does not prevent data prefetching done using + :py:obj:`~.cudaMemPrefetchAsync`. Having a preferred location can + override the page thrash detection and resolution logic in the + Unified Memory driver. Normally, if a page is detected to be + constantly thrashing between for example host and device memory, the + page may eventually be pinned to host memory by the Unified Memory + driver. But if the preferred location is set as device memory, then + the page will continue to thrash indefinitely. If + :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice, unless read + accesses from `device` will not result in a read-only copy being + created on that device as outlined in description for the advice + :py:obj:`~.cudaMemAdviseSetReadMostly`. If the memory region refers + to valid system-allocated pageable memory, then `device` must have a + non-zero value for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + + - :py:obj:`~.cudaMemAdviseUnsetPreferredLocation`: Undoes the effect of + :py:obj:`~.cudaMemAdviseSetPreferredLocation` and changes the + preferred location to none. + + - :py:obj:`~.cudaMemAdviseSetAccessedBy`: This advice implies that the + data will be accessed by `device`. Passing in + :py:obj:`~.cudaCpuDeviceId` for `device` will set the advice for the + CPU. If `device` is a GPU, then the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess` must be non-zero. This + advice does not cause data migration and has no impact on the + location of the data per se. Instead, it causes the data to always be + mapped in the specified processor's page tables, as long as the + location of the data permits a mapping to be established. If the data + gets migrated for any reason, the mappings are updated accordingly. + This advice is recommended in scenarios where data locality is not + important, but avoiding faults is. Consider for example a system + containing multiple GPUs with peer-to-peer access enabled, where the + data located on one GPU is occasionally accessed by peer GPUs. In + such scenarios, migrating data over to the other GPUs is not as + important because the accesses are infrequent and the overhead of + migration may be too high. But preventing faults can still help + improve performance, and so having a mapping set up in advance is + useful. Note that on CPU access of this data, the data may be + migrated to host memory because the CPU typically cannot access + device memory directly. Any GPU that had the + :py:obj:`~.cudaMemAdviceSetAccessedBy` flag set for this data will + now have its mapping updated to point to the page in host memory. If + :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice. Additionally, if + the preferred location of this memory region or any subset of it is + also `device`, then the policies associated with + :py:obj:`~.cudaMemAdviseSetPreferredLocation` will override the + policies of this advice. If the memory region refers to valid system- + allocated pageable memory, then `device` must have a non-zero value + for the device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + Additionally, if `device` has a non-zero value for the device + attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + this call has no effect. + + - :py:obj:`~.cudaMemAdviseUnsetAccessedBy`: Undoes the effect of + :py:obj:`~.cudaMemAdviseSetAccessedBy`. Any mappings to the data from + `device` may be removed at any time causing accesses to result in + non-fatal page faults. If the memory region refers to valid system- + allocated pageable memory, then `device` must have a non-zero value + for the device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + Additionally, if `device` has a non-zero value for the device + attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + this call has no effect. + + Parameters + ---------- + devPtr : Any + Pointer to memory to set the advice for + count : size_t + Size in bytes of the memory range + advice : :py:obj:`~.cudaMemoryAdvise` + Advice to be applied for the specified memory range + device : int + Device to apply the advice for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + cdef cyruntime.cudaMemoryAdvise cyadvice = int(advice) + with nogil: + err = cyruntime.cudaMemAdvise(cydevPtr, count, cyadvice, device) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemAdvise_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaMemAdvise_v2(devPtr, size_t count, advice not None : cudaMemoryAdvise, location not None : cudaMemLocation): + """ Advise about the usage of a given memory range. + + Advise the Unified Memory subsystem about the usage pattern for the + memory range starting at `devPtr` with a size of `count` bytes. The + start address and end address of the memory range will be rounded down + and rounded up respectively to be aligned to CPU page size before the + advice is applied. The memory range must refer to managed memory + allocated via :py:obj:`~.cudaMallocManaged` or declared via managed + variables. The memory range could also refer to system-allocated + pageable memory provided it represents a valid, host-accessible region + of memory and all additional constraints imposed by `advice` as + outlined below are also satisfied. Specifying an invalid system- + allocated pageable memory range results in an error being returned. + + The `advice` parameter can take the following values: + + - :py:obj:`~.cudaMemAdviseSetReadMostly`: This implies that the data is + mostly going to be read from and only occasionally written to. Any + read accesses from any processor to this region will create a read- + only copy of at least the accessed pages in that processor's memory. + Additionally, if :py:obj:`~.cudaMemPrefetchAsync` or + :py:obj:`~.cudaMemPrefetchAsync_v2` is called on this region, it will + create a read-only copy of the data on the destination processor. If + the target location for :py:obj:`~.cudaMemPrefetchAsync_v2` is a host + NUMA node and a read-only copy already exists on another host NUMA + node, that copy will be migrated to the targeted host NUMA node. If + any processor writes to this region, all copies of the corresponding + page will be invalidated except for the one where the write occurred. + If the writing processor is the CPU and the preferred location of the + page is a host NUMA node, then the page will also be migrated to that + host NUMA node. The `location` argument is ignored for this advice. + Note that for a page to be read-duplicated, the accessing processor + must either be the CPU or a GPU that has a non-zero value for the + device attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. + Also, if a context is created on a device that does not have the + device attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess` set, + then read-duplication will not occur until all such contexts are + destroyed. If the memory region refers to valid system-allocated + pageable memory, then the accessing device must have a non-zero value + for the device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess` + for a read-only copy to be created on that device. Note however that + if the accessing device also has a non-zero value for the device + attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + setting this advice will not create a read-only copy when that device + accesses this memory region. + + - :py:obj:`~.cudaMemAdviceUnsetReadMostly`: Undoes the effect of + :py:obj:`~.cudaMemAdviseSetReadMostly` and also prevents the Unified + Memory driver from attempting heuristic read-duplication on the + memory range. Any read-duplicated copies of the data will be + collapsed into a single copy. The location for the collapsed copy + will be the preferred location if the page has a preferred location + and one of the read-duplicated copies was resident at that location. + Otherwise, the location chosen is arbitrary. Note: The `location` + argument is ignored for this advice. + + - :py:obj:`~.cudaMemAdviseSetPreferredLocation`: This advice sets the + preferred location for the data to be the memory belonging to + `location`. When :py:obj:`~.cudaMemLocation.type` is + :py:obj:`~.cudaMemLocationTypeHost`, :py:obj:`~.cudaMemLocation.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:`~.cudaMemLocation.type` to + :py:obj:`~.cudaMemLocationTypeHostNuma` and + :py:obj:`~.cudaMemLocation.id` must specify the NUMA ID of the host + NUMA node. If :py:obj:`~.cudaMemLocation.type` is set to + :py:obj:`~.cudaMemLocationTypeHostNumaCurrent`, + :py:obj:`~.cudaMemLocation.id` will be ignored and the host NUMA node + closest to the calling thread's CPU will be used as the preferred + location. If :py:obj:`~.cudaMemLocation.type` is a + :py:obj:`~.cudaMemLocationTypeDevice`, then + :py:obj:`~.cudaMemLocation.id` must be a valid device ordinal and the + device must have a non-zero value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. Setting the preferred + location does not cause data to migrate to that location immediately. + Instead, it guides the migration policy when a fault occurs on that + memory region. If the data is already in its preferred location and + the faulting processor can establish a mapping without requiring the + data to be migrated, then data migration will be avoided. On the + other hand, if the data is not in its preferred location or if a + direct mapping cannot be established, then it will be migrated to the + processor accessing it. It is important to note that setting the + preferred location does not prevent data prefetching done using + :py:obj:`~.cudaMemPrefetchAsync`. Having a preferred location can + override the page thrash detection and resolution logic in the + Unified Memory driver. Normally, if a page is detected to be + constantly thrashing between for example host and device memory, the + page may eventually be pinned to host memory by the Unified Memory + driver. But if the preferred location is set as device memory, then + the page will continue to thrash indefinitely. If + :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice, unless read + accesses from `location` will not result in a read-only copy being + created on that procesor as outlined in description for the advice + :py:obj:`~.cudaMemAdviseSetReadMostly`. If the memory region refers + to valid system-allocated pageable memory, and + :py:obj:`~.cudaMemLocation.type` is + :py:obj:`~.cudaMemLocationTypeDevice` then + :py:obj:`~.cudaMemLocation.id` must be a valid device that has a non- + zero alue for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + + - :py:obj:`~.cudaMemAdviseUnsetPreferredLocation`: Undoes the effect of + :py:obj:`~.cudaMemAdviseSetPreferredLocation` and changes the + preferred location to none. The `location` argument is ignored for + this advice. + + - :py:obj:`~.cudaMemAdviseSetAccessedBy`: This advice implies that the + data will be accessed by processor `location`. The + :py:obj:`~.cudaMemLocation.type` must be either + :py:obj:`~.cudaMemLocationTypeDevice` with + :py:obj:`~.cudaMemLocation.id` representing a valid device ordinal or + :py:obj:`~.cudaMemLocationTypeHost` and + :py:obj:`~.cudaMemLocation.id` will be ignored. All other location + types are invalid. If :py:obj:`~.cudaMemLocation.id` is a GPU, then + the device attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess` + must be non-zero. This advice does not cause data migration and has + no impact on the location of the data per se. Instead, it causes the + data to always be mapped in the specified processor's page tables, as + long as the location of the data permits a mapping to be established. + If the data gets migrated for any reason, the mappings are updated + accordingly. This advice is recommended in scenarios where data + locality is not important, but avoiding faults is. Consider for + example a system containing multiple GPUs with peer-to-peer access + enabled, where the data located on one GPU is occasionally accessed + by peer GPUs. In such scenarios, migrating data over to the other + GPUs is not as important because the accesses are infrequent and the + overhead of migration may be too high. But preventing faults can + still help improve performance, and so having a mapping set up in + advance is useful. Note that on CPU access of this data, the data may + be migrated to host memory because the CPU typically cannot access + device memory directly. Any GPU that had the + :py:obj:`~.cudaMemAdviseSetAccessedBy` flag set for this data will + now have its mapping updated to point to the page in host memory. If + :py:obj:`~.cudaMemAdviseSetReadMostly` is also set on this memory + region or any subset of it, then the policies associated with that + advice will override the policies of this advice. Additionally, if + the preferred location of this memory region or any subset of it is + also `location`, then the policies associated with + :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION` will override the + policies of this advice. If the memory region refers to valid system- + allocated pageable memory, and :py:obj:`~.cudaMemLocation.type` is + :py:obj:`~.cudaMemLocationTypeDevice` then device in + :py:obj:`~.cudaMemLocation.id` must have a non-zero value for the + device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + Additionally, if :py:obj:`~.cudaMemLocation.id` has a non-zero value + for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + this call has no effect. + + - :py:obj:`~.CU_MEM_ADVISE_UNSET_ACCESSED_BY`: Undoes the effect of + :py:obj:`~.cudaMemAdviseSetAccessedBy`. Any mappings to the data from + `location` may be removed at any time causing accesses to result in + non-fatal page faults. If the memory region refers to valid system- + allocated pageable memory, and :py:obj:`~.cudaMemLocation.type` is + :py:obj:`~.cudaMemLocationTypeDevice` then device in + :py:obj:`~.cudaMemLocation.id` must have a non-zero value for the + device attribute :py:obj:`~.cudaDevAttrPageableMemoryAccess`. + Additionally, if :py:obj:`~.cudaMemLocation.id` has a non-zero value + for the device attribute + :py:obj:`~.cudaDevAttrPageableMemoryAccessUsesHostPageTables`, then + this call has no effect. + + Parameters + ---------- + devPtr : Any + Pointer to memory to set the advice for + count : size_t + Size in bytes of the memory range + advice : :py:obj:`~.cudaMemoryAdvise` + Advice to be applied for the specified memory range + location : :py:obj:`~.cudaMemLocation` + location to apply the advice for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemAdvise_v2` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + cdef cyruntime.cudaMemoryAdvise cyadvice = int(advice) + with nogil: + err = cyruntime.cudaMemAdvise_v2(cydevPtr, count, cyadvice, location._pvt_ptr[0]) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemRangeGetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeAttribute, devPtr, size_t count): + """ Query an attribute of a given memory range. + + Query an attribute about the memory range starting at `devPtr` with a + size of `count` bytes. The memory range must refer to managed memory + allocated via :py:obj:`~.cudaMallocManaged` or declared via managed + variables. + + The `attribute` parameter can take the following values: + + - :py:obj:`~.cudaMemRangeAttributeReadMostly`: If this attribute is + specified, `data` will be interpreted as a 32-bit integer, and + `dataSize` must be 4. The result returned will be 1 if all pages in + the given memory range have read-duplication enabled, or 0 otherwise. + + - :py:obj:`~.cudaMemRangeAttributePreferredLocation`: If this attribute + is specified, `data` will be interpreted as a 32-bit integer, and + `dataSize` must be 4. The result returned will be a GPU device id if + all pages in the memory range have that GPU as their preferred + location, or it will be cudaCpuDeviceId if all pages in the memory + range have the CPU as their preferred location, or it will be + cudaInvalidDeviceId if either all the pages don't have the same + preferred location or some of the pages don't have a preferred + location at all. Note that the actual location of the pages in the + memory range at the time of the query may be different from the + preferred location. + + - :py:obj:`~.cudaMemRangeAttributeAccessedBy`: If this attribute is + specified, `data` will be interpreted as an array of 32-bit integers, + and `dataSize` must be a non-zero multiple of 4. The result returned + will be a list of device ids that had + :py:obj:`~.cudaMemAdviceSetAccessedBy` set for that entire memory + range. If any device does not have that advice set for the entire + memory range, that device will not be included. If `data` is larger + than the number of devices that have that advice set for that memory + range, cudaInvalidDeviceId will be returned in all the extra space + provided. For ex., if `dataSize` is 12 (i.e. `data` has 3 elements) + and only device 0 has the advice set, then the result returned will + be { 0, cudaInvalidDeviceId, cudaInvalidDeviceId }. If `data` is + smaller than the number of devices that have that advice set, then + only as many devices will be returned as can fit in the array. There + is no guarantee on which specific devices will be returned, however. + + - :py:obj:`~.cudaMemRangeAttributeLastPrefetchLocation`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. The result returned will be the + last location to which all pages in the memory range were prefetched + explicitly via :py:obj:`~.cudaMemPrefetchAsync`. This will either be + a GPU id or cudaCpuDeviceId depending on whether the last location + for prefetch was a GPU or the CPU respectively. If any page in the + memory range was never explicitly prefetched or if all pages were not + prefetched to the same location, cudaInvalidDeviceId will be + returned. Note that this simply returns the last location that the + applicaton requested to prefetch the memory range to. It gives no + indication as to whether the prefetch operation to that location has + completed or even begun. + + - :py:obj:`~.cudaMemRangeAttributePreferredLocationType`: If this + attribute is specified, `data` will be interpreted as a + :py:obj:`~.cudaMemLocationType`, and `dataSize` must be + sizeof(cudaMemLocationType). The :py:obj:`~.cudaMemLocationType` + returned will be :py:obj:`~.cudaMemLocationTypeDevice` if all pages + in the memory range have the same GPU as their preferred location, or + :py:obj:`~.cudaMemLocationType` will be + :py:obj:`~.cudaMemLocationTypeHost` if all pages in the memory range + have the CPU as their preferred location, or or it will be + :py:obj:`~.cudaMemLocationTypeHostNuma` if all the pages in the + memory range have the same host NUMA node ID as their preferred + location or it will be :py:obj:`~.cudaMemLocationTypeInvalid` if + either all the pages don't have the same preferred location or some + of the pages don't have a preferred location at all. Note that the + actual location type of the pages in the memory range at the time of + the query may be different from the preferred location type. + + - :py:obj:`~.cudaMemRangeAttributePreferredLocationId`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. If the + :py:obj:`~.cudaMemRangeAttributePreferredLocationType` query for + the same address range returns + :py:obj:`~.cudaMemLocationTypeDevice`, it will be a valid device + ordinal or if it returns :py:obj:`~.cudaMemLocationTypeHostNuma`, + it will be a valid host NUMA node ID or if it returns any other + location type, the id should be ignored. + + - :py:obj:`~.cudaMemRangeAttributeLastPrefetchLocationType`: If this + attribute is specified, `data` will be interpreted as a + :py:obj:`~.cudaMemLocationType`, and `dataSize` must be + sizeof(cudaMemLocationType). The result returned will be the last + location type to which all pages in the memory range were prefetched + explicitly via :py:obj:`~.cuMemPrefetchAsync`. The + :py:obj:`~.cudaMemLocationType` returned will be + :py:obj:`~.cudaMemLocationTypeDevice` if the last prefetch location + was the GPU or :py:obj:`~.cudaMemLocationTypeHost` if it was the CPU + or :py:obj:`~.cudaMemLocationTypeHostNuma` if the last prefetch + location was a specific host NUMA node. If any page in the memory + range was never explicitly prefetched or if all pages were not + prefetched to the same location, :py:obj:`~.CUmemLocationType` will + be :py:obj:`~.cudaMemLocationTypeInvalid`. Note that this simply + returns the last location type that the application requested to + prefetch the memory range to. It gives no indication as to whether + the prefetch operation to that location has completed or even begun. + + - :py:obj:`~.cudaMemRangeAttributeLastPrefetchLocationId`: If this + attribute is specified, `data` will be interpreted as a 32-bit + integer, and `dataSize` must be 4. If the + :py:obj:`~.cudaMemRangeAttributeLastPrefetchLocationType` query for + the same address range returns + :py:obj:`~.cudaMemLocationTypeDevice`, it will be a valid device + ordinal or if it returns :py:obj:`~.cudaMemLocationTypeHostNuma`, + it will be a valid host NUMA node ID or if it returns any other + location type, the id should be ignored. + + Parameters + ---------- + dataSize : size_t + Array containing the size of data + attribute : :py:obj:`~.cudaMemRangeAttribute` + The attribute to query + devPtr : Any + Start of the range to query + count : size_t + Size of the range to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + data : Any + A pointers to a memory location where the result of each attribute + query will be written to. + + See Also + -------- + :py:obj:`~.cudaMemRangeGetAttributes`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cuMemRangeGetAttribute` + """ + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) + cdef void* cydata_ptr = cydata.cptr + cdef cyruntime.cudaMemRangeAttribute cyattribute = int(attribute) + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr, count) + _helper_input_void_ptr_free(&cydevPtrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cydata.pyObj()) +{{endif}} + +{{if 'cudaMemRangeGetAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Optional[tuple[cudaMemRangeAttribute] | list[cudaMemRangeAttribute]], size_t numAttributes, devPtr, size_t count): + """ Query attributes of a given memory range. + + Query attributes of the memory range starting at `devPtr` with a size + of `count` bytes. The memory range must refer to managed memory + allocated via :py:obj:`~.cudaMallocManaged` or declared via managed + variables. The `attributes` array will be interpreted to have + `numAttributes` entries. The `dataSizes` array will also be interpreted + to have `numAttributes` entries. The results of the query will be + stored in `data`. + + The list of supported attributes are given below. Please refer to + :py:obj:`~.cudaMemRangeGetAttribute` for attribute descriptions and + restrictions. + + - :py:obj:`~.cudaMemRangeAttributeReadMostly` + + - :py:obj:`~.cudaMemRangeAttributePreferredLocation` + + - :py:obj:`~.cudaMemRangeAttributeAccessedBy` + + - :py:obj:`~.cudaMemRangeAttributeLastPrefetchLocation` + + - :: cudaMemRangeAttributePreferredLocationType + + - :: cudaMemRangeAttributePreferredLocationId + + - :: cudaMemRangeAttributeLastPrefetchLocationType + + - :: cudaMemRangeAttributeLastPrefetchLocationId + + Parameters + ---------- + dataSizes : list[int] + Array containing the sizes of each result + attributes : list[:py:obj:`~.cudaMemRangeAttribute`] + An array of attributes to query (numAttributes and the number of + attributes in this array should match) + numAttributes : size_t + Number of attributes to query + devPtr : Any + Start of the range to query + count : size_t + Size of the range to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + data : list[Any] + A two-dimensional array containing pointers to memory locations + where the result of each attribute query will be written to. + + See Also + -------- + :py:obj:`~.cudaMemRangeGetAttribute`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemRangeGetAttributes` + """ + attributes = [] if attributes is None else attributes + if not all(isinstance(_x, (cudaMemRangeAttribute)) for _x in attributes): + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cyruntime.cudaMemRangeAttribute] or list[cyruntime.cudaMemRangeAttribute]") + if not all(isinstance(_x, (int)) for _x in dataSizes): + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) + cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr + cdef vector[size_t] cydataSizes = dataSizes + cdef vector[cyruntime.cudaMemRangeAttribute] cyattributes = attributes + if numAttributes > len(dataSizes): raise RuntimeError("List is too small: " + str(len(dataSizes)) + " < " + str(numAttributes)) + if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr, count) + _helper_input_void_ptr_free(&cydevPtrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, [obj.pyObj() for obj in pylist]) +{{endif}} + +{{if 'cudaMemcpyToArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyToArray(dst, size_t wOffset, size_t hOffset, src, size_t count, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + [Deprecated] + + Copies `count` bytes from the memory area pointed to by `src` to the + CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from + the upper left corner, where `kind` specifies the direction of the + copy, and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffset : size_t + Destination starting X offset (columns in bytes) + hOffset : size_t + Destination starting Y offset (rows) + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpyFromArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpyArrayToArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpyToArrayAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpyFromArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyDtoA` + """ + cdef cyruntime.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyToArray(cydst, wOffset, hOffset, cysrc, count, cykind) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyFromArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyFromArray(dst, src, size_t wOffset, size_t hOffset, size_t count, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + [Deprecated] + + Copies `count` bytes from the CUDA array `src` starting at `hOffset` + rows and `wOffset` bytes from the upper left corner to the memory area + pointed to by `dst`, where `kind` specifies the direction of the copy, + and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + Parameters + ---------- + dst : Any + Destination memory address + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffset : size_t + Source starting X offset (columns in bytes) + hOffset : size_t + Source starting Y offset (rows) + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpyToArray`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpyArrayToArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpyToArrayAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpyFromArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoD` + """ + cdef cyruntime.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyFromArray(cydst, cysrc, wOffset, hOffset, count, cykind) + _helper_input_void_ptr_free(&cydstHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyArrayToArray' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyArrayToArray(dst, size_t wOffsetDst, size_t hOffsetDst, src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, kind not None : cudaMemcpyKind): + """ Copies data between host and device. + + [Deprecated] + + Copies `count` bytes from the CUDA array `src` starting at `hOffsetSrc` + rows and `wOffsetSrc` bytes from the upper left corner to the CUDA + array `dst` starting at `hOffsetDst` rows and `wOffsetDst` bytes from + the upper left corner, where `kind` specifies the direction of the + copy, and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffsetDst : size_t + Destination starting X offset (columns in bytes) + hOffsetDst : size_t + Destination starting Y offset (rows) + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffsetSrc : size_t + Source starting X offset (columns in bytes) + hOffsetSrc : size_t + Source starting Y offset (rows) + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpyToArray`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpyFromArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpyToArrayAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpyFromArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyAtoA` + """ + cdef cyruntime.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef cyruntime.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyArrayToArray(cydst, wOffsetDst, hOffsetDst, cysrc, wOffsetSrc, hOffsetSrc, count, cykind) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyToArrayAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t count, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + [Deprecated] + + Copies `count` bytes from the memory area pointed to by `src` to the + CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from + the upper left corner, where `kind` specifies the direction of the + copy, and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + :py:obj:`~.cudaMemcpyToArrayAsync()` is asynchronous with respect to + the host, so the call may return before the copy is complete. The copy + can optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + Parameters + ---------- + dst : :py:obj:`~.cudaArray_t` + Destination memory address + wOffset : size_t + Destination starting X offset (columns in bytes) + hOffset : size_t + Destination starting Y offset (rows) + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpyToArray`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpyFromArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpyArrayToArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpyFromArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpy2DAsync` + """ + 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.cudaArray_t cydst + if dst is None: + pdst = 0 + elif isinstance(dst, (cudaArray_t,)): + pdst = int(dst) + else: + pdst = int(cudaArray_t(dst)) + cydst = pdst + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyToArrayAsync(cydst, wOffset, hOffset, cysrc, count, cykind, cystream) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemcpyFromArrayAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMemcpyFromArrayAsync(dst, src, size_t wOffset, size_t hOffset, size_t count, kind not None : cudaMemcpyKind, stream): + """ Copies data between host and device. + + [Deprecated] + + Copies `count` bytes from the CUDA array `src` starting at `hOffset` + rows and `wOffset` bytes from the upper left corner to the memory area + pointed to by `dst`, where `kind` specifies the direction of the copy, + and must be one of :py:obj:`~.cudaMemcpyHostToHost`, + :py:obj:`~.cudaMemcpyHostToDevice`, :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. + + :py:obj:`~.cudaMemcpyFromArrayAsync()` is asynchronous with respect to + the host, so the call may return before the copy is complete. The copy + can optionally be associated to a stream by passing a non-zero `stream` + argument. If `kind` is :py:obj:`~.cudaMemcpyHostToDevice` or + :py:obj:`~.cudaMemcpyDeviceToHost` and `stream` is non-zero, the copy + may overlap with operations in other streams. + + Parameters + ---------- + dst : Any + Destination memory address + src : :py:obj:`~.cudaArray_const_t` + Source memory address + wOffset : size_t + Source starting X offset (columns in bytes) + hOffset : size_t + Source starting Y offset (rows) + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream identifier + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidMemcpyDirection` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpyToArray`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpyFromArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpyArrayToArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpyToArrayAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpy2DAsync` + """ + 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.cudaArray_const_t cysrc + if src is None: + psrc = 0 + elif isinstance(src, (cudaArray_const_t,)): + psrc = int(src) + else: + psrc = int(cudaArray_const_t(src)) + cysrc = psrc + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaMemcpyFromArrayAsync(cydst, cysrc, wOffset, hOffset, count, cykind, cystream) + _helper_input_void_ptr_free(&cydstHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMallocAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocAsync(size_t size, hStream): + """ Allocates memory with stream ordered semantics. + + Inserts an allocation operation into `hStream`. A pointer to the + allocated memory is returned immediately in *dptr. The allocation must + not be accessed until the the allocation operation completes. The + allocation comes from the memory pool associated with the stream's + device. + + Parameters + ---------- + size : size_t + Number of bytes to allocate + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering contract and the memory + pool to allocate from + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorOutOfMemory`, + devPtr : Any + Returned device pointer + + See Also + -------- + :py:obj:`~.cuMemAllocAsync`, cudaMallocAsync (C++ API), :py:obj:`~.cudaMallocFromPoolAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceSetMemPool`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaMemPoolSetAccess`, :py:obj:`~.cudaMemPoolSetAttribute`, :py:obj:`~.cudaMemPoolGetAttribute` + + Notes + ----- + The default memory pool of a device contains device memory from that device. + + Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs. + + During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef void_ptr devPtr = 0 + with nogil: + err = cyruntime.cudaMallocAsync(&devPtr, size, cyhStream) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, devPtr) +{{endif}} + +{{if 'cudaFreeAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaFreeAsync(devPtr, hStream): + """ Frees memory with stream ordered semantics. + + Inserts a free operation into `hStream`. The allocation must not be + accessed after stream execution reaches the free. After this API + returns, accessing the memory from any subsequent work launched on the + GPU or querying its pointer attributes results in undefined behavior. + + Parameters + ---------- + dptr : Any + memory to free + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering promise + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cudaMallocAsync` + + Notes + ----- + During stream capture, this function results in the creation of a free node and must therefore be passed the address of a graph allocation. + """ + cdef cyruntime.cudaStream_t cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (cudaStream_t,driver.CUstream)): + phStream = int(hStream) + else: + phStream = int(cudaStream_t(hStream)) + cyhStream = phStream + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + with nogil: + err = cyruntime.cudaFreeAsync(cydevPtr, cyhStream) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPoolTrimTo' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolTrimTo(memPool, size_t minBytesToKeep): + """ Tries to release memory back to the OS. + + Releases memory back to the OS until the pool contains fewer than + minBytesToKeep reserved bytes, or there is no more memory that the + allocator can safely release. The allocator cannot release OS + allocations that back outstanding asynchronous allocations. The OS + allocations may happen at different granularity from the user + allocations. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to trim + minBytesToKeep : size_t + If the pool has less than minBytesToKeep reserved, the TrimTo + operation is a no-op. Otherwise the pool will be guaranteed to have + at least minBytesToKeep bytes reserved after the operation. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cuMemPoolTrimTo`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaMemPoolCreate` + + Notes + ----- + : Allocations that have not been freed count as outstanding. + + : Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize) can count as outstanding. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + with nogil: + err = cyruntime.cudaMemPoolTrimTo(cymemPool, minBytesToKeep) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPoolSetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolSetAttribute(memPool, attr not None : cudaMemPoolAttr, value): + """ Sets attributes of a memory pool. + + Supported attributes are: + + - :py:obj:`~.cudaMemPoolAttrReleaseThreshold`: (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:`~.cudaMemPoolReuseFollowEventDependencies`: (value type = + int) Allow :py:obj:`~.cudaMallocAsync` to use memory asynchronously + freed in another stream 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) + + - :py:obj:`~.cudaMemPoolReuseAllowOpportunistic`: (value type = int) + Allow reuse of already completed frees when there is no dependency + between the free and allocation. (default enabled) + + - :py:obj:`~.cudaMemPoolReuseAllowInternalDependencies`: (value type = + int) Allow :py:obj:`~.cudaMallocAsync` to insert new stream + dependencies in order to establish the stream ordering required to + reuse a piece of memory released by :py:obj:`~.cudaFreeAsync` + (default enabled). + + - :py:obj:`~.cudaMemPoolAttrReservedMemHigh`: (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:`~.cudaMemPoolAttrUsedMemHigh`: (value type = cuuint64_t) + Reset the high watermark that tracks the amount of used memory that + was allocated for the memory pool. It is illegal to set this + attribute to a non-zero value. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to modify + attr : :py:obj:`~.cudaMemPoolAttr` + The attribute to modify + value : Any + Pointer to the value to assign + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cuMemPoolSetAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaMemPoolCreate` + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef cyruntime.cudaMemPoolAttr cyattr = int(attr) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cyruntime.cudaMemPoolSetAttribute(cymemPool, cyattr, cyvalue_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPoolGetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): + """ Gets attributes of a memory pool. + + Supported attributes are: + + - :py:obj:`~.cudaMemPoolAttrReleaseThreshold`: (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:`~.cudaMemPoolReuseFollowEventDependencies`: (value type = + int) Allow :py:obj:`~.cudaMallocAsync` to use memory asynchronously + freed in another stream 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) + + - :py:obj:`~.cudaMemPoolReuseAllowOpportunistic`: (value type = int) + Allow reuse of already completed frees when there is no dependency + between the free and allocation. (default enabled) + + - :py:obj:`~.cudaMemPoolReuseAllowInternalDependencies`: (value type = + int) Allow :py:obj:`~.cudaMallocAsync` to insert new stream + dependencies in order to establish the stream ordering required to + reuse a piece of memory released by :py:obj:`~.cudaFreeAsync` + (default enabled). + + - :py:obj:`~.cudaMemPoolAttrReservedMemCurrent`: (value type = + cuuint64_t) Amount of backing memory currently allocated for the + mempool. + + - :py:obj:`~.cudaMemPoolAttrReservedMemHigh`: (value type = cuuint64_t) + High watermark of backing memory allocated for the mempool since the + last time it was reset. + + - :py:obj:`~.cudaMemPoolAttrUsedMemCurrent`: (value type = cuuint64_t) + Amount of memory from the pool that is currently in use by the + application. + + - :py:obj:`~.cudaMemPoolAttrUsedMemHigh`: (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. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The memory pool to get attributes of + attr : :py:obj:`~.cudaMemPoolAttr` + The attribute to get + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + value : Any + Retrieved value + + See Also + -------- + :py:obj:`~.cuMemPoolGetAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaMemPoolCreate` + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef cyruntime.cudaMemPoolAttr cyattr = int(attr) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cyruntime.cudaMemPoolGetAttribute(cymemPool, cyattr, cyvalue_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cyvalue.pyObj()) +{{endif}} + +{{if 'cudaMemPoolSetAccess' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolSetAccess(memPool, descList : Optional[tuple[cudaMemAccessDesc] | list[cudaMemAccessDesc]], size_t count): + """ Controls visibility of pools between devices. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The pool being modified + map : list[:py:obj:`~.cudaMemAccessDesc`] + Array of access descriptors. Each descriptor instructs the access + to enable for a single gpu + count : size_t + Number of descriptors in the map array. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cuMemPoolSetAccess`, :py:obj:`~.cudaMemPoolGetAccess`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` + """ + descList = [] if descList is None else descList + if not all(isinstance(_x, (cudaMemAccessDesc,)) for _x in descList): + raise TypeError("Argument 'descList' is not instance of type (expected tuple[cyruntime.cudaMemAccessDesc,] or list[cyruntime.cudaMemAccessDesc,]") + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef cyruntime.cudaMemAccessDesc* cydescList = NULL + if len(descList) > 1: + cydescList = calloc(len(descList), sizeof(cyruntime.cudaMemAccessDesc)) + if cydescList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(descList)) + 'x' + str(sizeof(cyruntime.cudaMemAccessDesc))) + for idx in range(len(descList)): + string.memcpy(&cydescList[idx], (descList[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + elif len(descList) == 1: + cydescList = (descList[0])._pvt_ptr + if count > len(descList): raise RuntimeError("List is too small: " + str(len(descList)) + " < " + str(count)) + with nogil: + err = cyruntime.cudaMemPoolSetAccess(cymemPool, cydescList, count) + if len(descList) > 1 and cydescList is not NULL: + free(cydescList) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMemPoolGetAccess' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolGetAccess(memPool, location : Optional[cudaMemLocation]): + """ Returns the accessibility of a pool from a device. + + Returns the accessibility of the pool's memory from the specified + location. + + Parameters + ---------- + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + the pool being queried + location : :py:obj:`~.cudaMemLocation` + the location accessing the pool + + Returns + ------- + cudaError_t + + flags : :py:obj:`~.cudaMemAccessFlags` + the accessibility of the pool from the specified location + + See Also + -------- + :py:obj:`~.cuMemPoolGetAccess`, :py:obj:`~.cudaMemPoolSetAccess` + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef cyruntime.cudaMemAccessFlags flags + 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: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaMemAccessFlags(flags)) +{{endif}} + +{{if 'cudaMemPoolCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): + """ Creates a memory pool. + + Creates a CUDA memory pool and returns the handle in `pool`. The + `poolProps` determines the properties of the pool such as the backing + device and IPC capabilities. + + To create a memory pool targeting a specific host NUMA node, + applications must set :py:obj:`~.cudaMemPoolProps.cudaMemLocation.type` + to :py:obj:`~.cudaMemLocationTypeHostNuma` and + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.id` must specify the NUMA + ID of the host memory node. Specifying + :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` or + :py:obj:`~.cudaMemLocationTypeHost` as the + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.type` will result in + :py:obj:`~.cudaErrorInvalidValue`. By default, the pool's memory will + be accessible from the device it is allocated on. In the case of pools + created with :py:obj:`~.cudaMemLocationTypeHostNuma`, their default + accessibility will be from the host CPU. Applications can control the + maximum size of the pool by specifying a non-zero value for + :py:obj:`~.cudaMemPoolProps.maxSize`. If set to 0, the maximum size of + the pool will default to a system dependent value. + + Applications that intend to use :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` + based memory sharing must ensure: (1) `nvidia-caps-imex-channels` + character device is created by the driver and is listed under + /proc/devices (2) have at least one IMEX channel file accessible by the + user launching the application. + + When exporter and importer CUDA processes have been granted access to + the same IMEX channel, they can securely share memory. + + The IMEX channel security model works on a per user basis. Which means + all processes under a user can share memory if the user has access to a + valid IMEX channel. When multi-user isolation is desired, a separate + IMEX channel is required for each user. + + These channel files exist in /dev/nvidia-caps-imex-channels/channel* + and can be created using standard OS native calls like mknod on Linux. + For example: To create channel0 with the major number from + /proc/devices users can execute the following command: `mknod + /dev/nvidia-caps-imex-channels/channel0 c 0` + + Parameters + ---------- + poolProps : :py:obj:`~.cudaMemPoolProps` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + memPool : :py:obj:`~.cudaMemPool_t` + None + + See Also + -------- + :py:obj:`~.cuMemPoolCreate`, :py:obj:`~.cudaDeviceSetMemPool`, :py:obj:`~.cudaMallocFromPoolAsync`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool` + + Notes + ----- + Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC. + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL + with nogil: + err = cyruntime.cudaMemPoolCreate(memPool._pvt_ptr, cypoolProps_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memPool) +{{endif}} + +{{if 'cudaMemPoolDestroy' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolDestroy(memPool): + """ Destroys the specified memory pool. + + If any pointers obtained from this pool haven't been freed or the pool + has free operations that haven't completed when + :py:obj:`~.cudaMemPoolDestroy` is invoked, the function will return + immediately and the resources associated with the pool will be released + automatically once there are no more outstanding allocations. + + Destroying the current mempool of a device sets the default mempool of + that device as the current mempool for that device. + + Parameters + ---------- + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + None + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + cuMemPoolDestroy, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceSetMemPool`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaDeviceGetMemPool`, :py:obj:`~.cudaMemPoolCreate` + + Notes + ----- + A device's default memory pool cannot be destroyed. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + with nogil: + err = cyruntime.cudaMemPoolDestroy(cymemPool) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaMallocFromPoolAsync' in found_functions}} + +@cython.embedsignature(True) +def cudaMallocFromPoolAsync(size_t size, memPool, stream): + """ Allocates memory from a specified pool with stream ordered semantics. + + Inserts an allocation operation into `hStream`. A pointer to the + allocated memory is returned immediately in *dptr. The allocation must + not be accessed until the the allocation operation completes. The + allocation comes from the specified memory pool. + + Parameters + ---------- + bytesize : size_t + Number of bytes to allocate + memPool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + The pool to allocate from + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + The stream establishing the stream ordering semantic + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorOutOfMemory` + ptr : Any + Returned device pointer + + See Also + -------- + :py:obj:`~.cuMemAllocFromPoolAsync`, cudaMallocAsync (C++ API), :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaDeviceGetDefaultMemPool`, :py:obj:`~.cudaMemPoolCreate`, :py:obj:`~.cudaMemPoolSetAccess`, :py:obj:`~.cudaMemPoolSetAttribute` + + Notes + ----- + During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. + """ + 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.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef void_ptr ptr = 0 + with nogil: + err = cyruntime.cudaMallocFromPoolAsync(&ptr, size, cymemPool, cystream) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ptr) +{{endif}} + +{{if 'cudaMemPoolExportToShareableHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolExportToShareableHandle(memPool, handleType not None : cudaMemAllocationHandleType, unsigned int flags): + """ Exports a memory pool to the requested handle type. + + Given an IPC capable mempool, create an OS handle to share the pool + with another process. A recipient process can convert the shareable + handle into a mempool with + :py:obj:`~.cudaMemPoolImportFromShareableHandle`. Individual pointers + can then be shared with the :py:obj:`~.cudaMemPoolExportPointer` and + :py:obj:`~.cudaMemPoolImportPointer` APIs. The implementation of what + the shareable handle is and how it can be transferred is defined by the + requested handle type. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + pool to export + handleType : :py:obj:`~.cudaMemAllocationHandleType` + the type of handle to create + flags : unsigned int + must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOutOfMemory` + handle_out : Any + pointer to the location in which to store the requested handle + + See Also + -------- + :py:obj:`~.cuMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolExportPointer`, :py:obj:`~.cudaMemPoolImportPointer` + + Notes + ----- + : To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than cudaMemHandleTypeNone. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) + cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr + cdef cyruntime.cudaMemAllocationHandleType cyhandleType = int(handleType) + with nogil: + err = cyruntime.cudaMemPoolExportToShareableHandle(cyshareableHandle_ptr, cymemPool, cyhandleType, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cyshareableHandle.pyObj()) +{{endif}} + +{{if 'cudaMemPoolImportFromShareableHandle' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolImportFromShareableHandle(shareableHandle, handleType not None : cudaMemAllocationHandleType, unsigned int flags): + """ imports a memory pool from a shared handle. + + Specific allocations can be imported from the imported pool with + :py:obj:`~.cudaMemPoolImportPointer`. + + Parameters + ---------- + handle : Any + OS handle of the pool to open + handleType : :py:obj:`~.cudaMemAllocationHandleType` + The type of handle being imported + flags : unsigned int + must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOutOfMemory` + pool_out : :py:obj:`~.cudaMemPool_t` + Returned memory pool + + See Also + -------- + :py:obj:`~.cuMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolExportPointer`, :py:obj:`~.cudaMemPoolImportPointer` + + Notes + ----- + Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in :py:obj:`~.cudaDeviceSetMemPool` or :py:obj:`~.cudaMallocFromPoolAsync` calls. + """ + cdef cudaMemPool_t memPool = cudaMemPool_t() + cdef _HelperInputVoidPtrStruct cyshareableHandleHelper + cdef void* cyshareableHandle = _helper_input_void_ptr(shareableHandle, &cyshareableHandleHelper) + cdef cyruntime.cudaMemAllocationHandleType cyhandleType = int(handleType) + with nogil: + err = cyruntime.cudaMemPoolImportFromShareableHandle(memPool._pvt_ptr, cyshareableHandle, cyhandleType, flags) + _helper_input_void_ptr_free(&cyshareableHandleHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, memPool) +{{endif}} + +{{if 'cudaMemPoolExportPointer' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolExportPointer(ptr): + """ Export data to share a memory pool allocation between processes. + + Constructs `shareData_out` for sharing a specific allocation from an + already shared memory pool. The recipient process can import the + allocation with the :py:obj:`~.cudaMemPoolImportPointer` api. The data + is not a handle and may be shared through any IPC mechanism. + + Parameters + ---------- + ptr : Any + pointer to memory being exported + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOutOfMemory` + shareData_out : :py:obj:`~.cudaMemPoolPtrExportData` + Returned export data + + See Also + -------- + :py:obj:`~.cuMemPoolExportPointer`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolImportPointer` + """ + cdef cudaMemPoolPtrExportData exportData = cudaMemPoolPtrExportData() + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaMemPoolExportPointer(exportData._pvt_ptr, cyptr) + _helper_input_void_ptr_free(&cyptrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, exportData) +{{endif}} + +{{if 'cudaMemPoolImportPointer' in found_functions}} + +@cython.embedsignature(True) +def cudaMemPoolImportPointer(memPool, exportData : Optional[cudaMemPoolPtrExportData]): + """ Import a memory pool allocation from another process. + + Returns in `ptr_out` a pointer to the imported memory. The imported + memory must not be accessed before the allocation operation completes + in the exporting process. The imported memory must be freed from all + importing processes before being freed in the exporting process. The + pointer may be freed with cudaFree or cudaFreeAsync. If + :py:obj:`~.cudaFreeAsync` is used, the free must be completed on the + importing process before the free operation on the exporting process. + + Parameters + ---------- + pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` + pool from which to import + shareData : :py:obj:`~.cudaMemPoolPtrExportData` + data specifying the memory to import + + Returns + ------- + cudaError_t + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + ptr_out : Any + pointer to imported memory + + See Also + -------- + :py:obj:`~.cuMemPoolImportPointer`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolExportPointer` + + Notes + ----- + The :py:obj:`~.cudaFreeAsync` api may be used in the exporting process before the :py:obj:`~.cudaFreeAsync` operation completes in its stream as long as the :py:obj:`~.cudaFreeAsync` in the exporting process specifies a stream with a stream dependency on the importing process's :py:obj:`~.cudaFreeAsync`. + """ + cdef cyruntime.cudaMemPool_t cymemPool + if memPool is None: + pmemPool = 0 + elif isinstance(memPool, (cudaMemPool_t,driver.CUmemoryPool)): + pmemPool = int(memPool) + else: + pmemPool = int(cudaMemPool_t(memPool)) + cymemPool = pmemPool + cdef void_ptr ptr = 0 + 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: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ptr) +{{endif}} + +{{if 'cudaPointerGetAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaPointerGetAttributes(ptr): + """ Returns attributes about a specified pointer. + + Returns in `*attributes` the attributes of the pointer `ptr`. If + pointer was not allocated in, mapped by or registered with context + supporting unified addressing :py:obj:`~.cudaErrorInvalidValue` is + returned. + + The :py:obj:`~.cudaPointerAttributes` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + In this structure, the individual fields mean + + - :py:obj:`~.cudaPointerAttributes.type` identifies type of memory. It + can be :py:obj:`~.cudaMemoryTypeUnregistered` for unregistered host + memory, :py:obj:`~.cudaMemoryTypeHost` for registered host memory, + :py:obj:`~.cudaMemoryTypeDevice` for device memory or + :py:obj:`~.cudaMemoryTypeManaged` for managed memory. + + - :py:obj:`~.device` is the device against which `ptr` was allocated. + If `ptr` has memory type :py:obj:`~.cudaMemoryTypeDevice` then this + identifies the device on which the memory referred to by `ptr` + physically resides. If `ptr` has memory type + :py:obj:`~.cudaMemoryTypeHost` then this identifies the device which + was current when the allocation was made (and if that device is + deinitialized then this allocation will vanish with that device's + state). + + - :py:obj:`~.devicePointer` is the device pointer alias through which + the memory referred to by `ptr` may be accessed on the current + device. If the memory referred to by `ptr` cannot be accessed + directly by the current device then this is NULL. + + - :py:obj:`~.hostPointer` is the host pointer alias through which the + memory referred to by `ptr` may be accessed on the host. If the + memory referred to by `ptr` cannot be accessed directly by the host + then this is NULL. + + Parameters + ---------- + ptr : Any + Pointer to get attributes for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue` + attributes : :py:obj:`~.cudaPointerAttributes` + Attributes for the specified pointer + + See Also + -------- + :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaChooseDevice`, :py:obj:`~.cudaInitDevice`, :py:obj:`~.cuPointerGetAttributes` + + Notes + ----- + In CUDA 11.0 forward passing host pointer will return :py:obj:`~.cudaMemoryTypeUnregistered` in :py:obj:`~.cudaPointerAttributes.type` and call will return :py:obj:`~.cudaSuccess`. + """ + cdef cudaPointerAttributes attributes = cudaPointerAttributes() + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaPointerGetAttributes(attributes._pvt_ptr, cyptr) + _helper_input_void_ptr_free(&cyptrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, attributes) +{{endif}} + +{{if 'cudaDeviceCanAccessPeer' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceCanAccessPeer(int device, int peerDevice): + """ Queries if a device may directly access a peer device's memory. + + Returns in `*canAccessPeer` a value of 1 if device `device` is capable + of directly accessing memory from `peerDevice` and 0 otherwise. If + direct access of `peerDevice` from `device` is possible, then access + may be enabled by calling :py:obj:`~.cudaDeviceEnablePeerAccess()`. + + Parameters + ---------- + device : int + Device from which allocations on `peerDevice` are to be directly + accessed. + peerDevice : int + Device on which the allocations to be directly accessed by `device` + reside. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice` + canAccessPeer : int + Returned access capability + + See Also + -------- + :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cudaDeviceDisablePeerAccess`, :py:obj:`~.cuDeviceCanAccessPeer` + """ + cdef int canAccessPeer = 0 + with nogil: + err = cyruntime.cudaDeviceCanAccessPeer(&canAccessPeer, device, peerDevice) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, canAccessPeer) +{{endif}} + +{{if 'cudaDeviceEnablePeerAccess' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags): + """ Enables direct access to memory allocations on a peer device. + + On success, all allocations from `peerDevice` will immediately be + accessible by the current device. They will remain accessible until + access is explicitly disabled using + :py:obj:`~.cudaDeviceDisablePeerAccess()` or either device is reset + using :py:obj:`~.cudaDeviceReset()`. + + Note that access granted by this call is unidirectional and that in + order to access memory on the current device from `peerDevice`, a + separate symmetric call to :py:obj:`~.cudaDeviceEnablePeerAccess()` is + required. + + Note that there are both device-wide and system-wide limitations per + system configuration, as noted in the CUDA Programming Guide under the + section "Peer-to-Peer Memory Access". + + Returns :py:obj:`~.cudaErrorInvalidDevice` if + :py:obj:`~.cudaDeviceCanAccessPeer()` indicates that the current device + cannot directly access memory from `peerDevice`. + + Returns :py:obj:`~.cudaErrorPeerAccessAlreadyEnabled` if direct access + of `peerDevice` from the current device has already been enabled. + + Returns :py:obj:`~.cudaErrorInvalidValue` if `flags` is not 0. + + Parameters + ---------- + peerDevice : int + Peer device to enable direct access to from the current device + flags : unsigned int + Reserved for future use and must be set to 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorPeerAccessAlreadyEnabled`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cudaDeviceDisablePeerAccess`, :py:obj:`~.cuCtxEnablePeerAccess` + """ + with nogil: + err = cyruntime.cudaDeviceEnablePeerAccess(peerDevice, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceDisablePeerAccess' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceDisablePeerAccess(int peerDevice): + """ Disables direct access to memory allocations on a peer device. + + Returns :py:obj:`~.cudaErrorPeerAccessNotEnabled` if direct access to + memory on `peerDevice` has not yet been enabled from the current + device. + + Parameters + ---------- + peerDevice : int + Peer device to disable direct access to + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorPeerAccessNotEnabled`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaDeviceCanAccessPeer`, :py:obj:`~.cudaDeviceEnablePeerAccess`, :py:obj:`~.cuCtxDisablePeerAccess` + """ + with nogil: + err = cyruntime.cudaDeviceDisablePeerAccess(peerDevice) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphicsUnregisterResource' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsUnregisterResource(resource): + """ Unregisters a graphics resource for access by CUDA. + + Unregisters the graphics resource `resource` so it is not accessible by + CUDA unless registered again. + + If `resource` is invalid then + :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + Resource to unregister + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaGraphicsD3D9RegisterResource`, :py:obj:`~.cudaGraphicsD3D10RegisterResource`, :py:obj:`~.cudaGraphicsD3D11RegisterResource`, :py:obj:`~.cudaGraphicsGLRegisterBuffer`, :py:obj:`~.cudaGraphicsGLRegisterImage`, :py:obj:`~.cuGraphicsUnregisterResource` + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + with nogil: + err = cyruntime.cudaGraphicsUnregisterResource(cyresource) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphicsResourceSetMapFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsResourceSetMapFlags(resource, unsigned int flags): + """ Set usage flags for mapping a graphics resource. + + Set `flags` for mapping the graphics resource `resource`. + + Changes to `flags` will take effect the next time `resource` is mapped. + The `flags` argument may be any of the following: + + - :py:obj:`~.cudaGraphicsMapFlagsNone`: Specifies no hints about how + `resource` will be used. It is therefore assumed that CUDA may read + from or write to `resource`. + + - :py:obj:`~.cudaGraphicsMapFlagsReadOnly`: Specifies that CUDA will + not write to `resource`. + + - :py:obj:`~.cudaGraphicsMapFlagsWriteDiscard`: Specifies CUDA will not + read from `resource` and will write over the entire contents of + `resource`, so none of the data previously stored in `resource` will + be preserved. + + If `resource` is presently mapped for access by CUDA then + :py:obj:`~.cudaErrorUnknown` is returned. If `flags` is not one of the + above values then :py:obj:`~.cudaErrorInvalidValue` is returned. + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + Registered resource to set flags for + flags : unsigned int + Parameters for resource mapping + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown`, + + See Also + -------- + :py:obj:`~.cudaGraphicsMapResources`, :py:obj:`~.cuGraphicsResourceSetMapFlags` + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + with nogil: + err = cyruntime.cudaGraphicsResourceSetMapFlags(cyresource, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphicsMapResources' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsMapResources(int count, resources, stream): + """ Map graphics resources for access by CUDA. + + Maps the `count` graphics resources in `resources` for access by CUDA. + + The resources in `resources` may be accessed by CUDA until they are + unmapped. The graphics API from which `resources` were registered + should not access any resources while they are mapped by CUDA. If an + application does so, the results are undefined. + + This function provides the synchronization guarantee that any graphics + calls issued before :py:obj:`~.cudaGraphicsMapResources()` will + complete before any subsequent CUDA work issued in `stream` begins. + + If `resources` contains any duplicate entries then + :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. If any of + `resources` are presently mapped for access by CUDA then + :py:obj:`~.cudaErrorUnknown` is returned. + + Parameters + ---------- + count : int + Number of resources to map + resources : :py:obj:`~.cudaGraphicsResource_t` + Resources to map for CUDA + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream for synchronization + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaGraphicsResourceGetMappedPointer`, :py:obj:`~.cudaGraphicsSubResourceGetMappedArray`, :py:obj:`~.cudaGraphicsUnmapResources`, :py:obj:`~.cuGraphicsMapResources` + """ + 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.cudaGraphicsResource_t *cyresources + if resources is None: + cyresources = NULL + elif isinstance(resources, (cudaGraphicsResource_t,)): + presources = resources.getPtr() + cyresources = presources + elif isinstance(resources, (int)): + cyresources = resources + else: + raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) + with nogil: + err = cyruntime.cudaGraphicsMapResources(count, cyresources, cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphicsUnmapResources' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsUnmapResources(int count, resources, stream): + """ Unmap graphics resources. + + Unmaps the `count` graphics resources in `resources`. + + Once unmapped, the resources in `resources` may not be accessed by CUDA + until they are mapped again. + + This function provides the synchronization guarantee that any CUDA work + issued in `stream` before :py:obj:`~.cudaGraphicsUnmapResources()` will + complete before any subsequently issued graphics work begins. + + If `resources` contains any duplicate entries then + :py:obj:`~.cudaErrorInvalidResourceHandle` is returned. If any of + `resources` are not presently mapped for access by CUDA then + :py:obj:`~.cudaErrorUnknown` is returned. + + Parameters + ---------- + count : int + Number of resources to unmap + resources : :py:obj:`~.cudaGraphicsResource_t` + Resources to unmap + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream for synchronization + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaGraphicsMapResources`, :py:obj:`~.cuGraphicsUnmapResources` + """ + 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.cudaGraphicsResource_t *cyresources + if resources is None: + cyresources = NULL + elif isinstance(resources, (cudaGraphicsResource_t,)): + presources = resources.getPtr() + cyresources = presources + elif isinstance(resources, (int)): + cyresources = resources + else: + raise TypeError("Argument 'resources' is not instance of type (expected , found " + str(type(resources))) + with nogil: + err = cyruntime.cudaGraphicsUnmapResources(count, cyresources, cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedPointer' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsResourceGetMappedPointer(resource): + """ Get an device pointer through which to access a mapped graphics resource. + + Returns in `*devPtr` a pointer through which the mapped graphics + resource `resource` may be accessed. Returns in `*size` the size of the + memory in bytes which may be accessed from that pointer. The value set + in `devPtr` may change every time that `resource` is mapped. + + If `resource` is not a buffer then it cannot be accessed via a pointer + and :py:obj:`~.cudaErrorUnknown` is returned. If `resource` is not + mapped then :py:obj:`~.cudaErrorUnknown` is returned. + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + None + + Returns + ------- + cudaError_t + + devPtr : Any + None + size : int + None + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + cdef void_ptr devPtr = 0 + cdef size_t size = 0 + with nogil: + err = cyruntime.cudaGraphicsResourceGetMappedPointer(&devPtr, &size, cyresource) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, devPtr, size) +{{endif}} + +{{if 'cudaGraphicsSubResourceGetMappedArray' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, unsigned int mipLevel): + """ Get an array through which to access a subresource of a mapped graphics resource. + + Returns in `*array` an array through which the subresource of the + mapped graphics resource `resource` which corresponds to array index + `arrayIndex` and mipmap level `mipLevel` may be accessed. The value set + in `array` may change every time that `resource` is mapped. + + If `resource` is not a texture then it cannot be accessed via an array + and :py:obj:`~.cudaErrorUnknown` is returned. If `arrayIndex` is not a + valid array index for `resource` then :py:obj:`~.cudaErrorInvalidValue` + is returned. If `mipLevel` is not a valid mipmap level for `resource` + then :py:obj:`~.cudaErrorInvalidValue` is returned. If `resource` is + not mapped then :py:obj:`~.cudaErrorUnknown` is returned. + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + Mapped resource to access + arrayIndex : unsigned int + Array index for array textures or cubemap face index as defined by + :py:obj:`~.cudaGraphicsCubeFace` for cubemap textures for the + subresource to access + mipLevel : unsigned int + Mipmap level for the subresource to access + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + array : :py:obj:`~.cudaArray_t` + Returned array through which a subresource of `resource` may be + accessed + + See Also + -------- + :py:obj:`~.cudaGraphicsResourceGetMappedPointer`, :py:obj:`~.cuGraphicsSubResourceGetMappedArray` + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + cdef cudaArray_t array = cudaArray_t() + with nogil: + err = cyruntime.cudaGraphicsSubResourceGetMappedArray(array._pvt_ptr, cyresource, arrayIndex, mipLevel) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, array) +{{endif}} + +{{if 'cudaGraphicsResourceGetMappedMipmappedArray' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphicsResourceGetMappedMipmappedArray(resource): + """ Get a mipmapped array through which to access a mapped graphics resource. + + Returns in `*mipmappedArray` a mipmapped array through which the mapped + graphics resource `resource` may be accessed. The value set in + `mipmappedArray` may change every time that `resource` is mapped. + + If `resource` is not a texture then it cannot be accessed via an array + and :py:obj:`~.cudaErrorUnknown` is returned. If `resource` is not + mapped then :py:obj:`~.cudaErrorUnknown` is returned. + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + Mapped resource to access + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + mipmappedArray : :py:obj:`~.cudaMipmappedArray_t` + Returned mipmapped array through which `resource` may be accessed + + See Also + -------- + :py:obj:`~.cudaGraphicsResourceGetMappedPointer`, :py:obj:`~.cuGraphicsResourceGetMappedMipmappedArray` + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + cdef cudaMipmappedArray_t mipmappedArray = cudaMipmappedArray_t() + with nogil: + err = cyruntime.cudaGraphicsResourceGetMappedMipmappedArray(mipmappedArray._pvt_ptr, cyresource) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, mipmappedArray) +{{endif}} + +{{if 'cudaGetChannelDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaGetChannelDesc(array): + """ Get the channel descriptor of an array. + + Returns in `*desc` the channel descriptor of the CUDA array `array`. + + Parameters + ---------- + array : :py:obj:`~.cudaArray_const_t` + Memory array on device + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + desc : :py:obj:`~.cudaChannelFormatDesc` + Channel format + + See Also + -------- + :py:obj:`~.cudaCreateChannelDesc (C API)`, :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cudaCreateSurfaceObject` + """ + cdef cyruntime.cudaArray_const_t cyarray + if array is None: + parray = 0 + elif isinstance(array, (cudaArray_const_t,)): + parray = int(array) + else: + parray = int(cudaArray_const_t(array)) + cyarray = parray + cdef cudaChannelFormatDesc desc = cudaChannelFormatDesc() + with nogil: + err = cyruntime.cudaGetChannelDesc(desc._pvt_ptr, cyarray) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, desc) +{{endif}} + +{{if 'cudaCreateChannelDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaCreateChannelDesc(int x, int y, int z, int w, f not None : cudaChannelFormatKind): + """ Returns a channel descriptor using the specified format. + + Returns a channel descriptor with format `f` and number of bits of each + component `x`, `y`, `z`, and `w`. The :py:obj:`~.cudaChannelFormatDesc` + is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where :py:obj:`~.cudaChannelFormatKind` is one of + :py:obj:`~.cudaChannelFormatKindSigned`, + :py:obj:`~.cudaChannelFormatKindUnsigned`, or + :py:obj:`~.cudaChannelFormatKindFloat`. + + Parameters + ---------- + x : int + X component + y : int + Y component + z : int + Z component + w : int + W component + f : :py:obj:`~.cudaChannelFormatKind` + Channel format + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + :py:obj:`~.cudaChannelFormatDesc` + Channel descriptor with format `f` + + See Also + -------- + cudaCreateChannelDesc (C++ API), :py:obj:`~.cudaGetChannelDesc`, :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cudaCreateSurfaceObject` + """ + cdef cyruntime.cudaChannelFormatKind cyf = int(f) + with nogil: + err = cyruntime.cudaCreateChannelDesc(x, y, z, w, cyf) + cdef cudaChannelFormatDesc wrapper = cudaChannelFormatDesc() + wrapper._pvt_ptr[0] = err + return (cudaError_t.cudaSuccess, wrapper) +{{endif}} + +{{if 'cudaCreateTextureObject' in found_functions}} + +@cython.embedsignature(True) +def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Optional[cudaTextureDesc], pResViewDesc : Optional[cudaResourceViewDesc]): + """ Creates a texture object. + + Creates a texture object and returns it in `pTexObject`. `pResDesc` + describes the data to texture from. `pTexDesc` describes how the data + should be sampled. `pResViewDesc` is an optional argument that + specifies an alternate format for the data described by `pResDesc`, and + also describes the subresource region to restrict access to when + texturing. `pResViewDesc` can only be specified if the type of resource + is a CUDA array or a CUDA mipmapped array not in a block compressed + format. + + Texture objects are only supported on devices of compute capability 3.0 + or higher. Additionally, a texture object is an opaque value, and, as + such, should only be accessed through CUDA API calls. + + The :py:obj:`~.cudaResourceDesc` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.cudaResourceDesc.resType` specifies the type of resource + to texture from. CUresourceType is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + If :py:obj:`~.cudaResourceDesc.resType` is set to + :py:obj:`~.cudaResourceTypeArray`, + :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:`~.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:`~.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 + address range cannot exceed + :py:obj:`~.cudaDeviceProp.maxTexture1DLinear`. 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:`~.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:`~.cudaDeviceProp.maxTexture2DLinear`[0] and + :py:obj:`~.cudaDeviceProp.maxTexture2DLinear`[1] respectively. + :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]. + + The :py:obj:`~.cudaTextureDesc` struct is defined as + + **View CUDA Toolkit Documentation for a C++ code example** + + where + + - :py:obj:`~.cudaTextureDesc.addressMode` specifies the addressing mode + for each dimension of the texture data. + :py:obj:`~.cudaTextureAddressMode` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - This is ignored if :py:obj:`~.cudaResourceDesc.resType` is + :py:obj:`~.cudaResourceTypeLinear`. Also, if + :py:obj:`~.cudaTextureDesc.normalizedCoords` is set to zero, + :py:obj:`~.cudaAddressModeWrap` and :py:obj:`~.cudaAddressModeMirror` + won't be supported and will be switched to + :py:obj:`~.cudaAddressModeClamp`. + + - :py:obj:`~.cudaTextureDesc.filterMode` specifies the filtering mode + to be used when fetching from the texture. + :py:obj:`~.cudaTextureFilterMode` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - This is ignored if :py:obj:`~.cudaResourceDesc.resType` is + :py:obj:`~.cudaResourceTypeLinear`. + + - :py:obj:`~.cudaTextureDesc.readMode` specifies whether integer data + should be converted to floating point or not. + :py:obj:`~.cudaTextureReadMode` is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Note that this applies only to 8-bit and 16-bit integer formats. + 32-bit integer format would not be promoted, regardless of whether or + not this :py:obj:`~.cudaTextureDesc.readMode` is set + :py:obj:`~.cudaReadModeNormalizedFloat` is specified. + + - :py:obj:`~.cudaTextureDesc.sRGB` specifies whether sRGB to linear + conversion should be performed during texture fetch. + + - :py:obj:`~.cudaTextureDesc.borderColor` specifies the float values of + color. where: :py:obj:`~.cudaTextureDesc.borderColor`[0] contains + value of 'R', :py:obj:`~.cudaTextureDesc.borderColor`[1] contains + value of 'G', :py:obj:`~.cudaTextureDesc.borderColor`[2] contains + value of 'B', :py:obj:`~.cudaTextureDesc.borderColor`[3] contains + value of 'A' Note that application using integer border color values + will need to these values to float. The values are + set only when the addressing mode specified by + :py:obj:`~.cudaTextureDesc.addressMode` is cudaAddressModeBorder. + + - :py:obj:`~.cudaTextureDesc.normalizedCoords` specifies whether the + texture coordinates will be normalized or not. + + - :py:obj:`~.cudaTextureDesc.maxAnisotropy` specifies the maximum + anistropy ratio to be used when doing anisotropic filtering. This + value will be clamped to the range [1,16]. + + - :py:obj:`~.cudaTextureDesc.mipmapFilterMode` specifies the filter + mode when the calculated mipmap level lies between two defined mipmap + levels. + + - :py:obj:`~.cudaTextureDesc.mipmapLevelBias` specifies the offset to + be applied to the calculated mipmap level. + + - :py:obj:`~.cudaTextureDesc.minMipmapLevelClamp` specifies the lower + end of the mipmap level range to clamp access to. + + - :py:obj:`~.cudaTextureDesc.maxMipmapLevelClamp` specifies the upper + end of the mipmap level range to clamp access to. + + - :py:obj:`~.cudaTextureDesc.disableTrilinearOptimization` specifies + whether the trilinear filtering optimizations will be disabled. + + - :py:obj:`~.cudaTextureDesc.seamlessCubemap` specifies whether + seamless cube map filtering is enabled. This flag can only be + specified if the underlying resource is a CUDA array or a CUDA + mipmapped array that was created with the flag + :py:obj:`~.cudaArrayCubemap`. When seamless cube map filtering is + enabled, texture address modes specified by + :py:obj:`~.cudaTextureDesc.addressMode` are ignored. Instead, if the + :py:obj:`~.cudaTextureDesc.filterMode` is set to + :py:obj:`~.cudaFilterModePoint` the address mode + :py:obj:`~.cudaAddressModeClamp` will be applied for all dimensions. + If the :py:obj:`~.cudaTextureDesc.filterMode` is set to + :py:obj:`~.cudaFilterModeLinear` seamless cube map filtering will be + performed when sampling along the cube face borders. + + The :py:obj:`~.cudaResourceViewDesc` struct is defined as + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.cudaResourceViewDesc.format` specifies how the data + contained in the CUDA array or CUDA mipmapped array should be + interpreted. Note that this can incur a change in size of the texture + data. If the resource view format is a block compressed format, then + the underlying CUDA array or CUDA mipmapped array has to have a + 32-bit unsigned integer format with 2 or 4 channels, depending on the + block compressed format. For ex., BC1 and BC4 require the underlying + CUDA array to have a 32-bit unsigned int with 2 channels. The other + BC formats require the underlying resource to have the same 32-bit + unsigned int format but with 4 channels. + + - :py:obj:`~.cudaResourceViewDesc.width` specifies the new width of the + texture data. If the resource view format is a block compressed + format, this value has to be 4 times the original width of the + resource. For non block compressed formats, this value has to be + equal to that of the original resource. + + - :py:obj:`~.cudaResourceViewDesc.height` specifies the new height of + the texture data. If the resource view format is a block compressed + format, this value has to be 4 times the original height of the + resource. For non block compressed formats, this value has to be + equal to that of the original resource. + + - :py:obj:`~.cudaResourceViewDesc.depth` specifies the new depth of the + texture data. This value has to be equal to that of the original + resource. + + - :py:obj:`~.cudaResourceViewDesc.firstMipmapLevel` specifies the most + detailed mipmap level. This will be the new mipmap level zero. For + non-mipmapped resources, this value has to be + zero.:py:obj:`~.cudaTextureDesc.minMipmapLevelClamp` and + :py:obj:`~.cudaTextureDesc.maxMipmapLevelClamp` will be relative to + this value. For ex., if the firstMipmapLevel is set to 2, and a + minMipmapLevelClamp of 1.2 is specified, then the actual minimum + mipmap level clamp will be 3.2. + + - :py:obj:`~.cudaResourceViewDesc.lastMipmapLevel` specifies the least + detailed mipmap level. For non-mipmapped resources, this value has to + be zero. + + - :py:obj:`~.cudaResourceViewDesc.firstLayer` specifies the first layer + index for layered textures. This will be the new layer zero. For non- + layered resources, this value has to be zero. + + - :py:obj:`~.cudaResourceViewDesc.lastLayer` specifies the last layer + index for layered textures. For non-layered resources, this value has + to be zero. + + Parameters + ---------- + pResDesc : :py:obj:`~.cudaResourceDesc` + Resource descriptor + pTexDesc : :py:obj:`~.cudaTextureDesc` + Texture descriptor + pResViewDesc : :py:obj:`~.cudaResourceViewDesc` + Resource view descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pTexObject : :py:obj:`~.cudaTextureObject_t` + Texture object to create + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaCreateTextureObject(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pTexObject) +{{endif}} + +{{if 'cudaDestroyTextureObject' in found_functions}} + +@cython.embedsignature(True) +def cudaDestroyTextureObject(texObject): + """ Destroys a texture object. + + Destroys the texture object specified by `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.cudaTextureObject_t` + Texture object to destroy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cuTexObjectDestroy` + """ + cdef cyruntime.cudaTextureObject_t cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (cudaTextureObject_t,)): + ptexObject = int(texObject) + else: + ptexObject = int(cudaTextureObject_t(texObject)) + cytexObject = ptexObject + with nogil: + err = cyruntime.cudaDestroyTextureObject(cytexObject) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetTextureObjectResourceDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaGetTextureObjectResourceDesc(texObject): + """ Returns a texture object's resource descriptor. + + Returns the resource descriptor for the texture object specified by + `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.cudaTextureObject_t` + Texture object + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pResDesc : :py:obj:`~.cudaResourceDesc` + Resource descriptor + + See Also + -------- + :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cuTexObjectGetResourceDesc` + """ + cdef cyruntime.cudaTextureObject_t cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (cudaTextureObject_t,)): + ptexObject = int(texObject) + else: + ptexObject = int(cudaTextureObject_t(texObject)) + cytexObject = ptexObject + cdef cudaResourceDesc pResDesc = cudaResourceDesc() + with nogil: + err = cyruntime.cudaGetTextureObjectResourceDesc(pResDesc._pvt_ptr, cytexObject) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pResDesc) +{{endif}} + +{{if 'cudaGetTextureObjectTextureDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaGetTextureObjectTextureDesc(texObject): + """ Returns a texture object's texture descriptor. + + Returns the texture descriptor for the texture object specified by + `texObject`. + + Parameters + ---------- + texObject : :py:obj:`~.cudaTextureObject_t` + Texture object + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pTexDesc : :py:obj:`~.cudaTextureDesc` + Texture descriptor + + See Also + -------- + :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cuTexObjectGetTextureDesc` + """ + cdef cyruntime.cudaTextureObject_t cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (cudaTextureObject_t,)): + ptexObject = int(texObject) + else: + ptexObject = int(cudaTextureObject_t(texObject)) + cytexObject = ptexObject + cdef cudaTextureDesc pTexDesc = cudaTextureDesc() + with nogil: + err = cyruntime.cudaGetTextureObjectTextureDesc(pTexDesc._pvt_ptr, cytexObject) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pTexDesc) +{{endif}} + +{{if 'cudaGetTextureObjectResourceViewDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaGetTextureObjectResourceViewDesc(texObject): + """ Returns a texture object's resource view descriptor. + + Returns the resource view descriptor for the texture object specified + by `texObject`. If no resource view was specified, + :py:obj:`~.cudaErrorInvalidValue` is returned. + + Parameters + ---------- + texObject : :py:obj:`~.cudaTextureObject_t` + Texture object + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pResViewDesc : :py:obj:`~.cudaResourceViewDesc` + Resource view descriptor + + See Also + -------- + :py:obj:`~.cudaCreateTextureObject`, :py:obj:`~.cuTexObjectGetResourceViewDesc` + """ + cdef cyruntime.cudaTextureObject_t cytexObject + if texObject is None: + ptexObject = 0 + elif isinstance(texObject, (cudaTextureObject_t,)): + ptexObject = int(texObject) + else: + ptexObject = int(cudaTextureObject_t(texObject)) + cytexObject = ptexObject + cdef cudaResourceViewDesc pResViewDesc = cudaResourceViewDesc() + with nogil: + err = cyruntime.cudaGetTextureObjectResourceViewDesc(pResViewDesc._pvt_ptr, cytexObject) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pResViewDesc) +{{endif}} + +{{if 'cudaCreateSurfaceObject' in found_functions}} + +@cython.embedsignature(True) +def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): + """ Creates a surface object. + + Creates a surface object and returns it in `pSurfObject`. `pResDesc` + 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 + CUDA array handle. + + Surface objects are only supported on devices of compute capability 3.0 + or higher. Additionally, a surface object is an opaque value, and, as + such, should only be accessed through CUDA API calls. + + Parameters + ---------- + pResDesc : :py:obj:`~.cudaResourceDesc` + Resource descriptor + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidChannelDescriptor`, :py:obj:`~.cudaErrorInvalidResourceHandle` + pSurfObject : :py:obj:`~.cudaSurfaceObject_t` + Surface object to create + + See Also + -------- + :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 + with nogil: + err = cyruntime.cudaCreateSurfaceObject(pSurfObject._pvt_ptr, cypResDesc_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pSurfObject) +{{endif}} + +{{if 'cudaDestroySurfaceObject' in found_functions}} + +@cython.embedsignature(True) +def cudaDestroySurfaceObject(surfObject): + """ Destroys a surface object. + + Destroys the surface object specified by `surfObject`. + + Parameters + ---------- + surfObject : :py:obj:`~.cudaSurfaceObject_t` + Surface object to destroy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaCreateSurfaceObject`, :py:obj:`~.cuSurfObjectDestroy` + """ + cdef cyruntime.cudaSurfaceObject_t cysurfObject + if surfObject is None: + psurfObject = 0 + elif isinstance(surfObject, (cudaSurfaceObject_t,)): + psurfObject = int(surfObject) + else: + psurfObject = int(cudaSurfaceObject_t(surfObject)) + cysurfObject = psurfObject + with nogil: + err = cyruntime.cudaDestroySurfaceObject(cysurfObject) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetSurfaceObjectResourceDesc' in found_functions}} + +@cython.embedsignature(True) +def cudaGetSurfaceObjectResourceDesc(surfObject): + """ Returns a surface object's resource descriptor Returns the resource descriptor for the surface object specified by `surfObject`. + + Parameters + ---------- + surfObject : :py:obj:`~.cudaSurfaceObject_t` + Surface object + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pResDesc : :py:obj:`~.cudaResourceDesc` + Resource descriptor + + See Also + -------- + :py:obj:`~.cudaCreateSurfaceObject`, :py:obj:`~.cuSurfObjectGetResourceDesc` + """ + cdef cyruntime.cudaSurfaceObject_t cysurfObject + if surfObject is None: + psurfObject = 0 + elif isinstance(surfObject, (cudaSurfaceObject_t,)): + psurfObject = int(surfObject) + else: + psurfObject = int(cudaSurfaceObject_t(surfObject)) + cysurfObject = psurfObject + cdef cudaResourceDesc pResDesc = cudaResourceDesc() + with nogil: + err = cyruntime.cudaGetSurfaceObjectResourceDesc(pResDesc._pvt_ptr, cysurfObject) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pResDesc) +{{endif}} + +{{if 'cudaDriverGetVersion' in found_functions}} + +@cython.embedsignature(True) +def cudaDriverGetVersion(): + """ Returns the latest version of CUDA supported by the driver. + + Returns in `*driverVersion` the latest version of CUDA supported by the + driver. The version is returned as (1000 * major + 10 * minor). For + example, CUDA 9.2 would be represented by 9020. If no driver is + installed, then 0 is returned as the driver version. + + This function automatically returns :py:obj:`~.cudaErrorInvalidValue` + if `driverVersion` is NULL. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + driverVersion : int + Returns the CUDA driver version. + + See Also + -------- + :py:obj:`~.cudaRuntimeGetVersion`, :py:obj:`~.cuDriverGetVersion` + """ + cdef int driverVersion = 0 + with nogil: + err = cyruntime.cudaDriverGetVersion(&driverVersion) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, driverVersion) +{{endif}} + +{{if 'cudaRuntimeGetVersion' in found_functions}} + +@cython.embedsignature(True) +def cudaRuntimeGetVersion(): + """ Returns the CUDA Runtime version. + + Returns in `*runtimeVersion` the version number of the current CUDA + Runtime instance. The version is returned as (1000 * major + 10 * + minor). For example, CUDA 9.2 would be represented by 9020. + + As of CUDA 12.0, this function no longer initializes CUDA. The purpose + of this API is solely to return a compile-time constant stating the + CUDA Toolkit version in the above format. + + This function automatically returns :py:obj:`~.cudaErrorInvalidValue` + if the `runtimeVersion` argument is NULL. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + runtimeVersion : int + Returns the CUDA Runtime version. + + See Also + -------- + :py:obj:`~.cudaDriverGetVersion`, :py:obj:`~.cuDriverGetVersion` + """ + cdef int runtimeVersion = 0 + with nogil: + err = cyruntime.cudaRuntimeGetVersion(&runtimeVersion) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, runtimeVersion) +{{endif}} + +{{if 'cudaGraphCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphCreate(unsigned int flags): + """ Creates a graph. + + Creates an empty graph, which is returned via `pGraph`. + + Parameters + ---------- + flags : unsigned int + Graph creation flags, must be 0 + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + pGraph : :py:obj:`~.cudaGraph_t` + Returns newly created graph + + See Also + -------- + :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphDestroy`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphClone` + """ + cdef cudaGraph_t pGraph = cudaGraph_t() + with nogil: + err = cyruntime.cudaGraphCreate(pGraph._pvt_ptr, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraph) +{{endif}} + +{{if 'cudaGraphAddKernelNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaKernelNodeParams]): + """ Creates a kernel execution node and adds it to a graph. + + Creates a new kernel execution node and adds it to `graph` with + `numDependencies` dependencies specified via `pDependencies` and + arguments specified in `pNodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `pDependencies` may not have any duplicate entries. + A handle to the new node will be returned in `pGraphNode`. + + The :py:obj:`~.cudaKernelNodeParams` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + When the graph is launched, the node will invoke kernel `func` on a + (`gridDim.x` x `gridDim.y` x `gridDim.z`) grid of blocks. Each block + contains (`blockDim.x` x `blockDim.y` x `blockDim.z`) threads. + + `sharedMem` sets the amount of dynamic shared memory that will be + available to each thread block. + + Kernel parameters to `func` can be specified in one of two ways: + + 1) Kernel parameters can be specified via `kernelParams`. If the kernel + has N parameters, then `kernelParams` needs to be an array of N + pointers. Each pointer, from `kernelParams`[0] to `kernelParams`[N-1], + points to the region of memory from which the actual 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. + + 2) Kernel parameters can also be packaged by the application into a + single buffer that is passed in via `extra`. This places the burden on + the application of knowing each kernel parameter's size and + alignment/padding within the buffer. The `extra` parameter exists to + allow this function to take additional less commonly used arguments. + `extra` specifies a list of names of extra settings and their + corresponding values. Each extra setting name is immediately followed + by the corresponding value. The list must be terminated with either + NULL or CU_LAUNCH_PARAM_END. + + - :py:obj:`~.CU_LAUNCH_PARAM_END`, which indicates the end of the + `extra` array; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the + next value in `extra` will be a pointer to a buffer containing all + the kernel parameters for launching kernel `func`; + + - :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE`, which specifies that the + next value in `extra` will be a pointer to a size_t containing the + size of the buffer specified with + :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`; + + The error :py:obj:`~.cudaErrorInvalidValue` will be returned if kernel + parameters are specified with both `kernelParams` and `extra` (i.e. + both `kernelParams` and `extra` are non-NULL). + + The `kernelParams` or `extra` array, as well as the argument values it + points to, are copied during this call. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + pNodeParams : :py:obj:`~.cudaKernelNodeParams` + Parameters for the GPU execution node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphKernelNodeGetParams`, :py:obj:`~.cudaGraphKernelNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphKernelNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphKernelNodeGetParams(node): + """ Returns a kernel node's parameters. + + Returns the parameters of kernel node `node` in `pNodeParams`. The + `kernelParams` or `extra` array returned in `pNodeParams`, as well as + the argument values it points to, are owned by the node. This memory + remains valid until the node is destroyed or its parameters are + modified, and should not be modified directly. Use + :py:obj:`~.cudaGraphKernelNodeSetParams` to update the parameters of + this node. + + The params will contain either `kernelParams` or `extra`, according to + which of these was most recently set on the node. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction` + pNodeParams : :py:obj:`~.cudaKernelNodeParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaKernelNodeParams pNodeParams = cudaKernelNodeParams() + with nogil: + err = cyruntime.cudaGraphKernelNodeGetParams(cynode, pNodeParams._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pNodeParams) +{{endif}} + +{{if 'cudaGraphKernelNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodeParams]): + """ Sets a kernel node's parameters. + + Sets the parameters of kernel node `node` to `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + pNodeParams : :py:obj:`~.cudaKernelNodeParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorMemoryAllocation` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.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),) +{{endif}} + +{{if 'cudaGraphKernelNodeCopyAttributes' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphKernelNodeCopyAttributes(hSrc, hDst): + """ Copies attributes from source node to destination node. + + Copies attributes from source node `src` to destination node `dst`. + Both node must have the same context. + + Parameters + ---------- + dst : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Destination node + src : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Source node For list of attributes see + :py:obj:`~.cudaKernelNodeAttrID` + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidContext` + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaGraphNode_t cyhDst + if hDst is None: + phDst = 0 + elif isinstance(hDst, (cudaGraphNode_t,driver.CUgraphNode)): + phDst = int(hDst) + else: + phDst = int(cudaGraphNode_t(hDst)) + cyhDst = phDst + cdef cyruntime.cudaGraphNode_t cyhSrc + if hSrc is None: + phSrc = 0 + elif isinstance(hSrc, (cudaGraphNode_t,driver.CUgraphNode)): + phSrc = int(hSrc) + else: + phSrc = int(cudaGraphNode_t(hSrc)) + cyhSrc = phSrc + with nogil: + err = cyruntime.cudaGraphKernelNodeCopyAttributes(cyhSrc, cyhDst) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphKernelNodeGetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphKernelNodeGetAttribute(hNode, attr not None : cudaKernelNodeAttrID): + """ Queries node attribute. + + Queries attribute `attr` from node `hNode` and stores it in + corresponding member of `value_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + + attr : :py:obj:`~.cudaKernelNodeAttrID` + + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + value_out : :py:obj:`~.cudaKernelNodeAttrValue` + + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaKernelNodeAttrID cyattr = int(attr) + cdef cudaKernelNodeAttrValue value_out = cudaKernelNodeAttrValue() + with nogil: + err = cyruntime.cudaGraphKernelNodeGetAttribute(cyhNode, cyattr, value_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, value_out) +{{endif}} + +{{if 'cudaGraphKernelNodeSetAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, value : Optional[cudaKernelNodeAttrValue]): + """ Sets node attribute. + + Sets attribute `attr` on node `hNode` from corresponding attribute of + `value`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + + attr : :py:obj:`~.cudaKernelNodeAttrID` + + value : :py:obj:`~.cudaKernelNodeAttrValue` + + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + + See Also + -------- + :py:obj:`~.cudaAccessPolicyWindow` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + 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 + with nogil: + err = cyruntime.cudaGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pCopyParams : Optional[cudaMemcpy3DParms]): + """ Creates a memcpy node and adds it to a graph. + + Creates a new memcpy node and adds it to `graph` with `numDependencies` + dependencies specified via `pDependencies`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `pDependencies` may not have any duplicate entries. + A handle to the new node will be returned in `pGraphNode`. + + When the graph is launched, the node will perform the memcpy described + by `pCopyParams`. See :py:obj:`~.cudaMemcpy3D()` for a description of + the structure and its restrictions. + + Memcpy nodes have some additional restrictions with regards to managed + memory, if the system contains at least one device which has a zero + value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + pCopyParams : :py:obj:`~.cudaMemcpy3DParms` + Parameters for the memory copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphAddMemcpyNodeToSymbol`, :py:obj:`~.cudaGraphAddMemcpyNodeFromSymbol`, :py:obj:`~.cudaGraphAddMemcpyNode1D`, :py:obj:`~.cudaGraphMemcpyNodeGetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphAddMemcpyNode1D' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dst, src, size_t count, kind not None : cudaMemcpyKind): + """ Creates a 1D memcpy node and adds it to a graph. + + Creates a new 1D memcpy node and adds it to `graph` with + `numDependencies` dependencies specified via `pDependencies`. It is + possible for `numDependencies` to be 0, in which case the node will be + placed at the root of the graph. `pDependencies` may not have any + duplicate entries. A handle to the new node will be returned in + `pGraphNode`. + + When the graph is launched, the node will copy `count` bytes from the + memory area pointed to by `src` to the memory area pointed to by `dst`, + where `kind` specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. Launching a memcpy node with dst and src + pointers that do not match the direction of the copy results in an + undefined behavior. + + Memcpy nodes have some additional restrictions with regards to managed + memory, if the system contains at least one device which has a zero + value for the device attribute + :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + dst : Any + Destination memory address + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeGetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaGraphAddMemcpyNode1D(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cydst, cysrc, count, cykind) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphMemcpyNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemcpyNodeGetParams(node): + """ Returns a memcpy node's parameters. + + Returns the parameters of memcpy node `node` in `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pNodeParams : :py:obj:`~.cudaMemcpy3DParms` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaMemcpy3DParms pNodeParams = cudaMemcpy3DParms() + with nogil: + err = cyruntime.cudaGraphMemcpyNodeGetParams(cynode, pNodeParams._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms]): + """ Sets a memcpy node's parameters. + + Sets the parameters of memcpy node `node` to `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + pNodeParams : :py:obj:`~.cudaMemcpy3DParms` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphMemcpyNodeSetParamsToSymbol`, :py:obj:`~.cudaGraphMemcpyNodeSetParamsFromSymbol`, :py:obj:`~.cudaGraphMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.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),) +{{endif}} + +{{if 'cudaGraphMemcpyNodeSetParams1D' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : cudaMemcpyKind): + """ Sets a memcpy node's parameters to perform a 1-dimensional copy. + + Sets the parameters of memcpy node `node` to the copy described by the + provided parameters. + + When the graph is launched, the node will copy `count` bytes from the + memory area pointed to by `src` to the memory area pointed to by `dst`, + where `kind` specifies the direction of the copy, and must be one of + :py:obj:`~.cudaMemcpyHostToHost`, :py:obj:`~.cudaMemcpyHostToDevice`, + :py:obj:`~.cudaMemcpyDeviceToHost`, + :py:obj:`~.cudaMemcpyDeviceToDevice`, or :py:obj:`~.cudaMemcpyDefault`. + Passing :py:obj:`~.cudaMemcpyDefault` is recommended, in which case the + type of transfer is inferred from the pointer values. However, + :py:obj:`~.cudaMemcpyDefault` is only allowed on systems that support + unified virtual addressing. Launching a memcpy node with dst and src + pointers that do not match the direction of the copy results in an + undefined behavior. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + dst : Any + Destination memory address + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaGraphMemcpyNodeSetParams1D(cynode, cydst, cysrc, count, cykind) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddMemsetNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pMemsetParams : Optional[cudaMemsetParams]): + """ Creates a memset node and adds it to a graph. + + Creates a new memset node and adds it to `graph` with `numDependencies` + dependencies specified via `pDependencies`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `pDependencies` may not have any duplicate entries. + A handle to the new node will be returned in `pGraphNode`. + + The element size must be 1, 2, or 4 bytes. When the graph is launched, + the node will perform the memset described by `pMemsetParams`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + pMemsetParams : :py:obj:`~.cudaMemsetParams` + Parameters for the memory set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphMemsetNodeGetParams`, :py:obj:`~.cudaGraphMemsetNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphMemsetNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemsetNodeGetParams(node): + """ Returns a memset node's parameters. + + Returns the parameters of memset node `node` in `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pNodeParams : :py:obj:`~.cudaMemsetParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaMemsetParams pNodeParams = cudaMemsetParams() + with nogil: + err = cyruntime.cudaGraphMemsetNodeGetParams(cynode, pNodeParams._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pNodeParams) +{{endif}} + +{{if 'cudaGraphMemsetNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]): + """ Sets a memset node's parameters. + + Sets the parameters of memset node `node` to `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + pNodeParams : :py:obj:`~.cudaMemsetParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.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),) +{{endif}} + +{{if 'cudaGraphAddHostNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaHostNodeParams]): + """ Creates a host execution node and adds it to a graph. + + Creates a new CPU execution node and adds it to `graph` with + `numDependencies` dependencies specified via `pDependencies` and + arguments specified in `pNodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `pDependencies` may not have any duplicate entries. + A handle to the new node will be returned in `pGraphNode`. + + When the graph is launched, the node will invoke the specified CPU + function. Host nodes are not supported under MPS with pre-Volta GPUs. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + pNodeParams : :py:obj:`~.cudaHostNodeParams` + Parameters for the host node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphHostNodeGetParams`, :py:obj:`~.cudaGraphHostNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphHostNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphHostNodeGetParams(node): + """ Returns a host node's parameters. + + Returns the parameters of host node `node` in `pNodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pNodeParams : :py:obj:`~.cudaHostNodeParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaHostNodeParams pNodeParams = cudaHostNodeParams() + with nogil: + err = cyruntime.cudaGraphHostNodeGetParams(cynode, pNodeParams._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pNodeParams) +{{endif}} + +{{if 'cudaGraphHostNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]): + """ Sets a host node's parameters. + + Sets the parameters of host node `node` to `nodeParams`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + pNodeParams : :py:obj:`~.cudaHostNodeParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.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),) +{{endif}} + +{{if 'cudaGraphAddChildGraphNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, childGraph): + """ Creates a child graph node and adds it to a graph. + + Creates a new node which executes an embedded graph, and adds it to + `graph` with `numDependencies` dependencies specified via + `pDependencies`. It is possible for `numDependencies` to be 0, in which + case the node will be placed at the root of the graph. `pDependencies` + may not have any duplicate entries. A handle to the new node will be + returned in `pGraphNode`. + + If `childGraph` contains allocation nodes, free nodes, or conditional + nodes, this call will return an error. + + The node executes an embedded child graph. The child graph is cloned in + this call. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + childGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to clone into this node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphChildGraphNodeGetGraph`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphClone` + """ + cdef cyruntime.cudaGraph_t cychildGraph + if childGraph is None: + pchildGraph = 0 + elif isinstance(childGraph, (cudaGraph_t,driver.CUgraph)): + pchildGraph = int(childGraph) + else: + pchildGraph = int(cudaGraph_t(childGraph)) + cychildGraph = pchildGraph + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphAddChildGraphNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cychildGraph) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphChildGraphNodeGetGraph' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphChildGraphNodeGetGraph(node): + """ Gets a handle to the embedded graph of a child graph node. + + Gets a handle to the embedded graph in a child graph node. This call + does not clone the graph. Changes to the graph will be reflected in the + node, and the node retains ownership of the graph. + + Allocation and free nodes cannot be added to the returned graph. + Attempting to do so will return an error. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the embedded graph for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraph : :py:obj:`~.cudaGraph_t` + Location to store a handle to the graph + + See Also + -------- + :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphNodeFindInClone` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaGraph_t pGraph = cudaGraph_t() + with nogil: + err = cyruntime.cudaGraphChildGraphNodeGetGraph(cynode, pGraph._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraph) +{{endif}} + +{{if 'cudaGraphAddEmptyNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddEmptyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): + """ Creates an empty node and adds it to a graph. + + Creates a new node which performs no operation, and adds it to `graph` + with `numDependencies` dependencies specified via `pDependencies`. It + is possible for `numDependencies` to be 0, in which case the node will + be placed at the root of the graph. `pDependencies` may not have any + duplicate entries. A handle to the new node will be returned in + `pGraphNode`. + + An empty node performs no operation during execution, but can be used + for transitive ordering. For example, a phased execution graph with 2 + groups of n nodes with a barrier between them can be represented using + an empty node and 2*n dependency edges, rather than no empty node and + n^2 dependency edges. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphAddEmptyNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphAddEventRecordNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): + """ Creates an event record node and adds it to a graph. + + Creates a new event record node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and event + specified in `event`. It is possible for `numDependencies` to be 0, in + which case the node will be placed at the root of the graph. + `dependencies` may not have any duplicate entries. A handle to the new + node will be returned in `phGraphNode`. + + Each launch of the graph will record `event` to capture execution of + the node's dependencies. + + These nodes may not be used in loops or conditionals. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event for the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + phGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphAddEventRecordNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cyevent) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphEventRecordNodeGetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphEventRecordNodeGetEvent(node): + """ Returns the event associated with an event record node. + + Returns the event of event record node `hNode` in `event_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the event for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + event_out : :py:obj:`~.cudaEvent_t` + Pointer to return the event + + See Also + -------- + :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaEvent_t event_out = cudaEvent_t() + with nogil: + err = cyruntime.cudaGraphEventRecordNodeGetEvent(cynode, event_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, event_out) +{{endif}} + +{{if 'cudaGraphEventRecordNodeSetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphEventRecordNodeSetEvent(node, event): + """ Sets an event record node's event. + + Sets the event of event record node `hNode` to `event`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the event for + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to use + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + with nogil: + err = cyruntime.cudaGraphEventRecordNodeSetEvent(cynode, cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddEventWaitNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): + """ Creates an event wait node and adds it to a graph. + + Creates a new event wait node and adds it to `hGraph` with + `numDependencies` dependencies specified via `dependencies` and event + specified in `event`. It is possible for `numDependencies` to be 0, in + which case the node will be placed at the root of the graph. + `dependencies` may not have any duplicate entries. A handle to the new + node will be returned in `phGraphNode`. + + The graph node will wait for all work captured in `event`. See + :py:obj:`~.cuEventRecord()` for details on what is captured by an + event. The synchronization will be performed efficiently on the device + when applicable. `event` may be from a different context or device than + the launch stream. + + These nodes may not be used in loops or conditionals. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event for the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + phGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphAddEventWaitNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cyevent) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphEventWaitNodeGetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphEventWaitNodeGetEvent(node): + """ Returns the event associated with an event wait node. + + Returns the event of event wait node `hNode` in `event_out`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the event for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + event_out : :py:obj:`~.cudaEvent_t` + Pointer to return the event + + See Also + -------- + :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaEvent_t event_out = cudaEvent_t() + with nogil: + err = cyruntime.cudaGraphEventWaitNodeGetEvent(cynode, event_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, event_out) +{{endif}} + +{{if 'cudaGraphEventWaitNodeSetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphEventWaitNodeSetEvent(node, event): + """ Sets an event wait node's event. + + Sets the event of event wait node `hNode` to `event`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the event for + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Event to use + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + with nogil: + err = cyruntime.cudaGraphEventWaitNodeSetEvent(cynode, cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): + """ Creates an external semaphore signal node and adds it to a graph. + + Creates a new external semaphore signal node and adds it to `graph` + with `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `pGraphNode`. + + Performs a signal operation on a set of externally allocated semaphore + objects when the node is launched. The operation(s) will occur after + all of the node's dependencies have completed. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` + Parameters for the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeGetParams`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExternalSemaphoresSignalNodeGetParams(hNode): + """ Returns an external semaphore signal node's parameters. + + Returns the parameters of an external semaphore signal node `hNode` in + `params_out`. The `extSemArray` and `paramsArray` returned in + `params_out`, are owned by the node. This memory remains valid until + the node is destroyed or its parameters are modified, and should not be + modified directly. Use + :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams` to update + the parameters of this node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + params_out : :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cudaExternalSemaphoreSignalNodeParams params_out = cudaExternalSemaphoreSignalNodeParams() + with nogil: + err = cyruntime.cudaGraphExternalSemaphoresSignalNodeGetParams(cyhNode, params_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): + """ Sets an external semaphore signal node's parameters. + + Sets the parameters of an external semaphore signal node `hNode` to + `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + 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),) +{{endif}} + +{{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): + """ Creates an external semaphore wait node and adds it to a graph. + + Creates a new external semaphore wait node and adds it to `graph` with + `numDependencies` dependencies specified via `dependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `dependencies` may not have any duplicate entries. A + handle to the new node will be returned in `pGraphNode`. + + Performs a wait operation on a set of externally allocated semaphore + objects when the node is launched. The node's dependencies will not be + launched until the wait operation has completed. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` + Parameters for the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeGetParams`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExternalSemaphoresWaitNodeGetParams(hNode): + """ Returns an external semaphore wait node's parameters. + + Returns the parameters of an external semaphore wait node `hNode` in + `params_out`. The `extSemArray` and `paramsArray` returned in + `params_out`, are owned by the node. This memory remains valid until + the node is destroyed or its parameters are modified, and should not be + modified directly. Use + :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams` to update + the parameters of this node. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + params_out : :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cudaExternalSemaphoreWaitNodeParams params_out = cudaExternalSemaphoreWaitNodeParams() + with nogil: + err = cyruntime.cudaGraphExternalSemaphoresWaitNodeGetParams(cyhNode, params_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, params_out) +{{endif}} + +{{if 'cudaGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): + """ Sets an external semaphore wait node's parameters. + + Sets the parameters of an external semaphore wait node `hNode` to + `nodeParams`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + 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),) +{{endif}} + +{{if 'cudaGraphAddMemAllocNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaMemAllocNodeParams]): + """ Creates an allocation node and adds it to a graph. + + Creates a new allocation node and adds it to `graph` with + `numDependencies` dependencies specified via `pDependencies` and + arguments specified in `nodeParams`. It is possible for + `numDependencies` to be 0, in which case the node will be placed at the + root of the graph. `pDependencies` may not have any duplicate entries. + A handle to the new node will be returned in `pGraphNode`. + + When :py:obj:`~.cudaGraphAddMemAllocNode` creates an allocation node, + it returns the address of the allocation in `nodeParams.dptr`. The + allocation's address remains fixed across instantiations and launches. + + If the allocation is freed in the same graph, by creating a free node + using :py:obj:`~.cudaGraphAddMemFreeNode`, the allocation can be + accessed by nodes ordered after the allocation node but before the free + node. These allocations cannot be freed outside the owning graph, and + they can only be freed once in the owning graph. + + If the allocation is not freed in the same graph, then it can be + accessed not only by nodes in the graph which are ordered after the + allocation node, but also by stream operations ordered after the + graph's execution but before the allocation is freed. + + Allocations which are not freed in the same graph can be freed by: + + - passing the allocation to :py:obj:`~.cudaMemFreeAsync` or + :py:obj:`~.cudaMemFree`; + + - launching a graph with a free node for that allocation; or + + - specifying :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch` + during instantiation, which makes each launch behave as though it + called :py:obj:`~.cudaMemFreeAsync` for every unfreed allocation. + + It is not possible to free an allocation in both the owning graph and + another graph. If the allocation is freed in the same graph, a free + node cannot be added to another graph. If the allocation is freed in + another graph, a free node can no longer be added to the owning graph. + + The following restrictions apply to graphs which contain allocation + and/or memory free nodes: + + - Nodes and edges of the graph cannot be deleted. + + - The graph can only be used in a child node if the ownership is moved + to the parent. + + - Only one instantiation of the graph may exist at any point in time. + + - The graph cannot be cloned. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.cudaMemAllocNodeParams` + Parameters for the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOutOfMemory` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaGraphMemAllocNodeGetParams`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.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: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphMemAllocNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemAllocNodeGetParams(node): + """ Returns a memory alloc node's parameters. + + Returns the parameters of a memory alloc node `hNode` in `params_out`. + The `poolProps` and `accessDescs` returned in `params_out`, are owned + by the node. This memory remains valid until the node is destroyed. The + returned parameters must not be modified. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + params_out : :py:obj:`~.cudaMemAllocNodeParams` + Pointer to return the parameters + + See Also + -------- + :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cudaMemAllocNodeParams params_out = cudaMemAllocNodeParams() + with nogil: + err = cyruntime.cudaGraphMemAllocNodeGetParams(cynode, params_out._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, params_out) +{{endif}} + +{{if 'cudaGraphAddMemFreeNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dptr): + """ Creates a memory free node and adds it to a graph. + + Creates a new memory free node and adds it to `graph` with + `numDependencies` dependencies specified via `pDependencies` and + address specified in `dptr`. It is possible for `numDependencies` to be + 0, in which case the node will be placed at the root of the graph. + `pDependencies` may not have any duplicate entries. A handle to the new + node will be returned in `pGraphNode`. + + :py:obj:`~.cudaGraphAddMemFreeNode` will return + :py:obj:`~.cudaErrorInvalidValue` if the user attempts to free: + + - an allocation twice in the same graph. + + - an address that was not returned by an allocation node. + + - an invalid address. + + The following restrictions apply to graphs which contain allocation + and/or memory free nodes: + + - Nodes and edges of the graph cannot be deleted. + + - The graph can only be used in a child node if the ownership is moved + to the parent. + + - Only one instantiation of the graph may exist at any point in time. + + - The graph cannot be cloned. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + dptr : Any + Address of memory to free + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOutOfMemory` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef _HelperInputVoidPtrStruct cydptrHelper + cdef void* cydptr = _helper_input_void_ptr(dptr, &cydptrHelper) + with nogil: + err = cyruntime.cudaGraphAddMemFreeNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cydptr) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + _helper_input_void_ptr_free(&cydptrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphMemFreeNodeGetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphMemFreeNodeGetParams(node): + """ Returns a memory free node's parameters. + + Returns the address of a memory free node `hNode` in `dptr_out`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to get the parameters for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + dptr_out : Any + Pointer to return the device address + + See Also + -------- + :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef void_ptr dptr_out = 0 + cdef void* cydptr_out_ptr = &dptr_out + with nogil: + err = cyruntime.cudaGraphMemFreeNodeGetParams(cynode, cydptr_out_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, dptr_out) +{{endif}} + +{{if 'cudaDeviceGraphMemTrim' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGraphMemTrim(int device): + """ Free unused memory that was cached on the specified device for use with graphs back to the OS. + + Blocks which are not in use by a graph that is either currently + executing or scheduled to execute are freed back to the operating + system. + + Parameters + ---------- + device : int + The device for which cached memory should be freed. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` + """ + with nogil: + err = cyruntime.cudaDeviceGraphMemTrim(device) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaDeviceGetGraphMemAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceGetGraphMemAttribute(int device, attr not None : cudaGraphMemAttributeType): + """ Query asynchronous allocation attributes related to graphs. + + Valid attributes are: + + - :py:obj:`~.cudaGraphMemAttrUsedMemCurrent`: Amount of memory, in + bytes, currently associated with graphs + + - :py:obj:`~.cudaGraphMemAttrUsedMemHigh`: High watermark of memory, in + bytes, associated with graphs since the last time it was reset. High + watermark can only be reset to zero. + + - :py:obj:`~.cudaGraphMemAttrReservedMemCurrent`: Amount of memory, in + bytes, currently allocated for use by the CUDA graphs asynchronous + allocator. + + - :py:obj:`~.cudaGraphMemAttrReservedMemHigh`: High watermark of + memory, in bytes, currently allocated for use by the CUDA graphs + asynchronous allocator. + + Parameters + ---------- + device : int + Specifies the scope of the query + attr : :py:obj:`~.cudaGraphMemAttributeType` + attribute to get + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice` + value : Any + retrieved value + + See Also + -------- + :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` + """ + cdef cyruntime.cudaGraphMemAttributeType cyattr = int(attr) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cyruntime.cudaDeviceGetGraphMemAttribute(device, cyattr, cyvalue_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cyvalue.pyObj()) +{{endif}} + +{{if 'cudaDeviceSetGraphMemAttribute' in found_functions}} + +@cython.embedsignature(True) +def cudaDeviceSetGraphMemAttribute(int device, attr not None : cudaGraphMemAttributeType, value): + """ Set asynchronous allocation attributes related to graphs. + + Valid attributes are: + + - :py:obj:`~.cudaGraphMemAttrUsedMemHigh`: High watermark of memory, in + bytes, associated with graphs since the last time it was reset. High + watermark can only be reset to zero. + + - :py:obj:`~.cudaGraphMemAttrReservedMemHigh`: High watermark of + memory, in bytes, currently allocated for use by the CUDA graphs + asynchronous allocator. + + Parameters + ---------- + device : int + Specifies the scope of the query + attr : :py:obj:`~.cudaGraphMemAttributeType` + attribute to get + value : Any + pointer to value to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice` + + See Also + -------- + :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` + """ + cdef cyruntime.cudaGraphMemAttributeType cyattr = int(attr) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + with nogil: + err = cyruntime.cudaDeviceSetGraphMemAttribute(device, cyattr, cyvalue_ptr) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphClone' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphClone(originalGraph): + """ Clones a graph. + + This function creates a copy of `originalGraph` and returns it in + `pGraphClone`. All parameters are copied into the cloned graph. The + original graph may be modified after this call without affecting the + clone. + + Child graph nodes in the original graph are recursively copied into the + clone. + + Parameters + ---------- + originalGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to clone + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation` + pGraphClone : :py:obj:`~.cudaGraph_t` + Returns newly created cloned graph + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphNodeFindInClone` + + Notes + ----- + : Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes. + """ + cdef cyruntime.cudaGraph_t cyoriginalGraph + if originalGraph is None: + poriginalGraph = 0 + elif isinstance(originalGraph, (cudaGraph_t,driver.CUgraph)): + poriginalGraph = int(originalGraph) + else: + poriginalGraph = int(cudaGraph_t(originalGraph)) + cyoriginalGraph = poriginalGraph + cdef cudaGraph_t pGraphClone = cudaGraph_t() + with nogil: + err = cyruntime.cudaGraphClone(pGraphClone._pvt_ptr, cyoriginalGraph) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphClone) +{{endif}} + +{{if 'cudaGraphNodeFindInClone' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeFindInClone(originalNode, clonedGraph): + """ Finds a cloned version of a node. + + This function returns the node in `clonedGraph` corresponding to + `originalNode` in the original graph. + + `clonedGraph` must have been cloned from `originalGraph` via + :py:obj:`~.cudaGraphClone`. `originalNode` must have been in + `originalGraph` at the time of the call to :py:obj:`~.cudaGraphClone`, + and the corresponding cloned node in `clonedGraph` must not have been + removed. The cloned node is then returned via `pClonedNode`. + + Parameters + ---------- + originalNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Handle to the original node + clonedGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Cloned graph to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pNode : :py:obj:`~.cudaGraphNode_t` + Returns handle to the cloned node + + See Also + -------- + :py:obj:`~.cudaGraphClone` + """ + cdef cyruntime.cudaGraph_t cyclonedGraph + if clonedGraph is None: + pclonedGraph = 0 + elif isinstance(clonedGraph, (cudaGraph_t,driver.CUgraph)): + pclonedGraph = int(clonedGraph) + else: + pclonedGraph = int(cudaGraph_t(clonedGraph)) + cyclonedGraph = pclonedGraph + cdef cyruntime.cudaGraphNode_t cyoriginalNode + if originalNode is None: + poriginalNode = 0 + elif isinstance(originalNode, (cudaGraphNode_t,driver.CUgraphNode)): + poriginalNode = int(originalNode) + else: + poriginalNode = int(cudaGraphNode_t(originalNode)) + cyoriginalNode = poriginalNode + cdef cudaGraphNode_t pNode = cudaGraphNode_t() + with nogil: + err = cyruntime.cudaGraphNodeFindInClone(pNode._pvt_ptr, cyoriginalNode, cyclonedGraph) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pNode) +{{endif}} + +{{if 'cudaGraphNodeGetType' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetType(node): + """ Returns a node's type. + + Returns the node type of `node` in `pType`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pType : :py:obj:`~.cudaGraphNodeType` + Pointer to return the node type + + See Also + -------- + :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphChildGraphNodeGetGraph`, :py:obj:`~.cudaGraphKernelNodeGetParams`, :py:obj:`~.cudaGraphKernelNodeSetParams`, :py:obj:`~.cudaGraphHostNodeGetParams`, :py:obj:`~.cudaGraphHostNodeSetParams`, :py:obj:`~.cudaGraphMemcpyNodeGetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphMemsetNodeGetParams`, :py:obj:`~.cudaGraphMemsetNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphNodeType pType + with nogil: + err = cyruntime.cudaGraphNodeGetType(cynode, &pType) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, cudaGraphNodeType(pType)) +{{endif}} + +{{if 'cudaGraphGetNodes' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphGetNodes(graph, size_t numNodes = 0): + """ Returns a graph's nodes. + + Returns a list of `graph's` nodes. `nodes` may be NULL, in which case + this function will return the number of nodes in `numNodes`. Otherwise, + `numNodes` entries will be filled in. If `numNodes` is higher than the + actual number of nodes, the remaining entries in `nodes` will be set to + NULL, and the number of nodes actually obtained will be returned in + `numNodes`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to query + numNodes : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + nodes : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the nodes + numNodes : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetType`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numNodes + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cynodes = NULL + pynodes = [] + if _graph_length != 0: + cynodes = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cynodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + with nogil: + err = cyruntime.cudaGraphGetNodes(cygraph, cynodes, &numNodes) + if cudaError_t(err) == cudaError_t(0): + 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: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, pynodes, numNodes) +{{endif}} + +{{if 'cudaGraphGetRootNodes' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): + """ Returns a graph's root nodes. + + Returns a list of `graph's` root nodes. `pRootNodes` may be NULL, in + which case this function will return the number of root nodes in + `pNumRootNodes`. Otherwise, `pNumRootNodes` entries will be filled in. + If `pNumRootNodes` is higher than the actual number of root nodes, the + remaining entries in `pRootNodes` will be set to NULL, and the number + of nodes actually obtained will be returned in `pNumRootNodes`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to query + pNumRootNodes : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pRootNodes : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the root nodes + pNumRootNodes : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetType`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = pNumRootNodes + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cypRootNodes = NULL + pypRootNodes = [] + if _graph_length != 0: + cypRootNodes = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cypRootNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + with nogil: + err = cyruntime.cudaGraphGetRootNodes(cygraph, cypRootNodes, &pNumRootNodes) + if cudaError_t(err) == cudaError_t(0): + 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: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, pypRootNodes, pNumRootNodes) +{{endif}} + +{{if 'cudaGraphGetEdges' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphGetEdges(graph, size_t numEdges = 0): + """ Returns a graph's dependency edges. + + Returns a list of `graph's` dependency edges. Edges are returned via + corresponding indices in `from` and `to`; that is, the node in `to`[i] + has a dependency on the node in `from`[i]. `from` and `to` may both be + NULL, in which case this function only returns the number of edges in + `numEdges`. Otherwise, `numEdges` entries will be filled in. If + `numEdges` is higher than the actual number of edges, the remaining + entries in `from` and `to` will be set to NULL, and the number of edges + actually returned will be written to `numEdges`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to get the edges from + numEdges : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + from : list[:py:obj:`~.cudaGraphNode_t`] + Location to return edge endpoints + to : list[:py:obj:`~.cudaGraphNode_t`] + Location to return edge endpoints + numEdges : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numEdges + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + pyfrom_ = [] + if _graph_length != 0: + cyfrom_ = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + cdef cyruntime.cudaGraphNode_t* cyto = NULL + pyto = [] + if _graph_length != 0: + cyto = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + with nogil: + err = cyruntime.cudaGraphGetEdges(cygraph, cyfrom_, cyto, &numEdges) + if cudaError_t(err) == cudaError_t(0): + pyfrom_ = [cudaGraphNode_t() 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() 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 err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None, None) + return (_cudaError_t_SUCCESS, pyfrom_, pyto, numEdges) +{{endif}} + +{{if 'cudaGraphGetEdges_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphGetEdges_v2(graph, size_t numEdges = 0): + """ Returns a graph's dependency edges (12.3+). + + Returns a list of `graph's` dependency edges. Edges are returned via + corresponding indices in `from`, `to` and `edgeData`; that is, the node + in `to`[i] has a dependency on the node in `from`[i] with data + `edgeData`[i]. `from` and `to` may both be NULL, in which case this + function only returns the number of edges in `numEdges`. Otherwise, + `numEdges` entries will be filled in. If `numEdges` is higher than the + actual number of edges, the remaining entries in `from` and `to` will + be set to NULL, and the number of edges actually returned will be + written to `numEdges`. `edgeData` may alone be NULL, in which case the + edges must all have default (zeroed) edge data. Attempting a losst + query via NULL `edgeData` will result in + :py:obj:`~.cudaErrorLossyQuery`. If `edgeData` is non-NULL then `from` + and `to` must be as well. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to get the edges from + numEdges : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` + from : list[:py:obj:`~.cudaGraphNode_t`] + Location to return edge endpoints + to : list[:py:obj:`~.cudaGraphNode_t`] + Location to return edge endpoints + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional location to return edge data + numEdges : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + cdef size_t _graph_length = numEdges + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + pyfrom_ = [] + if _graph_length != 0: + cyfrom_ = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + cdef cyruntime.cudaGraphNode_t* cyto = NULL + pyto = [] + if _graph_length != 0: + cyto = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + cdef cyruntime.cudaGraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cyruntime.cudaGraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + with nogil: + err = cyruntime.cudaGraphGetEdges_v2(cygraph, cyfrom_, cyto, cyedgeData, &numEdges) + if cudaError_t(err) == cudaError_t(0): + 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() 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() 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: + return (_cudaError_t(err), None, None, None, None) + return (_cudaError_t_SUCCESS, pyfrom_, pyto, pyedgeData, numEdges) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): + """ Returns a node's dependencies. + + Returns a list of `node's` dependencies. `pDependencies` may be NULL, + in which case this function will return the number of dependencies in + `pNumDependencies`. Otherwise, `pNumDependencies` entries will be + filled in. If `pNumDependencies` is higher than the actual number of + dependencies, the remaining entries in `pDependencies` will be set to + NULL, and the number of nodes actually obtained will be returned in + `pNumDependencies`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + pNumDependencies : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the dependencies + pNumDependencies : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphNodeGetDependentNodes`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` + """ + cdef size_t _graph_length = pNumDependencies + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + pypDependencies = [] + if _graph_length != 0: + cypDependencies = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + with nogil: + err = cyruntime.cudaGraphNodeGetDependencies(cynode, cypDependencies, &pNumDependencies) + if cudaError_t(err) == cudaError_t(0): + pypDependencies = [cudaGraphNode_t() 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 err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, pypDependencies, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependencies_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetDependencies_v2(node, size_t pNumDependencies = 0): + """ Returns a node's dependencies (12.3+). + + Returns a list of `node's` dependencies. `pDependencies` may be NULL, + in which case this function will return the number of dependencies in + `pNumDependencies`. Otherwise, `pNumDependencies` entries will be + filled in. If `pNumDependencies` is higher than the actual number of + dependencies, the remaining entries in `pDependencies` will be set to + NULL, and the number of nodes actually obtained will be returned in + `pNumDependencies`. + + Note that if an edge has non-zero (non-default) edge data and + `edgeData` is NULL, this API will return + :py:obj:`~.cudaErrorLossyQuery`. If `edgeData` is non-NULL, then + `pDependencies` must be as well. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + pNumDependencies : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the dependencies + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional array to return edge data for each dependency + pNumDependencies : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphNodeGetDependentNodes`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` + """ + cdef size_t _graph_length = pNumDependencies + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + pypDependencies = [] + if _graph_length != 0: + cypDependencies = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + cdef cyruntime.cudaGraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cyruntime.cudaGraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + with nogil: + err = cyruntime.cudaGraphNodeGetDependencies_v2(cynode, cypDependencies, cyedgeData, &pNumDependencies) + if cudaError_t(err) == cudaError_t(0): + 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() 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: + return (_cudaError_t(err), None, None, None) + return (_cudaError_t_SUCCESS, pypDependencies, pyedgeData, pNumDependencies) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): + """ Returns a node's dependent nodes. + + Returns a list of `node's` dependent nodes. `pDependentNodes` may be + NULL, in which case this function will return the number of dependent + nodes in `pNumDependentNodes`. Otherwise, `pNumDependentNodes` entries + will be filled in. If `pNumDependentNodes` is higher than the actual + number of dependent nodes, the remaining entries in `pDependentNodes` + will be set to NULL, and the number of nodes actually obtained will be + returned in `pNumDependentNodes`. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + pNumDependentNodes : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pDependentNodes : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the dependent nodes + pNumDependentNodes : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` + """ + cdef size_t _graph_length = pNumDependentNodes + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphNode_t* cypDependentNodes = NULL + pypDependentNodes = [] + if _graph_length != 0: + cypDependentNodes = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cypDependentNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + with nogil: + err = cyruntime.cudaGraphNodeGetDependentNodes(cynode, cypDependentNodes, &pNumDependentNodes) + if cudaError_t(err) == cudaError_t(0): + pypDependentNodes = [cudaGraphNode_t() 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 err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, pypDependentNodes, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphNodeGetDependentNodes_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): + """ Returns a node's dependent nodes (12.3+). + + Returns a list of `node's` dependent nodes. `pDependentNodes` may be + NULL, in which case this function will return the number of dependent + nodes in `pNumDependentNodes`. Otherwise, `pNumDependentNodes` entries + will be filled in. If `pNumDependentNodes` is higher than the actual + number of dependent nodes, the remaining entries in `pDependentNodes` + will be set to NULL, and the number of nodes actually obtained will be + returned in `pNumDependentNodes`. + + Note that if an edge has non-zero (non-default) edge data and + `edgeData` is NULL, this API will return + :py:obj:`~.cudaErrorLossyQuery`. If `edgeData` is non-NULL, then + `pDependentNodes` must be as well. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to query + pNumDependentNodes : int + See description + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` + pDependentNodes : list[:py:obj:`~.cudaGraphNode_t`] + Pointer to return the dependent nodes + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional pointer to return edge data for dependent nodes + pNumDependentNodes : int + See description + + See Also + -------- + :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphGetNodes`, :py:obj:`~.cudaGraphGetRootNodes`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphRemoveDependencies` + """ + cdef size_t _graph_length = pNumDependentNodes + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphNode_t* cypDependentNodes = NULL + pypDependentNodes = [] + if _graph_length != 0: + cypDependentNodes = calloc(_graph_length, sizeof(cyruntime.cudaGraphNode_t)) + if cypDependentNodes is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + cdef cyruntime.cudaGraphEdgeData* cyedgeData = NULL + pyedgeData = [] + if _graph_length != 0: + cyedgeData = calloc(_graph_length, sizeof(cyruntime.cudaGraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_graph_length) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + with nogil: + err = cyruntime.cudaGraphNodeGetDependentNodes_v2(cynode, cypDependentNodes, cyedgeData, &pNumDependentNodes) + if cudaError_t(err) == cudaError_t(0): + 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() 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: + return (_cudaError_t(err), None, None, None) + return (_cudaError_t_SUCCESS, pypDependentNodes, pyedgeData, pNumDependentNodes) +{{endif}} + +{{if 'cudaGraphAddDependencies' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): + """ Adds dependency edges to a graph. + + The number of dependencies to be added is defined by `numDependencies` + Elements in `pFrom` and `pTo` at corresponding indices define a + dependency. Each node in `pFrom` and `pTo` must belong to `graph`. + + If `numDependencies` is 0, elements in `pFrom` and `pTo` will be + ignored. Specifying an existing dependency will return an error. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which dependencies are added + from : list[:py:obj:`~.cudaGraphNode_t`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.cudaGraphNode_t`] + Array of dependent nodes + numDependencies : size_t + Number of dependencies to be added + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + to = [] if to is None else to + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cyruntime.cudaGraphNode_t* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + if numDependencies > len(from_): raise RuntimeError("List is too small: " + str(len(from_)) + " < " + str(numDependencies)) + if numDependencies > len(to): raise RuntimeError("List is too small: " + str(len(to)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphAddDependencies(cygraph, cyfrom_, cyto, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddDependencies_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddDependencies_v2(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): + """ Adds dependency edges to a graph. (12.3+). + + The number of dependencies to be added is defined by `numDependencies` + Elements in `pFrom` and `pTo` at corresponding indices define a + dependency. Each node in `pFrom` and `pTo` must belong to `graph`. + + If `numDependencies` is 0, elements in `pFrom` and `pTo` will be + ignored. Specifying an existing dependency will return an error. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which dependencies are added + from : list[:py:obj:`~.cudaGraphNode_t`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.cudaGraphNode_t`] + Array of dependent nodes + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional array of edge data. If NULL, default (zeroed) edge data is + assumed. + numDependencies : size_t + Number of dependencies to be added + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphRemoveDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + edgeData = [] if edgeData is None else edgeData + if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") + to = [] if to is None else to + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cyruntime.cudaGraphNode_t* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + cdef cyruntime.cudaGraphEdgeData* cyedgeData = NULL + if len(edgeData) > 1: + cyedgeData = calloc(len(edgeData), sizeof(cyruntime.cudaGraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(edgeData)) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + for idx in range(len(edgeData)): + string.memcpy(&cyedgeData[idx], (edgeData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) + elif len(edgeData) == 1: + cyedgeData = (edgeData[0])._pvt_ptr + with nogil: + err = cyruntime.cudaGraphAddDependencies_v2(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + if len(edgeData) > 1 and cyedgeData is not NULL: + free(cyedgeData) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphRemoveDependencies' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphRemoveDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): + """ Removes dependency edges from a graph. + + The number of `pDependencies` to be removed is defined by + `numDependencies`. Elements in `pFrom` and `pTo` at corresponding + indices define a dependency. Each node in `pFrom` and `pTo` must belong + to `graph`. + + If `numDependencies` is 0, elements in `pFrom` and `pTo` will be + ignored. Specifying a non-existing dependency will return an error. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph from which to remove dependencies + from : list[:py:obj:`~.cudaGraphNode_t`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.cudaGraphNode_t`] + Array of dependent nodes + numDependencies : size_t + Number of dependencies to be removed + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + to = [] if to is None else to + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cyruntime.cudaGraphNode_t* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + if numDependencies > len(from_): raise RuntimeError("List is too small: " + str(len(from_)) + " < " + str(numDependencies)) + if numDependencies > len(to): raise RuntimeError("List is too small: " + str(len(to)) + " < " + str(numDependencies)) + with nogil: + err = cyruntime.cudaGraphRemoveDependencies(cygraph, cyfrom_, cyto, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphRemoveDependencies_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): + """ Removes dependency edges from a graph. (12.3+). + + The number of `pDependencies` to be removed is defined by + `numDependencies`. Elements in `pFrom` and `pTo` at corresponding + indices define a dependency. Each node in `pFrom` and `pTo` must belong + to `graph`. + + If `numDependencies` is 0, elements in `pFrom` and `pTo` will be + ignored. Specifying an edge that does not exist in the graph, with data + matching `edgeData`, results in an error. `edgeData` is nullable, which + is equivalent to passing default (zeroed) data for each edge. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph from which to remove dependencies + from : list[:py:obj:`~.cudaGraphNode_t`] + Array of nodes that provide the dependencies + to : list[:py:obj:`~.cudaGraphNode_t`] + Array of dependent nodes + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional array of edge data. If NULL, edge data is assumed to be + default (zeroed). + numDependencies : size_t + Number of dependencies to be removed + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphAddDependencies`, :py:obj:`~.cudaGraphGetEdges`, :py:obj:`~.cudaGraphNodeGetDependencies`, :py:obj:`~.cudaGraphNodeGetDependentNodes` + """ + edgeData = [] if edgeData is None else edgeData + if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") + to = [] if to is None else to + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + from_ = [] if from_ is None else from_ + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cyruntime.cudaGraphNode_t* cyfrom_ = NULL + if len(from_) > 1: + cyfrom_ = calloc(len(from_), sizeof(cyruntime.cudaGraphNode_t)) + if cyfrom_ is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(from_)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(from_)): + cyfrom_[idx] = (from_[idx])._pvt_ptr[0] + elif len(from_) == 1: + cyfrom_ = (from_[0])._pvt_ptr + cdef cyruntime.cudaGraphNode_t* cyto = NULL + if len(to) > 1: + cyto = calloc(len(to), sizeof(cyruntime.cudaGraphNode_t)) + if cyto is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(to)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(to)): + cyto[idx] = (to[idx])._pvt_ptr[0] + elif len(to) == 1: + cyto = (to[0])._pvt_ptr + cdef cyruntime.cudaGraphEdgeData* cyedgeData = NULL + if len(edgeData) > 1: + cyedgeData = calloc(len(edgeData), sizeof(cyruntime.cudaGraphEdgeData)) + if cyedgeData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(edgeData)) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + for idx in range(len(edgeData)): + string.memcpy(&cyedgeData[idx], (edgeData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) + elif len(edgeData) == 1: + cyedgeData = (edgeData[0])._pvt_ptr + with nogil: + err = cyruntime.cudaGraphRemoveDependencies_v2(cygraph, cyfrom_, cyto, cyedgeData, numDependencies) + if len(from_) > 1 and cyfrom_ is not NULL: + free(cyfrom_) + if len(to) > 1 and cyto is not NULL: + free(cyto) + if len(edgeData) > 1 and cyedgeData is not NULL: + free(cyedgeData) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphDestroyNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphDestroyNode(node): + """ Remove a node from the graph. + + Removes `node` from its graph. This operation also severs any + dependencies of other nodes on `node` and vice versa. + + Dependencies cannot be removed from graphs which contain allocation or + free nodes. Any attempt to do so will return an error. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to remove + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + with nogil: + err = cyruntime.cudaGraphDestroyNode(cynode) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphInstantiate' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphInstantiate(graph, unsigned long long flags): + """ Creates an executable graph from a graph. + + Instantiates `graph` as an executable graph. The graph is validated for + any structural constraints or intra-node constraints which were not + previously validated. If instantiation is successful, a handle to the + instantiated graph is returned in `pGraphExec`. + + The `flags` parameter controls the behavior of instantiation and + subsequent graph launches. Valid flags are: + + - :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`, which + configures a graph containing memory allocation nodes to + automatically free any unfreed memory allocations before the graph is + relaunched. + + - :py:obj:`~.cudaGraphInstantiateFlagDeviceLaunch`, which configures + the graph for launch from the device. If this flag is passed, the + executable graph handle returned can be used to launch the graph from + both the host and device. This flag cannot be used in conjunction + with :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`. + + - :py:obj:`~.cudaGraphInstantiateFlagUseNodePriority`, which causes the + graph to use the priorities from the per-node attributes rather than + the priority of the launch stream during execution. Note that + priorities are only available on kernel nodes, and are copied from + stream priority during stream capture. + + If `graph` contains any allocation or free nodes, there can be at most + one executable graph in existence for that graph at a time. An attempt + to instantiate a second executable graph before destroying the first + with :py:obj:`~.cudaGraphExecDestroy` will result in an error. The same + also applies if `graph` contains any device-updatable kernel nodes. + + Graphs instantiated for launch on the device have additional + restrictions which do not apply to host graphs: + + - The graph's nodes must reside on a single device. + + - The graph can only contain kernel nodes, memcpy nodes, memset nodes, + and child graph nodes. + + - The graph cannot be empty and must contain at least one kernel, + memcpy, or memset node. Operation-specific restrictions are outlined + below. + + - Kernel nodes: + + - Use of CUDA Dynamic Parallelism is not permitted. + + - Cooperative launches are permitted as long as MPS is not in use. + + - Memcpy nodes: + + - Only copies involving device memory and/or pinned device-mapped + host memory are permitted. + + - Copies involving CUDA arrays are not permitted. + + - Both operands must be accessible from the current device, and the + current device must match the device of other nodes in the graph. + + If `graph` is not instantiated for launch on the device but contains + kernels which call device-side :py:obj:`~.cudaGraphLaunch()` from + multiple devices, this will result in an error. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to instantiate + flags : unsigned long long + Flags to control instantiation. See + :py:obj:`~.CUgraphInstantiate_flags`. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphExec : :py:obj:`~.cudaGraphExec_t` + Returns instantiated graph + + See Also + -------- + :py:obj:`~.cudaGraphInstantiateWithFlags`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphUpload`, :py:obj:`~.cudaGraphLaunch`, :py:obj:`~.cudaGraphExecDestroy` + """ + 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 cudaGraphExec_t pGraphExec = cudaGraphExec_t() + with nogil: + err = cyruntime.cudaGraphInstantiate(pGraphExec._pvt_ptr, cygraph, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphExec) +{{endif}} + +{{if 'cudaGraphInstantiateWithFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphInstantiateWithFlags(graph, unsigned long long flags): + """ Creates an executable graph from a graph. + + Instantiates `graph` as an executable graph. The graph is validated for + any structural constraints or intra-node constraints which were not + previously validated. If instantiation is successful, a handle to the + instantiated graph is returned in `pGraphExec`. + + The `flags` parameter controls the behavior of instantiation and + subsequent graph launches. Valid flags are: + + - :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`, which + configures a graph containing memory allocation nodes to + automatically free any unfreed memory allocations before the graph is + relaunched. + + - :py:obj:`~.cudaGraphInstantiateFlagDeviceLaunch`, which configures + the graph for launch from the device. If this flag is passed, the + executable graph handle returned can be used to launch the graph from + both the host and device. This flag can only be used on platforms + which support unified addressing. This flag cannot be used in + conjunction with + :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`. + + - :py:obj:`~.cudaGraphInstantiateFlagUseNodePriority`, which causes the + graph to use the priorities from the per-node attributes rather than + the priority of the launch stream during execution. Note that + priorities are only available on kernel nodes, and are copied from + stream priority during stream capture. + + If `graph` contains any allocation or free nodes, there can be at most + one executable graph in existence for that graph at a time. An attempt + to instantiate a second executable graph before destroying the first + with :py:obj:`~.cudaGraphExecDestroy` will result in an error. The same + also applies if `graph` contains any device-updatable kernel nodes. + + If `graph` contains kernels which call device-side + :py:obj:`~.cudaGraphLaunch()` from multiple devices, this will result + in an error. + + Graphs instantiated for launch on the device have additional + restrictions which do not apply to host graphs: + + - The graph's nodes must reside on a single device. + + - The graph can only contain kernel nodes, memcpy nodes, memset nodes, + and child graph nodes. + + - The graph cannot be empty and must contain at least one kernel, + memcpy, or memset node. Operation-specific restrictions are outlined + below. + + - Kernel nodes: + + - Use of CUDA Dynamic Parallelism is not permitted. + + - Cooperative launches are permitted as long as MPS is not in use. + + - Memcpy nodes: + + - Only copies involving device memory and/or pinned device-mapped + host memory are permitted. + + - Copies involving CUDA arrays are not permitted. + + - Both operands must be accessible from the current device, and the + current device must match the device of other nodes in the graph. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to instantiate + flags : unsigned long long + Flags to control instantiation. See + :py:obj:`~.CUgraphInstantiate_flags`. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphExec : :py:obj:`~.cudaGraphExec_t` + Returns instantiated graph + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphUpload`, :py:obj:`~.cudaGraphLaunch`, :py:obj:`~.cudaGraphExecDestroy` + """ + 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 cudaGraphExec_t pGraphExec = cudaGraphExec_t() + with nogil: + err = cyruntime.cudaGraphInstantiateWithFlags(pGraphExec._pvt_ptr, cygraph, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphExec) +{{endif}} + +{{if 'cudaGraphInstantiateWithParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphInstantiateWithParams(graph, instantiateParams : Optional[cudaGraphInstantiateParams]): + """ Creates an executable graph from a graph. + + Instantiates `graph` as an executable graph according to the + `instantiateParams` structure. The graph is validated for any + structural constraints or intra-node constraints which were not + previously validated. If instantiation is successful, a handle to the + instantiated graph is returned in `pGraphExec`. + + `instantiateParams` controls the behavior of instantiation and + subsequent graph launches, as well as returning more detailed + information in the event of an error. + :py:obj:`~.cudaGraphInstantiateParams` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + The `flags` field controls the behavior of instantiation and subsequent + graph launches. Valid flags are: + + - :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`, which + configures a graph containing memory allocation nodes to + automatically free any unfreed memory allocations before the graph is + relaunched. + + - :py:obj:`~.cudaGraphInstantiateFlagUpload`, which will perform an + upload of the graph into `uploadStream` once the graph has been + instantiated. + + - :py:obj:`~.cudaGraphInstantiateFlagDeviceLaunch`, which configures + the graph for launch from the device. If this flag is passed, the + executable graph handle returned can be used to launch the graph from + both the host and device. This flag can only be used on platforms + which support unified addressing. This flag cannot be used in + conjunction with + :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`. + + - :py:obj:`~.cudaGraphInstantiateFlagUseNodePriority`, which causes the + graph to use the priorities from the per-node attributes rather than + the priority of the launch stream during execution. Note that + priorities are only available on kernel nodes, and are copied from + stream priority during stream capture. + + If `graph` contains any allocation or free nodes, there can be at most + one executable graph in existence for that graph at a time. An attempt + to instantiate a second executable graph before destroying the first + with :py:obj:`~.cudaGraphExecDestroy` will result in an error. The same + also applies if `graph` contains any device-updatable kernel nodes. + + If `graph` contains kernels which call device-side + :py:obj:`~.cudaGraphLaunch()` from multiple devices, this will result + in an error. + + Graphs instantiated for launch on the device have additional + restrictions which do not apply to host graphs: + + - The graph's nodes must reside on a single device. + + - The graph can only contain kernel nodes, memcpy nodes, memset nodes, + and child graph nodes. + + - The graph cannot be empty and must contain at least one kernel, + memcpy, or memset node. Operation-specific restrictions are outlined + below. + + - Kernel nodes: + + - Use of CUDA Dynamic Parallelism is not permitted. + + - Cooperative launches are permitted as long as MPS is not in use. + + - Memcpy nodes: + + - Only copies involving device memory and/or pinned device-mapped + host memory are permitted. + + - Copies involving CUDA arrays are not permitted. + + - Both operands must be accessible from the current device, and the + current device must match the device of other nodes in the graph. + + In the event of an error, the `result_out` and `errNode_out` fields + will contain more information about the nature of the error. Possible + error reporting includes: + + - :py:obj:`~.cudaGraphInstantiateError`, if passed an invalid value or + if an unexpected error occurred which is described by the return + value of the function. `errNode_out` will be set to NULL. + + - :py:obj:`~.cudaGraphInstantiateInvalidStructure`, if the graph + structure is invalid. `errNode_out` will be set to one of the + offending nodes. + + - :py:obj:`~.cudaGraphInstantiateNodeOperationNotSupported`, if the + graph is instantiated for device launch but contains a node of an + unsupported node type, or a node which performs unsupported + operations, such as use of CUDA dynamic parallelism within a kernel + node. `errNode_out` will be set to this node. + + - :py:obj:`~.cudaGraphInstantiateMultipleDevicesNotSupported`, if the + graph is instantiated for device launch but a node’s device differs + from that of another node. This error can also be returned if a graph + is not instantiated for device launch and it contains kernels which + call device-side :py:obj:`~.cudaGraphLaunch()` from multiple devices. + `errNode_out` will be set to this node. + + If instantiation is successful, `result_out` will be set to + :py:obj:`~.cudaGraphInstantiateSuccess`, and `hErrNode_out` will be set + to NULL. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to instantiate + instantiateParams : :py:obj:`~.cudaGraphInstantiateParams` + Instantiation parameters + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + pGraphExec : :py:obj:`~.cudaGraphExec_t` + Returns instantiated graph + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphInstantiateWithFlags`, :py:obj:`~.cudaGraphExecDestroy` + """ + 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 cudaGraphExec_t pGraphExec = cudaGraphExec_t() + 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: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphExec) +{{endif}} + +{{if 'cudaGraphExecGetFlags' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecGetFlags(graphExec): + """ Query the instantiation flags of an executable graph. + + Returns the flags that were passed to instantiation for the given + executable graph. :py:obj:`~.cudaGraphInstantiateFlagUpload` will not + be returned by this API as it does not affect the resulting executable + graph. + + Parameters + ---------- + graphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + flags : unsigned long long + Returns the instantiation flags + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphInstantiateWithFlags`, :py:obj:`~.cudaGraphInstantiateWithParams` + """ + cdef cyruntime.cudaGraphExec_t cygraphExec + if graphExec is None: + pgraphExec = 0 + elif isinstance(graphExec, (cudaGraphExec_t,driver.CUgraphExec)): + pgraphExec = int(graphExec) + else: + pgraphExec = int(cudaGraphExec_t(graphExec)) + cygraphExec = pgraphExec + cdef unsigned long long flags = 0 + with nogil: + err = cyruntime.cudaGraphExecGetFlags(cygraphExec, &flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, flags) +{{endif}} + +{{if 'cudaGraphExecKernelNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cudaKernelNodeParams]): + """ Sets the parameters for a kernel node in the given graphExec. + + Sets the parameters of a kernel node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `node` + in the non-executable graph, from which the executable graph was + instantiated. + + `node` must not have been removed from the original graph. All + `nodeParams` fields may change, but the following restrictions apply to + `func` updates: + + - The owning device of the function cannot change. + + - A node whose function originally did not use CUDA dynamic parallelism + cannot be updated to a function which uses CDP + + - A node whose function originally did not make device-side update + calls cannot be updated to a function which makes device-side update + calls. + + - If `hGraphExec` was not instantiated for device launch, a node whose + function originally did not use device-side + :py:obj:`~.cudaGraphLaunch()` cannot be updated to a function which + uses device-side :py:obj:`~.cudaGraphLaunch()` unless the node + resides on the same device as nodes which contained such calls at + instantiate-time. If no such calls were present at instantiation, + these updates cannot be performed at all. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + If `node` is a device-updatable kernel node, the next upload/launch of + `hGraphExec` will overwrite any previous device-side updates. + Additionally, applying host updates to a device-updatable kernel node + while it is being updated from the device will result in undefined + behavior. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + kernel node from the graph from which graphExec was instantiated + pNodeParams : :py:obj:`~.cudaKernelNodeParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cudaMemcpy3DParms]): + """ Sets the parameters for a memcpy node in the given graphExec. + + Updates the work represented by `node` in `hGraphExec` as though `node` + had contained `pNodeParams` at instantiation. `node` must remain in the + graph which was used to instantiate `hGraphExec`. Changed edges to and + from `node` are ignored. + + The source and destination memory in `pNodeParams` must be allocated + from the same contexts as the original source and destination memory. + Both the instantiation-time memory operands and the memory operands in + `pNodeParams` must be 1-dimensional. Zero-length operations are not + supported. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + Returns :py:obj:`~.cudaErrorInvalidValue` if the memory operands' + mappings changed or either the original or new memory operands are + multidimensional. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Memcpy node from the graph which was used to instantiate graphExec + pNodeParams : :py:obj:`~.cudaMemcpy3DParms` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParamsToSymbol`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParamsFromSymbol`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphExecMemcpyNodeSetParams1D' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, size_t count, kind not None : cudaMemcpyKind): + """ Sets the parameters for a memcpy node in the given graphExec to perform a 1-dimensional copy. + + Updates the work represented by `node` in `hGraphExec` as though `node` + had contained the given params at instantiation. `node` must remain in + the graph which was used to instantiate `hGraphExec`. Changed edges to + and from `node` are ignored. + + `src` and `dst` must be allocated from the same contexts as the + original source and destination memory. The instantiation-time memory + operands must be 1-dimensional. Zero-length operations are not + supported. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + Returns :py:obj:`~.cudaErrorInvalidValue` if the memory operands' + mappings changed or the original memory operands are multidimensional. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Memcpy node from the graph which was used to instantiate graphExec + dst : Any + Destination memory address + src : Any + Source memory address + count : size_t + Size in bytes to copy + kind : :py:obj:`~.cudaMemcpyKind` + Type of transfer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemcpyNode1D`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + cdef _HelperInputVoidPtrStruct cydstHelper + cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) + cdef _HelperInputVoidPtrStruct cysrcHelper + cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) + cdef cyruntime.cudaMemcpyKind cykind = int(kind) + with nogil: + err = cyruntime.cudaGraphExecMemcpyNodeSetParams1D(cyhGraphExec, cynode, cydst, cysrc, count, cykind) + _helper_input_void_ptr_free(&cydstHelper) + _helper_input_void_ptr_free(&cysrcHelper) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphExecMemsetNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cudaMemsetParams]): + """ Sets the parameters for a memset node in the given graphExec. + + Updates the work represented by `node` in `hGraphExec` as though `node` + had contained `pNodeParams` at instantiation. `node` must remain in the + graph which was used to instantiate `hGraphExec`. Changed edges to and + from `node` are ignored. + + Zero sized operations are not supported. + + The new destination pointer in `pNodeParams` must be to the same kind + of allocation as the original destination pointer and have the same + context association and device mapping as the original destination + pointer. + + Both the value and pointer address may be updated. Changing other + aspects of the memset (width, height, element size or pitch) may cause + the update to be rejected. Specifically, for 2d memsets, all dimension + changes are rejected. For 1d memsets, changes in height are explicitly + rejected and other changes are opportunistically allowed if the + resulting work maps onto the work resources already allocated for the + node. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Memset node from the graph which was used to instantiate graphExec + pNodeParams : :py:obj:`~.cudaMemsetParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphExecHostNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cudaHostNodeParams]): + """ Sets the parameters for a host node in the given graphExec. + + Updates the work represented by `node` in `hGraphExec` as though `node` + had contained `pNodeParams` at instantiation. `node` must remain in the + graph which was used to instantiate `hGraphExec`. Changed edges to and + from `node` are ignored. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Host node from the graph which was used to instantiate graphExec + pNodeParams : :py:obj:`~.cudaHostNodeParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeSetParams`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphExecChildGraphNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph): + """ Updates node parameters in the child graph node in the given graphExec. + + Updates the work represented by `node` in `hGraphExec` as though the + nodes contained in `node's` graph had the parameters contained in + `childGraph's` nodes at instantiation. `node` must remain in the graph + which was used to instantiate `hGraphExec`. Changed edges to and from + `node` are ignored. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `node` is also not modified by this call. + + The topology of `childGraph`, as well as the node insertion order, must + match that of the graph contained in `node`. See + :py:obj:`~.cudaGraphExecUpdate()` for a list of restrictions on what + can be updated in an instantiated graph. The update is recursive, so + child graph nodes contained within the top level child graph will also + be updated. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Host node from the graph which was used to instantiate graphExec + childGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph supplying the updated parameters + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphChildGraphNodeGetGraph`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraph_t cychildGraph + if childGraph is None: + pchildGraph = 0 + elif isinstance(childGraph, (cudaGraph_t,driver.CUgraph)): + pchildGraph = int(childGraph) + else: + pchildGraph = int(cudaGraph_t(childGraph)) + cychildGraph = pchildGraph + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cyruntime.cudaGraphExecChildGraphNodeSetParams(cyhGraphExec, cynode, cychildGraph) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphExecEventRecordNodeSetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): + """ Sets the event for an event record node in the given graphExec. + + Sets the event of an event record node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Event record node from the graph from which graphExec was + instantiated + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Updated event to use + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cyruntime.cudaGraphExecEventRecordNodeSetEvent(cyhGraphExec, cyhNode, cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphExecEventWaitNodeSetEvent' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): + """ Sets the event for an event wait node in the given graphExec. + + Sets the event of an event wait node in an executable graph + `hGraphExec`. The node is identified by the corresponding node `hNode` + in the non-executable graph, from which the executable graph was + instantiated. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Event wait node from the graph from which graphExec was + instantiated + event : :py:obj:`~.CUevent` or :py:obj:`~.cudaEvent_t` + Updated event to use + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaEvent_t cyevent + if event is None: + pevent = 0 + elif isinstance(event, (cudaEvent_t,driver.CUevent)): + pevent = int(event) + else: + pevent = int(cudaEvent_t(event)) + cyevent = pevent + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cyruntime.cudaGraphExecEventWaitNodeSetEvent(cyhGraphExec, cyhNode, cyevent) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): + """ Sets the parameters for an external semaphore signal node in the given graphExec. + + Sets the parameters of an external semaphore signal node in an + executable graph `hGraphExec`. The node is identified by the + corresponding node `hNode` in the non-executable graph, from which the + executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Changing `nodeParams->numExtSems` is not supported. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + semaphore signal node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): + """ Sets the parameters for an external semaphore wait node in the given graphExec. + + Sets the parameters of an external semaphore wait node in an executable + graph `hGraphExec`. The node is identified by the corresponding node + `hNode` in the non-executable graph, from which the executable graph + was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Changing `nodeParams->numExtSems` is not supported. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + semaphore wait node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + 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),) +{{endif}} + +{{if 'cudaGraphNodeSetEnabled' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): + """ Enables or disables the specified node in the given graphExec. + + Sets `hNode` to be either enabled or disabled. Disabled nodes are + functionally equivalent to empty nodes until they are reenabled. + Existing node parameters are not affected by disabling/enabling the + node. + + The node is identified by the corresponding node `hNode` in the non- + executable graph, from which the executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + The modifications only affect future launches of `hGraphExec`. Already + enqueued or running launches of `hGraphExec` are not affected by this + call. `hNode` is also not modified by this call. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node from the graph from which graphExec was instantiated + isEnabled : unsigned int + Node is enabled if != 0, otherwise the node is disabled + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphNodeGetEnabled`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` :py:obj:`~.cudaGraphLaunch` + + Notes + ----- + Currently only kernel, memset and memcpy nodes are supported. + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + with nogil: + err = cyruntime.cudaGraphNodeSetEnabled(cyhGraphExec, cyhNode, isEnabled) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphNodeGetEnabled' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeGetEnabled(hGraphExec, hNode): + """ Query whether a node in the given graphExec is enabled. + + Sets isEnabled to 1 if `hNode` is enabled, or 0 if `hNode` is disabled. + + The node is identified by the corresponding node `hNode` in the non- + executable graph, from which the executable graph was instantiated. + + `hNode` must not have been removed from the original graph. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to set the specified node + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node from the graph from which graphExec was instantiated + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + isEnabled : unsigned int + Location to return the enabled status of the node + + See Also + -------- + :py:obj:`~.cudaGraphNodeSetEnabled`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` :py:obj:`~.cudaGraphLaunch` + + Notes + ----- + Currently only kernel, memset and memcpy nodes are supported. + """ + cdef cyruntime.cudaGraphNode_t cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (cudaGraphNode_t,driver.CUgraphNode)): + phNode = int(hNode) + else: + phNode = int(cudaGraphNode_t(hNode)) + cyhNode = phNode + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + cdef unsigned int isEnabled = 0 + with nogil: + err = cyruntime.cudaGraphNodeGetEnabled(cyhGraphExec, cyhNode, &isEnabled) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, isEnabled) +{{endif}} + +{{if 'cudaGraphExecUpdate' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecUpdate(hGraphExec, hGraph): + """ Check whether an executable graph can be updated with a graph and perform the update if possible. + + Updates the node parameters in the instantiated graph specified by + `hGraphExec` with the node parameters in a topologically identical + graph specified by `hGraph`. + + Limitations: + + - Kernel nodes: + + - The owning context of the function cannot change. + + - A node whose function originally did not use CUDA dynamic + parallelism cannot be updated to a function which uses CDP. + + - A node whose function originally did not make device-side update + calls cannot be updated to a function which makes device-side + update calls. + + - A cooperative node cannot be updated to a non-cooperative node, and + vice-versa. + + - If the graph was instantiated with + cudaGraphInstantiateFlagUseNodePriority, the priority attribute + cannot change. Equality is checked on the originally requested + priority values, before they are clamped to the device's supported + range. + + - If `hGraphExec` was not instantiated for device launch, a node + whose function originally did not use device-side + :py:obj:`~.cudaGraphLaunch()` cannot be updated to a function which + uses device-side :py:obj:`~.cudaGraphLaunch()` unless the node + resides on the same device as nodes which contained such calls at + instantiate-time. If no such calls were present at instantiation, + these updates cannot be performed at all. + + - Neither `hGraph` nor `hGraphExec` may contain device-updatable + kernel nodes. + + - Memset and memcpy nodes: + + - The CUDA device(s) to which the operand(s) was allocated/mapped + cannot change. + + - The source/destination memory must be allocated from the same + contexts as the original source/destination memory. + + - For 2d memsets, only address and assigned value may be updated. + + - For 1d memsets, updating dimensions is also allowed, but may fail + if the resulting operation doesn't map onto the work resources + already allocated for the node. + + - Additional memcpy node restrictions: + + - Changing either the source or destination memory type(i.e. + CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) is not supported. + + - Conditional nodes: + + - Changing node parameters is not supported. + + - Changing parameters of nodes within the conditional body graph is + subject to the rules above. + + - Conditional handle flags and default values are updated as part of + the graph update. + + Note: The API may add further restrictions in future releases. The + return code should always be checked. + + cudaGraphExecUpdate sets the result member of `resultInfo` to + cudaGraphExecUpdateErrorTopologyChanged under the following conditions: + + - The count of nodes directly in `hGraphExec` and `hGraph` differ, in + which case resultInfo->errorNode is set to NULL. + + - `hGraph` has more exit nodes than `hGraph`, in which case + resultInfo->errorNode is set to one of the exit nodes in hGraph. + + - A node in `hGraph` has a different number of dependencies than the + node from `hGraphExec` it is paired with, in which case + resultInfo->errorNode is set to the node from `hGraph`. + + - A node in `hGraph` has a dependency that does not match with the + corresponding dependency of the paired node from `hGraphExec`. + resultInfo->errorNode will be set to the node from `hGraph`. + resultInfo->errorFromNode will be set to the mismatched dependency. + The dependencies are paired based on edge order and a dependency does + not match when the nodes are already paired based on other edges + examined in the graph. + + cudaGraphExecUpdate sets `the` result member of `resultInfo` to: + + - cudaGraphExecUpdateError if passed an invalid value. + + - cudaGraphExecUpdateErrorTopologyChanged if the graph topology changed + + - cudaGraphExecUpdateErrorNodeTypeChanged if the type of a node + changed, in which case `hErrorNode_out` is set to the node from + `hGraph`. + + - cudaGraphExecUpdateErrorFunctionChanged if the function of a kernel + node changed (CUDA driver < 11.2) + + - cudaGraphExecUpdateErrorUnsupportedFunctionChange if the func field + of a kernel changed in an unsupported way(see note above), in which + case `hErrorNode_out` is set to the node from `hGraph` + + - cudaGraphExecUpdateErrorParametersChanged if any parameters to a node + changed in a way that is not supported, in which case + `hErrorNode_out` is set to the node from `hGraph` + + - cudaGraphExecUpdateErrorAttributesChanged if any attributes of a node + changed in a way that is not supported, in which case + `hErrorNode_out` is set to the node from `hGraph` + + - cudaGraphExecUpdateErrorNotSupported if something about a node is + unsupported, like the node's type or configuration, in which case + `hErrorNode_out` is set to the node from `hGraph` + + If the update fails for a reason not listed above, the result member of + `resultInfo` will be set to cudaGraphExecUpdateError. If the update + succeeds, the result member will be set to cudaGraphExecUpdateSuccess. + + cudaGraphExecUpdate returns cudaSuccess when the updated was performed + successfully. It returns cudaErrorGraphExecUpdateFailure if the graph + update was not performed because it included changes which violated + constraints specific to instantiated graph update. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The instantiated graph to be updated + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph containing the updated parameters + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorGraphExecUpdateFailure`, + resultInfo : :py:obj:`~.cudaGraphExecUpdateResultInfo` + the error info structure + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraph_t cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (cudaGraph_t,driver.CUgraph)): + phGraph = int(hGraph) + else: + phGraph = int(cudaGraph_t(hGraph)) + cyhGraph = phGraph + cdef cyruntime.cudaGraphExec_t cyhGraphExec + if hGraphExec is None: + phGraphExec = 0 + elif isinstance(hGraphExec, (cudaGraphExec_t,driver.CUgraphExec)): + phGraphExec = int(hGraphExec) + else: + phGraphExec = int(cudaGraphExec_t(hGraphExec)) + cyhGraphExec = phGraphExec + cdef cudaGraphExecUpdateResultInfo resultInfo = cudaGraphExecUpdateResultInfo() + with nogil: + err = cyruntime.cudaGraphExecUpdate(cyhGraphExec, cyhGraph, resultInfo._pvt_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, resultInfo) +{{endif}} + +{{if 'cudaGraphUpload' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphUpload(graphExec, stream): + """ Uploads an executable graph in a stream. + + Uploads `hGraphExec` to the device in `hStream` without executing it. + Uploads of the same `hGraphExec` will be serialized. Each upload is + ordered behind both any previous work in `hStream` and any previous + launches of `hGraphExec`. Uses memory cached by `stream` to back the + allocations owned by `graphExec`. + + Parameters + ---------- + hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to upload + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to upload the graph + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphLaunch`, :py:obj:`~.cudaGraphExecDestroy` + """ + 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.cudaGraphExec_t cygraphExec + if graphExec is None: + pgraphExec = 0 + elif isinstance(graphExec, (cudaGraphExec_t,driver.CUgraphExec)): + pgraphExec = int(graphExec) + else: + pgraphExec = int(cudaGraphExec_t(graphExec)) + cygraphExec = pgraphExec + with nogil: + err = cyruntime.cudaGraphUpload(cygraphExec, cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphLaunch' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphLaunch(graphExec, stream): + """ Launches an executable graph in a stream. + + Executes `graphExec` in `stream`. Only one instance of `graphExec` may + be executing at a time. Each launch is ordered behind both any previous + work in `stream` and any previous launches of `graphExec`. To execute a + graph concurrently, it must be instantiated multiple times into + multiple executable graphs. + + If any allocations created by `graphExec` remain unfreed (from a + previous launch) and `graphExec` was not instantiated with + :py:obj:`~.cudaGraphInstantiateFlagAutoFreeOnLaunch`, the launch will + fail with :py:obj:`~.cudaErrorInvalidValue`. + + Parameters + ---------- + graphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to launch + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to launch the graph + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphUpload`, :py:obj:`~.cudaGraphExecDestroy` + """ + 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.cudaGraphExec_t cygraphExec + if graphExec is None: + pgraphExec = 0 + elif isinstance(graphExec, (cudaGraphExec_t,driver.CUgraphExec)): + pgraphExec = int(graphExec) + else: + pgraphExec = int(cudaGraphExec_t(graphExec)) + cygraphExec = pgraphExec + with nogil: + err = cyruntime.cudaGraphLaunch(cygraphExec, cystream) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphExecDestroy' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecDestroy(graphExec): + """ Destroys an executable graph. + + Destroys the executable graph specified by `graphExec`. + + Parameters + ---------- + graphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + Executable graph to destroy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphInstantiate`, :py:obj:`~.cudaGraphUpload`, :py:obj:`~.cudaGraphLaunch` + """ + cdef cyruntime.cudaGraphExec_t cygraphExec + if graphExec is None: + pgraphExec = 0 + elif isinstance(graphExec, (cudaGraphExec_t,driver.CUgraphExec)): + pgraphExec = int(graphExec) + else: + pgraphExec = int(cudaGraphExec_t(graphExec)) + cygraphExec = pgraphExec + with nogil: + err = cyruntime.cudaGraphExecDestroy(cygraphExec) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphDestroy' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphDestroy(graph): + """ Destroys a graph. + + Destroys the graph specified by `graph`, as well as all of its nodes. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to destroy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaGraphCreate` + """ + 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 + with nogil: + err = cyruntime.cudaGraphDestroy(cygraph) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphDebugDotPrint' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphDebugDotPrint(graph, char* path, unsigned int flags): + """ Write a DOT file describing graph structure. + + Using the provided `graph`, write to `path` a DOT formatted description + of the graph. By default this includes the graph topology, node types, + node id, kernel names and memcpy direction. `flags` can be specified to + write more detailed information about each node type such as parameter + values, kernel attributes, node and function handles. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to create a DOT file from + path : bytes + The path to write the DOT file to + flags : unsigned int + Flags from :py:obj:`~.cudaGraphDebugDotFlags` for specifying which + additional node information to write + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorOperatingSystem` + """ + 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 + with nogil: + err = cyruntime.cudaGraphDebugDotPrint(cygraph, path, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaUserObjectCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int flags): + """ Create a user object. + + Create a user object with the specified destructor callback and initial + reference count. The initial references are owned by the caller. + + Destructor callbacks cannot make CUDA API calls and should avoid + blocking behavior, as they are executed by a shared internal thread. + Another thread may be signaled to perform such actions, if it does not + block forward progress of tasks scheduled through CUDA. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + ptr : Any + The pointer to pass to the destroy function + destroy : :py:obj:`~.cudaHostFn_t` + Callback to free the user object when it is no longer in use + initialRefcount : unsigned int + The initial refcount to create the object with, typically 1. The + initial references are owned by the calling thread. + flags : unsigned int + Currently it is required to pass + :py:obj:`~.cudaUserObjectNoDestructorSync`, which is the only + defined flag. This indicates that the destroy callback cannot be + waited on by any CUDA API. Users requiring synchronization of the + callback should signal its completion manually. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + object_out : :py:obj:`~.cudaUserObject_t` + Location to return the user object handle + + See Also + -------- + :py:obj:`~.cudaUserObjectRetain`, :py:obj:`~.cudaUserObjectRelease`, :py:obj:`~.cudaGraphRetainUserObject`, :py:obj:`~.cudaGraphReleaseUserObject`, :py:obj:`~.cudaGraphCreate` + """ + cdef cyruntime.cudaHostFn_t cydestroy + if destroy is None: + pdestroy = 0 + elif isinstance(destroy, (cudaHostFn_t,)): + pdestroy = int(destroy) + else: + pdestroy = int(cudaHostFn_t(destroy)) + cydestroy = pdestroy + cdef cudaUserObject_t object_out = cudaUserObject_t() + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cyruntime.cudaUserObjectCreate(object_out._pvt_ptr, cyptr, cydestroy, initialRefcount, flags) + _helper_input_void_ptr_free(&cyptrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, object_out) +{{endif}} + +{{if 'cudaUserObjectRetain' in found_functions}} + +@cython.embedsignature(True) +def cudaUserObjectRetain(object, unsigned int count): + """ Retain a reference to a user object. + + Retains new references to a user object. The new references are owned + by the caller. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + object : :py:obj:`~.cudaUserObject_t` + The object to retain + count : unsigned int + The number of references to retain, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaUserObjectCreate`, :py:obj:`~.cudaUserObjectRelease`, :py:obj:`~.cudaGraphRetainUserObject`, :py:obj:`~.cudaGraphReleaseUserObject`, :py:obj:`~.cudaGraphCreate` + """ + cdef cyruntime.cudaUserObject_t cyobject + if object is None: + pobject = 0 + elif isinstance(object, (cudaUserObject_t,driver.CUuserObject)): + pobject = int(object) + else: + pobject = int(cudaUserObject_t(object)) + cyobject = pobject + with nogil: + err = cyruntime.cudaUserObjectRetain(cyobject, count) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaUserObjectRelease' in found_functions}} + +@cython.embedsignature(True) +def cudaUserObjectRelease(object, unsigned int count): + """ Release a reference to a user object. + + Releases user object references owned by the caller. The object's + destructor is invoked if the reference count reaches zero. + + It is undefined behavior to release references not owned by the caller, + or to use a user object handle after all references are released. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + object : :py:obj:`~.cudaUserObject_t` + The object to release + count : unsigned int + The number of references to release, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaUserObjectCreate`, :py:obj:`~.cudaUserObjectRetain`, :py:obj:`~.cudaGraphRetainUserObject`, :py:obj:`~.cudaGraphReleaseUserObject`, :py:obj:`~.cudaGraphCreate` + """ + cdef cyruntime.cudaUserObject_t cyobject + if object is None: + pobject = 0 + elif isinstance(object, (cudaUserObject_t,driver.CUuserObject)): + pobject = int(object) + else: + pobject = int(cudaUserObject_t(object)) + cyobject = pobject + with nogil: + err = cyruntime.cudaUserObjectRelease(cyobject, count) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphRetainUserObject' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphRetainUserObject(graph, object, unsigned int count, unsigned int flags): + """ Retain a reference to a user object from a graph. + + Creates or moves user object references that will be owned by a CUDA + graph. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph to associate the reference with + object : :py:obj:`~.cudaUserObject_t` + The user object to retain a reference for + count : unsigned int + The number of references to add to the graph, typically 1. Must be + nonzero and not larger than INT_MAX. + flags : unsigned int + The optional flag :py:obj:`~.cudaGraphUserObjectMove` transfers + references from the calling thread, rather than create new + references. Pass 0 to create new references. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaUserObjectCreate` :py:obj:`~.cudaUserObjectRetain`, :py:obj:`~.cudaUserObjectRelease`, :py:obj:`~.cudaGraphReleaseUserObject`, :py:obj:`~.cudaGraphCreate` + """ + cdef cyruntime.cudaUserObject_t cyobject + if object is None: + pobject = 0 + elif isinstance(object, (cudaUserObject_t,driver.CUuserObject)): + pobject = int(object) + else: + pobject = int(cudaUserObject_t(object)) + cyobject = pobject + 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 + with nogil: + err = cyruntime.cudaGraphRetainUserObject(cygraph, cyobject, count, flags) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphReleaseUserObject' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphReleaseUserObject(graph, object, unsigned int count): + """ Release a user object reference from a graph. + + Releases user object references owned by a graph. + + See CUDA User Objects in the CUDA C++ Programming Guide for more + information on user objects. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + The graph that will release the reference + object : :py:obj:`~.cudaUserObject_t` + The user object to release a reference for + count : unsigned int + The number of references to release, typically 1. Must be nonzero + and not larger than INT_MAX. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaUserObjectCreate` :py:obj:`~.cudaUserObjectRetain`, :py:obj:`~.cudaUserObjectRelease`, :py:obj:`~.cudaGraphRetainUserObject`, :py:obj:`~.cudaGraphCreate` + """ + cdef cyruntime.cudaUserObject_t cyobject + if object is None: + pobject = 0 + elif isinstance(object, (cudaUserObject_t,driver.CUuserObject)): + pobject = int(object) + else: + pobject = int(cudaUserObject_t(object)) + cyobject = pobject + 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 + with nogil: + err = cyruntime.cudaGraphReleaseUserObject(cygraph, cyobject, count) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGraphAddNode' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): + """ Adds a node of arbitrary type to a graph. + + Creates a new node in `graph` described by `nodeParams` with + `numDependencies` dependencies specified via `pDependencies`. + `numDependencies` may be 0. `pDependencies` may be null if + `numDependencies` is 0. `pDependencies` may not have any duplicate + entries. + + `nodeParams` is a tagged union. The node type should be specified in + the `typename` field, and type-specific parameters in the corresponding + union member. All unused bytes - that is, `reserved0` and all bytes + past the utilized union member - must be set to zero. It is recommended + to use brace initialization or memset to ensure all bytes are + initialized. + + Note that for some node types, `nodeParams` may contain "out + parameters" which are modified during the call, such as + `nodeParams->alloc.dptr`. + + A handle to the new node will be returned in `phGraphNode`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.cudaGraphNodeParams` + Specification of the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorNotSupported` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphExecNodeSetParams` + """ + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphAddNode_v2' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphAddNode_v2(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): + """ Adds a node of arbitrary type to a graph (12.3+). + + Creates a new node in `graph` described by `nodeParams` with + `numDependencies` dependencies specified via `pDependencies`. + `numDependencies` may be 0. `pDependencies` may be null if + `numDependencies` is 0. `pDependencies` may not have any duplicate + entries. + + `nodeParams` is a tagged union. The node type should be specified in + the `typename` field, and type-specific parameters in the corresponding + union member. All unused bytes - that is, `reserved0` and all bytes + past the utilized union member - must be set to zero. It is recommended + to use brace initialization or memset to ensure all bytes are + initialized. + + Note that for some node types, `nodeParams` may contain "out + parameters" which are modified during the call, such as + `nodeParams->alloc.dptr`. + + A handle to the new node will be returned in `phGraphNode`. + + Parameters + ---------- + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] + Dependencies of the node + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] + Optional edge data for the dependencies. If NULL, the data is + assumed to be default (zeroed) for all dependencies. + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.cudaGraphNodeParams` + Specification of the node + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorNotSupported` + pGraphNode : :py:obj:`~.cudaGraphNode_t` + Returns newly created node + + See Also + -------- + :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphExecNodeSetParams` + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") + pDependencies = [] if pDependencies is None else pDependencies + if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + cdef cyruntime.cudaGraph_t cygraph + if graph is None: + pgraph = 0 + elif isinstance(graph, (cudaGraph_t,driver.CUgraph)): + pgraph = int(graph) + else: + pgraph = int(cudaGraph_t(graph)) + cygraph = pgraph + cdef cudaGraphNode_t pGraphNode = cudaGraphNode_t() + cdef cyruntime.cudaGraphNode_t* cypDependencies = NULL + if len(pDependencies) > 1: + cypDependencies = calloc(len(pDependencies), sizeof(cyruntime.cudaGraphNode_t)) + if cypDependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(pDependencies)) + 'x' + str(sizeof(cyruntime.cudaGraphNode_t))) + else: + for idx in range(len(pDependencies)): + cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] + elif len(pDependencies) == 1: + cypDependencies = (pDependencies[0])._pvt_ptr + cdef cyruntime.cudaGraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cyruntime.cudaGraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cyruntime.cudaGraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cyruntime.cudaGraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) + if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cyruntime.cudaGraphAddNode_v2(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) + if len(pDependencies) > 1 and cypDependencies is not NULL: + free(cypDependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pGraphNode) +{{endif}} + +{{if 'cudaGraphNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphNodeSetParams(node, nodeParams : Optional[cudaGraphNodeParams]): + """ Update's a graph node's parameters. + + Sets the parameters of graph node `node` to `nodeParams`. The node type + specified by `nodeParams->type` must match the type of `node`. + `nodeParams` must be fully initialized and all unused bytes (reserved, + padding) zeroed. + + Modifying parameters is not supported for node types + cudaGraphNodeTypeMemAlloc and cudaGraphNodeTypeMemFree. + + Parameters + ---------- + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.cudaGraphNodeParams` + Parameters to copy + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphExecNodeSetParams` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.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),) +{{endif}} + +{{if 'cudaGraphExecNodeSetParams' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphExecNodeSetParams(graphExec, node, nodeParams : Optional[cudaGraphNodeParams]): + """ Update's a graph node's parameters in an instantiated graph. + + Sets the parameters of a node in an executable graph `graphExec`. The + node is identified by the corresponding node `node` in the non- + executable graph from which the executable graph was instantiated. + `node` must not have been removed from the original graph. + + The modifications only affect future launches of `graphExec`. Already + enqueued or running launches of `graphExec` are not affected by this + call. `node` is also not modified by this call. + + Allowed changes to parameters on executable graphs are as follows: + + **View CUDA Toolkit Documentation for a table example** + + Parameters + ---------- + graphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + The executable graph in which to update the specified node + node : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Corresponding node from the graph from which graphExec was + instantiated + nodeParams : :py:obj:`~.cudaGraphNodeParams` + Updated Parameters to set + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorNotSupported` + + See Also + -------- + :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphNodeSetParams` :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + """ + cdef cyruntime.cudaGraphNode_t cynode + if node is None: + pnode = 0 + elif isinstance(node, (cudaGraphNode_t,driver.CUgraphNode)): + pnode = int(node) + else: + pnode = int(cudaGraphNode_t(node)) + cynode = pnode + cdef cyruntime.cudaGraphExec_t cygraphExec + if graphExec is None: + pgraphExec = 0 + elif isinstance(graphExec, (cudaGraphExec_t,driver.CUgraphExec)): + pgraphExec = int(graphExec) + else: + pgraphExec = int(cudaGraphExec_t(graphExec)) + cygraphExec = pgraphExec + 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),) +{{endif}} + +{{if 'cudaGraphConditionalHandleCreate' in found_functions}} + +@cython.embedsignature(True) +def cudaGraphConditionalHandleCreate(graph, unsigned int defaultLaunchValue, unsigned int flags): + """ Create a conditional handle. + + Creates a conditional handle associated with `hGraph`. + + The conditional handle must be associated with a conditional node in + this graph or one of its children. + + Handles not associated with a conditional node may cause graph + instantiation to fail. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph which will contain the conditional node using this handle. + defaultLaunchValue : unsigned int + Optional initial value for the conditional variable. Applied at the + beginning of each graph execution if cudaGraphCondAssignDefault is + set in `flags`. + flags : unsigned int + Currently must be cudaGraphCondAssignDefault or 0. + + Returns + ------- + cudaError_t + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + pHandle_out : :py:obj:`~.cudaGraphConditionalHandle` + Pointer used to return the handle to the caller. + + See Also + -------- + :py:obj:`~.cuGraphAddNode`, + """ + 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 cudaGraphConditionalHandle pHandle_out = cudaGraphConditionalHandle() + with nogil: + err = cyruntime.cudaGraphConditionalHandleCreate(pHandle_out._pvt_ptr, cygraph, defaultLaunchValue, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pHandle_out) +{{endif}} + +{{if 'cudaGetDriverEntryPoint' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDriverEntryPoint(char* symbol, unsigned long long flags): + """ Returns the requested driver API function pointer. + + Returns in `**funcPtr` the address of the CUDA driver function for the + requested flags. + + For a requested driver symbol, if the CUDA version in which the driver + symbol was introduced is less than or equal to the CUDA runtime + version, the API will return the function pointer to the corresponding + versioned driver function. + + The pointer returned by the API should be cast to a function pointer + matching the requested driver function's definition in the API header + file. The function pointer typedef can be picked up from the + corresponding typedefs header file. For example, cudaTypedefs.h + consists of function pointer typedefs for driver APIs defined in + cuda.h. + + The API will return :py:obj:`~.cudaSuccess` and set the returned + `funcPtr` if the requested driver function is valid and supported on + the platform. + + The API will return :py:obj:`~.cudaSuccess` and set the returned + `funcPtr` to NULL if the requested driver function is not supported on + the platform, no ABI compatible driver function exists for the CUDA + runtime version or if the driver symbol is invalid. + + It will also set the optional `driverStatus` to one of the values in + :py:obj:`~.cudaDriverEntryPointQueryResult` with the following + meanings: + + - :py:obj:`~.cudaDriverEntryPointSuccess` - The requested symbol was + succesfully found based on input arguments and `pfn` is valid + + - :py:obj:`~.cudaDriverEntryPointSymbolNotFound` - The requested symbol + was not found + + - :py:obj:`~.cudaDriverEntryPointVersionNotSufficent` - The requested + symbol was found but is not supported by the current runtime version + (CUDART_VERSION) + + The requested flags can be: + + - :py:obj:`~.cudaEnableDefault`: This is the default mode. This is + equivalent to :py:obj:`~.cudaEnablePerThreadDefaultStream` if the + code is compiled with --default-stream per-thread compilation flag or + the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; + :py:obj:`~.cudaEnableLegacyStream` otherwise. + + - :py:obj:`~.cudaEnableLegacyStream`: This will enable the search for + all driver symbols that match the requested driver symbol name except + the corresponding per-thread versions. + + - :py:obj:`~.cudaEnablePerThreadDefaultStream`: This will enable the + search for all driver symbols that match the requested driver symbol + name including the per-thread versions. If a per-thread version is + not found, the API will return the legacy version of the driver + function. + + Parameters + ---------- + symbol : bytes + The base name of the driver API function to look for. As an + example, for the driver API :py:obj:`~.cuMemAlloc_v2`, `symbol` + would be cuMemAlloc. Note that the API will use the CUDA runtime + version to return the address to the most recent ABI compatible + driver symbol, :py:obj:`~.cuMemAlloc` or :py:obj:`~.cuMemAlloc_v2`. + flags : unsigned long long + Flags to specify search options. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + funcPtr : Any + Location to return the function pointer to the requested driver + function + driverStatus : :py:obj:`~.cudaDriverEntryPointQueryResult` + Optional location to store the status of finding the symbol from + the driver. See :py:obj:`~.cudaDriverEntryPointQueryResult` for + possible values. + + See Also + -------- + :py:obj:`~.cuGetProcAddress` + """ + cdef void_ptr funcPtr = 0 + cdef cyruntime.cudaDriverEntryPointQueryResult driverStatus + with nogil: + err = cyruntime.cudaGetDriverEntryPoint(symbol, &funcPtr, flags, &driverStatus) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) +{{endif}} + +{{if 'cudaGetDriverEntryPointByVersion' in found_functions}} + +@cython.embedsignature(True) +def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, unsigned long long flags): + """ Returns the requested driver API function pointer by CUDA version. + + Returns in `**funcPtr` the address of the CUDA driver function for the + requested flags and CUDA driver version. + + The CUDA version is specified as (1000 * major + 10 * minor), so CUDA + 11.2 should be specified as 11020. For a requested driver symbol, if + the specified CUDA version is greater than or equal to the CUDA version + in which the driver symbol was introduced, this API will return the + function pointer to the corresponding versioned function. + + The pointer returned by the API should be cast to a function pointer + matching the requested driver function's definition in the API header + file. The function pointer typedef can be picked up from the + corresponding typedefs header file. For example, cudaTypedefs.h + consists of function pointer typedefs for driver APIs defined in + cuda.h. + + For the case where the CUDA version requested is greater than the CUDA + Toolkit installed, there may not be an appropriate function pointer + typedef in the corresponding header file and may need a custom typedef + to match the driver function signature returned. This can be done by + getting the typedefs from a later toolkit or creating appropriately + matching custom function typedefs. + + The API will return :py:obj:`~.cudaSuccess` and set the returned + `funcPtr` if the requested driver function is valid and supported on + the platform. + + The API will return :py:obj:`~.cudaSuccess` and set the returned + `funcPtr` to NULL if the requested driver function is not supported on + the platform, no ABI compatible driver function exists for the + requested version or if the driver symbol is invalid. + + It will also set the optional `driverStatus` to one of the values in + :py:obj:`~.cudaDriverEntryPointQueryResult` with the following + meanings: + + - :py:obj:`~.cudaDriverEntryPointSuccess` - The requested symbol was + succesfully found based on input arguments and `pfn` is valid + + - :py:obj:`~.cudaDriverEntryPointSymbolNotFound` - The requested symbol + was not found + + - :py:obj:`~.cudaDriverEntryPointVersionNotSufficent` - The requested + symbol was found but is not supported by the specified version + `cudaVersion` + + The requested flags can be: + + - :py:obj:`~.cudaEnableDefault`: This is the default mode. This is + equivalent to :py:obj:`~.cudaEnablePerThreadDefaultStream` if the + code is compiled with --default-stream per-thread compilation flag or + the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; + :py:obj:`~.cudaEnableLegacyStream` otherwise. + + - :py:obj:`~.cudaEnableLegacyStream`: This will enable the search for + all driver symbols that match the requested driver symbol name except + the corresponding per-thread versions. + + - :py:obj:`~.cudaEnablePerThreadDefaultStream`: This will enable the + search for all driver symbols that match the requested driver symbol + name including the per-thread versions. If a per-thread version is + not found, the API will return the legacy version of the driver + function. + + Parameters + ---------- + symbol : bytes + The base name of the driver API function to look for. As an + example, for the driver API :py:obj:`~.cuMemAlloc_v2`, `symbol` + would be cuMemAlloc. + cudaVersion : unsigned int + The CUDA version to look for the requested driver symbol + flags : unsigned long long + Flags to specify search options. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + funcPtr : Any + Location to return the function pointer to the requested driver + function + driverStatus : :py:obj:`~.cudaDriverEntryPointQueryResult` + Optional location to store the status of finding the symbol from + the driver. See :py:obj:`~.cudaDriverEntryPointQueryResult` for + possible values. + + See Also + -------- + :py:obj:`~.cuGetProcAddress` + """ + cdef void_ptr funcPtr = 0 + cdef cyruntime.cudaDriverEntryPointQueryResult driverStatus + with nogil: + err = cyruntime.cudaGetDriverEntryPointByVersion(symbol, &funcPtr, cudaVersion, flags, &driverStatus) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, funcPtr, cudaDriverEntryPointQueryResult(driverStatus)) +{{endif}} + +{{if 'cudaLibraryLoadData' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryLoadData(code, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): + """ Load a library with specified code and options. + + Takes a pointer `code` and loads the corresponding library `library` + based on the application defined library loading mode: + + - If module loading is set to EAGER, via the environment variables + described in "Module loading", `library` is loaded eagerly into all + contexts at the time of the call and future contexts at the time of + creation until the library is unloaded with + :py:obj:`~.cudaLibraryUnload()`. + + - If the environment variables are set to LAZY, `library` is not + immediately loaded onto all existent contexts and will only be loaded + when a function is needed for that context, such as a kernel launch. + + These environment variables are described in the CUDA programming guide + under the "CUDA environment variables" section. + + The `code` may be a `cubin` or `fatbin` as output by nvcc, or a NULL- + terminated `PTX`, either as output by nvcc or hand-written. A fatbin + should also contain relocatable code when doing separate compilation. + Please also see the documentation for nvrtc + (https://docs.nvidia.com/cuda/nvrtc/index.html), nvjitlink + (https://docs.nvidia.com/cuda/nvjitlink/index.html), and nvfatbin + (https://docs.nvidia.com/cuda/nvfatbin/index.html) for more information + on generating loadable code at runtime. + + Options are passed as an array via `jitOptions` and any corresponding + parameters are passed in `jitOptionsValues`. The number of total JIT + options is supplied via `numJitOptions`. Any outputs will be returned + via `jitOptionsValues`. + + Library load options are passed as an array via `libraryOptions` and + any corresponding parameters are passed in `libraryOptionValues`. The + number of total library load options is supplied via + `numLibraryOptions`. + + Parameters + ---------- + code : Any + Code to load + jitOptions : list[:py:obj:`~.cudaJitOption`] + Options for JIT + jitOptionsValues : list[Any] + Option values for JIT + numJitOptions : unsigned int + Number of options + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] + Options for loading + libraryOptionValues : list[Any] + Option values for loading + numLibraryOptions : unsigned int + Number of options for loading + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInvalidPtx`, :py:obj:`~.cudaErrorUnsupportedPtxVersion`, :py:obj:`~.cudaErrorNoKernelImageForDevice`, :py:obj:`~.cudaErrorSharedObjectSymbolNotFound`, :py:obj:`~.cudaErrorSharedObjectInitFailed`, :py:obj:`~.cudaErrorJitCompilerNotFound` + library : :py:obj:`~.cudaLibrary_t` + Returned library + + See Also + -------- + :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cuLibraryLoadData` + """ + libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues + libraryOptions = [] if libraryOptions is None else libraryOptions + if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") + jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues + jitOptions = [] if jitOptions is None else jitOptions + if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") + cdef cudaLibrary_t library = cudaLibrary_t() + cdef _HelperInputVoidPtrStruct cycodeHelper + cdef void* cycode = _helper_input_void_ptr(code, &cycodeHelper) + cdef vector[cyruntime.cudaJitOption] cyjitOptions = jitOptions + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr + if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) + if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) + cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = libraryOptions + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr + if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) + if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) + with nogil: + err = cyruntime.cudaLibraryLoadData(library._pvt_ptr, cycode, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) + _helper_input_void_ptr_free(&cycodeHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, library) +{{endif}} + +{{if 'cudaLibraryLoadFromFile' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): + """ Load a library with specified file and options. + + Takes a pointer `code` and loads the corresponding library `library` + based on the application defined library loading mode: + + - If module loading is set to EAGER, via the environment variables + described in "Module loading", `library` is loaded eagerly into all + contexts at the time of the call and future contexts at the time of + creation until the library is unloaded with + :py:obj:`~.cudaLibraryUnload()`. + + - If the environment variables are set to LAZY, `library` is not + immediately loaded onto all existent contexts and will only be loaded + when a function is needed for that context, such as a kernel launch. + + These environment variables are described in the CUDA programming guide + under the "CUDA environment variables" section. + + The file should be a `cubin` file as output by nvcc, or a `PTX` file + either as output by nvcc or handwritten, or a `fatbin` file as output + by nvcc. A fatbin should also contain relocatable code when doing + separate compilation. Please also see the documentation for nvrtc + (https://docs.nvidia.com/cuda/nvrtc/index.html), nvjitlink + (https://docs.nvidia.com/cuda/nvjitlink/index.html), and nvfatbin + (https://docs.nvidia.com/cuda/nvfatbin/index.html) for more information + on generating loadable code at runtime. + + Options are passed as an array via `jitOptions` and any corresponding + parameters are passed in `jitOptionsValues`. The number of total + options is supplied via `numJitOptions`. Any outputs will be returned + via `jitOptionsValues`. + + Library load options are passed as an array via `libraryOptions` and + any corresponding parameters are passed in `libraryOptionValues`. The + number of total library load options is supplied via + `numLibraryOptions`. + + Parameters + ---------- + fileName : bytes + File to load from + jitOptions : list[:py:obj:`~.cudaJitOption`] + Options for JIT + jitOptionsValues : list[Any] + Option values for JIT + numJitOptions : unsigned int + Number of options + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] + Options for loading + libraryOptionValues : list[Any] + Option values for loading + numLibraryOptions : unsigned int + Number of options for loading + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorMemoryAllocation`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInvalidPtx`, :py:obj:`~.cudaErrorUnsupportedPtxVersion`, :py:obj:`~.cudaErrorNoKernelImageForDevice`, :py:obj:`~.cudaErrorSharedObjectSymbolNotFound`, :py:obj:`~.cudaErrorSharedObjectInitFailed`, :py:obj:`~.cudaErrorJitCompilerNotFound` + library : :py:obj:`~.cudaLibrary_t` + Returned library + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cuLibraryLoadFromFile` + """ + libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues + libraryOptions = [] if libraryOptions is None else libraryOptions + if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") + jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues + jitOptions = [] if jitOptions is None else jitOptions + if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") + cdef cudaLibrary_t library = cudaLibrary_t() + cdef vector[cyruntime.cudaJitOption] cyjitOptions = jitOptions + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr + if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) + if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) + cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = libraryOptions + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) + cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr + if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) + if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) + with nogil: + err = cyruntime.cudaLibraryLoadFromFile(library._pvt_ptr, fileName, cyjitOptions.data(), cyjitOptionsValues_ptr, numJitOptions, cylibraryOptions.data(), cylibraryOptionValues_ptr, numLibraryOptions) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, library) +{{endif}} + +{{if 'cudaLibraryUnload' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryUnload(library): + """ Unloads a library. + + Unloads the library specified with `library` + + Parameters + ---------- + library : :py:obj:`~.cudaLibrary_t` + Library to unload + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cuLibraryUnload` + """ + cdef cyruntime.cudaLibrary_t cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (cudaLibrary_t,)): + plibrary = int(library) + else: + plibrary = int(cudaLibrary_t(library)) + cylibrary = plibrary + with nogil: + err = cyruntime.cudaLibraryUnload(cylibrary) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaLibraryGetKernel' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryGetKernel(library, char* name): + """ Returns a kernel handle. + + Returns in `pKernel` the handle of the kernel with name `name` located + in library `library`. If kernel handle is not found, the call returns + :py:obj:`~.cudaErrorSymbolNotFound`. + + Parameters + ---------- + library : :py:obj:`~.cudaLibrary_t` + Library to retrieve kernel from + name : bytes + Name of kernel to retrieve + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorSymbolNotFound` + pKernel : :py:obj:`~.cudaKernel_t` + Returned kernel handle + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cuLibraryGetKernel` + """ + cdef cyruntime.cudaLibrary_t cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (cudaLibrary_t,)): + plibrary = int(library) + else: + plibrary = int(cudaLibrary_t(library)) + cylibrary = plibrary + cdef cudaKernel_t pKernel = cudaKernel_t() + with nogil: + err = cyruntime.cudaLibraryGetKernel(pKernel._pvt_ptr, cylibrary, name) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pKernel) +{{endif}} + +{{if 'cudaLibraryGetGlobal' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryGetGlobal(library, char* name): + """ Returns a global device pointer. + + Returns in `*dptr` and `*bytes` the base pointer and size of the global + with name `name` for the requested library `library` and the current + device. If no global for the requested name `name` exists, the call + returns :py:obj:`~.cudaErrorSymbolNotFound`. One of the parameters + `dptr` or `numbytes` (not both) can be NULL in which case it is + ignored. The returned `dptr` cannot be passed to the Symbol APIs such + as :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, + :py:obj:`~.cudaGetSymbolAddress`, or :py:obj:`~.cudaGetSymbolSize`. + + Parameters + ---------- + library : :py:obj:`~.cudaLibrary_t` + Library to retrieve global from + name : bytes + Name of global to retrieve + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorSymbolNotFound` :py:obj:`~.cudaErrorDeviceUninitialized`, :py:obj:`~.cudaErrorContextIsDestroyed` + dptr : Any + Returned global device pointer for the requested library + numbytes : int + Returned global size in bytes + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cudaLibraryGetManaged`, :py:obj:`~.cuLibraryGetGlobal` + """ + cdef cyruntime.cudaLibrary_t cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (cudaLibrary_t,)): + plibrary = int(library) + else: + plibrary = int(cudaLibrary_t(library)) + cylibrary = plibrary + cdef void_ptr dptr = 0 + cdef size_t numbytes = 0 + with nogil: + err = cyruntime.cudaLibraryGetGlobal(&dptr, &numbytes, cylibrary, name) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, dptr, numbytes) +{{endif}} + +{{if 'cudaLibraryGetManaged' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryGetManaged(library, char* name): + """ Returns a pointer to managed memory. + + Returns in `*dptr` and `*bytes` the base pointer and size of the + managed memory with name `name` for the requested library `library`. If + no managed memory with the requested name `name` exists, the call + returns :py:obj:`~.cudaErrorSymbolNotFound`. One of the parameters + `dptr` or `numbytes` (not both) can be NULL in which case it is + ignored. Note that managed memory for library `library` is shared + across devices and is registered when the library is loaded. The + returned `dptr` cannot be passed to the Symbol APIs such as + :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, + :py:obj:`~.cudaGetSymbolAddress`, or :py:obj:`~.cudaGetSymbolSize`. + + Parameters + ---------- + library : :py:obj:`~.cudaLibrary_t` + Library to retrieve managed memory from + name : bytes + Name of managed memory to retrieve + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorSymbolNotFound` + dptr : Any + Returned pointer to the managed memory + numbytes : int + Returned memory size in bytes + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cudaLibraryGetGlobal`, :py:obj:`~.cuLibraryGetManaged` + """ + cdef cyruntime.cudaLibrary_t cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (cudaLibrary_t,)): + plibrary = int(library) + else: + plibrary = int(cudaLibrary_t(library)) + cylibrary = plibrary + cdef void_ptr dptr = 0 + cdef size_t numbytes = 0 + with nogil: + err = cyruntime.cudaLibraryGetManaged(&dptr, &numbytes, cylibrary, name) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, dptr, numbytes) +{{endif}} + +{{if 'cudaLibraryGetUnifiedFunction' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryGetUnifiedFunction(library, char* symbol): + """ Returns a pointer to a unified function. + + Returns in `*fptr` the function pointer to a unified function denoted + by `symbol`. If no unified function with name `symbol` exists, the call + returns :py:obj:`~.cudaErrorSymbolNotFound`. If there is no device with + attribute :py:obj:`~.cudaDeviceProp.unifiedFunctionPointers` present in + the system, the call may return :py:obj:`~.cudaErrorSymbolNotFound`. + + Parameters + ---------- + library : :py:obj:`~.cudaLibrary_t` + Library to retrieve function pointer memory from + symbol : bytes + Name of function pointer to retrieve + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorSymbolNotFound` + fptr : Any + Returned pointer to a unified function + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cuLibraryGetUnifiedFunction` + """ + cdef cyruntime.cudaLibrary_t cylibrary + if library is None: + plibrary = 0 + elif isinstance(library, (cudaLibrary_t,)): + plibrary = int(library) + else: + plibrary = int(cudaLibrary_t(library)) + cylibrary = plibrary + cdef void_ptr fptr = 0 + with nogil: + err = cyruntime.cudaLibraryGetUnifiedFunction(&fptr, cylibrary, symbol) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, fptr) +{{endif}} + +{{if 'cudaLibraryGetKernelCount' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryGetKernelCount(lib): + """ Returns the number of kernels within a library. + + Returns in `count` the number of kernels in `lib`. + + Parameters + ---------- + lib : :py:obj:`~.cudaLibrary_t` + Library to query + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + count : unsigned int + Number of kernels found within the library + + See Also + -------- + :py:obj:`~.cudaLibraryEnumerateKernels`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cuLibraryGetKernelCount` + """ + cdef cyruntime.cudaLibrary_t cylib + if lib is None: + plib = 0 + elif isinstance(lib, (cudaLibrary_t,)): + plib = int(lib) + else: + plib = int(cudaLibrary_t(lib)) + cylib = plib + cdef unsigned int count = 0 + with nogil: + err = cyruntime.cudaLibraryGetKernelCount(&count, cylib) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, count) +{{endif}} + +{{if 'cudaLibraryEnumerateKernels' in found_functions}} + +@cython.embedsignature(True) +def cudaLibraryEnumerateKernels(unsigned int numKernels, lib): + """ Retrieve the kernel handles within a library. + + Returns in `kernels` a maximum number of `numKernels` kernel handles + within `lib`. The returned kernel handle becomes invalid when the + library is unloaded. + + Parameters + ---------- + numKernels : unsigned int + Maximum number of kernel handles may be returned to the buffer + lib : :py:obj:`~.cudaLibrary_t` + Library to query from + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` + kernels : list[:py:obj:`~.cudaKernel_t`] + Buffer where the kernel handles are returned to + + See Also + -------- + :py:obj:`~.cudaLibraryGetKernelCount`, :py:obj:`~.cuLibraryEnumerateKernels` + """ + cdef cyruntime.cudaLibrary_t cylib + if lib is None: + plib = 0 + elif isinstance(lib, (cudaLibrary_t,)): + plib = int(lib) + else: + plib = int(cudaLibrary_t(lib)) + cylib = plib + cdef cyruntime.cudaKernel_t* cykernels = NULL + pykernels = [] + if numKernels != 0: + cykernels = calloc(numKernels, sizeof(cyruntime.cudaKernel_t)) + if cykernels is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(numKernels) + 'x' + str(sizeof(cyruntime.cudaKernel_t))) + with nogil: + err = cyruntime.cudaLibraryEnumerateKernels(cykernels, numKernels, cylib) + if cudaError_t(err) == cudaError_t(0): + pykernels = [cudaKernel_t(init_value=cykernels[idx]) for idx in range(numKernels)] + if cykernels is not NULL: + free(cykernels) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pykernels) +{{endif}} + +{{if 'cudaKernelSetAttributeForDevice' in found_functions}} + +@cython.embedsignature(True) +def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, int value, int device): + """ Sets information about a kernel. + + This call sets the value of a specified attribute `attr` on the kernel + `kernel` for the requested device `device` to an integer value + specified by `value`. This function returns :py:obj:`~.cudaSuccess` if + the new value of the attribute could be successfully set. If the set + fails, this call will return an error. Not all attributes can have + values set. Attempting to set a value on a read-only attribute will + result in an error (:py:obj:`~.cudaErrorInvalidValue`) + + Note that attributes set using :py:obj:`~.cudaFuncSetAttribute()` will + override the attribute set by this API irrespective of whether the call + to :py:obj:`~.cudaFuncSetAttribute()` is made before or after this API + call. Because of this and the stricter locking requirements mentioned + below it is suggested that this call be used during the initialization + path and not on each thread accessing `kernel` such as on kernel + launches or on the critical path. + + Valid values for `attr` are: + + - :py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize` - The + requested maximum size in bytes of dynamically-allocated shared + memory. The sum of this value and the function attribute + :py:obj:`~.sharedSizeBytes` cannot exceed the device attribute + :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`. The maximal size + of requestable dynamic shared memory may differ by GPU architecture. + + - :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout` - On + devices where the L1 cache and shared memory use the same hardware + resources, this sets the shared memory carveout preference, in + percent of the total shared memory. See + :py:obj:`~.cudaDevAttrMaxSharedMemoryPerMultiprocessor`. This is only + a hint, and the driver can choose a different ratio if required to + execute the function. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterWidth`: The required + cluster width in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterHeight`: The required + cluster height in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeRequiredClusterDepth`: The required + cluster depth in blocks. The width, height, and depth values must + either all be 0 or all be positive. The validity of the cluster + dimensions is checked at launch time. If the value is set during + compile time, it cannot be set at runtime. Setting it at runtime will + return cudaErrorNotPermitted. + + - :py:obj:`~.cudaFuncAttributeNonPortableClusterSizeAllowed`: Indicates + whether the function can be launched with non-portable cluster size. + 1 is allowed, 0 is disallowed. + + - :py:obj:`~.cudaFuncAttributeClusterSchedulingPolicyPreference`: The + block scheduling policy of a function. The value type is + :py:obj:`~.cudaClusterSchedulingPolicy`. + + Parameters + ---------- + kernel : :py:obj:`~.cudaKernel_t` + Kernel to set attribute of + attr : :py:obj:`~.cudaFuncAttribute` + Attribute requested + value : int + Value to set + device : int + Device to set attribute of + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue` + + See Also + -------- + :py:obj:`~.cudaLibraryLoadData`, :py:obj:`~.cudaLibraryLoadFromFile`, :py:obj:`~.cudaLibraryUnload`, :py:obj:`~.cudaLibraryGetKernel`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + Notes + ----- + The API has stricter locking requirements in comparison to its legacy counterpart :py:obj:`~.cudaFuncSetAttribute()` due to device-wide semantics. If multiple threads are trying to set the same attribute on the same device simultaneously, the attribute setting will depend on the interleavings chosen by the OS scheduler and memory consistency. + """ + cdef cyruntime.cudaKernel_t cykernel + if kernel is None: + pkernel = 0 + elif isinstance(kernel, (cudaKernel_t,)): + pkernel = int(kernel) + else: + pkernel = int(cudaKernel_t(kernel)) + cykernel = pkernel + cdef cyruntime.cudaFuncAttribute cyattr = int(attr) + with nogil: + err = cyruntime.cudaKernelSetAttributeForDevice(cykernel, cyattr, value, device) + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaGetExportTable' in found_functions}} + +@cython.embedsignature(True) +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 + with nogil: + err = cyruntime.cudaGetExportTable(&ppExportTable, cypExportTableId_ptr) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, ppExportTable) +{{endif}} + +{{if 'cudaGetKernel' in found_functions}} + +@cython.embedsignature(True) +def cudaGetKernel(entryFuncAddr): + """ Get pointer to device kernel that matches entry function `entryFuncAddr`. + + Returns in `kernelPtr` the device kernel corresponding to the entry + function `entryFuncAddr`. + + Note that it is possible that there are multiple symbols belonging to + different translation units with the same `entryFuncAddr` registered + with this CUDA Runtime and so the order which the translation units are + loaded and registered with the CUDA Runtime can lead to differing + return pointers in `kernelPtr` . Suggested methods of ensuring + uniqueness are to limit visibility of global device functions by using + static or hidden visibility attribute in the respective translation + units. + + Parameters + ---------- + entryFuncAddr : Any + Address of device entry function to search kernel for + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + kernelPtr : :py:obj:`~.cudaKernel_t` + Returns the device kernel + + See Also + -------- + cudaGetKernel (C++ API) + """ + cdef cudaKernel_t kernelPtr = cudaKernel_t() + cdef _HelperInputVoidPtrStruct cyentryFuncAddrHelper + cdef void* cyentryFuncAddr = _helper_input_void_ptr(entryFuncAddr, &cyentryFuncAddrHelper) + with nogil: + err = cyruntime.cudaGetKernel(kernelPtr._pvt_ptr, cyentryFuncAddr) + _helper_input_void_ptr_free(&cyentryFuncAddrHelper) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, kernelPtr) +{{endif}} + +{{if 'make_cudaPitchedPtr' in found_functions}} + +@cython.embedsignature(True) +def make_cudaPitchedPtr(d, size_t p, size_t xsz, size_t ysz): + """ Returns a :py:obj:`~.cudaPitchedPtr` based on input parameters. + + Returns a :py:obj:`~.cudaPitchedPtr` based on the specified input + parameters `d`, `p`, `xsz`, and `ysz`. + + Parameters + ---------- + d : Any + Pointer to allocated memory + p : size_t + Pitch of allocated memory in bytes + xsz : size_t + Logical width of allocation in elements + ysz : size_t + Logical height of allocation in elements + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + :py:obj:`~.cudaPitchedPtr` + :py:obj:`~.cudaPitchedPtr` specified by `d`, `p`, `xsz`, and `ysz` + + See Also + -------- + make_cudaExtent, make_cudaPos + """ + cdef _HelperInputVoidPtrStruct cydHelper + cdef void* cyd = _helper_input_void_ptr(d, &cydHelper) + with nogil: + err = cyruntime.make_cudaPitchedPtr(cyd, p, xsz, ysz) + _helper_input_void_ptr_free(&cydHelper) + cdef cudaPitchedPtr wrapper = cudaPitchedPtr() + wrapper._pvt_ptr[0] = err + return wrapper +{{endif}} + +{{if 'make_cudaPos' in found_functions}} + +@cython.embedsignature(True) +def make_cudaPos(size_t x, size_t y, size_t z): + """ Returns a :py:obj:`~.cudaPos` based on input parameters. + + Returns a :py:obj:`~.cudaPos` based on the specified input parameters + `x`, `y`, and `z`. + + Parameters + ---------- + x : size_t + X position + y : size_t + Y position + z : size_t + Z position + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + :py:obj:`~.cudaPos` + :py:obj:`~.cudaPos` specified by `x`, `y`, and `z` + + See Also + -------- + make_cudaExtent, make_cudaPitchedPtr + """ + with nogil: + err = cyruntime.make_cudaPos(x, y, z) + cdef cudaPos wrapper = cudaPos() + wrapper._pvt_ptr[0] = err + return wrapper +{{endif}} + +{{if 'make_cudaExtent' in found_functions}} + +@cython.embedsignature(True) +def make_cudaExtent(size_t w, size_t h, size_t d): + """ Returns a :py:obj:`~.cudaExtent` based on input parameters. + + Returns a :py:obj:`~.cudaExtent` based on the specified input + parameters `w`, `h`, and `d`. + + Parameters + ---------- + w : size_t + Width in elements when referring to array memory, in bytes when + referring to linear memory + h : size_t + Height in elements + d : size_t + Depth in elements + + Returns + ------- + cudaError_t.cudaSuccess + cudaError_t.cudaSuccess + :py:obj:`~.cudaExtent` + :py:obj:`~.cudaExtent` specified by `w`, `h`, and `d` + + See Also + -------- + make_cudaPitchedPtr, make_cudaPos + """ + with nogil: + err = cyruntime.make_cudaExtent(w, h, d) + cdef cudaExtent wrapper = cudaExtent() + wrapper._pvt_ptr[0] = err + return wrapper +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsEGLRegisterImage(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:`~.cudaGraphicsResourceGetMappedEglFrame` 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 + access the objects have completed before passing control to CUDA. This + may be accomplished by issuing and waiting for glFinish command on all + GLcontexts (for OpenGL and likewise for other APIs). The application + will be also responsible for ensuring that any pending operation on the + registered CUDA resource has completed prior to executing subsequent + commands in other APIs accesing the same memory objects. This can be + accomplished by calling cuCtxSynchronize or cuEventSynchronize + (preferably). + + The surface's intended usage is specified using `flags`, as follows: + + - :py:obj:`~.cudaGraphicsRegisterFlagsNone`: Specifies no hints about + how this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.cudaGraphicsRegisterFlagsReadOnly`: Specifies that CUDA + will not write to this resource. + + - :py:obj:`~.cudaGraphicsRegisterFlagsWriteDiscard`: Specifies that + CUDA will not read from this resource and will write over the 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 + + Parameters + ---------- + image : :py:obj:`~.EGLImageKHR` + An EGLImageKHR image which can be used to create target resource. + flags : unsigned int + Map flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + pCudaResource : :py:obj:`~.cudaGraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cudaGraphicsUnregisterResource`, :py:obj:`~.cudaGraphicsResourceGetMappedEglFrame`, :py:obj:`~.cuGraphicsEGLRegisterImage` + """ + cdef cyruntime.EGLImageKHR cyimage + if image is None: + pimage = 0 + elif isinstance(image, (EGLImageKHR,)): + pimage = int(image) + else: + pimage = int(EGLImageKHR(image)) + cyimage = pimage + cdef cudaGraphicsResource_t pCudaResource = cudaGraphicsResource_t() + with nogil: + err = cyruntime.cudaGraphicsEGLRegisterImage(pCudaResource._pvt_ptr, cyimage, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, pCudaResource) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamConsumerConnect(eglStream): + """ Connect CUDA to EGLStream as a consumer. + + Connect CUDA as a consumer to EGLStreamKHR specified by `eglStream`. + + The EGLStreamKHR is an EGL object that transfers a sequence of image + frames from one API to another. + + Parameters + ---------- + eglStream : :py:obj:`~.EGLStreamKHR` + EGLStreamKHR handle + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + conn : :py:obj:`~.cudaEglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cudaEGLStreamConsumerDisconnect`, :py:obj:`~.cudaEGLStreamConsumerAcquireFrame`, :py:obj:`~.cudaEGLStreamConsumerReleaseFrame`, :py:obj:`~.cuEGLStreamConsumerConnect` + """ + cdef cyruntime.EGLStreamKHR cyeglStream + if eglStream is None: + peglStream = 0 + elif isinstance(eglStream, (EGLStreamKHR,)): + peglStream = int(eglStream) + else: + peglStream = int(EGLStreamKHR(eglStream)) + cyeglStream = peglStream + cdef cudaEglStreamConnection conn = cudaEglStreamConnection() + with nogil: + err = cyruntime.cudaEGLStreamConsumerConnect(conn._pvt_ptr, cyeglStream) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, conn) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamConsumerConnectWithFlags(eglStream, 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 :py:obj:`~.cudaEglResourceLocationFlags`. + + The flags specify whether the consumer wants to access frames from + system memory or video memory. Default is + :py:obj:`~.cudaEglResourceLocationVidmem`. + + Parameters + ---------- + eglStream : :py:obj:`~.EGLStreamKHR` + EGLStreamKHR handle + flags : unsigned int + Flags denote intended location - system or video. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + conn : :py:obj:`~.cudaEglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cudaEGLStreamConsumerDisconnect`, :py:obj:`~.cudaEGLStreamConsumerAcquireFrame`, :py:obj:`~.cudaEGLStreamConsumerReleaseFrame`, :py:obj:`~.cuEGLStreamConsumerConnectWithFlags` + """ + cdef cyruntime.EGLStreamKHR cyeglStream + if eglStream is None: + peglStream = 0 + elif isinstance(eglStream, (EGLStreamKHR,)): + peglStream = int(eglStream) + else: + peglStream = int(EGLStreamKHR(eglStream)) + cyeglStream = peglStream + cdef cudaEglStreamConnection conn = cudaEglStreamConnection() + with nogil: + err = cyruntime.cudaEGLStreamConsumerConnectWithFlags(conn._pvt_ptr, cyeglStream, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, conn) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamConsumerDisconnect(conn): + """ Disconnect CUDA as a consumer to EGLStream . + + Disconnect CUDA as a consumer to EGLStreamKHR. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Conection to disconnect. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaEGLStreamConsumerConnect`, :py:obj:`~.cudaEGLStreamConsumerAcquireFrame`, :py:obj:`~.cudaEGLStreamConsumerReleaseFrame`, :py:obj:`~.cuEGLStreamConsumerDisconnect` + """ + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cyruntime.cudaEGLStreamConsumerDisconnect(cyconn) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, unsigned int timeout): + """ Acquire an image frame from the EGLStream with CUDA as a consumer. + + Acquire an image frame from EGLStreamKHR. + :py:obj:`~.cudaGraphicsResourceGetMappedEglFrame` can be called on + `pCudaResource` to get :py:obj:`~.cudaEglFrame`. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Connection on which to acquire + pCudaResource : :py:obj:`~.cudaGraphicsResource_t` + CUDA resource on which the EGLStream frame will be mapped for use. + pStream : :py:obj:`~.cudaStream_t` + CUDA stream for synchronization and any data migrations implied by + :py:obj:`~.cudaEglResourceLocationFlags`. + timeout : unsigned int + Desired timeout in usec. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown`, :py:obj:`~.cudaErrorLaunchTimeout` + + See Also + -------- + :py:obj:`~.cudaEGLStreamConsumerConnect`, :py:obj:`~.cudaEGLStreamConsumerDisconnect`, :py:obj:`~.cudaEGLStreamConsumerReleaseFrame`, :py:obj:`~.cuEGLStreamConsumerAcquireFrame` + """ + cdef cyruntime.cudaStream_t *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (cudaStream_t,driver.CUstream)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cyruntime.cudaGraphicsResource_t *cypCudaResource + if pCudaResource is None: + cypCudaResource = NULL + elif isinstance(pCudaResource, (cudaGraphicsResource_t,)): + ppCudaResource = pCudaResource.getPtr() + cypCudaResource = ppCudaResource + elif isinstance(pCudaResource, (int)): + cypCudaResource = pCudaResource + else: + raise TypeError("Argument 'pCudaResource' is not instance of type (expected , found " + str(type(pCudaResource))) + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cyruntime.cudaEGLStreamConsumerAcquireFrame(cyconn, cypCudaResource, cypStream, timeout) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream): + """ Releases the last frame acquired from the EGLStream. + + Release the acquired image frame specified by `pCudaResource` to + EGLStreamKHR. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Connection on which to release + pCudaResource : :py:obj:`~.cudaGraphicsResource_t` + CUDA resource whose corresponding frame is to be released + pStream : :py:obj:`~.cudaStream_t` + CUDA stream on which release will be done. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaEGLStreamConsumerConnect`, :py:obj:`~.cudaEGLStreamConsumerDisconnect`, :py:obj:`~.cudaEGLStreamConsumerAcquireFrame`, :py:obj:`~.cuEGLStreamConsumerReleaseFrame` + """ + cdef cyruntime.cudaStream_t *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (cudaStream_t,driver.CUstream)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cyruntime.cudaGraphicsResource_t cypCudaResource + if pCudaResource is None: + ppCudaResource = 0 + elif isinstance(pCudaResource, (cudaGraphicsResource_t,)): + ppCudaResource = int(pCudaResource) + else: + ppCudaResource = int(cudaGraphicsResource_t(pCudaResource)) + cypCudaResource = ppCudaResource + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cyruntime.cudaEGLStreamConsumerReleaseFrame(cyconn, cypCudaResource, cypStream) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamProducerConnect(eglStream, width, height): + """ Connect CUDA to EGLStream as a producer. + + Connect CUDA as a producer to EGLStreamKHR specified by `stream`. + + The EGLStreamKHR is an EGL object that transfers a sequence of image + frames from one API to another. + + Parameters + ---------- + eglStream : :py:obj:`~.EGLStreamKHR` + EGLStreamKHR handle + width : :py:obj:`~.EGLint` + width of the image to be submitted to the stream + height : :py:obj:`~.EGLint` + height of the image to be submitted to the stream + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + conn : :py:obj:`~.cudaEglStreamConnection` + Pointer to the returned connection handle + + See Also + -------- + :py:obj:`~.cudaEGLStreamProducerDisconnect`, :py:obj:`~.cudaEGLStreamProducerPresentFrame`, :py:obj:`~.cudaEGLStreamProducerReturnFrame`, :py:obj:`~.cuEGLStreamProducerConnect` + """ + cdef cyruntime.EGLint cyheight + if height is None: + pheight = 0 + elif isinstance(height, (EGLint,)): + pheight = int(height) + else: + pheight = int(EGLint(height)) + cyheight = pheight + cdef cyruntime.EGLint cywidth + if width is None: + pwidth = 0 + elif isinstance(width, (EGLint,)): + pwidth = int(width) + else: + pwidth = int(EGLint(width)) + cywidth = pwidth + cdef cyruntime.EGLStreamKHR cyeglStream + if eglStream is None: + peglStream = 0 + elif isinstance(eglStream, (EGLStreamKHR,)): + peglStream = int(eglStream) + else: + peglStream = int(EGLStreamKHR(eglStream)) + cyeglStream = peglStream + cdef cudaEglStreamConnection conn = cudaEglStreamConnection() + with nogil: + err = cyruntime.cudaEGLStreamProducerConnect(conn._pvt_ptr, cyeglStream, cywidth, cyheight) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, conn) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamProducerDisconnect(conn): + """ Disconnect CUDA as a producer to EGLStream . + + Disconnect CUDA as a producer to EGLStreamKHR. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Conection to disconnect. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaEGLStreamProducerConnect`, :py:obj:`~.cudaEGLStreamProducerPresentFrame`, :py:obj:`~.cudaEGLStreamProducerReturnFrame`, :py:obj:`~.cuEGLStreamProducerDisconnect` + """ + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cyruntime.cudaEGLStreamProducerDisconnect(cyconn) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamProducerPresentFrame(conn, eglframe not None : cudaEglFrame, pStream): + """ Present a CUDA eglFrame to the EGLStream with CUDA as a producer. + + The :py:obj:`~.cudaEglFrame` is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + For :py:obj:`~.cudaEglFrame` of type :py:obj:`~.cudaEglFrameTypePitch`, + the application may present sub-region of a memory allocation. In that + case, :py:obj:`~.cudaPitchedPtr.ptr` will specify the start address of + the sub-region in the allocation and :py:obj:`~.cudaEglPlaneDesc` will + specify the dimensions of the sub-region. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Connection on which to present the CUDA array + eglframe : :py:obj:`~.cudaEglFrame` + CUDA Eglstream Proucer Frame handle to be sent to the consumer over + EglStream. + pStream : :py:obj:`~.cudaStream_t` + CUDA stream on which to present the frame. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaEGLStreamProducerConnect`, :py:obj:`~.cudaEGLStreamProducerDisconnect`, :py:obj:`~.cudaEGLStreamProducerReturnFrame`, :py:obj:`~.cuEGLStreamProducerPresentFrame` + """ + cdef cyruntime.cudaStream_t *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (cudaStream_t,driver.CUstream)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + cyconn = conn + else: + raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) + with nogil: + err = cyruntime.cudaEGLStreamProducerPresentFrame(cyconn, eglframe._pvt_ptr[0], cypStream) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEGLStreamProducerReturnFrame(conn, eglframe : Optional[cudaEglFrame], pStream): + """ Return the CUDA eglFrame to the EGLStream last released by the consumer. + + This API can potentially return cudaErrorLaunchTimeout if the consumer + has not returned a frame to EGL stream. If timeout is returned the + application can retry. + + Parameters + ---------- + conn : :py:obj:`~.cudaEglStreamConnection` + Connection on which to present the CUDA array + eglframe : :py:obj:`~.cudaEglFrame` + CUDA Eglstream Proucer Frame handle returned from the consumer over + EglStream. + pStream : :py:obj:`~.cudaStream_t` + CUDA stream on which to return the frame. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLaunchTimeout`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + + See Also + -------- + :py:obj:`~.cudaEGLStreamProducerConnect`, :py:obj:`~.cudaEGLStreamProducerDisconnect`, :py:obj:`~.cudaEGLStreamProducerPresentFrame`, :py:obj:`~.cuEGLStreamProducerReturnFrame` + """ + cdef cyruntime.cudaStream_t *cypStream + if pStream is None: + cypStream = NULL + elif isinstance(pStream, (cudaStream_t,driver.CUstream)): + ppStream = pStream.getPtr() + cypStream = ppStream + elif isinstance(pStream, (int)): + cypStream = pStream + else: + raise TypeError("Argument 'pStream' is not instance of type (expected , found " + str(type(pStream))) + cdef cyruntime.cudaEglStreamConnection *cyconn + if conn is None: + cyconn = NULL + elif isinstance(conn, (cudaEglStreamConnection,driver.CUeglStreamConnection)): + pconn = conn.getPtr() + cyconn = pconn + elif isinstance(conn, (int)): + 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 + with nogil: + err = cyruntime.cudaEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned int mipLevel): + """ Get an eglFrame through which to access a registered EGL graphics resource. + + Returns in `*eglFrame` an eglFrame pointer through which the registered + graphics resource `resource` may be accessed. This API can only be + called for EGL graphics resources. + + The :py:obj:`~.cudaEglFrame` is defined as + + **View CUDA Toolkit Documentation for a C++ code example** + + Parameters + ---------- + resource : :py:obj:`~.cudaGraphicsResource_t` + Registered resource to access. + index : unsigned int + Index for cubemap surfaces. + mipLevel : unsigned int + Mipmap level for the subresource to access. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorUnknown` + eglFrame : :py:obj:`~.cudaEglFrame` + Returned eglFrame. + + See Also + -------- + :py:obj:`~.cudaGraphicsSubResourceGetMappedArray`, :py:obj:`~.cudaGraphicsResourceGetMappedPointer`, :py:obj:`~.cuGraphicsResourceGetMappedEglFrame` + + Notes + ----- + Note that in case of multiplanar `*eglFrame`, pitch of only first plane (unsigned int :py:obj:`~.cudaEglPlaneDesc.pitch`) is to be considered by the application. + """ + cdef cyruntime.cudaGraphicsResource_t cyresource + if resource is None: + presource = 0 + elif isinstance(resource, (cudaGraphicsResource_t,)): + presource = int(resource) + else: + presource = int(cudaGraphicsResource_t(resource)) + cyresource = presource + cdef cudaEglFrame eglFrame = cudaEglFrame() + with nogil: + err = cyruntime.cudaGraphicsResourceGetMappedEglFrame(eglFrame._pvt_ptr, cyresource, index, mipLevel) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, eglFrame) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaEventCreateFromEGLSync(eglSync, unsigned int flags): + """ Creates an event from EGLSync object. + + Creates an event *phEvent from an EGLSyncKHR eglSync with the flages + specified via `flags`. Valid flags include: + + - :py:obj:`~.cudaEventDefault`: Default event creation flag. + + - :py:obj:`~.cudaEventBlockingSync`: Specifies that the created event + should use blocking synchronization. A CPU thread that uses + :py:obj:`~.cudaEventSynchronize()` to wait on an event created with + this flag will block until the event has actually been completed. + + :py:obj:`~.cudaEventRecord` and TimingData are not supported for events + created from EGLSync. + + The EGLSyncKHR is an opaque handle to an EGL sync object. typedef void* + EGLSyncKHR + + Parameters + ---------- + eglSync : :py:obj:`~.EGLSyncKHR` + Opaque handle to EGLSync object + flags : unsigned int + Event creation flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorLaunchFailure`, :py:obj:`~.cudaErrorMemoryAllocation` + phEvent : :py:obj:`~.cudaEvent_t` + Returns newly created event + + See Also + -------- + :py:obj:`~.cudaEventQuery`, :py:obj:`~.cudaEventSynchronize`, :py:obj:`~.cudaEventDestroy` + """ + cdef cyruntime.EGLSyncKHR cyeglSync + if eglSync is None: + peglSync = 0 + elif isinstance(eglSync, (EGLSyncKHR,)): + peglSync = int(eglSync) + else: + peglSync = int(EGLSyncKHR(eglSync)) + cyeglSync = peglSync + cdef cudaEvent_t phEvent = cudaEvent_t() + with nogil: + err = cyruntime.cudaEventCreateFromEGLSync(phEvent._pvt_ptr, cyeglSync, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, phEvent) +{{endif}} + +{{if 'cudaProfilerStart' in found_functions}} + +@cython.embedsignature(True) +def cudaProfilerStart(): + """ Enable profiling. + + Enables profile collection by the active profiling tool for the current + context. If profiling is already enabled, then + :py:obj:`~.cudaProfilerStart()` has no effect. + + cudaProfilerStart and cudaProfilerStop APIs are used to + programmatically control the profiling granularity by allowing + profiling to be done only on selective pieces of code. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + + See Also + -------- + :py:obj:`~.cudaProfilerStop`, :py:obj:`~.cuProfilerStart` + """ + with nogil: + err = cyruntime.cudaProfilerStart() + return (_cudaError_t(err),) +{{endif}} + +{{if 'cudaProfilerStop' in found_functions}} + +@cython.embedsignature(True) +def cudaProfilerStop(): + """ Disable profiling. + + Disables profile collection by the active profiling tool for the + current context. If profiling is already disabled, then + :py:obj:`~.cudaProfilerStop()` has no effect. + + cudaProfilerStart and cudaProfilerStop APIs are used to + programmatically control the profiling granularity by allowing + profiling to be done only on selective pieces of code. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + + See Also + -------- + :py:obj:`~.cudaProfilerStart`, :py:obj:`~.cuProfilerStop` + """ + with nogil: + err = cyruntime.cudaProfilerStop() + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : cudaGLDeviceList): + """ Gets the CUDA devices associated with the current OpenGL context. + + Returns in `*pCudaDeviceCount` the number of CUDA-compatible devices + corresponding to the current OpenGL context. Also returns in + `*pCudaDevices` at most `cudaDeviceCount` of the CUDA-compatible + devices corresponding to the current OpenGL context. If any of the GPUs + being used by the current OpenGL context are not CUDA capable then the + call will return cudaErrorNoDevice. + + Parameters + ---------- + cudaDeviceCount : unsigned int + The size of the output device array `pCudaDevices` + deviceList : cudaGLDeviceList + The set of devices to return. This set may be cudaGLDeviceListAll + for all devices, cudaGLDeviceListCurrentFrame for the devices used + to render the current frame (in SLI), or cudaGLDeviceListNextFrame + for the devices used to render the next frame (in SLI). + + Returns + ------- + cudaError_t + cudaSuccess + cudaErrorNoDevice + cudaErrorInvalidGraphicsContext + cudaErrorUnknown + pCudaDeviceCount : unsigned int + Returned number of CUDA devices corresponding to the current OpenGL + context + pCudaDevices : list[int] + Returned CUDA devices corresponding to the current OpenGL context + + See Also + -------- + ~.cudaGraphicsUnregisterResource + ~.cudaGraphicsMapResources + ~.cudaGraphicsSubResourceGetMappedArray + ~.cudaGraphicsResourceGetMappedPointer + ~.cuGLGetDevices + + Notes + ----- + This function is not supported on Mac OS X. + + """ + cdef unsigned int pCudaDeviceCount = 0 + cdef int* cypCudaDevices = NULL + pypCudaDevices = [] + if cudaDeviceCount != 0: + cypCudaDevices = calloc(cudaDeviceCount, sizeof(int)) + if cypCudaDevices is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(cudaDeviceCount) + 'x' + str(sizeof(int))) + cdef cyruntime.cudaGLDeviceList cydeviceList = int(deviceList) + with nogil: + err = cyruntime.cudaGLGetDevices(&pCudaDeviceCount, cypCudaDevices, cudaDeviceCount, cydeviceList) + if cudaError_t(err) == cudaError_t(0): + pypCudaDevices = [cypCudaDevices[idx] for idx in range(cudaDeviceCount)] + if cypCudaDevices is not NULL: + free(cypCudaDevices) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None, None) + return (_cudaError_t_SUCCESS, pCudaDeviceCount, pypCudaDevices) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsGLRegisterImage(image, target, unsigned int flags): + """ Register an OpenGL texture or renderbuffer object. + + Registers the texture or renderbuffer object specified by `image` for + access by CUDA. A handle to the registered object is returned as + `resource`. + + `target` must match the type of the object, and must be one of + :py:obj:`~.GL_TEXTURE_2D`, :py:obj:`~.GL_TEXTURE_RECTANGLE`, + :py:obj:`~.GL_TEXTURE_CUBE_MAP`, :py:obj:`~.GL_TEXTURE_3D`, + :py:obj:`~.GL_TEXTURE_2D_ARRAY`, or :py:obj:`~.GL_RENDERBUFFER`. + + The register flags `flags` specify the intended usage, as follows: + + - :py:obj:`~.cudaGraphicsRegisterFlagsNone`: Specifies no hints about + how this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.cudaGraphicsRegisterFlagsReadOnly`: Specifies that CUDA + will not write to this resource. + + - :py:obj:`~.cudaGraphicsRegisterFlagsWriteDiscard`: Specifies that + CUDA will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + - :py:obj:`~.cudaGraphicsRegisterFlagsSurfaceLoadStore`: Specifies that + CUDA will bind this resource to a surface reference. + + - :py:obj:`~.cudaGraphicsRegisterFlagsTextureGather`: Specifies that + CUDA will perform texture gather operations on this resource. + + The following image formats are supported. For brevity's sake, the list + is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would expand to the + following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16} : + + - GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, + GL_INTENSITY + + - {GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, + 32I} + + - {GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, + 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, + 32I_EXT} + + The following image classes are currently disallowed: + + - Textures with borders + + - Multisampled renderbuffers + + Parameters + ---------- + image : :py:obj:`~.GLuint` + name of texture or renderbuffer object to be registered + target : :py:obj:`~.GLenum` + Identifies the type of object specified by `image` + flags : unsigned int + Register flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorOperatingSystem`, :py:obj:`~.cudaErrorUnknown` + resource : :py:obj:`~.cudaGraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cudaGraphicsUnregisterResource`, :py:obj:`~.cudaGraphicsMapResources`, :py:obj:`~.cudaGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuGraphicsGLRegisterImage` + """ + cdef cyruntime.GLenum cytarget + if target is None: + ptarget = 0 + elif isinstance(target, (GLenum,)): + ptarget = int(target) + else: + ptarget = int(GLenum(target)) + cytarget = ptarget + cdef cyruntime.GLuint cyimage + if image is None: + pimage = 0 + elif isinstance(image, (GLuint,)): + pimage = int(image) + else: + pimage = int(GLuint(image)) + cyimage = pimage + cdef cudaGraphicsResource_t resource = cudaGraphicsResource_t() + with nogil: + err = cyruntime.cudaGraphicsGLRegisterImage(resource._pvt_ptr, cyimage, cytarget, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, resource) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsGLRegisterBuffer(buffer, unsigned int flags): + """ Registers an OpenGL buffer object. + + Registers the buffer object specified by `buffer` for access by CUDA. A + handle to the registered object is returned as `resource`. The register + flags `flags` specify the intended usage, as follows: + + - :py:obj:`~.cudaGraphicsRegisterFlagsNone`: Specifies no hints about + how this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.cudaGraphicsRegisterFlagsReadOnly`: Specifies that CUDA + will not write to this resource. + + - :py:obj:`~.cudaGraphicsRegisterFlagsWriteDiscard`: Specifies that + CUDA will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + Parameters + ---------- + buffer : :py:obj:`~.GLuint` + name of buffer object to be registered + flags : unsigned int + Register flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorOperatingSystem`, :py:obj:`~.cudaErrorUnknown` + resource : :py:obj:`~.cudaGraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cudaGraphicsUnregisterResource`, :py:obj:`~.cudaGraphicsMapResources`, :py:obj:`~.cudaGraphicsResourceGetMappedPointer`, :py:obj:`~.cuGraphicsGLRegisterBuffer` + """ + cdef cyruntime.GLuint cybuffer + if buffer is None: + pbuffer = 0 + elif isinstance(buffer, (GLuint,)): + pbuffer = int(buffer) + else: + pbuffer = int(GLuint(buffer)) + cybuffer = pbuffer + cdef cudaGraphicsResource_t resource = cudaGraphicsResource_t() + with nogil: + err = cyruntime.cudaGraphicsGLRegisterBuffer(resource._pvt_ptr, cybuffer, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, resource) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaVDPAUGetDevice(vdpDevice, vdpGetProcAddress): + """ Gets the CUDA device associated with a VdpDevice. + + Returns the CUDA device associated with a VdpDevice, if applicable. + + Parameters + ---------- + vdpDevice : :py:obj:`~.VdpDevice` + A VdpDevice handle + vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` + VDPAU's VdpGetProcAddress function pointer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess` + device : int + Returns the device associated with vdpDevice, or -1 if the device + associated with vdpDevice is not a compute device. + + See Also + -------- + :py:obj:`~.cudaVDPAUSetVDPAUDevice`, :py:obj:`~.cuVDPAUGetDevice` + """ + cdef cyruntime.VdpGetProcAddress *cyvdpGetProcAddress + if vdpGetProcAddress is None: + cyvdpGetProcAddress = NULL + elif isinstance(vdpGetProcAddress, (VdpGetProcAddress,)): + pvdpGetProcAddress = vdpGetProcAddress.getPtr() + cyvdpGetProcAddress = pvdpGetProcAddress + elif isinstance(vdpGetProcAddress, (int)): + cyvdpGetProcAddress = vdpGetProcAddress + else: + raise TypeError("Argument 'vdpGetProcAddress' is not instance of type (expected , found " + str(type(vdpGetProcAddress))) + cdef cyruntime.VdpDevice cyvdpDevice + if vdpDevice is None: + pvdpDevice = 0 + elif isinstance(vdpDevice, (VdpDevice,)): + pvdpDevice = int(vdpDevice) + else: + pvdpDevice = int(VdpDevice(vdpDevice)) + cyvdpDevice = pvdpDevice + cdef int device = 0 + with nogil: + err = cyruntime.cudaVDPAUGetDevice(&device, cyvdpDevice, cyvdpGetProcAddress) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, device) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaVDPAUSetVDPAUDevice(int device, vdpDevice, vdpGetProcAddress): + """ Sets a CUDA device to use VDPAU interoperability. + + Records `vdpDevice` as the VdpDevice for VDPAU interoperability with + the CUDA device `device` and sets `device` as the current device for + the calling host thread. + + This function will immediately initialize the primary context on + `device` if needed. + + If `device` has already been initialized then this call will fail with + the error :py:obj:`~.cudaErrorSetOnActiveProcess`. In this case it is + necessary to reset `device` using :py:obj:`~.cudaDeviceReset()` before + VDPAU interoperability on `device` may be enabled. + + Parameters + ---------- + device : int + Device to use for VDPAU interoperability + vdpDevice : :py:obj:`~.VdpDevice` + The VdpDevice to interoperate with + vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` + VDPAU's VdpGetProcAddress function pointer + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorSetOnActiveProcess` + + See Also + -------- + :py:obj:`~.cudaGraphicsVDPAURegisterVideoSurface`, :py:obj:`~.cudaGraphicsVDPAURegisterOutputSurface`, :py:obj:`~.cudaDeviceReset` + """ + cdef cyruntime.VdpGetProcAddress *cyvdpGetProcAddress + if vdpGetProcAddress is None: + cyvdpGetProcAddress = NULL + elif isinstance(vdpGetProcAddress, (VdpGetProcAddress,)): + pvdpGetProcAddress = vdpGetProcAddress.getPtr() + cyvdpGetProcAddress = pvdpGetProcAddress + elif isinstance(vdpGetProcAddress, (int)): + cyvdpGetProcAddress = vdpGetProcAddress + else: + raise TypeError("Argument 'vdpGetProcAddress' is not instance of type (expected , found " + str(type(vdpGetProcAddress))) + cdef cyruntime.VdpDevice cyvdpDevice + if vdpDevice is None: + pvdpDevice = 0 + elif isinstance(vdpDevice, (VdpDevice,)): + pvdpDevice = int(vdpDevice) + else: + pvdpDevice = int(VdpDevice(vdpDevice)) + cyvdpDevice = pvdpDevice + with nogil: + err = cyruntime.cudaVDPAUSetVDPAUDevice(device, cyvdpDevice, cyvdpGetProcAddress) + return (_cudaError_t(err),) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): + """ Register a VdpVideoSurface object. + + Registers the VdpVideoSurface specified by `vdpSurface` for access by + CUDA. A handle to the registered object is returned as `resource`. The + surface's intended usage is specified using `flags`, as follows: + + - :py:obj:`~.cudaGraphicsMapFlagsNone`: Specifies no hints about how + this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.cudaGraphicsMapFlagsReadOnly`: Specifies that CUDA will + not write to this resource. + + - :py:obj:`~.cudaGraphicsMapFlagsWriteDiscard`: Specifies that CUDA + will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + Parameters + ---------- + vdpSurface : :py:obj:`~.VdpVideoSurface` + VDPAU object to be registered + flags : unsigned int + Map flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + resource : :py:obj:`~.cudaGraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cudaVDPAUSetVDPAUDevice`, :py:obj:`~.cudaGraphicsUnregisterResource`, :py:obj:`~.cudaGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuGraphicsVDPAURegisterVideoSurface` + """ + cdef cyruntime.VdpVideoSurface cyvdpSurface + if vdpSurface is None: + pvdpSurface = 0 + elif isinstance(vdpSurface, (VdpVideoSurface,)): + pvdpSurface = int(vdpSurface) + else: + pvdpSurface = int(VdpVideoSurface(vdpSurface)) + cyvdpSurface = pvdpSurface + cdef cudaGraphicsResource_t resource = cudaGraphicsResource_t() + with nogil: + err = cyruntime.cudaGraphicsVDPAURegisterVideoSurface(resource._pvt_ptr, cyvdpSurface, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, resource) +{{endif}} + +{{if True}} + +@cython.embedsignature(True) +def cudaGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): + """ Register a VdpOutputSurface object. + + Registers the VdpOutputSurface specified by `vdpSurface` for access by + CUDA. A handle to the registered object is returned as `resource`. The + surface's intended usage is specified using `flags`, as follows: + + - :py:obj:`~.cudaGraphicsMapFlagsNone`: Specifies no hints about how + this resource will be used. It is therefore assumed that this + resource will be read from and written to by CUDA. This is the + default value. + + - :py:obj:`~.cudaGraphicsMapFlagsReadOnly`: Specifies that CUDA will + not write to this resource. + + - :py:obj:`~.cudaGraphicsMapFlagsWriteDiscard`: Specifies that CUDA + will not read from this resource and will write over the entire + contents of the resource, so none of the data previously stored in + the resource will be preserved. + + Parameters + ---------- + vdpSurface : :py:obj:`~.VdpOutputSurface` + VDPAU object to be registered + flags : unsigned int + Map flags + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle`, :py:obj:`~.cudaErrorUnknown` + resource : :py:obj:`~.cudaGraphicsResource` + Pointer to the returned object handle + + See Also + -------- + :py:obj:`~.cudaVDPAUSetVDPAUDevice`, :py:obj:`~.cudaGraphicsUnregisterResource`, :py:obj:`~.cudaGraphicsSubResourceGetMappedArray`, :py:obj:`~.cuGraphicsVDPAURegisterOutputSurface` + """ + cdef cyruntime.VdpOutputSurface cyvdpSurface + if vdpSurface is None: + pvdpSurface = 0 + elif isinstance(vdpSurface, (VdpOutputSurface,)): + pvdpSurface = int(vdpSurface) + else: + pvdpSurface = int(VdpOutputSurface(vdpSurface)) + cyvdpSurface = pvdpSurface + cdef cudaGraphicsResource_t resource = cudaGraphicsResource_t() + with nogil: + err = cyruntime.cudaGraphicsVDPAURegisterOutputSurface(resource._pvt_ptr, cyvdpSurface, flags) + if err != cyruntime.cudaSuccess: + return (_cudaError_t(err), None) + return (_cudaError_t_SUCCESS, resource) +{{endif}} + + +@cython.embedsignature(True) +def getLocalRuntimeVersion(): + """ Returns the CUDA Runtime version of local shared library. + + Returns in `*runtimeVersion` the version number of the current CUDA + Runtime instance. The version is returned as (1000 * major + 10 * + minor). For example, CUDA 9.2 would be represented by 9020. + + As of CUDA 12.0, this function no longer initializes CUDA. The purpose + of this API is solely to return a compile-time constant stating the + CUDA Toolkit version in the above format. + + This function automatically returns :py:obj:`~.cudaErrorInvalidValue` + if the `runtimeVersion` argument is NULL. + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + runtimeVersion : int + Returns the CUDA Runtime version. + + See Also + -------- + :py:obj:`~.cudaDriverGetVersion`, :py:obj:`~.cuDriverGetVersion` + """ + cdef int runtimeVersion = 0 + err = cyruntime.getLocalRuntimeVersion(&runtimeVersion) + return (cudaError_t(err), runtimeVersion) + + +cdef class cudaBindingsRuntimeGlobal: + cdef map[void_ptr, void*] _allocated + + def __dealloc__(self): + for item in self._allocated: + free(item.second) + self._allocated.clear() + +cdef cudaBindingsRuntimeGlobal m_global = cudaBindingsRuntimeGlobal() + + +@cython.embedsignature(True) +def sizeof(objType): + """ Returns the size of provided CUDA Python structure in bytes + + Parameters + ---------- + objType : Any + CUDA Python object + + Returns + ------- + lowered_name : int + The size of `objType` in bytes + """ + {{if 'dim3' in found_struct}} + if objType == dim3: + return sizeof(cyruntime.dim3){{endif}} + {{if 'cudaChannelFormatDesc' in found_struct}} + if objType == cudaChannelFormatDesc: + return sizeof(cyruntime.cudaChannelFormatDesc){{endif}} + {{if 'cudaArray_t' in found_types}} + if objType == cudaArray_t: + return sizeof(cyruntime.cudaArray_t){{endif}} + {{if 'cudaArray_const_t' in found_types}} + if objType == cudaArray_const_t: + return sizeof(cyruntime.cudaArray_const_t){{endif}} + {{if 'cudaMipmappedArray_t' in found_types}} + if objType == cudaMipmappedArray_t: + return sizeof(cyruntime.cudaMipmappedArray_t){{endif}} + {{if 'cudaMipmappedArray_const_t' in found_types}} + if objType == cudaMipmappedArray_const_t: + return sizeof(cyruntime.cudaMipmappedArray_const_t){{endif}} + {{if 'cudaArraySparseProperties' in found_struct}} + if objType == cudaArraySparseProperties: + return sizeof(cyruntime.cudaArraySparseProperties){{endif}} + {{if 'cudaArrayMemoryRequirements' in found_struct}} + if objType == cudaArrayMemoryRequirements: + return sizeof(cyruntime.cudaArrayMemoryRequirements){{endif}} + {{if 'cudaPitchedPtr' in found_struct}} + if objType == cudaPitchedPtr: + return sizeof(cyruntime.cudaPitchedPtr){{endif}} + {{if 'cudaExtent' in found_struct}} + if objType == cudaExtent: + return sizeof(cyruntime.cudaExtent){{endif}} + {{if 'cudaPos' in found_struct}} + if objType == cudaPos: + return sizeof(cyruntime.cudaPos){{endif}} + {{if 'cudaMemcpy3DParms' in found_struct}} + if objType == cudaMemcpy3DParms: + return sizeof(cyruntime.cudaMemcpy3DParms){{endif}} + {{if 'cudaMemcpyNodeParams' in found_struct}} + if objType == cudaMemcpyNodeParams: + return sizeof(cyruntime.cudaMemcpyNodeParams){{endif}} + {{if 'cudaMemcpy3DPeerParms' in found_struct}} + if objType == cudaMemcpy3DPeerParms: + return sizeof(cyruntime.cudaMemcpy3DPeerParms){{endif}} + {{if 'cudaMemsetParams' in found_struct}} + if objType == cudaMemsetParams: + return sizeof(cyruntime.cudaMemsetParams){{endif}} + {{if 'cudaMemsetParamsV2' in found_struct}} + if objType == cudaMemsetParamsV2: + return sizeof(cyruntime.cudaMemsetParamsV2){{endif}} + {{if 'cudaAccessPolicyWindow' in found_struct}} + if objType == cudaAccessPolicyWindow: + return sizeof(cyruntime.cudaAccessPolicyWindow){{endif}} + {{if 'cudaHostFn_t' in found_types}} + if objType == cudaHostFn_t: + return sizeof(cyruntime.cudaHostFn_t){{endif}} + {{if 'cudaHostNodeParams' in found_struct}} + if objType == cudaHostNodeParams: + return sizeof(cyruntime.cudaHostNodeParams){{endif}} + {{if 'cudaHostNodeParamsV2' in found_struct}} + if objType == cudaHostNodeParamsV2: + return sizeof(cyruntime.cudaHostNodeParamsV2){{endif}} + {{if 'cudaResourceDesc' in found_struct}} + if objType == cudaResourceDesc: + return sizeof(cyruntime.cudaResourceDesc){{endif}} + {{if 'cudaResourceViewDesc' in found_struct}} + if objType == cudaResourceViewDesc: + return sizeof(cyruntime.cudaResourceViewDesc){{endif}} + {{if 'cudaPointerAttributes' in found_struct}} + if objType == cudaPointerAttributes: + return sizeof(cyruntime.cudaPointerAttributes){{endif}} + {{if 'cudaFuncAttributes' in found_struct}} + if objType == cudaFuncAttributes: + return sizeof(cyruntime.cudaFuncAttributes){{endif}} + {{if 'cudaMemLocation' in found_struct}} + if objType == cudaMemLocation: + return sizeof(cyruntime.cudaMemLocation){{endif}} + {{if 'cudaMemAccessDesc' in found_struct}} + if objType == cudaMemAccessDesc: + return sizeof(cyruntime.cudaMemAccessDesc){{endif}} + {{if 'cudaMemPoolProps' in found_struct}} + if objType == cudaMemPoolProps: + return sizeof(cyruntime.cudaMemPoolProps){{endif}} + {{if 'cudaMemPoolPtrExportData' in found_struct}} + if objType == cudaMemPoolPtrExportData: + return sizeof(cyruntime.cudaMemPoolPtrExportData){{endif}} + {{if 'cudaMemAllocNodeParams' in found_struct}} + if objType == cudaMemAllocNodeParams: + return sizeof(cyruntime.cudaMemAllocNodeParams){{endif}} + {{if 'cudaMemAllocNodeParamsV2' in found_struct}} + if objType == cudaMemAllocNodeParamsV2: + return sizeof(cyruntime.cudaMemAllocNodeParamsV2){{endif}} + {{if 'cudaMemFreeNodeParams' in found_struct}} + if objType == cudaMemFreeNodeParams: + return sizeof(cyruntime.cudaMemFreeNodeParams){{endif}} + {{if 'cudaMemcpyAttributes' in found_struct}} + if objType == cudaMemcpyAttributes: + return sizeof(cyruntime.cudaMemcpyAttributes){{endif}} + {{if 'cudaOffset3D' in found_struct}} + if objType == cudaOffset3D: + return sizeof(cyruntime.cudaOffset3D){{endif}} + {{if 'cudaMemcpy3DOperand' in found_struct}} + if objType == cudaMemcpy3DOperand: + return sizeof(cyruntime.cudaMemcpy3DOperand){{endif}} + {{if 'cudaMemcpy3DBatchOp' in found_struct}} + if objType == cudaMemcpy3DBatchOp: + return sizeof(cyruntime.cudaMemcpy3DBatchOp){{endif}} + {{if 'CUuuid_st' in found_struct}} + if objType == CUuuid_st: + return sizeof(cyruntime.CUuuid_st){{endif}} + {{if 'CUuuid' in found_types}} + if objType == CUuuid: + return sizeof(cyruntime.CUuuid){{endif}} + {{if 'cudaUUID_t' in found_types}} + if objType == cudaUUID_t: + return sizeof(cyruntime.cudaUUID_t){{endif}} + {{if 'cudaDeviceProp' in found_struct}} + if objType == cudaDeviceProp: + return sizeof(cyruntime.cudaDeviceProp){{endif}} + {{if 'cudaIpcEventHandle_st' in found_struct}} + if objType == cudaIpcEventHandle_st: + return sizeof(cyruntime.cudaIpcEventHandle_st){{endif}} + {{if 'cudaIpcEventHandle_t' in found_types}} + if objType == cudaIpcEventHandle_t: + return sizeof(cyruntime.cudaIpcEventHandle_t){{endif}} + {{if 'cudaIpcMemHandle_st' in found_struct}} + if objType == cudaIpcMemHandle_st: + return sizeof(cyruntime.cudaIpcMemHandle_st){{endif}} + {{if 'cudaIpcMemHandle_t' in found_types}} + if objType == cudaIpcMemHandle_t: + return sizeof(cyruntime.cudaIpcMemHandle_t){{endif}} + {{if 'cudaMemFabricHandle_st' in found_struct}} + if objType == cudaMemFabricHandle_st: + return sizeof(cyruntime.cudaMemFabricHandle_st){{endif}} + {{if 'cudaMemFabricHandle_t' in found_types}} + if objType == cudaMemFabricHandle_t: + return sizeof(cyruntime.cudaMemFabricHandle_t){{endif}} + {{if 'cudaExternalMemoryHandleDesc' in found_struct}} + if objType == cudaExternalMemoryHandleDesc: + return sizeof(cyruntime.cudaExternalMemoryHandleDesc){{endif}} + {{if 'cudaExternalMemoryBufferDesc' in found_struct}} + if objType == cudaExternalMemoryBufferDesc: + return sizeof(cyruntime.cudaExternalMemoryBufferDesc){{endif}} + {{if 'cudaExternalMemoryMipmappedArrayDesc' in found_struct}} + if objType == cudaExternalMemoryMipmappedArrayDesc: + return sizeof(cyruntime.cudaExternalMemoryMipmappedArrayDesc){{endif}} + {{if 'cudaExternalSemaphoreHandleDesc' in found_struct}} + if objType == cudaExternalSemaphoreHandleDesc: + return sizeof(cyruntime.cudaExternalSemaphoreHandleDesc){{endif}} + {{if 'cudaExternalSemaphoreSignalParams' in found_struct}} + if objType == cudaExternalSemaphoreSignalParams: + return sizeof(cyruntime.cudaExternalSemaphoreSignalParams){{endif}} + {{if 'cudaExternalSemaphoreWaitParams' in found_struct}} + if objType == cudaExternalSemaphoreWaitParams: + return sizeof(cyruntime.cudaExternalSemaphoreWaitParams){{endif}} + {{if 'cudaStream_t' in found_types}} + if objType == cudaStream_t: + return sizeof(cyruntime.cudaStream_t){{endif}} + {{if 'cudaEvent_t' in found_types}} + if objType == cudaEvent_t: + return sizeof(cyruntime.cudaEvent_t){{endif}} + {{if 'cudaGraphicsResource_t' in found_types}} + if objType == cudaGraphicsResource_t: + return sizeof(cyruntime.cudaGraphicsResource_t){{endif}} + {{if 'cudaExternalMemory_t' in found_types}} + if objType == cudaExternalMemory_t: + return sizeof(cyruntime.cudaExternalMemory_t){{endif}} + {{if 'cudaExternalSemaphore_t' in found_types}} + if objType == cudaExternalSemaphore_t: + return sizeof(cyruntime.cudaExternalSemaphore_t){{endif}} + {{if 'cudaGraph_t' in found_types}} + if objType == cudaGraph_t: + return sizeof(cyruntime.cudaGraph_t){{endif}} + {{if 'cudaGraphNode_t' in found_types}} + if objType == cudaGraphNode_t: + return sizeof(cyruntime.cudaGraphNode_t){{endif}} + {{if 'cudaUserObject_t' in found_types}} + if objType == cudaUserObject_t: + return sizeof(cyruntime.cudaUserObject_t){{endif}} + {{if 'cudaGraphConditionalHandle' in found_types}} + if objType == cudaGraphConditionalHandle: + return sizeof(cyruntime.cudaGraphConditionalHandle){{endif}} + {{if 'cudaFunction_t' in found_types}} + if objType == cudaFunction_t: + return sizeof(cyruntime.cudaFunction_t){{endif}} + {{if 'cudaKernel_t' in found_types}} + if objType == cudaKernel_t: + return sizeof(cyruntime.cudaKernel_t){{endif}} + {{if 'cudalibraryHostUniversalFunctionAndDataTable' in found_struct}} + if objType == cudalibraryHostUniversalFunctionAndDataTable: + return sizeof(cyruntime.cudalibraryHostUniversalFunctionAndDataTable){{endif}} + {{if 'cudaLibrary_t' in found_types}} + if objType == cudaLibrary_t: + return sizeof(cyruntime.cudaLibrary_t){{endif}} + {{if 'cudaMemPool_t' in found_types}} + if objType == cudaMemPool_t: + return sizeof(cyruntime.cudaMemPool_t){{endif}} + {{if 'cudaKernelNodeParams' in found_struct}} + if objType == cudaKernelNodeParams: + return sizeof(cyruntime.cudaKernelNodeParams){{endif}} + {{if 'cudaKernelNodeParamsV2' in found_struct}} + if objType == cudaKernelNodeParamsV2: + return sizeof(cyruntime.cudaKernelNodeParamsV2){{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParams' in found_struct}} + if objType == cudaExternalSemaphoreSignalNodeParams: + return sizeof(cyruntime.cudaExternalSemaphoreSignalNodeParams){{endif}} + {{if 'cudaExternalSemaphoreSignalNodeParamsV2' in found_struct}} + if objType == cudaExternalSemaphoreSignalNodeParamsV2: + return sizeof(cyruntime.cudaExternalSemaphoreSignalNodeParamsV2){{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParams' in found_struct}} + if objType == cudaExternalSemaphoreWaitNodeParams: + return sizeof(cyruntime.cudaExternalSemaphoreWaitNodeParams){{endif}} + {{if 'cudaExternalSemaphoreWaitNodeParamsV2' in found_struct}} + if objType == cudaExternalSemaphoreWaitNodeParamsV2: + return sizeof(cyruntime.cudaExternalSemaphoreWaitNodeParamsV2){{endif}} + {{if 'cudaConditionalNodeParams' in found_struct}} + if objType == cudaConditionalNodeParams: + return sizeof(cyruntime.cudaConditionalNodeParams){{endif}} + {{if 'cudaChildGraphNodeParams' in found_struct}} + if objType == cudaChildGraphNodeParams: + return sizeof(cyruntime.cudaChildGraphNodeParams){{endif}} + {{if 'cudaEventRecordNodeParams' in found_struct}} + if objType == cudaEventRecordNodeParams: + return sizeof(cyruntime.cudaEventRecordNodeParams){{endif}} + {{if 'cudaEventWaitNodeParams' in found_struct}} + if objType == cudaEventWaitNodeParams: + return sizeof(cyruntime.cudaEventWaitNodeParams){{endif}} + {{if 'cudaGraphNodeParams' in found_struct}} + if objType == cudaGraphNodeParams: + return sizeof(cyruntime.cudaGraphNodeParams){{endif}} + {{if 'cudaGraphEdgeData_st' in found_struct}} + if objType == cudaGraphEdgeData_st: + return sizeof(cyruntime.cudaGraphEdgeData_st){{endif}} + {{if 'cudaGraphEdgeData' in found_types}} + if objType == cudaGraphEdgeData: + return sizeof(cyruntime.cudaGraphEdgeData){{endif}} + {{if 'cudaGraphExec_t' in found_types}} + if objType == cudaGraphExec_t: + return sizeof(cyruntime.cudaGraphExec_t){{endif}} + {{if 'cudaGraphInstantiateParams_st' in found_struct}} + if objType == cudaGraphInstantiateParams_st: + return sizeof(cyruntime.cudaGraphInstantiateParams_st){{endif}} + {{if 'cudaGraphInstantiateParams' in found_types}} + if objType == cudaGraphInstantiateParams: + return sizeof(cyruntime.cudaGraphInstantiateParams){{endif}} + {{if 'cudaGraphExecUpdateResultInfo_st' in found_struct}} + if objType == cudaGraphExecUpdateResultInfo_st: + return sizeof(cyruntime.cudaGraphExecUpdateResultInfo_st){{endif}} + {{if 'cudaGraphExecUpdateResultInfo' in found_types}} + if objType == cudaGraphExecUpdateResultInfo: + return sizeof(cyruntime.cudaGraphExecUpdateResultInfo){{endif}} + {{if 'cudaGraphDeviceNode_t' in found_types}} + if objType == cudaGraphDeviceNode_t: + return sizeof(cyruntime.cudaGraphDeviceNode_t){{endif}} + {{if 'cudaGraphKernelNodeUpdate' in found_struct}} + if objType == cudaGraphKernelNodeUpdate: + return sizeof(cyruntime.cudaGraphKernelNodeUpdate){{endif}} + {{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} + if objType == cudaLaunchMemSyncDomainMap_st: + return sizeof(cyruntime.cudaLaunchMemSyncDomainMap_st){{endif}} + {{if 'cudaLaunchMemSyncDomainMap' in found_types}} + if objType == cudaLaunchMemSyncDomainMap: + return sizeof(cyruntime.cudaLaunchMemSyncDomainMap){{endif}} + {{if 'cudaLaunchAttributeValue' in found_struct}} + if objType == cudaLaunchAttributeValue: + return sizeof(cyruntime.cudaLaunchAttributeValue){{endif}} + {{if 'cudaLaunchAttribute_st' in found_struct}} + if objType == cudaLaunchAttribute_st: + return sizeof(cyruntime.cudaLaunchAttribute_st){{endif}} + {{if 'cudaLaunchAttribute' in found_types}} + if objType == cudaLaunchAttribute: + return sizeof(cyruntime.cudaLaunchAttribute){{endif}} + {{if 'cudaAsyncCallbackHandle_t' in found_types}} + if objType == cudaAsyncCallbackHandle_t: + return sizeof(cyruntime.cudaAsyncCallbackHandle_t){{endif}} + {{if 'cudaAsyncNotificationInfo' in found_struct}} + if objType == cudaAsyncNotificationInfo: + return sizeof(cyruntime.cudaAsyncNotificationInfo){{endif}} + {{if 'cudaAsyncNotificationInfo_t' in found_types}} + if objType == cudaAsyncNotificationInfo_t: + return sizeof(cyruntime.cudaAsyncNotificationInfo_t){{endif}} + {{if 'cudaAsyncCallback' in found_types}} + if objType == cudaAsyncCallback: + return sizeof(cyruntime.cudaAsyncCallback){{endif}} + {{if 'cudaSurfaceObject_t' in found_types}} + if objType == cudaSurfaceObject_t: + return sizeof(cyruntime.cudaSurfaceObject_t){{endif}} + {{if 'cudaTextureDesc' in found_struct}} + if objType == cudaTextureDesc: + return sizeof(cyruntime.cudaTextureDesc){{endif}} + {{if 'cudaTextureObject_t' in found_types}} + if objType == cudaTextureObject_t: + return sizeof(cyruntime.cudaTextureObject_t){{endif}} + {{if 'cudaStreamCallback_t' in found_types}} + if objType == cudaStreamCallback_t: + return sizeof(cyruntime.cudaStreamCallback_t){{endif}} + {{if True}} + if objType == GLenum: + return sizeof(cyruntime.GLenum){{endif}} + {{if True}} + if objType == GLuint: + return sizeof(cyruntime.GLuint){{endif}} + {{if True}} + if objType == EGLImageKHR: + return sizeof(cyruntime.EGLImageKHR){{endif}} + {{if True}} + if objType == EGLStreamKHR: + return sizeof(cyruntime.EGLStreamKHR){{endif}} + {{if True}} + if objType == EGLint: + return sizeof(cyruntime.EGLint){{endif}} + {{if True}} + if objType == EGLSyncKHR: + return sizeof(cyruntime.EGLSyncKHR){{endif}} + {{if True}} + if objType == VdpDevice: + return sizeof(cyruntime.VdpDevice){{endif}} + {{if True}} + if objType == VdpGetProcAddress: + return sizeof(cyruntime.VdpGetProcAddress){{endif}} + {{if True}} + if objType == VdpVideoSurface: + return sizeof(cyruntime.VdpVideoSurface){{endif}} + {{if True}} + if objType == VdpOutputSurface: + return sizeof(cyruntime.VdpOutputSurface){{endif}} + {{if True}} + if objType == cudaStreamAttrValue: + return sizeof(cyruntime.cudaStreamAttrValue){{endif}} + {{if True}} + if objType == cudaKernelNodeAttrValue: + return sizeof(cyruntime.cudaKernelNodeAttrValue){{endif}} + {{if True}} + if objType == cudaEglPlaneDesc_st: + return sizeof(cyruntime.cudaEglPlaneDesc_st){{endif}} + {{if True}} + if objType == cudaEglPlaneDesc: + return sizeof(cyruntime.cudaEglPlaneDesc){{endif}} + {{if True}} + if objType == cudaEglFrame_st: + return sizeof(cyruntime.cudaEglFrame_st){{endif}} + {{if True}} + if objType == cudaEglFrame: + return sizeof(cyruntime.cudaEglFrame){{endif}} + {{if True}} + if objType == cudaEglStreamConnection: + return sizeof(cyruntime.cudaEglStreamConnection){{endif}} + raise TypeError("Unknown type: " + str(objType)) + +cdef int _add_native_handle_getters() except?-1: + from cuda.bindings.utils import _add_cuda_native_handle_getter + {{if 'cudaArray_t' in found_types}} + def cudaArray_t_getter(cudaArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_t, cudaArray_t_getter) + {{endif}} + {{if 'cudaArray_const_t' in found_types}} + def cudaArray_const_t_getter(cudaArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_const_t, cudaArray_const_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_t' in found_types}} + def cudaMipmappedArray_t_getter(cudaMipmappedArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_t, cudaMipmappedArray_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_const_t' in found_types}} + def cudaMipmappedArray_const_t_getter(cudaMipmappedArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_const_t, cudaMipmappedArray_const_t_getter) + {{endif}} + {{if 'cudaStream_t' in found_types}} + def cudaStream_t_getter(cudaStream_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaStream_t, cudaStream_t_getter) + {{endif}} + {{if 'cudaEvent_t' in found_types}} + def cudaEvent_t_getter(cudaEvent_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEvent_t, cudaEvent_t_getter) + {{endif}} + {{if 'cudaGraphicsResource_t' in found_types}} + def cudaGraphicsResource_t_getter(cudaGraphicsResource_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphicsResource_t, cudaGraphicsResource_t_getter) + {{endif}} + {{if 'cudaExternalMemory_t' in found_types}} + def cudaExternalMemory_t_getter(cudaExternalMemory_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalMemory_t, cudaExternalMemory_t_getter) + {{endif}} + {{if 'cudaExternalSemaphore_t' in found_types}} + def cudaExternalSemaphore_t_getter(cudaExternalSemaphore_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalSemaphore_t, cudaExternalSemaphore_t_getter) + {{endif}} + {{if 'cudaGraph_t' in found_types}} + def cudaGraph_t_getter(cudaGraph_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraph_t, cudaGraph_t_getter) + {{endif}} + {{if 'cudaGraphNode_t' in found_types}} + def cudaGraphNode_t_getter(cudaGraphNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphNode_t, cudaGraphNode_t_getter) + {{endif}} + {{if 'cudaUserObject_t' in found_types}} + def cudaUserObject_t_getter(cudaUserObject_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaUserObject_t, cudaUserObject_t_getter) + {{endif}} + {{if 'cudaFunction_t' in found_types}} + def cudaFunction_t_getter(cudaFunction_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaFunction_t, cudaFunction_t_getter) + {{endif}} + {{if 'cudaKernel_t' in found_types}} + def cudaKernel_t_getter(cudaKernel_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaKernel_t, cudaKernel_t_getter) + {{endif}} + {{if 'cudaLibrary_t' in found_types}} + def cudaLibrary_t_getter(cudaLibrary_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaLibrary_t, cudaLibrary_t_getter) + {{endif}} + {{if 'cudaMemPool_t' in found_types}} + def cudaMemPool_t_getter(cudaMemPool_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMemPool_t, cudaMemPool_t_getter) + {{endif}} + {{if 'cudaGraphExec_t' in found_types}} + def cudaGraphExec_t_getter(cudaGraphExec_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphExec_t, cudaGraphExec_t_getter) + {{endif}} + {{if 'cudaGraphDeviceNode_t' in found_types}} + def cudaGraphDeviceNode_t_getter(cudaGraphDeviceNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphDeviceNode_t, cudaGraphDeviceNode_t_getter) + {{endif}} + {{if 'cudaAsyncCallbackHandle_t' in found_types}} + def cudaAsyncCallbackHandle_t_getter(cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaAsyncCallbackHandle_t, cudaAsyncCallbackHandle_t_getter) + {{endif}} + {{if True}} + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + {{endif}} + {{if True}} + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + {{endif}} + {{if True}} + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + {{endif}} + {{if True}} + def cudaEglStreamConnection_getter(cudaEglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEglStreamConnection, cudaEglStreamConnection_getter) + {{endif}} + return 0 +_add_native_handle_getters() + diff --git a/cuda_bindings_12/cuda/bindings/utils/__init__.py b/cuda_bindings_12/cuda/bindings/utils/__init__.py new file mode 100644 index 00000000000..62d083dc7c6 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/utils/__init__.py @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from typing import Any, Callable + +from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver + +_handle_getters: dict[type, Callable[[Any], int]] = {} + + +def _add_cuda_native_handle_getter(t: type, getter: Callable[[Any], int]) -> None: + _handle_getters[t] = getter + + +def get_cuda_native_handle(obj: Any) -> int: + """Returns the address of the provided CUDA Python object as a Python int. + + Parameters + ---------- + obj : Any + CUDA Python object + + Returns + ------- + int : The object address. + """ + obj_type = type(obj) + try: + return _handle_getters[obj_type](obj) + except KeyError: + raise TypeError("Unknown type: " + str(obj_type)) from None diff --git a/cuda_bindings_12/cuda/bindings/utils/_ptx_utils.py b/cuda_bindings_12/cuda/bindings/utils/_ptx_utils.py new file mode 100644 index 00000000000..091fb1fc6f9 --- /dev/null +++ b/cuda_bindings_12/cuda/bindings/utils/_ptx_utils.py @@ -0,0 +1,131 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import re + +# Mapping based on the official PTX ISA <-> CUDA Release table +# https://docs.nvidia.com/cuda/parallel-thread-execution/#release-notes-ptx-release-history +_ptx_to_cuda = { + "1.0": (1, 0), + "1.1": (1, 1), + "1.2": (2, 0), + "1.3": (2, 1), + "1.4": (2, 2), + "2.0": (3, 0), + "2.1": (3, 1), + "2.2": (3, 2), + "2.3": (4, 0), + "3.0": (4, 1), + "3.1": (5, 0), + "3.2": (5, 5), + "4.0": (6, 0), + "4.1": (6, 5), + "4.2": (7, 0), + "4.3": (7, 5), + "5.0": (8, 0), + "6.0": (9, 0), + "6.1": (9, 1), + "6.2": (9, 2), + "6.3": (10, 0), + "6.4": (10, 1), + "6.5": (10, 2), + "7.0": (11, 0), + "7.1": (11, 1), + "7.2": (11, 2), + "7.3": (11, 3), + "7.4": (11, 4), + "7.5": (11, 5), + "7.6": (11, 6), + "7.7": (11, 7), + "7.8": (11, 8), + "8.0": (12, 0), + "8.1": (12, 1), + "8.2": (12, 2), + "8.3": (12, 3), + "8.4": (12, 4), + "8.5": (12, 5), + "8.6": (12, 7), + "8.7": (12, 8), + "8.8": (12, 9), +} + + +def get_minimal_required_cuda_ver_from_ptx_ver(ptx_version: str) -> int: + """ + Maps the PTX ISA version to the minimal CUDA driver, nvPTXCompiler, or nvJitLink version + that is needed to load a PTX of the given ISA version. + + Parameters + ---------- + ptx_version : str + PTX ISA version as a string, e.g. "8.8" for PTX ISA 8.8. This is the ``.version`` + directive in the PTX header. + + Returns + ------- + int + Minimal CUDA version as 1000 * major + 10 * minor, e.g. 12090 for CUDA 12.9. + + Raises + ------ + ValueError + If the PTX version is unknown. + + Examples + -------- + >>> get_minimal_required_driver_ver_from_ptx_ver("8.8") + 12090 + >>> get_minimal_required_driver_ver_from_ptx_ver("7.0") + 11000 + """ + try: + major, minor = _ptx_to_cuda[ptx_version] + return 1000 * major + 10 * minor + except KeyError: + raise ValueError(f"Unknown or unsupported PTX ISA version: {ptx_version}") from None + + +# Regex pattern to match .version directive and capture the version number +# TODO: if import speed is a concern, consider lazy-initializing it. +_ptx_ver_pattern = re.compile(r"\.version\s+([0-9]+\.[0-9]+)") + + +def get_ptx_ver(ptx: str) -> str: + """ + Extract the PTX ISA version string from PTX source code. + + Parameters + ---------- + ptx : str + The PTX assembly source code as a string. + + Returns + ------- + str + The PTX ISA version string, e.g., "8.8". + + Raises + ------ + ValueError + If the .version directive is not found in the PTX source. + + Examples + -------- + >>> ptx = r''' + ... .version 8.8 + ... .target sm_86 + ... .address_size 64 + ... + ... .visible .entry test_kernel() + ... { + ... ret; + ... } + ... ''' + >>> get_ptx_ver(ptx) + '8.8' + """ + m = _ptx_ver_pattern.search(ptx) + if m: + return m.group(1) + else: + raise ValueError("No .version directive found in PTX source. Is it a valid PTX?") diff --git a/cuda_bindings_12/cuda/ccuda.pxd b/cuda_bindings_12/cuda/ccuda.pxd new file mode 100644 index 00000000000..3b3eae369bd --- /dev/null +++ b/cuda_bindings_12/cuda/ccuda.pxd @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cydriver cimport * + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.ccuda module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.cydriver module instead." ) + #else + #warning The cuda.ccuda module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.cydriver module instead. + #endif + """ diff --git a/cuda_bindings_12/cuda/ccuda.pyx b/cuda_bindings_12/cuda/ccuda.pyx new file mode 100644 index 00000000000..1ca31b9f28a --- /dev/null +++ b/cuda_bindings_12/cuda/ccuda.pyx @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cydriver cimport * +from cuda.bindings import cydriver +__pyx_capi__ = cydriver.__pyx_capi__ +del cydriver diff --git a/cuda_bindings_12/cuda/ccudart.pxd b/cuda_bindings_12/cuda/ccudart.pxd new file mode 100644 index 00000000000..b6e5c9b307a --- /dev/null +++ b/cuda_bindings_12/cuda/ccudart.pxd @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cyruntime cimport * + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.ccudart module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.cyruntime module instead." ) + #else + #warning The cuda.ccudart module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.cyruntime module instead. + #endif + """ diff --git a/cuda_bindings_12/cuda/ccudart.pyx b/cuda_bindings_12/cuda/ccudart.pyx new file mode 100644 index 00000000000..bdaa609f2d0 --- /dev/null +++ b/cuda_bindings_12/cuda/ccudart.pyx @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cyruntime cimport * +from cuda.bindings import cyruntime +__pyx_capi__ = cyruntime.__pyx_capi__ +del cyruntime diff --git a/cuda_bindings_12/cuda/cnvrtc.pxd b/cuda_bindings_12/cuda/cnvrtc.pxd new file mode 100644 index 00000000000..c773d667051 --- /dev/null +++ b/cuda_bindings_12/cuda/cnvrtc.pxd @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cynvrtc cimport * + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.cnvrtc module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.cynvrtc module instead." ) + #else + #warning The cuda.cnvrtc module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.cynvrtc module instead. + #endif + """ diff --git a/cuda_bindings_12/cuda/cnvrtc.pyx b/cuda_bindings_12/cuda/cnvrtc.pyx new file mode 100644 index 00000000000..54f74128843 --- /dev/null +++ b/cuda_bindings_12/cuda/cnvrtc.pyx @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings.cynvrtc cimport * +from cuda.bindings import cynvrtc +__pyx_capi__ = cynvrtc.__pyx_capi__ +del cynvrtc diff --git a/cuda_bindings_12/cuda/cuda.pyx b/cuda_bindings_12/cuda/cuda.pyx new file mode 100644 index 00000000000..dfa9d73ed8a --- /dev/null +++ b/cuda_bindings_12/cuda/cuda.pyx @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import warnings as _warnings + +from cuda.bindings.driver import * + + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.cuda module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.driver module instead." ) + #else + #warning The cuda.cuda module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.driver module instead. + #endif + """ + + +_warnings.warn("The cuda.cuda module is deprecated and will be removed in a future release, " + "please switch to use the cuda.bindings.driver module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings_12/cuda/cudart.pyx b/cuda_bindings_12/cuda/cudart.pyx new file mode 100644 index 00000000000..bba378fe76a --- /dev/null +++ b/cuda_bindings_12/cuda/cudart.pyx @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import warnings as _warnings + +from cuda.bindings.runtime import * + + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.cudart module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.runtime module instead." ) + #else + #warning The cuda.cudart module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.runtime module instead. + #endif + """ + + +_warnings.warn("The cuda.cudart module is deprecated and will be removed in a future release, " + "please switch to use the cuda.bindings.runtime module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings_12/cuda/nvrtc.pyx b/cuda_bindings_12/cuda/nvrtc.pyx new file mode 100644 index 00000000000..769392a3ce6 --- /dev/null +++ b/cuda_bindings_12/cuda/nvrtc.pyx @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import warnings as _warnings + +from cuda.bindings.nvrtc import * + + +cdef extern from *: + """ + #ifdef _MSC_VER + #pragma message ( "The cuda.nvrtc module is deprecated and will be removed in a future release, " \ + "please switch to use the cuda.bindings.nvrtc module instead." ) + #else + #warning The cuda.nvrtc module is deprecated and will be removed in a future release, \ + please switch to use the cuda.bindings.nvrtc module instead. + #endif + """ + + +_warnings.warn("The cuda.nvrtc module is deprecated and will be removed in a future release, " + "please switch to use the cuda.bindings.nvrtc module instead.", FutureWarning, stacklevel=2) diff --git a/cuda_bindings_12/docs/Makefile b/cuda_bindings_12/docs/Makefile new file mode 100644 index 00000000000..5d861d28088 --- /dev/null +++ b/cuda_bindings_12/docs/Makefile @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= -j auto +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build/html/${SPHINX_CUDA_BINDINGS_VER} + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -b help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/cuda_bindings_12/docs/README.md b/cuda_bindings_12/docs/README.md new file mode 100644 index 00000000000..a5e65842a8e --- /dev/null +++ b/cuda_bindings_12/docs/README.md @@ -0,0 +1,11 @@ +# Build the documentation + +1. Install the `cuda-bindings` package of the version that we need to document. +2. Ensure the version is included in the [`versions.json`](./versions.json). +3. Build the docs with `./build_docs.sh`. +4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. + +Alternatively, we can build all the docs at once by running [`cuda_python/docs/build_all_docs.sh`](../../cuda_python/docs/build_all_docs.sh). + +To publish the docs with the built version, it is important to note that the html files of older versions +should be kept intact, in order for the version selection (through `versions.json`) to work. diff --git a/cuda_bindings_12/docs/build_docs.sh b/cuda_bindings_12/docs/build_docs.sh new file mode 100755 index 00000000000..1effba90148 --- /dev/null +++ b/cuda_bindings_12/docs/build_docs.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +if [[ "$#" == "0" ]]; then + LATEST_ONLY="0" +elif [[ "$#" == "1" && "$1" == "latest-only" ]]; then + LATEST_ONLY="1" +else + echo "usage: ./build_docs.sh [latest-only]" + exit 1 +fi + +# SPHINX_CUDA_BINDINGS_VER is used to create a subdir under build/html +# (the Makefile file for sphinx-build also honors it if defined). +# If there's a post release (ex: .post1) we don't want it to show up in the +# version selector or directory structure. +if [[ -z "${SPHINX_CUDA_BINDINGS_VER}" ]]; then + export SPHINX_CUDA_BINDINGS_VER=$(python -c "from importlib.metadata import version; \ + ver = '.'.join(str(version('cuda-bindings')).split('.')[:3]); \ + print(ver)" \ + | awk -F'+' '{print $1}') +fi + +# build the docs (in parallel) +SPHINXOPTS="-j 4 -d build/.doctrees" make html + +# for debugging/developing (conf.py), please comment out the above line and +# use the line below instead, as we must build in serial to avoid getting +# obsecure Sphinx errors +#SPHINXOPTS="-v" make html + +# Keep the CUDA 12.9 release pages on the monorepo's shared bindings version +# selector so publishing a legacy line cannot remove newer CUDA 13 entries. +cp ../../cuda_bindings/docs/versions.json build/html/versions.json + +# to have a redirection page (to the latest docs) +cp source/_templates/main.html build/html/index.html + +# ensure that the latest docs is the one we built +if [[ $LATEST_ONLY == "0" ]]; then + cp -r build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest +else + mv build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest +fi + +# ensure that the Sphinx reference uses the latest docs +cp build/html/latest/objects.inv build/html diff --git a/cuda_bindings_12/docs/make.bat b/cuda_bindings_12/docs/make.bat new file mode 100644 index 00000000000..85f34efee44 --- /dev/null +++ b/cuda_bindings_12/docs/make.bat @@ -0,0 +1,38 @@ +@ECHO OFF + +REM SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +REM SPDX-License-Identifier: Apache-2.0 + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/cuda_bindings_12/docs/source/_static/images/Nsight-Compute-CLI-625x473.png b/cuda_bindings_12/docs/source/_static/images/Nsight-Compute-CLI-625x473.png new file mode 100644 index 00000000000..9895798f7cc Binary files /dev/null and b/cuda_bindings_12/docs/source/_static/images/Nsight-Compute-CLI-625x473.png differ diff --git a/cuda_bindings_12/docs/source/_static/javascripts/version_dropdown.js b/cuda_bindings_12/docs/source/_static/javascripts/version_dropdown.js new file mode 100644 index 00000000000..aa0ce2bdc67 --- /dev/null +++ b/cuda_bindings_12/docs/source/_static/javascripts/version_dropdown.js @@ -0,0 +1,61 @@ +// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +function change_current_version(event) { + event.preventDefault(); + + var selectedVersion = event.target.textContent; + var currentVersion = document.getElementById('currentVersion'); + + // need to update both the on-screen state and the internal (persistent) storage + currentVersion.textContent = selectedVersion; + sessionStorage.setItem("currentVersion", selectedVersion); + + // Navigate to the clicked URL + window.location.href = event.target.href; +} + + +function add_version_dropdown(jsonLoc, targetLoc, currentVersion) { + var otherVersionsDiv = document.getElementById('otherVersions'); + + fetch(jsonLoc) + .then(function(response) { + return response.json(); + }) + .then(function(data) { + var versions = data; + + if (Object.keys(versions).length >= 1) { + var dlElement = document.createElement('dl'); + var dtElement = document.createElement('dt'); + dtElement.textContent = 'Versions'; + dlElement.appendChild(dtElement); + + for (var ver in versions) { + var url = versions[ver]; + var ddElement = document.createElement('dd'); + var aElement = document.createElement('a'); + aElement.setAttribute('href', targetLoc + url); + aElement.textContent = ver; + + if (ver === currentVersion) { + var strongElement = document.createElement('strong'); + strongElement.appendChild(aElement); + aElement = strongElement; + } + + ddElement.appendChild(aElement); + // Attach event listeners to version links + ddElement.addEventListener('click', change_current_version); + dlElement.appendChild(ddElement); + } + + otherVersionsDiv.innerHTML = ''; + otherVersionsDiv.appendChild(dlElement); + } + }) + .catch(function(error) { + console.error('Error fetching version.json:', error); + }); +} diff --git a/cuda_bindings_12/docs/source/_static/logo-dark-mode.png b/cuda_bindings_12/docs/source/_static/logo-dark-mode.png new file mode 100644 index 00000000000..6b005a283ba Binary files /dev/null and b/cuda_bindings_12/docs/source/_static/logo-dark-mode.png differ diff --git a/cuda_bindings_12/docs/source/_static/logo-light-mode.png b/cuda_bindings_12/docs/source/_static/logo-light-mode.png new file mode 100644 index 00000000000..c07d6848c98 Binary files /dev/null and b/cuda_bindings_12/docs/source/_static/logo-light-mode.png differ diff --git a/cuda_bindings_12/docs/source/_templates/main.html b/cuda_bindings_12/docs/source/_templates/main.html new file mode 100644 index 00000000000..b5e870a278d --- /dev/null +++ b/cuda_bindings_12/docs/source/_templates/main.html @@ -0,0 +1,13 @@ + + + + + + + + +

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

+ + diff --git a/cuda_bindings_12/docs/source/_templates/sidebar/variant-selector.html b/cuda_bindings_12/docs/source/_templates/sidebar/variant-selector.html new file mode 100644 index 00000000000..b041194c501 --- /dev/null +++ b/cuda_bindings_12/docs/source/_templates/sidebar/variant-selector.html @@ -0,0 +1,24 @@ +
+ + cuda-bindings + v: {{ version }} + + +
+
+
+
+ + + diff --git a/cuda_bindings_12/docs/source/api.rst b/cuda_bindings_12/docs/source/api.rst new file mode 100644 index 00000000000..b011d7b5c27 --- /dev/null +++ b/cuda_bindings_12/docs/source/api.rst @@ -0,0 +1,19 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +------------------------- +CUDA Python API Reference +------------------------- + +.. toctree:: + :maxdepth: 3 + :caption: CaptionHolder: + + module/driver + module/runtime + module/nvrtc + module/nvjitlink + module/nvvm + module/nvfatbin + module/cufile + module/utils diff --git a/cuda_bindings_12/docs/source/conduct.md b/cuda_bindings_12/docs/source/conduct.md new file mode 100644 index 00000000000..80f5032e86e --- /dev/null +++ b/cuda_bindings_12/docs/source/conduct.md @@ -0,0 +1,82 @@ +# Code of Conduct + +## Overview + +Define the code of conduct followed and enforced for the `cuda.bindings` project. + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at +[cuda-python-conduct@nvidia.com](mailto:cuda-python-conduct@nvidia.com) All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an +incident. Further details of specific enforcement policies may be posted +separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/cuda_bindings_12/docs/source/conf.py b/cuda_bindings_12/docs/source/conf.py new file mode 100644 index 00000000000..e3703f41cc9 --- /dev/null +++ b/cuda_bindings_12/docs/source/conf.py @@ -0,0 +1,113 @@ +# 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. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +import os + +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = "cuda.bindings" +copyright = "2021-2025, NVIDIA" +author = "NVIDIA" + +# The full version, including alpha/beta/rc tags +release = os.environ["SPHINX_CUDA_BINDINGS_VER"] + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx.ext.intersphinx", + "myst_nb", + "enum_tools.autoenum", + "sphinx_copybutton", +] + +nb_execution_mode = "off" +numfig = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_baseurl = "docs" +html_theme = "furo" +# html_theme = 'pydata_sphinx_theme' +html_theme_options = { + "light_logo": "logo-light-mode.png", + "dark_logo": "logo-dark-mode.png", + # For pydata_sphinx_theme: + # "logo": { + # "image_light": "_static/logo-light-mode.png", + # "image_dark": "_static/logo-dark-mode.png", + # }, + # "switcher": { + # "json_url": "https://nvidia.github.io/cuda-python/cuda-bindings/versions.json", + # "version_match": release, + # }, + ## Add light/dark mode and documentation version switcher + # "navbar_end": [ + # "search-button", + # "theme-switcher", + # "version-switcher", + # "navbar-icon-links", + # ], +} +if os.environ.get("CI"): + if int(os.environ.get("BUILD_PREVIEW", 0)): + PR_NUMBER = f"{os.environ['PR_NUMBER']}" + PR_TEXT = f'PR {PR_NUMBER}' + html_theme_options["announcement"] = f"Warning: This documentation is only a preview for {PR_TEXT}!" + elif int(os.environ.get("BUILD_LATEST", 0)): + html_theme_options["announcement"] = ( + "Warning: This documentation is built from the development branch!" + ) + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# skip cmdline prompts +copybutton_exclude = ".linenos, .gp" + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "nvvm": ("https://docs.nvidia.com/cuda/libnvvm-api/", None), + "nvjitlink": ("https://docs.nvidia.com/cuda/nvjitlink/", None), + "cufile": ("https://docs.nvidia.com/gpudirect-storage/api-reference-guide/", None), +} + +suppress_warnings = [ + # for warnings about multiple possible targets, see NVIDIA/cuda-python#152 + "ref.python", +] diff --git a/cuda_bindings_12/docs/source/contribute.md b/cuda_bindings_12/docs/source/contribute.md new file mode 100644 index 00000000000..e2f95fab6f2 --- /dev/null +++ b/cuda_bindings_12/docs/source/contribute.md @@ -0,0 +1,17 @@ +# Contributing + +Thank you for your interest in contributing to `cuda-bindings`! Based on the type of contribution, it will fall into two categories: + +1. You want to report a bug, feature request, or documentation issue + - File an [issue](https://github.com/NVIDIA/cuda-python/issues/new/choose) + describing what you encountered or what you want to see changed. + - The NVIDIA team will evaluate the issues and triage them, scheduling + them for a release. If you believe the issue needs priority attention + comment on the issue to notify the team. +2. You want to implement a feature, improvement, or bug fix: + - 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](https://github.com/NVIDIA/cuda-python/blob/main/CONTRIBUTING.md), + including signing off each commit under the Developer Certificate of + Origin (DCO) and cryptographically signing commits. diff --git a/cuda_bindings_12/docs/source/environment_variables.md b/cuda_bindings_12/docs/source/environment_variables.md new file mode 100644 index 00000000000..7329e582cf9 --- /dev/null +++ b/cuda_bindings_12/docs/source/environment_variables.md @@ -0,0 +1,13 @@ +# Environment Variables + +## Build-Time Environment Variables + +- `CUDA_HOME` or `CUDA_PATH`: Specifies the location of the CUDA Toolkit. + +- `CUDA_PYTHON_PARSER_CACHING` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (`CUDA_PYTHON_PARSER_CACHING` is True), the cache path is set to ./cache_, where is derived from the cuda toolkit libraries used to build cuda-bindings. + +- `CUDA_PYTHON_PARALLEL_LEVEL` (previously `PARALLEL_LEVEL`) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds. + +## Runtime Environment Variables + +- `CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM` : When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See [Stream Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html) for an explanation of the legacy and per-thread default streams. diff --git a/cuda_bindings_12/docs/source/index.rst b/cuda_bindings_12/docs/source/index.rst new file mode 100644 index 00000000000..74b456359e8 --- /dev/null +++ b/cuda_bindings_12/docs/source/index.rst @@ -0,0 +1,29 @@ +.. 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 +===================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + release + install.md + overview.md + motivation.md + environment_variables.md + api + tips_and_tricks + support + contribute.md + conduct.md + license + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/cuda_bindings_12/docs/source/install.md b/cuda_bindings_12/docs/source/install.md new file mode 100644 index 00000000000..0673d8e6e57 --- /dev/null +++ b/cuda_bindings_12/docs/source/install.md @@ -0,0 +1,76 @@ +# Installation + +## Runtime Requirements + +`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are: + +* Linux (x86-64, arm64) and Windows (x86-64) +* Python 3.10 - 3.14 +* Driver: Linux (450.80.02 or later) Windows (456.38 or later) +* Optionally, NVRTC, nvJitLink, and NVVM from CUDA Toolkit 12.x + +```{note} +The optional CUDA Toolkit components can be installed via PyPI, Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). +``` + +Starting from v12.8.0, `cuda-python` becomes a meta package which currently depends only on `cuda-bindings`; in the future more sub-packages will be added to `cuda-python`. In the instructions below, we still use `cuda-python` as example to serve existing users, but everything is applicable to `cuda-bindings` as well. + + +## Installing from PyPI + +```console +$ pip install -U cuda-python +``` + +Install all optional dependencies with: +```{code-block} shell +pip install -U cuda-python[all] +``` + +Where the optional dependencies are: + +* nvidia-cuda-nvrtc-cu12 (Provides NVRTC shared library) +* nvidia-nvjitlink-cu12>=12.3 (Provides nvJitLink shared library) +* nvidia-cuda-nvcc-cu12 (Provides NVVM shared library) + + +## Installing from Conda + +```console +$ conda install -c conda-forge cuda-python +``` + + +## Installing from Source + +### Requirements + +* CUDA Toolkit headers[^1] +* CUDA Runtime static library[^2] + +[^1]: User projects that `cimport` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the `cuda.bindings` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. + +[^2]: The CUDA Runtime static library (`libcudart_static.a` on Linux, `cudart_static.lib` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the `cuda-cudart-static` package. + +Source builds require that the provided CUDA headers are of the same major.minor version as the `cuda.bindings` you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the `CUDA_HOME` (or `CUDA_PATH`) environment variable to specify the location of your headers. For example, if your headers are located in `/usr/local/cuda/include`, then you should set `CUDA_HOME` with: + +```console +$ export CUDA_HOME=/usr/local/cuda +``` + +See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. + +```{note} +Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. +``` + + +### Editable Install + +You can use + +```console +$ pip install -v -e . +``` + +to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding). diff --git a/cuda_bindings_12/docs/source/license.rst b/cuda_bindings_12/docs/source/license.rst new file mode 100644 index 00000000000..f5de9869980 --- /dev/null +++ b/cuda_bindings_12/docs/source/license.rst @@ -0,0 +1,8 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Apache License 2.0 +****************** + +.. literalinclude:: ../../LICENSE + :language: text diff --git a/cuda_bindings_12/docs/source/module/cufile.rst b/cuda_bindings_12/docs/source/module/cufile.rst new file mode 100644 index 00000000000..bd51ff26a40 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/cufile.rst @@ -0,0 +1,76 @@ +.. 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 + +cufile +====== + +The ``cuda.bindings.cufile`` Python module wraps the +`cuFile C APIs `_. +Supported on Linux only. + +Currently using this module requires NumPy to be present. Any recent NumPy 1.x or 2.x should work. + + +Functions +--------- + +.. autosummary:: + :toctree: generated/ + + handle_register + handle_deregister + buf_register + buf_deregister + read + write + driver_open + use_count + driver_get_properties + driver_set_poll_mode + driver_set_max_direct_io_size + driver_set_max_cache_size + driver_set_max_pinned_mem_size + batch_io_set_up + batch_io_submit + batch_io_get_status + batch_io_cancel + batch_io_destroy + read_async + write_async + stream_register + stream_deregister + get_version + get_parameter_size_t + get_parameter_bool + get_parameter_string + set_parameter_size_t + set_parameter_bool + set_parameter_string + op_status_error + driver_close + + +Types +----- + +.. autosummary:: + :toctree: generated/ + + IOEvents + Descr + IOParams + OpError + DriverStatusFlags + DriverControlFlags + FeatureFlags + FileHandleType + Opcode + Status + BatchMode + SizeTConfigParameter + BoolConfigParameter + StringConfigParameter + cuFileError diff --git a/cuda_bindings_12/docs/source/module/driver.rst b/cuda_bindings_12/docs/source/module/driver.rst new file mode 100644 index 00000000000..474f72ed5ea --- /dev/null +++ b/cuda_bindings_12/docs/source/module/driver.rst @@ -0,0 +1,7382 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. This code was automatically generated with version 12.9.0. Do not modify it directly. + +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3341eb958de99a8a92ef2f17b31e2e2e5a40e5ba4f563a8bb1e4d94239154141 +------ +driver +------ + +Data types used by CUDA driver +------------------------------ + + + +.. autoclass:: cuda.bindings.driver.CUuuid_st +.. autoclass:: cuda.bindings.driver.CUmemFabricHandle_st +.. autoclass:: cuda.bindings.driver.CUipcEventHandle_st +.. autoclass:: cuda.bindings.driver.CUipcMemHandle_st +.. autoclass:: cuda.bindings.driver.CUstreamBatchMemOpParams_union +.. autoclass:: cuda.bindings.driver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st +.. autoclass:: cuda.bindings.driver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUasyncNotificationInfo_st +.. autoclass:: cuda.bindings.driver.CUdevprop_st +.. autoclass:: cuda.bindings.driver.CUaccessPolicyWindow_st +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_v3_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMSET_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMSET_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUDA_HOST_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_HOST_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUDA_CONDITIONAL_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUgraphEdgeData_st +.. autoclass:: cuda.bindings.driver.CUDA_GRAPH_INSTANTIATE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUlaunchMemSyncDomainMap_st +.. autoclass:: cuda.bindings.driver.CUlaunchAttributeValue_union +.. autoclass:: cuda.bindings.driver.CUlaunchAttribute_st +.. autoclass:: cuda.bindings.driver.CUlaunchConfig_st +.. autoclass:: cuda.bindings.driver.CUexecAffinitySmCount_st +.. autoclass:: cuda.bindings.driver.CUexecAffinityParam_st +.. autoclass:: cuda.bindings.driver.CUctxCigParam_st +.. autoclass:: cuda.bindings.driver.CUctxCreateParams_st +.. autoclass:: cuda.bindings.driver.CUlibraryHostUniversalFunctionAndDataTable_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY2D_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_PEER_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_DESCRIPTOR_st +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY3D_DESCRIPTOR_st +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_SPARSE_PROPERTIES_st +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_TEXTURE_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_VIEW_DESC_st +.. autoclass:: cuda.bindings.driver.CUtensorMap_st +.. autoclass:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st +.. autoclass:: cuda.bindings.driver.CUDA_LAUNCH_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUarrayMapInfo_st +.. autoclass:: cuda.bindings.driver.CUmemLocation_st +.. autoclass:: cuda.bindings.driver.CUmemAllocationProp_st +.. autoclass:: cuda.bindings.driver.CUmulticastObjectProp_st +.. autoclass:: cuda.bindings.driver.CUmemAccessDesc_st +.. autoclass:: cuda.bindings.driver.CUgraphExecUpdateResultInfo_st +.. autoclass:: cuda.bindings.driver.CUmemPoolProps_st +.. autoclass:: cuda.bindings.driver.CUmemPoolPtrExportData_st +.. autoclass:: cuda.bindings.driver.CUmemcpyAttributes_st +.. autoclass:: cuda.bindings.driver.CUoffset3D_st +.. autoclass:: cuda.bindings.driver.CUextent3D_st +.. autoclass:: cuda.bindings.driver.CUmemcpy3DOperand_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_BATCH_OP_st +.. autoclass:: cuda.bindings.driver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st +.. autoclass:: cuda.bindings.driver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st +.. autoclass:: cuda.bindings.driver.CUDA_MEM_FREE_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_CHILD_GRAPH_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUgraphNodeParams_st +.. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs_st +.. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs_st +.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs_st +.. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs_st +.. autoclass:: cuda.bindings.driver.CUeglFrame_st +.. autoclass:: cuda.bindings.driver.CUipcMem_flags + + .. autoattribute:: cuda.bindings.driver.CUipcMem_flags.CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS + + + Automatically enable peer access between remote devices as needed + +.. autoclass:: cuda.bindings.driver.CUmemAttach_flags + + .. autoattribute:: cuda.bindings.driver.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL + + + Memory can be accessed by any stream on any device + + + .. autoattribute:: cuda.bindings.driver.CUmemAttach_flags.CU_MEM_ATTACH_HOST + + + Memory cannot be accessed by any stream on any device + + + .. autoattribute:: cuda.bindings.driver.CUmemAttach_flags.CU_MEM_ATTACH_SINGLE + + + Memory can only be accessed by a single stream on the associated device + +.. autoclass:: cuda.bindings.driver.CUctx_flags + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_AUTO + + + Automatic scheduling + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_SPIN + + + Set spin as default scheduling + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_YIELD + + + Set yield as default scheduling + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_BLOCKING_SYNC + + + Set blocking synchronization as default scheduling + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_BLOCKING_SYNC + + + Set blocking synchronization as default scheduling + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_MASK + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_MAP_HOST + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_LMEM_RESIZE_TO_MAX + + + Keep local memory allocation after launch + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_COREDUMP_ENABLE + + + Trigger coredumps from exceptions in this context + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_USER_COREDUMP_ENABLE + + + Enable user pipe to trigger coredumps in this context + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SYNC_MEMOPS + + + Ensure synchronous memory operations on this context will synchronize + + + .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_FLAGS_MASK + +.. autoclass:: cuda.bindings.driver.CUevent_sched_flags + + .. autoattribute:: cuda.bindings.driver.CUevent_sched_flags.CU_EVENT_SCHED_AUTO + + + Automatic scheduling + + + .. autoattribute:: cuda.bindings.driver.CUevent_sched_flags.CU_EVENT_SCHED_SPIN + + + Set spin as default scheduling + + + .. autoattribute:: cuda.bindings.driver.CUevent_sched_flags.CU_EVENT_SCHED_YIELD + + + Set yield as default scheduling + + + .. autoattribute:: cuda.bindings.driver.CUevent_sched_flags.CU_EVENT_SCHED_BLOCKING_SYNC + + + Set blocking synchronization as default scheduling + +.. autoclass:: cuda.bindings.driver.cl_event_flags + + .. autoattribute:: cuda.bindings.driver.cl_event_flags.NVCL_EVENT_SCHED_AUTO + + + Automatic scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_event_flags.NVCL_EVENT_SCHED_SPIN + + + Set spin as default scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_event_flags.NVCL_EVENT_SCHED_YIELD + + + Set yield as default scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_event_flags.NVCL_EVENT_SCHED_BLOCKING_SYNC + + + Set blocking synchronization as default scheduling + +.. autoclass:: cuda.bindings.driver.cl_context_flags + + .. autoattribute:: cuda.bindings.driver.cl_context_flags.NVCL_CTX_SCHED_AUTO + + + Automatic scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_context_flags.NVCL_CTX_SCHED_SPIN + + + Set spin as default scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_context_flags.NVCL_CTX_SCHED_YIELD + + + Set yield as default scheduling + + + .. autoattribute:: cuda.bindings.driver.cl_context_flags.NVCL_CTX_SCHED_BLOCKING_SYNC + + + Set blocking synchronization as default scheduling + +.. autoclass:: cuda.bindings.driver.CUstream_flags + + .. autoattribute:: cuda.bindings.driver.CUstream_flags.CU_STREAM_DEFAULT + + + Default stream flag + + + .. autoattribute:: cuda.bindings.driver.CUstream_flags.CU_STREAM_NON_BLOCKING + + + Stream does not synchronize with stream 0 (the NULL stream) + +.. autoclass:: cuda.bindings.driver.CUevent_flags + + .. autoattribute:: cuda.bindings.driver.CUevent_flags.CU_EVENT_DEFAULT + + + Default event flag + + + .. autoattribute:: cuda.bindings.driver.CUevent_flags.CU_EVENT_BLOCKING_SYNC + + + Event uses blocking synchronization + + + .. autoattribute:: cuda.bindings.driver.CUevent_flags.CU_EVENT_DISABLE_TIMING + + + Event will not record timing data + + + .. autoattribute:: cuda.bindings.driver.CUevent_flags.CU_EVENT_INTERPROCESS + + + Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set + +.. autoclass:: cuda.bindings.driver.CUevent_record_flags + + .. autoattribute:: cuda.bindings.driver.CUevent_record_flags.CU_EVENT_RECORD_DEFAULT + + + Default event record flag + + + .. autoattribute:: cuda.bindings.driver.CUevent_record_flags.CU_EVENT_RECORD_EXTERNAL + + + When using stream capture, create an event record node instead of the default behavior. This flag is invalid when used outside of capture. + +.. autoclass:: cuda.bindings.driver.CUevent_wait_flags + + .. autoattribute:: cuda.bindings.driver.CUevent_wait_flags.CU_EVENT_WAIT_DEFAULT + + + Default event wait flag + + + .. autoattribute:: cuda.bindings.driver.CUevent_wait_flags.CU_EVENT_WAIT_EXTERNAL + + + When using stream capture, create an event wait node instead of the default behavior. This flag is invalid when used outside of capture. + +.. autoclass:: cuda.bindings.driver.CUstreamWaitValue_flags + + .. 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.) + + + .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_EQ + + + Wait until \*addr == value. + + + .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_AND + + + 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`. + + + .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_FLUSH + + + Follow the wait operation with a flush of outstanding remote writes. This means that, if a remote write operation is guaranteed to have reached the device before the wait can be satisfied, that write is guaranteed to be visible to downstream device work. The device is permitted to reorder remote writes internally. For example, this flag would be required if two remote writes arrive in a defined order, the wait is satisfied by the second write, and downstream work needs to observe the first write. Support for this operation is restricted to selected platforms and can be queried with :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES`. + +.. autoclass:: cuda.bindings.driver.CUstreamWriteValue_flags + + .. autoattribute:: cuda.bindings.driver.CUstreamWriteValue_flags.CU_STREAM_WRITE_VALUE_DEFAULT + + + Default behavior + + + .. autoattribute:: cuda.bindings.driver.CUstreamWriteValue_flags.CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER + + + Permits the write to be reordered with writes which were issued before it, as a performance optimization. Normally, :py:obj:`~.cuStreamWriteValue32` will provide a memory fence before the write, which has similar semantics to __threadfence_system() but is scoped to the stream rather than a CUDA thread. This flag is not supported in the v2 API. + +.. autoclass:: cuda.bindings.driver.CUstreamBatchMemOpType + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_32 + + + Represents a :py:obj:`~.cuStreamWaitValue32` operation + + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WRITE_VALUE_32 + + + Represents a :py:obj:`~.cuStreamWriteValue32` operation + + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_64 + + + Represents a :py:obj:`~.cuStreamWaitValue64` operation + + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WRITE_VALUE_64 + + + Represents a :py:obj:`~.cuStreamWriteValue64` operation + + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_BARRIER + + + Insert a memory barrier of the specified type + + + .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES + + + This has the same effect as :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH`, but as a standalone operation. + +.. autoclass:: cuda.bindings.driver.CUstreamMemoryBarrier_flags + + .. autoattribute:: cuda.bindings.driver.CUstreamMemoryBarrier_flags.CU_STREAM_MEMORY_BARRIER_TYPE_SYS + + + System-wide memory barrier. + + + .. autoattribute:: cuda.bindings.driver.CUstreamMemoryBarrier_flags.CU_STREAM_MEMORY_BARRIER_TYPE_GPU + + + Limit memory barrier scope to the GPU. + +.. autoclass:: cuda.bindings.driver.CUoccupancy_flags + + .. autoattribute:: cuda.bindings.driver.CUoccupancy_flags.CU_OCCUPANCY_DEFAULT + + + Default behavior + + + .. autoattribute:: cuda.bindings.driver.CUoccupancy_flags.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE + + + Assume global caching is enabled and cannot be automatically turned off + +.. autoclass:: cuda.bindings.driver.CUstreamUpdateCaptureDependencies_flags + + .. autoattribute:: cuda.bindings.driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_ADD_CAPTURE_DEPENDENCIES + + + Add new nodes to the dependency set + + + .. autoattribute:: cuda.bindings.driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_SET_CAPTURE_DEPENDENCIES + + + Replace the dependency set with the new nodes + +.. autoclass:: cuda.bindings.driver.CUasyncNotificationType + + .. autoattribute:: cuda.bindings.driver.CUasyncNotificationType.CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET + + + Sent when the process has exceeded its device memory budget + +.. autoclass:: cuda.bindings.driver.CUarray_format + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNSIGNED_INT8 + + + Unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNSIGNED_INT16 + + + Unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNSIGNED_INT32 + + + Unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SIGNED_INT8 + + + Signed 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SIGNED_INT16 + + + Signed 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SIGNED_INT32 + + + Signed 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_HALF + + + 16-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_FLOAT + + + 32-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_NV12 + + + 8-bit YUV planar format, with 4:2:0 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT8X1 + + + 1 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT8X2 + + + 2 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT8X4 + + + 4 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT16X1 + + + 1 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT16X2 + + + 2 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT16X4 + + + 4 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT8X1 + + + 1 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT8X2 + + + 2 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT8X4 + + + 4 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT16X1 + + + 1 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT16X2 + + + 2 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_SNORM_INT16X4 + + + 4 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC1_UNORM + + + 4 channel unsigned normalized block-compressed (BC1 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC1_UNORM_SRGB + + + 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC2_UNORM + + + 4 channel unsigned normalized block-compressed (BC2 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC2_UNORM_SRGB + + + 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC3_UNORM + + + 4 channel unsigned normalized block-compressed (BC3 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC3_UNORM_SRGB + + + 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC4_UNORM + + + 1 channel unsigned normalized block-compressed (BC4 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC4_SNORM + + + 1 channel signed normalized block-compressed (BC4 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC5_UNORM + + + 2 channel unsigned normalized block-compressed (BC5 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC5_SNORM + + + 2 channel signed normalized block-compressed (BC5 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC6H_UF16 + + + 3 channel unsigned half-float block-compressed (BC6H compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC6H_SF16 + + + 3 channel signed half-float block-compressed (BC6H compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC7_UNORM + + + 4 channel unsigned normalized block-compressed (BC7 compression) format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_BC7_UNORM_SRGB + + + 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_P010 + + + 10-bit YUV planar format, with 4:2:0 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_P016 + + + 16-bit YUV planar format, with 4:2:0 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_NV16 + + + 8-bit YUV planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_P210 + + + 10-bit YUV planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_P216 + + + 16-bit YUV planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_YUY2 + + + 2 channel, 8-bit YUV packed planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y210 + + + 2 channel, 10-bit YUV packed planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y216 + + + 2 channel, 16-bit YUV packed planar format, with 4:2:2 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_AYUV + + + 4 channel, 8-bit YUV packed planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y410 + + + 10-bit YUV packed planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y416 + + + 4 channel, 12-bit YUV packed planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y444_PLANAR8 + + + 3 channel 8-bit YUV planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_Y444_PLANAR10 + + + 3 channel 10-bit YUV planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_YUV444_8bit_SemiPlanar + + + 3 channel 8-bit YUV semi-planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_YUV444_16bit_SemiPlanar + + + 3 channel 16-bit YUV semi-planar format, with 4:4:4 sampling + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_UNORM_INT_101010_2 + + + 4 channel unorm R10G10B10A2 RGB format + + + .. autoattribute:: cuda.bindings.driver.CUarray_format.CU_AD_FORMAT_MAX + +.. autoclass:: cuda.bindings.driver.CUaddress_mode + + .. autoattribute:: cuda.bindings.driver.CUaddress_mode.CU_TR_ADDRESS_MODE_WRAP + + + Wrapping address mode + + + .. autoattribute:: cuda.bindings.driver.CUaddress_mode.CU_TR_ADDRESS_MODE_CLAMP + + + Clamp to edge address mode + + + .. autoattribute:: cuda.bindings.driver.CUaddress_mode.CU_TR_ADDRESS_MODE_MIRROR + + + Mirror address mode + + + .. autoattribute:: cuda.bindings.driver.CUaddress_mode.CU_TR_ADDRESS_MODE_BORDER + + + Border address mode + +.. autoclass:: cuda.bindings.driver.CUfilter_mode + + .. autoattribute:: cuda.bindings.driver.CUfilter_mode.CU_TR_FILTER_MODE_POINT + + + Point filter mode + + + .. autoattribute:: cuda.bindings.driver.CUfilter_mode.CU_TR_FILTER_MODE_LINEAR + + + Linear filter mode + +.. autoclass:: cuda.bindings.driver.CUdevice_attribute + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK + + + Maximum number of threads per block + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X + + + Maximum block dimension X + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y + + + Maximum block dimension Y + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z + + + Maximum block dimension Z + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X + + + Maximum grid dimension X + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y + + + Maximum grid dimension Y + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z + + + Maximum grid dimension Z + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK + + + Maximum shared memory available per block in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK + + + Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY + + + Memory available on device for constant variables in a CUDA C kernel in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_WARP_SIZE + + + Warp size in threads + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_PITCH + + + Maximum pitch in bytes allowed by memory copies + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK + + + Maximum number of 32-bit registers available per block + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK + + + Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CLOCK_RATE + + + Typical clock frequency in kilohertz + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT + + + Alignment requirement for textures + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP + + + Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use instead CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT + + + Number of multiprocessors on device + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT + + + Specifies whether there is a run time limit on kernels + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_INTEGRATED + + + Device is integrated with host memory + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY + + + Device can map host memory into CUDA address space + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE + + + Compute mode (See :py:obj:`~.CUcomputemode` for details) + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH + + + Maximum 1D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH + + + Maximum 2D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT + + + Maximum 2D texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH + + + Maximum 3D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT + + + Maximum 3D texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH + + + Maximum 3D texture depth + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH + + + Maximum 2D layered texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT + + + Maximum 2D layered texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS + + + Maximum layers in a 2D layered texture + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH + + + Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT + + + Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES + + + Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT + + + Alignment requirement for surfaces + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS + + + Device can possibly execute multiple kernels concurrently + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_ECC_ENABLED + + + Device has ECC support enabled + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID + + + PCI bus ID of the device + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID + + + PCI device ID of the device + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TCC_DRIVER + + + Device is using TCC driver model + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE + + + Peak memory clock frequency in kilohertz + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH + + + Global memory bus width in bits + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE + + + Size of L2 cache in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR + + + Maximum resident threads per multiprocessor + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT + + + Number of asynchronous engines + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING + + + Device shares a unified address space with the host + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH + + + Maximum 1D layered texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS + + + Maximum layers in a 1D layered texture + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER + + + Deprecated, do not use. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH + + + Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT + + + Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE + + + Alternate maximum 3D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE + + + Alternate maximum 3D texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE + + + Alternate maximum 3D texture depth + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID + + + PCI domain ID of the device + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT + + + Pitch alignment requirement for textures + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH + + + Maximum cubemap texture width/height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH + + + Maximum cubemap layered texture width/height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS + + + Maximum layers in a cubemap layered texture + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH + + + Maximum 1D surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH + + + Maximum 2D surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT + + + Maximum 2D surface height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH + + + Maximum 3D surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT + + + Maximum 3D surface height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH + + + Maximum 3D surface depth + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH + + + Maximum 1D layered surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS + + + Maximum layers in a 1D layered surface + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH + + + Maximum 2D layered surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT + + + Maximum 2D layered surface height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS + + + Maximum layers in a 2D layered surface + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH + + + Maximum cubemap surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH + + + Maximum cubemap layered surface width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS + + + Maximum layers in a cubemap layered surface + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH + + + Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() or :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth()` instead. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH + + + Maximum 2D linear texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT + + + Maximum 2D linear texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH + + + Maximum 2D linear texture pitch in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH + + + Maximum mipmapped 2D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT + + + Maximum mipmapped 2D texture height + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR + + + Major compute capability version number + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR + + + Minor compute capability version number + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH + + + Maximum mipmapped 1D texture width + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED + + + Device supports stream priorities + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED + + + Device supports caching globals in L1 + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED + + + Device supports caching locals in L1 + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR + + + Maximum shared memory available per multiprocessor in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR + + + Maximum number of 32-bit registers available per multiprocessor + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY + + + Device can allocate managed memory on this system + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD + + + Device is on a multi-GPU board + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID + + + Unique id for a group of devices on the same multi-GPU board + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED + + + Link between the device and the host supports native atomic operations + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO + + + Ratio of single precision performance (in floating-point operations per second) to double precision performance + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS + + + Device supports coherently accessing pageable memory without calling cudaHostRegister on it + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS + + + Device can coherently access managed memory concurrently with the CPU + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED + + + Device supports compute preemption. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM + + + Device can access host registered memory at the same virtual address as the CPU + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 + + + Deprecated, along with v1 MemOps API, :py:obj:`~.cuStreamBatchMemOp` and related APIs are supported. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 + + + Deprecated, along with v1 MemOps API, 64-bit operations are supported in :py:obj:`~.cuStreamBatchMemOp` and related APIs. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 + + + Deprecated, along with v1 MemOps API, :py:obj:`~.CU_STREAM_WAIT_VALUE_NOR` is supported. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH + + + Device supports launching cooperative kernels via :py:obj:`~.cuLaunchCooperativeKernel` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH + + + Deprecated, :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` is deprecated. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN + + + Maximum optin shared memory per block + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES + + + 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 device. See :py:obj:`~.Stream Memory Operations` for additional details. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED + + + Device supports host memory registration via :py:obj:`~.cudaHostRegister`. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES + + + Device accesses pageable memory via the host's page tables. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST + + + The host can directly access managed memory on the device without migration. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED + + + Deprecated, Use CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + + + Device supports virtual memory management APIs like :py:obj:`~.cuMemAddressReserve`, :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED + + + Device supports exporting memory to a posix file descriptor with :py:obj:`~.cuMemExportToShareableHandle`, if requested via :py:obj:`~.cuMemCreate` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED + + + Device supports exporting memory to a Win32 NT handle with :py:obj:`~.cuMemExportToShareableHandle`, if requested via :py:obj:`~.cuMemCreate` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED + + + Device supports exporting memory to a Win32 KMT handle with :py:obj:`~.cuMemExportToShareableHandle`, if requested via :py:obj:`~.cuMemCreate` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR + + + Maximum number of blocks per multiprocessor + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED + + + Device supports compression of memory + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE + + + Maximum L2 persisting lines capacity setting in bytes. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE + + + Maximum value of :py:obj:`~.CUaccessPolicyWindow.num_bytes`. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED + + + Device supports specifying the GPUDirect RDMA flag with :py:obj:`~.cuMemCreate` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK + + + Shared memory reserved by CUDA driver per block in bytes + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED + + + Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED + + + Device supports using the :py:obj:`~.cuMemHostRegister` flag :py:obj:`~.CU_MEMHOSTERGISTER_READ_ONLY` to register memory that must be mapped as read-only to the GPU + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED + + + External timeline semaphore interop is supported on the device + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED + + + Device supports using the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED + + + Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information) + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS + + + The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the :py:obj:`~.CUflushGPUDirectRDMAWritesOptions` enum + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING + + + GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute. See :py:obj:`~.CUGPUDirectRDMAWritesOrdering` for the numerical values returned here. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES + + + Handle types supported with mempool based IPC + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH + + + Indicates device supports cluster launch + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED + + + Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS + + + 64-bit operations are supported in :py:obj:`~.cuStreamBatchMemOp` and related MemOp APIs. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR + + + :py:obj:`~.CU_STREAM_WAIT_VALUE_NOR` is supported by MemOp APIs. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED + + + Device supports buffer sharing with dma_buf mechanism. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED + + + Device supports IPC Events. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT + + + Number of memory domains the device supports. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED + + + Device supports accessing memory using Tensor Map. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED + + + Device supports exporting memory to a fabric handle with :py:obj:`~.cuMemExportToShareableHandle()` or requested with :py:obj:`~.cuMemCreate()` + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS + + + Device supports unified function pointers. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_NUMA_CONFIG + + + NUMA configuration of a device: value is of type :py:obj:`~.CUdeviceNumaConfig` enum + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_NUMA_ID + + + NUMA node ID of the GPU memory + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED + + + Device supports switch multicast and reduction operations. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MPS_ENABLED + + + Indicates if contexts created on this device will be shared via MPS + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID + + + NUMA ID of the host node closest to the device. Returns -1 when system does not support NUMA. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED + + + Device supports CIG with D3D12. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK + + + The returned valued shall be interpreted as a bitmask, where the individual bits are described by the :py:obj:`~.CUmemDecompressAlgorithm` enum. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH + + + The returned valued is the maximum length in bytes of a single decompress operation that is allowed. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED + + + Device supports CIG with Vulkan. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID + + + The combined 16-bit PCI device ID and 16-bit PCI vendor ID. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID + + + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + + + Device supports HOST_NUMA location with the virtual memory management APIs like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED + + + Device supports HOST_NUMA location with the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED + + + Device supports HOST_NUMA location IPC between nodes in a multi-node system. + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX + +.. autoclass:: cuda.bindings.driver.CUpointer_attribute + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_CONTEXT + + + The :py:obj:`~.CUcontext` on which a pointer was allocated or registered + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE + + + The :py:obj:`~.CUmemorytype` describing the physical location of a pointer + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_POINTER + + + The address at which a pointer's memory may be accessed on the device + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_HOST_POINTER + + + The address at which a pointer's memory may be accessed on the host + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_P2P_TOKENS + + + A pair of tokens for use with the nv-p2p.h Linux kernel interface + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS + + + Synchronize every synchronous memory operation initiated on this region + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_BUFFER_ID + + + A process-wide unique ID for an allocated memory region + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED + + + Indicates if the pointer points to managed memory + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL + + + A device ordinal of a device on which a pointer was allocated or registered + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE + + + 1 if this pointer maps to an allocation that is suitable for :py:obj:`~.cudaIpcGetMemHandle`, 0 otherwise + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR + + + Starting address for this requested pointer + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_SIZE + + + Size of the address range for this requested pointer + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPED + + + 1 if this pointer is in a valid address range that is mapped to a backing allocation, 0 otherwise + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES + + + Bitmask of allowed :py:obj:`~.CUmemAllocationHandleType` for this allocation + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE + + + 1 if the memory this pointer is referencing can be used with the GPUDirect RDMA API + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS + + + Returns the access flags the device associated with the current context has on the corresponding memory referenced by the pointer given + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE + + + Returns the mempool handle for the allocation if it was allocated from a mempool. Otherwise returns NULL. + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPING_SIZE + + + Size of the actual underlying mapping that the pointer belongs to + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR + + + The start address of the mapping that the pointer belongs to + + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID + + + A process-wide unique id corresponding to the physical allocation the pointer belongs to + + + .. 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. + +.. autoclass:: cuda.bindings.driver.CUfunction_attribute + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK + + + The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the function and the device on which the function is currently loaded. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES + + + The size in bytes of statically-allocated shared memory required by this function. This does not include dynamically-allocated shared memory requested by the user at runtime. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES + + + The size in bytes of user-allocated constant memory required by this function. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES + + + The size in bytes of local memory used by each thread of this function. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_NUM_REGS + + + The number of registers used by each thread of this function. + + + .. 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. + + + .. 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. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA + + + The attribute to indicate whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set . + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES + + + The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + + + On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. Refer to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`. This is only a hint, and the driver can choose a different ratio if required to execute the function. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET + + + If this attribute is set, the kernel must launch with a valid cluster size specified. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH + + + The required cluster width in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. + + + + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT + + + The required cluster height in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. + + + + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH + + + The required cluster depth in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. + + + + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED + + + Whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. + + + + CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. + + + + Portable Cluster Size + + + + A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. + + + + The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE + + + 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_MAX + +.. autoclass:: cuda.bindings.driver.CUfunc_cache + + .. autoattribute:: cuda.bindings.driver.CUfunc_cache.CU_FUNC_CACHE_PREFER_NONE + + + no preference for shared memory or L1 (default) + + + .. autoattribute:: cuda.bindings.driver.CUfunc_cache.CU_FUNC_CACHE_PREFER_SHARED + + + prefer larger shared memory and smaller L1 cache + + + .. autoattribute:: cuda.bindings.driver.CUfunc_cache.CU_FUNC_CACHE_PREFER_L1 + + + prefer larger L1 cache and smaller shared memory + + + .. autoattribute:: cuda.bindings.driver.CUfunc_cache.CU_FUNC_CACHE_PREFER_EQUAL + + + prefer equal sized L1 cache and shared memory + +.. autoclass:: cuda.bindings.driver.CUsharedconfig + + .. autoattribute:: cuda.bindings.driver.CUsharedconfig.CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE + + + set default shared memory bank size + + + .. autoattribute:: cuda.bindings.driver.CUsharedconfig.CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE + + + set shared memory bank width to four bytes + + + .. autoattribute:: cuda.bindings.driver.CUsharedconfig.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE + + + set shared memory bank width to eight bytes + +.. autoclass:: cuda.bindings.driver.CUshared_carveout + + .. autoattribute:: cuda.bindings.driver.CUshared_carveout.CU_SHAREDMEM_CARVEOUT_DEFAULT + + + No preference for shared memory or L1 (default) + + + .. autoattribute:: cuda.bindings.driver.CUshared_carveout.CU_SHAREDMEM_CARVEOUT_MAX_SHARED + + + Prefer maximum available shared memory, minimum L1 cache + + + .. autoattribute:: cuda.bindings.driver.CUshared_carveout.CU_SHAREDMEM_CARVEOUT_MAX_L1 + + + Prefer maximum available L1 cache, minimum shared memory + +.. autoclass:: cuda.bindings.driver.CUmemorytype + + .. autoattribute:: cuda.bindings.driver.CUmemorytype.CU_MEMORYTYPE_HOST + + + Host memory + + + .. autoattribute:: cuda.bindings.driver.CUmemorytype.CU_MEMORYTYPE_DEVICE + + + Device memory + + + .. autoattribute:: cuda.bindings.driver.CUmemorytype.CU_MEMORYTYPE_ARRAY + + + Array memory + + + .. autoattribute:: cuda.bindings.driver.CUmemorytype.CU_MEMORYTYPE_UNIFIED + + + Unified device or host memory + +.. autoclass:: cuda.bindings.driver.CUcomputemode + + .. autoattribute:: cuda.bindings.driver.CUcomputemode.CU_COMPUTEMODE_DEFAULT + + + Default compute mode (Multiple contexts allowed per device) + + + .. autoattribute:: cuda.bindings.driver.CUcomputemode.CU_COMPUTEMODE_PROHIBITED + + + Compute-prohibited mode (No contexts can be created on this device at this time) + + + .. autoattribute:: cuda.bindings.driver.CUcomputemode.CU_COMPUTEMODE_EXCLUSIVE_PROCESS + + + Compute-exclusive-process mode (Only one context used by a single process can be present on this device at a time) + +.. autoclass:: cuda.bindings.driver.CUmem_advise + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY + + + Data will mostly be read and only occasionally be written to + + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_UNSET_READ_MOSTLY + + + Undo the effect of :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` + + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_SET_PREFERRED_LOCATION + + + Set the preferred location for the data as the specified device + + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION + + + Clear the preferred location for the data + + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY + + + Data will be accessed by the specified device, so prevent page faults as much as possible + + + .. autoattribute:: cuda.bindings.driver.CUmem_advise.CU_MEM_ADVISE_UNSET_ACCESSED_BY + + + Let the Unified Memory subsystem decide on the page faulting policy for the specified device + +.. autoclass:: cuda.bindings.driver.CUmem_range_attribute + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY + + + Whether the range will mostly be read and only occasionally be written to + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION + + + The preferred location of the range + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY + + + Memory range has :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` set for specified device + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION + + + The last location to which the range was prefetched + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE + + + The preferred location type of the range + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID + + + The preferred location id of the range + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE + + + The last location type to which the range was prefetched + + + .. autoattribute:: cuda.bindings.driver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID + + + The last location id to which the range was prefetched + +.. autoclass:: cuda.bindings.driver.CUjit_option + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_MAX_REGISTERS + + + Max number of registers that a thread may use. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_THREADS_PER_BLOCK + + + 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. + + Cannot be combined with :py:obj:`~.CU_JIT_TARGET`. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_WALL_TIME + + + Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker + + Option type: float + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_INFO_LOG_BUFFER + + + 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 \* + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES + + + 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 + + Option type: unsigned int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_ERROR_LOG_BUFFER + + + 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 \* + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES + + + 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 + + Option type: unsigned int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_OPTIMIZATION_LEVEL + + + Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_TARGET_FROM_CUCONTEXT + + + No option value required. Determines the target based on the current attached context (default) + + Option type: No option value needed + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_TARGET + + + Target is chosen based on supplied :py:obj:`~.CUjit_target`. Cannot be combined with :py:obj:`~.CU_JIT_THREADS_PER_BLOCK`. + + Option type: unsigned int for enumerated type :py:obj:`~.CUjit_target` + + Applies to: compiler and linker + + + .. 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. + + Option type: unsigned int for enumerated type :py:obj:`~.CUjit_fallback` + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_GENERATE_DEBUG_INFO + + + Specifies whether to create debug information in output (-g) (0: false, default) + + Option type: int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_LOG_VERBOSE + + + Generate verbose log messages (0: false, default) + + Option type: int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_GENERATE_LINE_INFO + + + Generate line number information (-lineinfo) (0: false, default) + + Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_CACHE_MODE + + + Specifies whether to enable caching explicitly (-dlcm) + + Choice is based on supplied :py:obj:`~.CUjit_cacheMode_enum`. + + Option type: unsigned int for enumerated type :py:obj:`~.CUjit_cacheMode_enum` + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_NEW_SM3X_OPT + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_FAST_COMPILE + + + This jit option is used for internal purpose only. + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_GLOBAL_SYMBOL_NAMES + + + Array of device symbol names that will be relocated to the corresponding host addresses stored in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_ADDRESSES`. + + Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries. + + When loading a device module, driver will relocate all encountered unresolved symbols to the host addresses. + + It is only allowed to register symbols that correspond to unresolved global variables. + + It is illegal to register the same device symbol at multiple addresses. + + Option type: const char \*\* + + Applies to: dynamic linker only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_GLOBAL_SYMBOL_ADDRESSES + + + Array of host addresses that will be used to relocate corresponding device symbols stored in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_NAMES`. + + Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries. + + Option type: void \*\* + + Applies to: dynamic linker only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_GLOBAL_SYMBOL_COUNT + + + Number of entries in :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_NAMES` and :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_ADDRESSES` arrays. + + Option type: unsigned int + + Applies to: dynamic linker only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_LTO + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_FTZ + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_PREC_DIV + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_PREC_SQRT + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_FMA + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_REFERENCED_KERNEL_NAMES + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_REFERENCED_KERNEL_COUNT + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_REFERENCED_VARIABLE_NAMES + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_REFERENCED_VARIABLE_COUNT + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_POSITION_INDEPENDENT_CODE + + + Generate position independent code (0: false) + + Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_MIN_CTA_PER_SM + + + 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:`~.CU_JIT_MAX_REGISTERS` or :py:obj:`~.CU_JIT_THREADS_PER_BLOCK`. Optimizations based on this option need :py:obj:`~.CU_JIT_MAX_THREADS_PER_BLOCK` to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use :py:obj:`~.CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to let this option take precedence over the PTX directive. Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_MAX_THREADS_PER_BLOCK + + + 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:`~.CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to let this option take precedence over the PTX directive. Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_OVERRIDE_DIRECTIVE_VALUES + + + This option lets the values specified using :py:obj:`~.CU_JIT_MAX_REGISTERS`, :py:obj:`~.CU_JIT_THREADS_PER_BLOCK`, :py:obj:`~.CU_JIT_MAX_THREADS_PER_BLOCK` and :py:obj:`~.CU_JIT_MIN_CTA_PER_SM` take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_NUM_OPTIONS + +.. autoclass:: cuda.bindings.driver.CUjit_target + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_30 + + + Compute device class 3.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_32 + + + Compute device class 3.2 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_35 + + + Compute device class 3.5 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_37 + + + Compute device class 3.7 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_50 + + + Compute device class 5.0 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_52 + + + Compute device class 5.2 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_53 + + + Compute device class 5.3 + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_60 + + + Compute device class 6.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_61 + + + Compute device class 6.1. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_62 + + + Compute device class 6.2. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_70 + + + Compute device class 7.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_72 + + + Compute device class 7.2. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_75 + + + Compute device class 7.5. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_80 + + + Compute device class 8.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_86 + + + Compute device class 8.6. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_87 + + + Compute device class 8.7. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_89 + + + Compute device class 8.9. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_90 + + + Compute device class 9.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_100 + + + Compute device class 10.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101 + + + Compute device class 10.1. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103 + + + Compute device class 10.3. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_120 + + + Compute device class 12.0. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_121 + + + Compute device class 12.1. Compute device class 9.0. with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_90A + + + Compute device class 10.0. with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_100A + + + Compute device class 10.1 with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101A + + + Compute device class 10.3. with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103A + + + Compute device class 12.0. with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_120A + + + Compute device class 12.1. with accelerated features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_121A + + + Compute device class 10.x with family features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_100F + + + Compute device class 10.1 with family features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_101F + + + Compute device class 10.3. with family features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103F + + + Compute device class 12.0. with family features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_120F + + + Compute device class 12.1. with family features. + + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_121F + +.. autoclass:: cuda.bindings.driver.CUjit_fallback + + .. autoattribute:: cuda.bindings.driver.CUjit_fallback.CU_PREFER_PTX + + + Prefer to compile ptx if exact binary match not found + + + .. autoattribute:: cuda.bindings.driver.CUjit_fallback.CU_PREFER_BINARY + + + Prefer to fall back to compatible binary code if exact match not found + +.. autoclass:: cuda.bindings.driver.CUjit_cacheMode + + .. autoattribute:: cuda.bindings.driver.CUjit_cacheMode.CU_JIT_CACHE_OPTION_NONE + + + Compile with no -dlcm flag specified + + + .. autoattribute:: cuda.bindings.driver.CUjit_cacheMode.CU_JIT_CACHE_OPTION_CG + + + Compile with L1 cache disabled + + + .. autoattribute:: cuda.bindings.driver.CUjit_cacheMode.CU_JIT_CACHE_OPTION_CA + + + Compile with L1 cache enabled + +.. autoclass:: cuda.bindings.driver.CUjitInputType + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_CUBIN + + + Compiled device-class-specific device code + + Applicable options: none + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_PTX + + + PTX source code + + Applicable options: PTX compiler options + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_FATBINARY + + + Bundle of multiple cubins and/or PTX of some device code + + Applicable options: PTX compiler options, :py:obj:`~.CU_JIT_FALLBACK_STRATEGY` + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_OBJECT + + + Host object with embedded device code + + Applicable options: PTX compiler options, :py:obj:`~.CU_JIT_FALLBACK_STRATEGY` + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_LIBRARY + + + Archive of host objects with embedded device code + + Applicable options: PTX compiler options, :py:obj:`~.CU_JIT_FALLBACK_STRATEGY` + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_INPUT_NVVM + + + [Deprecated] + + + + Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0 + + + .. autoattribute:: cuda.bindings.driver.CUjitInputType.CU_JIT_NUM_INPUT_TYPES + +.. autoclass:: cuda.bindings.driver.CUgraphicsRegisterFlags + + .. autoattribute:: cuda.bindings.driver.CUgraphicsRegisterFlags.CU_GRAPHICS_REGISTER_FLAGS_NONE + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsRegisterFlags.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsRegisterFlags.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsRegisterFlags.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsRegisterFlags.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER + +.. autoclass:: cuda.bindings.driver.CUgraphicsMapResourceFlags + + .. autoattribute:: cuda.bindings.driver.CUgraphicsMapResourceFlags.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsMapResourceFlags.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY + + + .. autoattribute:: cuda.bindings.driver.CUgraphicsMapResourceFlags.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD + +.. autoclass:: cuda.bindings.driver.CUarray_cubemap_face + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_POSITIVE_X + + + Positive X face of cubemap + + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_NEGATIVE_X + + + Negative X face of cubemap + + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_POSITIVE_Y + + + Positive Y face of cubemap + + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_NEGATIVE_Y + + + Negative Y face of cubemap + + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_POSITIVE_Z + + + Positive Z face of cubemap + + + .. autoattribute:: cuda.bindings.driver.CUarray_cubemap_face.CU_CUBEMAP_FACE_NEGATIVE_Z + + + Negative Z face of cubemap + +.. autoclass:: cuda.bindings.driver.CUlimit + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_STACK_SIZE + + + GPU thread stack size + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_PRINTF_FIFO_SIZE + + + GPU printf FIFO size + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_MALLOC_HEAP_SIZE + + + GPU malloc heap size + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH + + + GPU device runtime launch synchronize depth + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT + + + GPU device runtime pending launch count + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_MAX_L2_FETCH_GRANULARITY + + + A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_PERSISTING_L2_CACHE_SIZE + + + A size in bytes for L2 persisting lines cache size + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_SHMEM_SIZE + + + A maximum size in bytes of shared memory available to CUDA kernels on a CIG context. Can only be queried, cannot be set + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_CIG_ENABLED + + + A non-zero value indicates this CUDA context is a CIG-enabled context. Can only be queried, cannot be set + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED + + + When set to zero, CUDA will fail to launch a kernel on a CIG context, instead of using the fallback path, if the kernel uses more shared memory than available + + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_MAX + +.. autoclass:: cuda.bindings.driver.CUresourcetype + + .. autoattribute:: cuda.bindings.driver.CUresourcetype.CU_RESOURCE_TYPE_ARRAY + + + Array resource + + + .. autoattribute:: cuda.bindings.driver.CUresourcetype.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY + + + Mipmapped array resource + + + .. autoattribute:: cuda.bindings.driver.CUresourcetype.CU_RESOURCE_TYPE_LINEAR + + + Linear resource + + + .. autoattribute:: cuda.bindings.driver.CUresourcetype.CU_RESOURCE_TYPE_PITCH2D + + + Pitch 2D resource + +.. autoclass:: cuda.bindings.driver.CUaccessProperty + + .. autoattribute:: cuda.bindings.driver.CUaccessProperty.CU_ACCESS_PROPERTY_NORMAL + + + Normal cache persistence. + + + .. autoattribute:: cuda.bindings.driver.CUaccessProperty.CU_ACCESS_PROPERTY_STREAMING + + + Streaming access is less likely to persit from cache. + + + .. autoattribute:: cuda.bindings.driver.CUaccessProperty.CU_ACCESS_PROPERTY_PERSISTING + + + Persisting access is more likely to persist in cache. + +.. autoclass:: cuda.bindings.driver.CUgraphConditionalNodeType + + .. 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. + + + .. autoattribute:: cuda.bindings.driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_WHILE + + + Conditional 'while' Node. Body executed repeatedly while condition value is non-zero. + + + .. autoattribute:: cuda.bindings.driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_SWITCH + + + 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.driver.CUgraphNodeType + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_KERNEL + + + GPU kernel node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEMCPY + + + Memcpy node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEMSET + + + Memset node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_HOST + + + Host (executable) node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_GRAPH + + + Node which executes an embedded graph + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_EMPTY + + + Empty (no-op) node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_WAIT_EVENT + + + External event wait node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_EVENT_RECORD + + + External event record node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL + + + External semaphore signal node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT + + + External semaphore wait node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEM_ALLOC + + + Memory Allocation Node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEM_FREE + + + Memory Free Node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP + + + Batch MemOp Node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + + + 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 + + can be selectively executed or iterated upon based on the value of a conditional + + variable. + + + + Handles must be created in advance of creating the node + + using :py:obj:`~.cuGraphConditionalHandleCreate`. + + + + The following restrictions apply to graphs which contain conditional nodes: + + The graph cannot be used in a child node. + + Only one instantiation of the graph may exist at any point in time. + + The graph cannot be cloned. + + + + To set the control value, supply a default value when creating the handle and/or + + call :py:obj:`~.cudaGraphSetConditional` from device code. + +.. autoclass:: cuda.bindings.driver.CUgraphDependencyType + + .. autoattribute:: cuda.bindings.driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_DEFAULT + + + This is an ordinary dependency. + + + .. 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. + +.. autoclass:: cuda.bindings.driver.CUgraphInstantiateResult + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_SUCCESS + + + Instantiation succeeded + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_ERROR + + + Instantiation failed for an unexpected reason which is described in the return value of the function + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE + + + Instantiation failed due to invalid structure, such as cycles + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED + + + Instantiation for device launch failed because the graph contained an unsupported operation + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED + + + Instantiation for device launch failed due to the nodes belonging to different contexts + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED + + + One or more conditional handles are not associated with conditional nodes + +.. autoclass:: cuda.bindings.driver.CUsynchronizationPolicy + + .. autoattribute:: cuda.bindings.driver.CUsynchronizationPolicy.CU_SYNC_POLICY_AUTO + + + .. autoattribute:: cuda.bindings.driver.CUsynchronizationPolicy.CU_SYNC_POLICY_SPIN + + + .. autoattribute:: cuda.bindings.driver.CUsynchronizationPolicy.CU_SYNC_POLICY_YIELD + + + .. autoattribute:: cuda.bindings.driver.CUsynchronizationPolicy.CU_SYNC_POLICY_BLOCKING_SYNC + +.. autoclass:: cuda.bindings.driver.CUclusterSchedulingPolicy + + .. autoattribute:: cuda.bindings.driver.CUclusterSchedulingPolicy.CU_CLUSTER_SCHEDULING_POLICY_DEFAULT + + + the default policy + + + .. autoattribute:: cuda.bindings.driver.CUclusterSchedulingPolicy.CU_CLUSTER_SCHEDULING_POLICY_SPREAD + + + spread the blocks within a cluster to the SMs + + + .. autoattribute:: cuda.bindings.driver.CUclusterSchedulingPolicy.CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING + + + allow the hardware to load-balance the blocks in a cluster to the SMs + +.. autoclass:: cuda.bindings.driver.CUlaunchMemSyncDomain + + .. autoattribute:: cuda.bindings.driver.CUlaunchMemSyncDomain.CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT + + + Launch kernels in the default domain + + + .. autoattribute:: cuda.bindings.driver.CUlaunchMemSyncDomain.CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE + + + Launch kernels in the remote domain + +.. autoclass:: cuda.bindings.driver.CUlaunchAttributeID + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_IGNORE + + + Ignored entry, for convenient composition + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW + + + Valid for streams, graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.accessPolicyWindow`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_COOPERATIVE + + + Valid for graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.cooperative`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY + + + Valid for streams. See :py:obj:`~.CUlaunchAttributeValue.syncPolicy`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + + + Valid for graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.clusterDim`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE + + + Valid for graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.clusterSchedulingPolicyPreference`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION + + + Valid for launches. Setting :py:obj:`~.CUlaunchAttributeValue.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.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + + + Valid for launches. Set :py:obj:`~.CUlaunchAttributeValue.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 through PTX launchdep.release or CUDA builtin function cudaTriggerProgrammaticLaunchCompletion(). 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:`~.cuEventSynchronize()`) are not guaranteed to observe the release precisely when it is released. For example, :py:obj:`~.cuEventSynchronize()` 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:`~.CU_EVENT_DISABLE_TIMING` flag set). + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PRIORITY + + + Valid for streams, graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.priority`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP + + + Valid for streams, graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.memSyncDomainMap`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN + + + Valid for streams, graph nodes, launches. See :py:obj:`~.CUlaunchAttributeValue.memSyncDomain`. + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION + + + Valid for graph nodes, launches. Set :py:obj:`~.CUlaunchAttributeValue.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:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION` 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. + + 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.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT + + + Valid for launches. Set :py:obj:`~.CUlaunchAttributeValue.launchCompletionEvent` to record the event. + + 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:`~.CU_EVENT_DISABLE_TIMING` flag set). + + + .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE + + + 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`. + + 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`. + + 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.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + + + Valid for launches. On devices where the L1 cache and shared memory use the same hardware resources, setting :py:obj:`~.CUlaunchAttributeValue.sharedMemCarveout` to a percentage between 0-100 signals the CUDA driver to set the shared memory carveout preference, in percent of the total shared memory for that kernel launch. This attribute takes precedence over :py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is only a hint, and the CUDA driver can choose a different configuration if required for the launch. + +.. autoclass:: cuda.bindings.driver.CUstreamCaptureStatus + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_NONE + + + Stream is not capturing + + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE + + + Stream is actively capturing + + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_INVALIDATED + + + Stream is part of a capture sequence that has been invalidated, but not terminated + +.. autoclass:: cuda.bindings.driver.CUstreamCaptureMode + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_GLOBAL + + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_THREAD_LOCAL + + + .. autoattribute:: cuda.bindings.driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_RELAXED + +.. autoclass:: cuda.bindings.driver.CUdriverProcAddress_flags + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddress_flags.CU_GET_PROC_ADDRESS_DEFAULT + + + Default search mode for driver symbols. + + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddress_flags.CU_GET_PROC_ADDRESS_LEGACY_STREAM + + + Search for legacy versions of driver symbols. + + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddress_flags.CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + + + Search for per-thread versions of driver symbols. + +.. autoclass:: cuda.bindings.driver.CUdriverProcAddressQueryResult + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddressQueryResult.CU_GET_PROC_ADDRESS_SUCCESS + + + Symbol was succesfully found + + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddressQueryResult.CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND + + + Symbol was not found in search + + + .. autoattribute:: cuda.bindings.driver.CUdriverProcAddressQueryResult.CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT + + + Symbol was found but version supplied was not sufficient + +.. autoclass:: cuda.bindings.driver.CUexecAffinityType + + .. autoattribute:: cuda.bindings.driver.CUexecAffinityType.CU_EXEC_AFFINITY_TYPE_SM_COUNT + + + Create a context with limited SMs. + + + .. autoattribute:: cuda.bindings.driver.CUexecAffinityType.CU_EXEC_AFFINITY_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUcigDataType + + .. autoattribute:: cuda.bindings.driver.CUcigDataType.CIG_DATA_TYPE_D3D12_COMMAND_QUEUE + + + .. autoattribute:: cuda.bindings.driver.CUcigDataType.CIG_DATA_TYPE_NV_BLOB + + + D3D12 Command Queue Handle + +.. autoclass:: cuda.bindings.driver.CUlibraryOption + + .. autoattribute:: cuda.bindings.driver.CUlibraryOption.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE + + + .. 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`. + + + .. autoattribute:: cuda.bindings.driver.CUlibraryOption.CU_LIBRARY_NUM_OPTIONS + +.. autoclass:: cuda.bindings.driver.CUresult + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_SUCCESS + + + 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:`~.cuEventQuery()` and :py:obj:`~.cuStreamQuery()`). + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_VALUE + + + 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.driver.CUresult.CUDA_ERROR_OUT_OF_MEMORY + + + The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_INITIALIZED + + + This indicates that the CUDA driver has not been initialized with :py:obj:`~.cuInit()` or that initialization has failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_DEINITIALIZED + + + This indicates that the CUDA driver is in the process of shutting down. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PROFILER_DISABLED + + + 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.driver.CUresult.CUDA_ERROR_PROFILER_NOT_INITIALIZED + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PROFILER_ALREADY_STARTED + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PROFILER_ALREADY_STOPPED + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STUB_LIBRARY + + + This indicates that the CUDA driver that the application has loaded is a stub library. Applications that run with the stub rather than a real driver loaded will result in CUDA API returning this error. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_DEVICE_UNAVAILABLE + + + This indicates that requested CUDA device is unavailable at the current time. Devices are often unavailable due to use of :py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS` or :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NO_DEVICE + + + This indicates that no CUDA-capable devices were detected by the installed CUDA driver. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_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.driver.CUresult.CUDA_ERROR_DEVICE_NOT_LICENSED + + + This error indicates that the Grid license is not applied. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_IMAGE + + + This indicates that the device kernel image is invalid. This can also indicate an invalid CUDA module. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_CONTEXT + + + 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. This can also be returned if the green context passed to an API call was not converted to a :py:obj:`~.CUcontext` using :py:obj:`~.cuCtxFromGreenCtx` API. + + + .. 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] + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MAP_FAILED + + + This indicates that a map or register operation has failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNMAP_FAILED + + + This indicates that an unmap or unregister operation has failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ARRAY_IS_MAPPED + + + This indicates that the specified array is currently mapped and thus cannot be destroyed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ALREADY_MAPPED + + + This indicates that the resource is already mapped. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NO_BINARY_FOR_GPU + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ALREADY_ACQUIRED + + + This indicates that a resource has already been acquired. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_MAPPED + + + This indicates that a resource is not mapped. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_MAPPED_AS_ARRAY + + + This indicates that a mapped resource is not available for access as an array. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_MAPPED_AS_POINTER + + + This indicates that a mapped resource is not available for access as a pointer. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ECC_UNCORRECTABLE + + + This indicates that an uncorrectable ECC error was detected during execution. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNSUPPORTED_LIMIT + + + This indicates that the :py:obj:`~.CUlimit` passed to the API call is not supported by the active device. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CONTEXT_ALREADY_IN_USE + + + This indicates that the :py:obj:`~.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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PEER_ACCESS_UNSUPPORTED + + + This indicates that peer access is not supported across the given devices. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_PTX + + + This indicates that a PTX JIT compilation failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_GRAPHICS_CONTEXT + + + This indicates an error with OpenGL or DirectX context. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NVLINK_UNCORRECTABLE + + + This indicates that an uncorrectable NVLink error was detected during the execution. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_JIT_COMPILER_NOT_FOUND + + + This indicates that the PTX JIT compiler library was not found. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNSUPPORTED_PTX_VERSION + + + This indicates that the provided PTX was compiled with an unsupported toolchain. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_JIT_COMPILATION_DISABLED + + + This indicates that the PTX JIT compilation was disabled. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY + + + This indicates that the :py:obj:`~.CUexecAffinityType` passed to the API call is not supported by the active device. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC + + + This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CONTAINED + + + 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.driver.CUresult.CUDA_ERROR_INVALID_SOURCE + + + This indicates that the device kernel source is invalid. This includes compilation/linker errors encountered in device code or user error. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_FILE_NOT_FOUND + + + This indicates that the file specified was not found. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND + + + This indicates that a link to a shared object failed to resolve. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED + + + This indicates that initialization of a shared object failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_OPERATING_SYSTEM + + + This indicates that an OS call failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_HANDLE + + + This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like :py:obj:`~.CUstream` and :py:obj:`~.CUevent`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ILLEGAL_STATE + + + This indicates that a resource required by the API call is not in a valid state to perform the requested operation. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_LOSSY_QUERY + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_FOUND + + + 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.driver.CUresult.CUDA_ERROR_NOT_READY + + + 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:`~.CUDA_SUCCESS` (which indicates completion). Calls that may return this value include :py:obj:`~.cuEventQuery()` and :py:obj:`~.cuStreamQuery()`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ILLEGAL_ADDRESS + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_LAUNCH_TIMEOUT + + + 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:`~.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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING + + + This error indicates a kernel launch that uses an incompatible texturing mode. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED + + + This error indicates that a call to :py:obj:`~.cuCtxEnablePeerAccess()` is trying to re-enable peer access to a context which has already had peer access to it enabled. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PEER_ACCESS_NOT_ENABLED + + + This error indicates that :py:obj:`~.cuCtxDisablePeerAccess()` is trying to disable peer access which has not been enabled yet via :py:obj:`~.cuCtxEnablePeerAccess()`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE + + + This error indicates that the primary context for the specified device has already been initialized. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CONTEXT_IS_DESTROYED + + + 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.driver.CUresult.CUDA_ERROR_ASSERT + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_TOO_MANY_PEERS + + + 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:`~.cuCtxEnablePeerAccess()`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED + + + This error indicates that the memory range passed to :py:obj:`~.cuMemHostRegister()` has already been registered. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED + + + This error indicates that the pointer passed to :py:obj:`~.cuMemHostUnregister()` does not correspond to any currently registered memory region. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_HARDWARE_STACK_ERROR + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_ILLEGAL_INSTRUCTION + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MISALIGNED_ADDRESS + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_ADDRESS_SPACE + + + 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.driver.CUresult.CUDA_ERROR_INVALID_PC + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_LAUNCH_FAILED + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE + + + This error indicates that the number of blocks launched per grid for a kernel that was launched via either :py:obj:`~.cuLaunchCooperativeKernel` or :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` exceeds the maximum number of blocks as allowed 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`. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_TENSOR_MEMORY_LEAK + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_PERMITTED + + + This error indicates that the attempted operation is not permitted. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NOT_SUPPORTED + + + This error indicates that the attempted operation is not supported on the current system or device. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_SYSTEM_NOT_READY + + + 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.driver.CUresult.CUDA_ERROR_SYSTEM_DRIVER_MISMATCH + + + 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.driver.CUresult.CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_CONNECTION_FAILED + + + This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_RPC_FAILURE + + + This error indicates that the remote procedural call between the MPS server and the MPS client failed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_SERVER_NOT_READY + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_MAX_CLIENTS_REACHED + + + This error indicates that the hardware resources required to create MPS client have been exhausted. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED + + + This error indicates the the hardware resources required to support device connections have been exhausted. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MPS_CLIENT_TERMINATED + + + 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.driver.CUresult.CUDA_ERROR_CDP_NOT_SUPPORTED + + + This error indicates that the module is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CDP_VERSION_MISMATCH + + + This error indicates that a module contains an unsupported interaction between different versions of CUDA Dynamic Parallelism. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED + + + This error indicates that the operation is not permitted when the stream is capturing. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_INVALIDATED + + + This error indicates that the current capture sequence on the stream has been invalidated due to a previous error. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_MERGE + + + This error indicates that the operation would have resulted in a merge of two independent capture sequences. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_UNMATCHED + + + This error indicates that the capture was not initiated in this stream. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_UNJOINED + + + This error indicates that the capture sequence contains a fork that was not joined to the primary stream. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_ISOLATION + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT + + + This error indicates a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CAPTURED_EVENT + + + This error indicates that the operation is not permitted on an event which was last recorded in a capturing stream. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD + + + A stream capture sequence not initiated with the :py:obj:`~.CU_STREAM_CAPTURE_MODE_RELAXED` argument to :py:obj:`~.cuStreamBeginCapture` was passed to :py:obj:`~.cuStreamEndCapture` in a different thread. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_TIMEOUT + + + This error indicates that the timeout specified for the wait operation has lapsed. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE + + + 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.driver.CUresult.CUDA_ERROR_EXTERNAL_DEVICE + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_CLUSTER_SIZE + + + Indicates a kernel launch error due to cluster misconfiguration. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_FUNCTION_NOT_LOADED + + + Indiciates a function handle is not loaded when calling an API that requires a loaded function. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_RESOURCE_TYPE + + + This error indicates one or more resources passed in are not valid resource types for the operation. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION + + + This error indicates one or more resources are insufficient or non-applicable for the operation. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_KEY_ROTATION + + + This error indicates that an error happened during the key rotation sequence. + + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNKNOWN + + + This indicates that an unknown internal error has occurred. + +.. autoclass:: cuda.bindings.driver.CUdevice_P2PAttribute + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK + + + A relative value indicating the performance of the link between two devices + + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED + + + P2P Access is enable + + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED + + + Atomic operation over the link supported + + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.driver.CUdevice_P2PAttribute.CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED + + + Accessing CUDA arrays over the link supported + +.. autoclass:: cuda.bindings.driver.CUresourceViewFormat + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_NONE + + + No resource view format (use underlying resource format) + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_1X8 + + + 1 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_2X8 + + + 2 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_4X8 + + + 4 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_1X8 + + + 1 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_2X8 + + + 2 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_4X8 + + + 4 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_1X16 + + + 1 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_2X16 + + + 2 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_4X16 + + + 4 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_1X16 + + + 1 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_2X16 + + + 2 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_4X16 + + + 4 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_1X32 + + + 1 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_2X32 + + + 2 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UINT_4X32 + + + 4 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_1X32 + + + 1 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_2X32 + + + 2 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SINT_4X32 + + + 4 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_1X16 + + + 1 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_2X16 + + + 2 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_4X16 + + + 4 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_1X32 + + + 1 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_2X32 + + + 2 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_FLOAT_4X32 + + + 4 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC1 + + + Block compressed 1 + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC2 + + + Block compressed 2 + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC3 + + + Block compressed 3 + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC4 + + + Block compressed 4 unsigned + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SIGNED_BC4 + + + Block compressed 4 signed + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC5 + + + Block compressed 5 unsigned + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SIGNED_BC5 + + + Block compressed 5 signed + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC6H + + + Block compressed 6 unsigned half-float + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_SIGNED_BC6H + + + Block compressed 6 signed half-float + + + .. autoattribute:: cuda.bindings.driver.CUresourceViewFormat.CU_RES_VIEW_FORMAT_UNSIGNED_BC7 + + + Block compressed 7 + +.. autoclass:: cuda.bindings.driver.CUtensorMapDataType + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_UINT8 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_UINT16 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_UINT32 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_INT32 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_UINT64 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_INT64 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT16 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT32 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT64 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B + +.. autoclass:: cuda.bindings.driver.CUtensorMapInterleave + + .. autoattribute:: cuda.bindings.driver.CUtensorMapInterleave.CU_TENSOR_MAP_INTERLEAVE_NONE + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapInterleave.CU_TENSOR_MAP_INTERLEAVE_16B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapInterleave.CU_TENSOR_MAP_INTERLEAVE_32B + +.. autoclass:: cuda.bindings.driver.CUtensorMapSwizzle + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_NONE + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_32B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_64B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B + +.. autoclass:: cuda.bindings.driver.CUtensorMapL2promotion + + .. autoattribute:: cuda.bindings.driver.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_NONE + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_L2_64B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_L2_128B + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_L2_256B + +.. autoclass:: cuda.bindings.driver.CUtensorMapFloatOOBfill + + .. autoattribute:: cuda.bindings.driver.CUtensorMapFloatOOBfill.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapFloatOOBfill.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA + +.. autoclass:: cuda.bindings.driver.CUtensorMapIm2ColWideMode + + .. autoattribute:: cuda.bindings.driver.CUtensorMapIm2ColWideMode.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapIm2ColWideMode.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 + +.. autoclass:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS + + .. autoattribute:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE + + + No access, meaning the device cannot access this memory at all, thus must be staged through accessible memory in order to complete certain operations + + + .. autoattribute:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ + + + Read-only access, meaning writes to this memory are considered invalid accesses and thus return error in that case. + + + .. autoattribute:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE + + + Read-write access, the device has full read-write access to the memory + +.. autoclass:: cuda.bindings.driver.CUexternalMemoryHandleType + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD + + + Handle is an opaque file descriptor + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 + + + Handle is an opaque shared NT handle + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT + + + Handle is an opaque, globally shared handle + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP + + + Handle is a D3D12 heap object + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE + + + Handle is a D3D12 committed resource + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE + + + Handle is a shared NT handle to a D3D11 resource + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT + + + Handle is a globally shared handle to a D3D11 resource + + + .. autoattribute:: cuda.bindings.driver.CUexternalMemoryHandleType.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF + + + Handle is an NvSciBuf object + +.. autoclass:: cuda.bindings.driver.CUexternalSemaphoreHandleType + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD + + + Handle is an opaque file descriptor + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 + + + Handle is an opaque shared NT handle + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT + + + Handle is an opaque, globally shared handle + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE + + + Handle is a shared NT handle referencing a D3D12 fence object + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE + + + Handle is a shared NT handle referencing a D3D11 fence object + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC + + + Opaque handle to NvSciSync Object + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX + + + Handle is a shared NT handle referencing a D3D11 keyed mutex object + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT + + + Handle is a globally shared handle referencing a D3D11 keyed mutex object + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD + + + Handle is an opaque file descriptor referencing a timeline semaphore + + + .. autoattribute:: cuda.bindings.driver.CUexternalSemaphoreHandleType.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 + + + Handle is an opaque shared NT handle referencing a timeline semaphore + +.. autoclass:: cuda.bindings.driver.CUmemAllocationHandleType + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_NONE + + + Does not allow any export mechanism. > + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR + + + Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_WIN32 + + + Allows a Win32 NT handle to be used for exporting. (HANDLE) + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_WIN32_KMT + + + Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_FABRIC + + + Allows a fabric handle to be used for exporting. (:py:obj:`~.CUmemFabricHandle`) + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUmemAccess_flags + + .. autoattribute:: cuda.bindings.driver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_NONE + + + Default, make the address range not accessible + + + .. autoattribute:: cuda.bindings.driver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READ + + + Make the address range read accessible + + + .. autoattribute:: cuda.bindings.driver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + + + Make the address range read-write accessible + + + .. autoattribute:: cuda.bindings.driver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_MAX + +.. autoclass:: cuda.bindings.driver.CUmemLocationType + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_INVALID + + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + + + Location is a device location, thus id is a device ordinal + + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + + + Location is host, id is ignored + + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA + + + Location is a host NUMA node, thus id is a host NUMA node id + + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT + + + Location is a host NUMA node of the current thread, id is ignored + + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUmemAllocationType + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_INVALID + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + + + This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUmemAllocationGranularity_flags + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationGranularity_flags.CU_MEM_ALLOC_GRANULARITY_MINIMUM + + + Minimum required granularity for allocation + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationGranularity_flags.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED + + + Recommended granularity for allocation for best performance + +.. autoclass:: cuda.bindings.driver.CUmemRangeHandleType + + .. autoattribute:: cuda.bindings.driver.CUmemRangeHandleType.CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD + + + .. autoattribute:: cuda.bindings.driver.CUmemRangeHandleType.CU_MEM_RANGE_HANDLE_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUmemRangeFlags + + .. autoattribute:: cuda.bindings.driver.CUmemRangeFlags.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE + + + Indicates that DMA_BUF handle should be mapped via PCIe BAR1 + +.. autoclass:: cuda.bindings.driver.CUarraySparseSubresourceType + + .. autoattribute:: cuda.bindings.driver.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL + + + .. autoattribute:: cuda.bindings.driver.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL + +.. autoclass:: cuda.bindings.driver.CUmemOperationType + + .. autoattribute:: cuda.bindings.driver.CUmemOperationType.CU_MEM_OPERATION_TYPE_MAP + + + .. autoattribute:: cuda.bindings.driver.CUmemOperationType.CU_MEM_OPERATION_TYPE_UNMAP + +.. autoclass:: cuda.bindings.driver.CUmemHandleType + + .. autoattribute:: cuda.bindings.driver.CUmemHandleType.CU_MEM_HANDLE_TYPE_GENERIC + +.. autoclass:: cuda.bindings.driver.CUmemAllocationCompType + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationCompType.CU_MEM_ALLOCATION_COMP_NONE + + + Allocating non-compressible memory + + + .. autoattribute:: cuda.bindings.driver.CUmemAllocationCompType.CU_MEM_ALLOCATION_COMP_GENERIC + + + Allocating compressible memory + +.. autoclass:: cuda.bindings.driver.CUmulticastGranularity_flags + + .. autoattribute:: cuda.bindings.driver.CUmulticastGranularity_flags.CU_MULTICAST_GRANULARITY_MINIMUM + + + Minimum required granularity + + + .. autoattribute:: cuda.bindings.driver.CUmulticastGranularity_flags.CU_MULTICAST_GRANULARITY_RECOMMENDED + + + Recommended granularity for best performance + +.. autoclass:: cuda.bindings.driver.CUgraphExecUpdateResult + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_SUCCESS + + + The update succeeded + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR + + + The update failed for an unexpected reason which is described in the return value of the function + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED + + + The update failed because the topology changed + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED + + + The update failed because a node type changed + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED + + + The update failed because the function of a kernel node changed (CUDA driver < 11.2) + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED + + + The update failed because the parameters changed in a way that is not supported + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED + + + The update failed because something about the node is not supported + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE + + + The update failed because the function of a kernel node changed in an unsupported way + + + .. autoattribute:: cuda.bindings.driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED + + + The update failed because the node attributes changed in a way that is not supported + +.. autoclass:: cuda.bindings.driver.CUmemPool_attribute + + .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES + + + (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) + + + .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC + + + (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) + + + .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES + + + (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). + + + .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD + + + (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 = :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 = :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 = :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 = :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. + +.. autoclass:: cuda.bindings.driver.CUmemcpyFlags + + .. autoattribute:: cuda.bindings.driver.CUmemcpyFlags.CU_MEMCPY_FLAG_DEFAULT + + + .. autoattribute:: cuda.bindings.driver.CUmemcpyFlags.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE + + + Hint to the driver to try and overlap the copy with compute work on the SMs. + +.. autoclass:: cuda.bindings.driver.CUmemcpySrcAccessOrder + + .. autoattribute:: cuda.bindings.driver.CUmemcpySrcAccessOrder.CU_MEMCPY_SRC_ACCESS_ORDER_INVALID + + + Default invalid. + + + .. autoattribute:: cuda.bindings.driver.CUmemcpySrcAccessOrder.CU_MEMCPY_SRC_ACCESS_ORDER_STREAM + + + Indicates that access to the source pointer must be in stream order. + + + .. autoattribute:: cuda.bindings.driver.CUmemcpySrcAccessOrder.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL + + + 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.driver.CUmemcpySrcAccessOrder.CU_MEMCPY_SRC_ACCESS_ORDER_ANY + + + 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.driver.CUmemcpySrcAccessOrder.CU_MEMCPY_SRC_ACCESS_ORDER_MAX + +.. autoclass:: cuda.bindings.driver.CUmemcpy3DOperandType + + .. autoattribute:: cuda.bindings.driver.CUmemcpy3DOperandType.CU_MEMCPY_OPERAND_TYPE_POINTER + + + Memcpy operand is a valid pointer. + + + .. autoattribute:: cuda.bindings.driver.CUmemcpy3DOperandType.CU_MEMCPY_OPERAND_TYPE_ARRAY + + + Memcpy operand is a :py:obj:`~.CUarray`. + + + .. autoattribute:: cuda.bindings.driver.CUmemcpy3DOperandType.CU_MEMCPY_OPERAND_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUgraphMem_attribute + + .. autoattribute:: cuda.bindings.driver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT + + + (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 = :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 = :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 = :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 + + .. autoattribute:: cuda.bindings.driver.CUgraphChildGraphNodeOwnership.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUgraphChildGraphNodeOwnership.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE + + + 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. + + + + 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 cuGraphExecUpdate; Cannot have additional memory allocation or free nodes added. + +.. autoclass:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesOptions + + .. autoattribute:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesOptions.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST + + + :py:obj:`~.cuFlushGPUDirectRDMAWrites()` and its CUDA Runtime API counterpart are supported on the device. + + + .. autoattribute:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesOptions.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS + + + 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 device. + +.. autoclass:: cuda.bindings.driver.CUGPUDirectRDMAWritesOrdering + + .. autoattribute:: cuda.bindings.driver.CUGPUDirectRDMAWritesOrdering.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE + + + The device does not natively support ordering of remote writes. :py:obj:`~.cuFlushGPUDirectRDMAWrites()` can be leveraged if supported. + + + .. autoattribute:: cuda.bindings.driver.CUGPUDirectRDMAWritesOrdering.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER + + + Natively, the device can consistently consume remote writes, although other CUDA devices may not. + + + .. autoattribute:: cuda.bindings.driver.CUGPUDirectRDMAWritesOrdering.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES + + + Any CUDA device in the system can consistently consume remote writes to this device. + +.. autoclass:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesScope + + .. autoattribute:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesScope.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER + + + Blocks until remote writes are visible to the CUDA device context owning the data. + + + .. autoattribute:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesScope.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES + + + Blocks until remote writes are visible to all CUDA device contexts. + +.. autoclass:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesTarget + + .. autoattribute:: cuda.bindings.driver.CUflushGPUDirectRDMAWritesTarget.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX + + + Sets the target for :py:obj:`~.cuFlushGPUDirectRDMAWrites()` to the currently active CUDA device context. + +.. autoclass:: cuda.bindings.driver.CUgraphDebugDot_flags + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE + + + Output all debug data as if every debug flag is enabled + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES + + + Use CUDA Runtime structures for output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS + + + 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 :py:obj:`~.CUDA_MEMCPY3D` values to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS + + + 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 :py:obj:`~.CUDA_HOST_NODE_PARAMS` values to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS + + + 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 :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 :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 :py:obj:`~.CUkernelNodeAttrValue` values to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES + + + Adds node handles and every kernel function handle to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS + + + Adds memory alloc node parameters to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS + + + Adds memory free node parameters to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS + + + Adds batch mem op node parameters to output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO + + + Adds edge numbering information + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS + + + Adds conditional node parameters to output + +.. autoclass:: cuda.bindings.driver.CUuserObject_flags + + .. autoattribute:: cuda.bindings.driver.CUuserObject_flags.CU_USER_OBJECT_NO_DESTRUCTOR_SYNC + + + Indicates the destructor execution is not synchronized by any CUDA handle. + +.. autoclass:: cuda.bindings.driver.CUuserObjectRetain_flags + + .. autoattribute:: cuda.bindings.driver.CUuserObjectRetain_flags.CU_GRAPH_USER_OBJECT_MOVE + + + Transfer references from the caller rather than creating new references. + +.. autoclass:: cuda.bindings.driver.CUgraphInstantiate_flags + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH + + + Automatically free memory allocated in a graph before relaunching. + + + .. 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``. + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH + + + 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 used in conjunction with CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH. + + + .. autoattribute:: cuda.bindings.driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY + + + Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into. + +.. autoclass:: cuda.bindings.driver.CUdeviceNumaConfig + + .. autoattribute:: cuda.bindings.driver.CUdeviceNumaConfig.CU_DEVICE_NUMA_CONFIG_NONE + + + The GPU is not a NUMA node + + + .. autoattribute:: cuda.bindings.driver.CUdeviceNumaConfig.CU_DEVICE_NUMA_CONFIG_NUMA_NODE + + + The GPU is a NUMA node, CU_DEVICE_ATTRIBUTE_NUMA_ID contains its NUMA ID + +.. autoclass:: cuda.bindings.driver.CUprocessState + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_RUNNING + + + Default process state + + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_LOCKED + + + CUDA API locks are taken so further CUDA API calls will block + + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_CHECKPOINTED + + + Application memory contents have been checkpointed and underlying allocations and device handles have been released + + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_FAILED + + + Application entered an uncorrectable error during the checkpoint/restore process + +.. autoclass:: cuda.bindings.driver.CUeglFrameType + + .. autoattribute:: cuda.bindings.driver.CUeglFrameType.CU_EGL_FRAME_TYPE_ARRAY + + + Frame type CUDA array + + + .. autoattribute:: cuda.bindings.driver.CUeglFrameType.CU_EGL_FRAME_TYPE_PITCH + + + Frame type pointer + +.. autoclass:: cuda.bindings.driver.CUeglResourceLocationFlags + + .. autoattribute:: cuda.bindings.driver.CUeglResourceLocationFlags.CU_EGL_RESOURCE_LOCATION_SYSMEM + + + Resource location sysmem + + + .. autoattribute:: cuda.bindings.driver.CUeglResourceLocationFlags.CU_EGL_RESOURCE_LOCATION_VIDMEM + + + Resource location vidmem + +.. autoclass:: cuda.bindings.driver.CUeglColorFormat + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV420_PLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR + + + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR + + + Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_RGB + + + R/G/B three channels in one surface with BGR byte ordering. Only pitch linear format supported. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BGR + + + R/G/B three channels in one surface with RGB byte ordering. Only pitch linear format supported. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_ARGB + + + R/G/B/A four channels in one surface with BGRA byte ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_RGBA + + + R/G/B/A four channels in one surface with ABGR byte ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_L + + + single luminance channel in one surface. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_R + + + single color channel in one surface. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV444_PLANAR + + + Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR + + + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUYV_422 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_UYVY_422 + + + Y, U, V in one surface, interleaved as YUYV in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_ABGR + + + R/G/B/A four channels in one surface with RGBA byte ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BGRA + + + R/G/B/A four channels in one surface with ARGB byte ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_A + + + Alpha color format - one channel in one surface. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_RG + + + R/G color format - two channels in one surface with GR byte ordering + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_AYUV + + + Y, U, V, A four channels in one surface, interleaved as VUYA. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_VYUY_ER + + + Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_UYVY_ER + + + Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUYV_ER + + + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVYU_ER + + + Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV_ER + + + Extended Range Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUVA_ER + + + Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_AYUV_ER + + + Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER + + + Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER + + + Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER + + + Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER + + + Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_RGGB + + + Bayer format - one channel in one surface with interleaved RGGB ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_BGGR + + + Bayer format - one channel in one surface with interleaved BGGR ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_GRBG + + + Bayer format - one channel in one surface with interleaved GRBG ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_GBRG + + + Bayer format - one channel in one surface with interleaved GBRG ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER10_RGGB + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER10_BGGR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER10_GRBG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER10_GBRG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_RGGB + + + Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_BGGR + + + Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_GRBG + + + Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_GBRG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER14_RGGB + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER14_BGGR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER14_GRBG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER14_GBRG + + + Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER20_RGGB + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER20_BGGR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER20_GRBG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER20_GBRG + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU444_PLANAR + + + Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU422_PLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVU420_PLANAR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_BCCR + + + Bayer format - one channel in one surface with interleaved BCCR ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_RCCB + + + Bayer format - one channel in one surface with interleaved RCCB ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_CRBC + + + Bayer format - one channel in one surface with interleaved CRBC ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER_CBRC + + + Bayer format - one channel in one surface with interleaved CBRC ordering. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER10_CCCC + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_BCCR + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_RCCB + + + Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_CRBC + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_CBRC + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_BAYER12_CCCC + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y + + + Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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= 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 = 1/2 Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 + + + 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.driver.CUeglColorFormat.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 height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.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 height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y_ER + + + Extended Range Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y_709_ER + + + Extended Range Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10_ER + + + Extended Range Color format for single Y10 plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10_709_ER + + + Extended Range Color format for single Y10 plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12_ER + + + Extended Range Color format for single Y12 plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12_709_ER + + + Extended Range Color format for single Y12 plane. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUVA + + + Y, U, V, A four channels in one surface, interleaved as AVUY. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YUV + + + Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_YVYU + + + Y, U, V in one surface, interleaved as YVYU in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_VYUY + + + Y, U, V in one surface, interleaved as VYUY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER + + + 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. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER + + + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER + + + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER + + + 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.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER + + + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER + + + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_UYVY_709 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_UYVY_709_ER + + + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_UYVY_2020 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.driver.CUeglColorFormat.CU_EGL_COLOR_FORMAT_MAX + +.. autoclass:: cuda.bindings.driver.CUdeviceptr_v2 +.. autoclass:: cuda.bindings.driver.CUdeviceptr +.. autoclass:: cuda.bindings.driver.CUdevice_v1 +.. autoclass:: cuda.bindings.driver.CUdevice +.. autoclass:: cuda.bindings.driver.CUcontext +.. autoclass:: cuda.bindings.driver.CUmodule +.. autoclass:: cuda.bindings.driver.CUfunction +.. autoclass:: cuda.bindings.driver.CUlibrary +.. autoclass:: cuda.bindings.driver.CUkernel +.. autoclass:: cuda.bindings.driver.CUarray +.. autoclass:: cuda.bindings.driver.CUmipmappedArray +.. autoclass:: cuda.bindings.driver.CUtexref +.. autoclass:: cuda.bindings.driver.CUsurfref +.. autoclass:: cuda.bindings.driver.CUevent +.. autoclass:: cuda.bindings.driver.CUstream +.. autoclass:: cuda.bindings.driver.CUgraphicsResource +.. autoclass:: cuda.bindings.driver.CUtexObject_v1 +.. autoclass:: cuda.bindings.driver.CUtexObject +.. autoclass:: cuda.bindings.driver.CUsurfObject_v1 +.. autoclass:: cuda.bindings.driver.CUsurfObject +.. autoclass:: cuda.bindings.driver.CUexternalMemory +.. autoclass:: cuda.bindings.driver.CUexternalSemaphore +.. autoclass:: cuda.bindings.driver.CUgraph +.. autoclass:: cuda.bindings.driver.CUgraphNode +.. autoclass:: cuda.bindings.driver.CUgraphExec +.. autoclass:: cuda.bindings.driver.CUmemoryPool +.. autoclass:: cuda.bindings.driver.CUuserObject +.. autoclass:: cuda.bindings.driver.CUgraphConditionalHandle +.. autoclass:: cuda.bindings.driver.CUgraphDeviceNode +.. autoclass:: cuda.bindings.driver.CUasyncCallbackHandle +.. autoclass:: cuda.bindings.driver.CUgreenCtx +.. autoclass:: cuda.bindings.driver.CUuuid +.. autoclass:: cuda.bindings.driver.CUmemFabricHandle_v1 +.. autoclass:: cuda.bindings.driver.CUmemFabricHandle +.. autoclass:: cuda.bindings.driver.CUipcEventHandle_v1 +.. autoclass:: cuda.bindings.driver.CUipcEventHandle +.. autoclass:: cuda.bindings.driver.CUipcMemHandle_v1 +.. autoclass:: cuda.bindings.driver.CUipcMemHandle +.. autoclass:: cuda.bindings.driver.CUstreamBatchMemOpParams_v1 +.. autoclass:: cuda.bindings.driver.CUstreamBatchMemOpParams +.. autoclass:: cuda.bindings.driver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_BATCH_MEM_OP_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUasyncNotificationInfo +.. autoclass:: cuda.bindings.driver.CUasyncCallback +.. autoclass:: cuda.bindings.driver.CUdevprop_v1 +.. autoclass:: cuda.bindings.driver.CUdevprop +.. autoclass:: cuda.bindings.driver.CUlinkState +.. autoclass:: cuda.bindings.driver.CUhostFn +.. autoclass:: cuda.bindings.driver.CUaccessPolicyWindow_v1 +.. autoclass:: cuda.bindings.driver.CUaccessPolicyWindow +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_KERNEL_NODE_PARAMS_v3 +.. autoclass:: cuda.bindings.driver.CUDA_MEMSET_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_MEMSET_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_MEMSET_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUDA_HOST_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_HOST_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_HOST_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUDA_CONDITIONAL_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUgraphEdgeData +.. autoclass:: cuda.bindings.driver.CUDA_GRAPH_INSTANTIATE_PARAMS +.. autoclass:: cuda.bindings.driver.CUlaunchMemSyncDomainMap +.. autoclass:: cuda.bindings.driver.CUlaunchAttributeValue +.. autoclass:: cuda.bindings.driver.CUlaunchAttribute +.. autoclass:: cuda.bindings.driver.CUlaunchConfig +.. autoclass:: cuda.bindings.driver.CUkernelNodeAttrID +.. autoclass:: cuda.bindings.driver.CUkernelNodeAttrValue_v1 +.. autoclass:: cuda.bindings.driver.CUkernelNodeAttrValue +.. autoclass:: cuda.bindings.driver.CUstreamAttrID +.. autoclass:: cuda.bindings.driver.CUstreamAttrValue_v1 +.. autoclass:: cuda.bindings.driver.CUstreamAttrValue +.. autoclass:: cuda.bindings.driver.CUexecAffinitySmCount_v1 +.. autoclass:: cuda.bindings.driver.CUexecAffinitySmCount +.. autoclass:: cuda.bindings.driver.CUexecAffinityParam_v1 +.. autoclass:: cuda.bindings.driver.CUexecAffinityParam +.. autoclass:: cuda.bindings.driver.CUctxCigParam +.. autoclass:: cuda.bindings.driver.CUctxCreateParams +.. autoclass:: cuda.bindings.driver.CUlibraryHostUniversalFunctionAndDataTable +.. autoclass:: cuda.bindings.driver.CUstreamCallback +.. autoclass:: cuda.bindings.driver.CUoccupancyB2DSize +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY2D_v2 +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY2D +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_v2 +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_PEER_v1 +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_PEER +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_DESCRIPTOR_v2 +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_DESCRIPTOR +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY3D_DESCRIPTOR_v2 +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY3D_DESCRIPTOR +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_SPARSE_PROPERTIES_v1 +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_SPARSE_PROPERTIES +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_ARRAY_MEMORY_REQUIREMENTS +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_DESC +.. autoclass:: cuda.bindings.driver.CUDA_TEXTURE_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_TEXTURE_DESC +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_VIEW_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_RESOURCE_VIEW_DESC +.. autoclass:: cuda.bindings.driver.CUtensorMap +.. autoclass:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS +.. autoclass:: cuda.bindings.driver.CUDA_LAUNCH_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_LAUNCH_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_WAIT_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUmemGenericAllocationHandle_v1 +.. autoclass:: cuda.bindings.driver.CUmemGenericAllocationHandle +.. autoclass:: cuda.bindings.driver.CUarrayMapInfo_v1 +.. autoclass:: cuda.bindings.driver.CUarrayMapInfo +.. autoclass:: cuda.bindings.driver.CUmemLocation_v1 +.. autoclass:: cuda.bindings.driver.CUmemLocation +.. autoclass:: cuda.bindings.driver.CUmemAllocationProp_v1 +.. autoclass:: cuda.bindings.driver.CUmemAllocationProp +.. autoclass:: cuda.bindings.driver.CUmulticastObjectProp_v1 +.. autoclass:: cuda.bindings.driver.CUmulticastObjectProp +.. autoclass:: cuda.bindings.driver.CUmemAccessDesc_v1 +.. autoclass:: cuda.bindings.driver.CUmemAccessDesc +.. autoclass:: cuda.bindings.driver.CUgraphExecUpdateResultInfo_v1 +.. autoclass:: cuda.bindings.driver.CUgraphExecUpdateResultInfo +.. autoclass:: cuda.bindings.driver.CUmemPoolProps_v1 +.. autoclass:: cuda.bindings.driver.CUmemPoolProps +.. autoclass:: cuda.bindings.driver.CUmemPoolPtrExportData_v1 +.. autoclass:: cuda.bindings.driver.CUmemPoolPtrExportData +.. autoclass:: cuda.bindings.driver.CUmemcpyAttributes_v1 +.. autoclass:: cuda.bindings.driver.CUmemcpyAttributes +.. autoclass:: cuda.bindings.driver.CUoffset3D_v1 +.. autoclass:: cuda.bindings.driver.CUoffset3D +.. autoclass:: cuda.bindings.driver.CUextent3D_v1 +.. autoclass:: cuda.bindings.driver.CUextent3D +.. autoclass:: cuda.bindings.driver.CUmemcpy3DOperand_v1 +.. autoclass:: cuda.bindings.driver.CUmemcpy3DOperand +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_BATCH_OP_v1 +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY3D_BATCH_OP +.. autoclass:: cuda.bindings.driver.CUDA_MEM_ALLOC_NODE_PARAMS_v1 +.. autoclass:: cuda.bindings.driver.CUDA_MEM_ALLOC_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_MEM_ALLOC_NODE_PARAMS_v2 +.. autoclass:: cuda.bindings.driver.CUDA_MEM_FREE_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_CHILD_GRAPH_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUgraphNodeParams +.. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs +.. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs +.. autoclass:: cuda.bindings.driver.CUcheckpointRestoreArgs +.. autoclass:: cuda.bindings.driver.CUcheckpointUnlockArgs +.. autoclass:: cuda.bindings.driver.CUeglFrame_v1 +.. autoclass:: cuda.bindings.driver.CUeglFrame +.. autoclass:: cuda.bindings.driver.CUeglStreamConnection +.. autoattribute:: cuda.bindings.driver.CUDA_VERSION + + CUDA API version number + +.. autoattribute:: cuda.bindings.driver.CU_IPC_HANDLE_SIZE + + CUDA IPC handle size + +.. autoattribute:: cuda.bindings.driver.CU_STREAM_LEGACY + + Legacy stream handle + + + + 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 + +.. autoattribute:: cuda.bindings.driver.CU_STREAM_PER_THREAD + + Per-thread stream handle + + + + 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 + +.. autoattribute:: cuda.bindings.driver.CU_COMPUTE_ACCELERATED_TARGET_BASE +.. autoattribute:: cuda.bindings.driver.CU_COMPUTE_FAMILY_TARGET_BASE +.. autoattribute:: cuda.bindings.driver.CU_GRAPH_COND_ASSIGN_DEFAULT + + Conditional node handle flags Default value is applied when graph is launched. + +.. autoattribute:: cuda.bindings.driver.CU_GRAPH_KERNEL_NODE_PORT_DEFAULT + + This port activates when the kernel has finished executing. + +.. autoattribute:: cuda.bindings.driver.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC + + This port activates when all blocks of the kernel have performed cudaTriggerProgrammaticLaunchCompletion() or have terminated. It must be used with edge type :py:obj:`~.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC`. See also :py:obj:`~.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`. + +.. autoattribute:: cuda.bindings.driver.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER + + This port activates when all blocks of the kernel have begun execution. See also :py:obj:`~.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`. + +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_DIMENSION +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_PRIORITY +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE +.. autoattribute:: cuda.bindings.driver.CU_KERNEL_NODE_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT +.. autoattribute:: cuda.bindings.driver.CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW +.. autoattribute:: cuda.bindings.driver.CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY +.. autoattribute:: cuda.bindings.driver.CU_STREAM_ATTRIBUTE_PRIORITY +.. autoattribute:: cuda.bindings.driver.CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP +.. autoattribute:: cuda.bindings.driver.CU_STREAM_ATTRIBUTE_MEM_SYNC_DOMAIN +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTALLOC_PORTABLE + + If set, host memory is portable between CUDA contexts. Flag for :py:obj:`~.cuMemHostAlloc()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTALLOC_DEVICEMAP + + If set, host memory is mapped into CUDA address space and :py:obj:`~.cuMemHostGetDevicePointer()` may be called on the host pointer. Flag for :py:obj:`~.cuMemHostAlloc()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTALLOC_WRITECOMBINED + + If set, host memory is allocated as write-combined - fast to write, faster to DMA, slow to read except via SSE4 streaming load instruction (MOVNTDQA). Flag for :py:obj:`~.cuMemHostAlloc()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTREGISTER_PORTABLE + + If set, host memory is portable between CUDA contexts. Flag for :py:obj:`~.cuMemHostRegister()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTREGISTER_DEVICEMAP + + If set, host memory is mapped into CUDA address space and :py:obj:`~.cuMemHostGetDevicePointer()` may be called on the host pointer. Flag for :py:obj:`~.cuMemHostRegister()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTREGISTER_IOMEMORY + + If set, the passed memory pointer is treated as pointing to some memory-mapped I/O space, e.g. belonging to a third-party PCIe device. On Windows the flag is a no-op. On Linux that memory is marked as non cache-coherent for the GPU and is expected to be physically contiguous. It may return :py:obj:`~.CUDA_ERROR_NOT_PERMITTED` if run as an unprivileged user, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` on older Linux kernel versions. On all other platforms, it is not supported and :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` is returned. Flag for :py:obj:`~.cuMemHostRegister()` + +.. autoattribute:: cuda.bindings.driver.CU_MEMHOSTREGISTER_READ_ONLY + + If set, the passed memory pointer is treated as pointing to memory that is considered read-only by the device. On platforms without :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`, this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be queried from the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`. Using this flag with a current context associated with a device that does not have this attribute set will cause :py:obj:`~.cuMemHostRegister` to error with :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`. + +.. autoattribute:: cuda.bindings.driver.CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL + + Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers + +.. autoattribute:: cuda.bindings.driver.CU_TENSOR_MAP_NUM_QWORDS + + Size of tensor map descriptor + +.. autoattribute:: cuda.bindings.driver.CUDA_EXTERNAL_MEMORY_DEDICATED + + Indicates that the external memory object is a dedicated resource + +.. 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. + +.. 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. + +.. 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`. + +.. 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`. + +.. autoattribute:: cuda.bindings.driver.CU_MEM_CREATE_USAGE_TILE_POOL + + This flag if set indicates that the memory will be used as a tile pool. + +.. autoattribute:: cuda.bindings.driver.CU_MEM_CREATE_USAGE_HW_DECOMPRESS + + This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. + +.. autoattribute:: cuda.bindings.driver.CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS + + This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. + +.. autoattribute:: cuda.bindings.driver.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC + + If set, each kernel launched as part of :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution. + +.. autoattribute:: cuda.bindings.driver.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC + + If set, any subsequent work pushed in a stream that participated in a call to :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution. + +.. 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 :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` specifies the number of layers, not the depth of a 3D array. + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_2DARRAY + + Deprecated, use CUDA_ARRAY3D_LAYERED + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_SURFACE_LDST + + This flag must be set in order to bind a surface reference to the CUDA array + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_CUBEMAP + + If set, the CUDA array is a collection of six 2D arrays, representing faces of a cube. The width of such a CUDA array must be equal to its height, and Depth must be six. If :py:obj:`~.CUDA_ARRAY3D_LAYERED` flag is also set, then the CUDA array is a collection of cubemaps and Depth must be a multiple of six. + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_TEXTURE_GATHER + + This flag must be set in order to perform texture gather operations on a CUDA array. + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_DEPTH_TEXTURE + + This flag if set indicates that the CUDA array is a DEPTH_TEXTURE. + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_COLOR_ATTACHMENT + + This flag indicates that the CUDA array may be bound as a color target in an external graphics API + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_SPARSE + + This flag if set indicates that the CUDA array or CUDA mipmapped array is a sparse CUDA array or CUDA mipmapped array respectively + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_DEFERRED_MAPPING + + This flag if set indicates that the CUDA array or CUDA mipmapped array will allow deferred memory mapping + +.. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_VIDEO_ENCODE_DECODE + + This flag indicates that the CUDA array will be used for hardware accelerated video encode/decode operations. + +.. autoattribute:: cuda.bindings.driver.CU_TRSA_OVERRIDE_FORMAT + + Override the texref format with a format inferred from the array. Flag for :py:obj:`~.cuTexRefSetArray()` + +.. autoattribute:: cuda.bindings.driver.CU_TRSF_READ_AS_INTEGER + + Read the texture as integers rather than promoting the values to floats in the range [0,1]. Flag for :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` + +.. autoattribute:: cuda.bindings.driver.CU_TRSF_NORMALIZED_COORDINATES + + Use normalized texture coordinates in the range [0,1) instead of [0,dim). Flag for :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` + +.. autoattribute:: cuda.bindings.driver.CU_TRSF_SRGB + + Perform sRGB->linear conversion during texture read. Flag for :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` + +.. autoattribute:: cuda.bindings.driver.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION + + Disable any trilinear filtering optimizations. Flag for :py:obj:`~.cuTexRefSetFlags()` and :py:obj:`~.cuTexObjectCreate()` + +.. autoattribute:: cuda.bindings.driver.CU_TRSF_SEAMLESS_CUBEMAP + + Enable seamless cube map filtering. Flag for :py:obj:`~.cuTexObjectCreate()` + +.. autoattribute:: cuda.bindings.driver.CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM + + Launch with the required block dimension. + +.. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_END_AS_INT + + C++ compile time constant for CU_LAUNCH_PARAM_END + +.. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_END + + End of array terminator for the ``extra`` parameter to :py:obj:`~.cuLaunchKernel` + +.. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT + + C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_POINTER + +.. 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. + +.. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT + + C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_SIZE + +.. 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. + +.. autoattribute:: cuda.bindings.driver.CU_PARAM_TR_DEFAULT + + For texture references loaded into the module, use default texunit from texture reference. + +.. autoattribute:: cuda.bindings.driver.CU_DEVICE_CPU + + Device that represents the CPU + +.. autoattribute:: cuda.bindings.driver.CU_DEVICE_INVALID + + Device that represents an invalid device + +.. autoattribute:: cuda.bindings.driver.MAX_PLANES + + Maximum number of planes per frame + +.. autoattribute:: cuda.bindings.driver.CUDA_EGL_INFINITE_TIMEOUT + + Indicates that timeout for :py:obj:`~.cuEGLStreamConsumerAcquireFrame` is infinite. + + +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 +.. autofunction:: cuda.bindings.driver.cuGetErrorName + +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 + +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 + +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 +.. autofunction:: cuda.bindings.driver.cuDeviceGetCount +.. autofunction:: cuda.bindings.driver.cuDeviceGetName +.. autofunction:: cuda.bindings.driver.cuDeviceGetUuid +.. autofunction:: cuda.bindings.driver.cuDeviceGetUuid_v2 +.. autofunction:: cuda.bindings.driver.cuDeviceGetLuid +.. autofunction:: cuda.bindings.driver.cuDeviceTotalMem +.. autofunction:: cuda.bindings.driver.cuDeviceGetTexture1DLinearMaxWidth +.. autofunction:: cuda.bindings.driver.cuDeviceGetAttribute +.. autofunction:: cuda.bindings.driver.cuDeviceGetNvSciSyncAttributes +.. autofunction:: cuda.bindings.driver.cuDeviceSetMemPool +.. autofunction:: cuda.bindings.driver.cuDeviceGetMemPool +.. autofunction:: cuda.bindings.driver.cuDeviceGetDefaultMemPool +.. autofunction:: cuda.bindings.driver.cuDeviceGetExecAffinitySupport +.. autofunction:: cuda.bindings.driver.cuFlushGPUDirectRDMAWrites + +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. + + + +The primary context is unique per device and shared with the CUDA runtime API. These functions allow integration with other libraries using CUDA. + +.. autofunction:: cuda.bindings.driver.cuDevicePrimaryCtxRetain +.. autofunction:: cuda.bindings.driver.cuDevicePrimaryCtxRelease +.. autofunction:: cuda.bindings.driver.cuDevicePrimaryCtxSetFlags +.. autofunction:: cuda.bindings.driver.cuDevicePrimaryCtxGetState +.. autofunction:: cuda.bindings.driver.cuDevicePrimaryCtxReset + +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. + + + +Please note that some functions are described in Primary Context Management section. + +.. autofunction:: cuda.bindings.driver.cuCtxCreate +.. autofunction:: cuda.bindings.driver.cuCtxCreate_v3 +.. autofunction:: cuda.bindings.driver.cuCtxCreate_v4 +.. autofunction:: cuda.bindings.driver.cuCtxDestroy +.. autofunction:: cuda.bindings.driver.cuCtxPushCurrent +.. autofunction:: cuda.bindings.driver.cuCtxPopCurrent +.. autofunction:: cuda.bindings.driver.cuCtxSetCurrent +.. autofunction:: cuda.bindings.driver.cuCtxGetCurrent +.. autofunction:: cuda.bindings.driver.cuCtxGetDevice +.. autofunction:: cuda.bindings.driver.cuCtxGetFlags +.. autofunction:: cuda.bindings.driver.cuCtxSetFlags +.. autofunction:: cuda.bindings.driver.cuCtxGetId +.. autofunction:: cuda.bindings.driver.cuCtxSynchronize +.. autofunction:: cuda.bindings.driver.cuCtxSetLimit +.. autofunction:: cuda.bindings.driver.cuCtxGetLimit +.. autofunction:: cuda.bindings.driver.cuCtxGetCacheConfig +.. autofunction:: cuda.bindings.driver.cuCtxSetCacheConfig +.. autofunction:: cuda.bindings.driver.cuCtxGetApiVersion +.. autofunction:: cuda.bindings.driver.cuCtxGetStreamPriorityRange +.. autofunction:: cuda.bindings.driver.cuCtxResetPersistingL2Cache +.. autofunction:: cuda.bindings.driver.cuCtxGetExecAffinity +.. autofunction:: cuda.bindings.driver.cuCtxRecordEvent +.. autofunction:: cuda.bindings.driver.cuCtxWaitEvent + +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 + + .. autoattribute:: cuda.bindings.driver.CUmoduleLoadingMode.CU_MODULE_EAGER_LOADING + + + Lazy Kernel Loading is not enabled + + + .. autoattribute:: cuda.bindings.driver.CUmoduleLoadingMode.CU_MODULE_LAZY_LOADING + + + Lazy Kernel Loading is enabled + +.. autofunction:: cuda.bindings.driver.cuModuleLoad +.. autofunction:: cuda.bindings.driver.cuModuleLoadData +.. autofunction:: cuda.bindings.driver.cuModuleLoadDataEx +.. autofunction:: cuda.bindings.driver.cuModuleLoadFatBinary +.. autofunction:: cuda.bindings.driver.cuModuleUnload +.. autofunction:: cuda.bindings.driver.cuModuleGetLoadingMode +.. autofunction:: cuda.bindings.driver.cuModuleGetFunction +.. autofunction:: cuda.bindings.driver.cuModuleGetFunctionCount +.. autofunction:: cuda.bindings.driver.cuModuleEnumerateFunctions +.. autofunction:: cuda.bindings.driver.cuModuleGetGlobal +.. autofunction:: cuda.bindings.driver.cuLinkCreate +.. autofunction:: cuda.bindings.driver.cuLinkAddData +.. autofunction:: cuda.bindings.driver.cuLinkAddFile +.. autofunction:: cuda.bindings.driver.cuLinkComplete +.. autofunction:: cuda.bindings.driver.cuLinkDestroy + +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 +.. autofunction:: cuda.bindings.driver.cuLibraryLoadFromFile +.. autofunction:: cuda.bindings.driver.cuLibraryUnload +.. autofunction:: cuda.bindings.driver.cuLibraryGetKernel +.. autofunction:: cuda.bindings.driver.cuLibraryGetKernelCount +.. autofunction:: cuda.bindings.driver.cuLibraryEnumerateKernels +.. autofunction:: cuda.bindings.driver.cuLibraryGetModule +.. autofunction:: cuda.bindings.driver.cuKernelGetFunction +.. autofunction:: cuda.bindings.driver.cuKernelGetLibrary +.. autofunction:: cuda.bindings.driver.cuLibraryGetGlobal +.. autofunction:: cuda.bindings.driver.cuLibraryGetManaged +.. autofunction:: cuda.bindings.driver.cuLibraryGetUnifiedFunction +.. autofunction:: cuda.bindings.driver.cuKernelGetAttribute +.. autofunction:: cuda.bindings.driver.cuKernelSetAttribute +.. autofunction:: cuda.bindings.driver.cuKernelSetCacheConfig +.. autofunction:: cuda.bindings.driver.cuKernelGetName +.. autofunction:: cuda.bindings.driver.cuKernelGetParamInfo + +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 +.. autoclass:: cuda.bindings.driver.CUmemDecompressAlgorithm + + .. autoattribute:: cuda.bindings.driver.CUmemDecompressAlgorithm.CU_MEM_DECOMPRESS_UNSUPPORTED + + + Decompression is unsupported. + + + .. autoattribute:: cuda.bindings.driver.CUmemDecompressAlgorithm.CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE + + + Deflate is supported. + + + .. autoattribute:: cuda.bindings.driver.CUmemDecompressAlgorithm.CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY + + + Snappy is supported. + + + .. autoattribute:: cuda.bindings.driver.CUmemDecompressAlgorithm.CU_MEM_DECOMPRESS_ALGORITHM_LZ4 + + + LZ4 is supported. + +.. autoclass:: cuda.bindings.driver.CUmemDecompressParams +.. autofunction:: cuda.bindings.driver.cuMemGetInfo +.. autofunction:: cuda.bindings.driver.cuMemAlloc +.. autofunction:: cuda.bindings.driver.cuMemAllocPitch +.. autofunction:: cuda.bindings.driver.cuMemFree +.. autofunction:: cuda.bindings.driver.cuMemGetAddressRange +.. autofunction:: cuda.bindings.driver.cuMemAllocHost +.. autofunction:: cuda.bindings.driver.cuMemFreeHost +.. autofunction:: cuda.bindings.driver.cuMemHostAlloc +.. autofunction:: cuda.bindings.driver.cuMemHostGetDevicePointer +.. autofunction:: cuda.bindings.driver.cuMemHostGetFlags +.. autofunction:: cuda.bindings.driver.cuMemAllocManaged +.. autofunction:: cuda.bindings.driver.cuDeviceRegisterAsyncNotification +.. autofunction:: cuda.bindings.driver.cuDeviceUnregisterAsyncNotification +.. autofunction:: cuda.bindings.driver.cuDeviceGetByPCIBusId +.. autofunction:: cuda.bindings.driver.cuDeviceGetPCIBusId +.. autofunction:: cuda.bindings.driver.cuIpcGetEventHandle +.. autofunction:: cuda.bindings.driver.cuIpcOpenEventHandle +.. autofunction:: cuda.bindings.driver.cuIpcGetMemHandle +.. autofunction:: cuda.bindings.driver.cuIpcOpenMemHandle +.. autofunction:: cuda.bindings.driver.cuIpcCloseMemHandle +.. autofunction:: cuda.bindings.driver.cuMemHostRegister +.. autofunction:: cuda.bindings.driver.cuMemHostUnregister +.. autofunction:: cuda.bindings.driver.cuMemcpy +.. autofunction:: cuda.bindings.driver.cuMemcpyPeer +.. autofunction:: cuda.bindings.driver.cuMemcpyHtoD +.. autofunction:: cuda.bindings.driver.cuMemcpyDtoH +.. autofunction:: cuda.bindings.driver.cuMemcpyDtoD +.. autofunction:: cuda.bindings.driver.cuMemcpyDtoA +.. autofunction:: cuda.bindings.driver.cuMemcpyAtoD +.. autofunction:: cuda.bindings.driver.cuMemcpyHtoA +.. autofunction:: cuda.bindings.driver.cuMemcpyAtoH +.. autofunction:: cuda.bindings.driver.cuMemcpyAtoA +.. autofunction:: cuda.bindings.driver.cuMemcpy2D +.. autofunction:: cuda.bindings.driver.cuMemcpy2DUnaligned +.. autofunction:: cuda.bindings.driver.cuMemcpy3D +.. autofunction:: cuda.bindings.driver.cuMemcpy3DPeer +.. autofunction:: cuda.bindings.driver.cuMemcpyAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyPeerAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyHtoDAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyDtoHAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyDtoDAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyHtoAAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyAtoHAsync +.. autofunction:: cuda.bindings.driver.cuMemcpy2DAsync +.. autofunction:: cuda.bindings.driver.cuMemcpy3DAsync +.. autofunction:: cuda.bindings.driver.cuMemcpy3DPeerAsync +.. autofunction:: cuda.bindings.driver.cuMemcpyBatchAsync +.. autofunction:: cuda.bindings.driver.cuMemcpy3DBatchAsync +.. autofunction:: cuda.bindings.driver.cuMemsetD8 +.. autofunction:: cuda.bindings.driver.cuMemsetD16 +.. autofunction:: cuda.bindings.driver.cuMemsetD32 +.. autofunction:: cuda.bindings.driver.cuMemsetD2D8 +.. autofunction:: cuda.bindings.driver.cuMemsetD2D16 +.. autofunction:: cuda.bindings.driver.cuMemsetD2D32 +.. autofunction:: cuda.bindings.driver.cuMemsetD8Async +.. autofunction:: cuda.bindings.driver.cuMemsetD16Async +.. autofunction:: cuda.bindings.driver.cuMemsetD32Async +.. autofunction:: cuda.bindings.driver.cuMemsetD2D8Async +.. autofunction:: cuda.bindings.driver.cuMemsetD2D16Async +.. autofunction:: cuda.bindings.driver.cuMemsetD2D32Async +.. autofunction:: cuda.bindings.driver.cuArrayCreate +.. autofunction:: cuda.bindings.driver.cuArrayGetDescriptor +.. autofunction:: cuda.bindings.driver.cuArrayGetSparseProperties +.. autofunction:: cuda.bindings.driver.cuMipmappedArrayGetSparseProperties +.. autofunction:: cuda.bindings.driver.cuArrayGetMemoryRequirements +.. autofunction:: cuda.bindings.driver.cuMipmappedArrayGetMemoryRequirements +.. autofunction:: cuda.bindings.driver.cuArrayGetPlane +.. autofunction:: cuda.bindings.driver.cuArrayDestroy +.. autofunction:: cuda.bindings.driver.cuArray3DCreate +.. autofunction:: cuda.bindings.driver.cuArray3DGetDescriptor +.. autofunction:: cuda.bindings.driver.cuMipmappedArrayCreate +.. autofunction:: cuda.bindings.driver.cuMipmappedArrayGetLevel +.. autofunction:: cuda.bindings.driver.cuMipmappedArrayDestroy +.. autofunction:: cuda.bindings.driver.cuMemGetHandleForAddressRange +.. autofunction:: cuda.bindings.driver.cuMemBatchDecompressAsync + +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 +.. autofunction:: cuda.bindings.driver.cuMemAddressFree +.. autofunction:: cuda.bindings.driver.cuMemCreate +.. autofunction:: cuda.bindings.driver.cuMemRelease +.. autofunction:: cuda.bindings.driver.cuMemMap +.. autofunction:: cuda.bindings.driver.cuMemMapArrayAsync +.. autofunction:: cuda.bindings.driver.cuMemUnmap +.. autofunction:: cuda.bindings.driver.cuMemSetAccess +.. autofunction:: cuda.bindings.driver.cuMemGetAccess +.. autofunction:: cuda.bindings.driver.cuMemExportToShareableHandle +.. autofunction:: cuda.bindings.driver.cuMemImportFromShareableHandle +.. autofunction:: cuda.bindings.driver.cuMemGetAllocationGranularity +.. autofunction:: cuda.bindings.driver.cuMemGetAllocationPropertiesFromHandle +.. autofunction:: cuda.bindings.driver.cuMemRetainAllocationHandle + +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 + + + +This section describes the stream ordered memory allocator exposed by the low-level CUDA driver application programming interface. + + + + + +**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 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. + + + + + +**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 +.. autofunction:: cuda.bindings.driver.cuMemAllocAsync +.. autofunction:: cuda.bindings.driver.cuMemPoolTrimTo +.. autofunction:: cuda.bindings.driver.cuMemPoolSetAttribute +.. autofunction:: cuda.bindings.driver.cuMemPoolGetAttribute +.. autofunction:: cuda.bindings.driver.cuMemPoolSetAccess +.. autofunction:: cuda.bindings.driver.cuMemPoolGetAccess +.. autofunction:: cuda.bindings.driver.cuMemPoolCreate +.. autofunction:: cuda.bindings.driver.cuMemPoolDestroy +.. autofunction:: cuda.bindings.driver.cuMemAllocFromPoolAsync +.. autofunction:: cuda.bindings.driver.cuMemPoolExportToShareableHandle +.. autofunction:: cuda.bindings.driver.cuMemPoolImportFromShareableHandle +.. autofunction:: cuda.bindings.driver.cuMemPoolExportPointer +.. autofunction:: cuda.bindings.driver.cuMemPoolImportPointer + +Multicast Object Management +--------------------------- + +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** + +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 either cuMulticastBindMem or cuMulticastBindAddr. Multicast objects can be mapped into a device's virtual address space using the virtual memmory management APIs (see cuMemMap and cuMemSetAccess). + + + + + +**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 +.. autofunction:: cuda.bindings.driver.cuMulticastAddDevice +.. autofunction:: cuda.bindings.driver.cuMulticastBindMem +.. autofunction:: cuda.bindings.driver.cuMulticastBindAddr +.. autofunction:: cuda.bindings.driver.cuMulticastUnbind +.. autofunction:: cuda.bindings.driver.cuMulticastGetGranularity + +Unified Addressing +------------------ + +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** + +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). + + + + + +**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 + + + + + +**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. + + + + + +**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. + +Note that this is not the case for memory allocated using the flag CU_MEMHOSTALLOC_WRITECOMBINED, as discussed below. + + + + + +**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. + + + + + +**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. + +.. autofunction:: cuda.bindings.driver.cuPointerGetAttribute +.. autofunction:: cuda.bindings.driver.cuMemPrefetchAsync +.. autofunction:: cuda.bindings.driver.cuMemPrefetchAsync_v2 +.. autofunction:: cuda.bindings.driver.cuMemAdvise +.. autofunction:: cuda.bindings.driver.cuMemAdvise_v2 +.. autofunction:: cuda.bindings.driver.cuMemRangeGetAttribute +.. autofunction:: cuda.bindings.driver.cuMemRangeGetAttributes +.. autofunction:: cuda.bindings.driver.cuPointerSetAttribute +.. autofunction:: cuda.bindings.driver.cuPointerGetAttributes + +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. + +.. autofunction:: cuda.bindings.driver.cuStreamCreate +.. autofunction:: cuda.bindings.driver.cuStreamCreateWithPriority +.. autofunction:: cuda.bindings.driver.cuStreamGetPriority +.. autofunction:: cuda.bindings.driver.cuStreamGetDevice +.. autofunction:: cuda.bindings.driver.cuStreamGetFlags +.. autofunction:: cuda.bindings.driver.cuStreamGetId +.. autofunction:: cuda.bindings.driver.cuStreamGetCtx +.. autofunction:: cuda.bindings.driver.cuStreamGetCtx_v2 +.. autofunction:: cuda.bindings.driver.cuStreamWaitEvent +.. autofunction:: cuda.bindings.driver.cuStreamAddCallback +.. autofunction:: cuda.bindings.driver.cuStreamBeginCapture +.. autofunction:: cuda.bindings.driver.cuStreamBeginCaptureToGraph +.. autofunction:: cuda.bindings.driver.cuThreadExchangeStreamCaptureMode +.. autofunction:: cuda.bindings.driver.cuStreamEndCapture +.. autofunction:: cuda.bindings.driver.cuStreamIsCapturing +.. autofunction:: cuda.bindings.driver.cuStreamGetCaptureInfo +.. autofunction:: cuda.bindings.driver.cuStreamGetCaptureInfo_v3 +.. autofunction:: cuda.bindings.driver.cuStreamUpdateCaptureDependencies +.. autofunction:: cuda.bindings.driver.cuStreamUpdateCaptureDependencies_v2 +.. autofunction:: cuda.bindings.driver.cuStreamAttachMemAsync +.. autofunction:: cuda.bindings.driver.cuStreamQuery +.. autofunction:: cuda.bindings.driver.cuStreamSynchronize +.. autofunction:: cuda.bindings.driver.cuStreamDestroy +.. autofunction:: cuda.bindings.driver.cuStreamCopyAttributes +.. autofunction:: cuda.bindings.driver.cuStreamGetAttribute +.. autofunction:: cuda.bindings.driver.cuStreamSetAttribute + +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 +.. autofunction:: cuda.bindings.driver.cuEventRecord +.. autofunction:: cuda.bindings.driver.cuEventRecordWithFlags +.. autofunction:: cuda.bindings.driver.cuEventQuery +.. autofunction:: cuda.bindings.driver.cuEventSynchronize +.. autofunction:: cuda.bindings.driver.cuEventDestroy +.. autofunction:: cuda.bindings.driver.cuEventElapsedTime +.. autofunction:: cuda.bindings.driver.cuEventElapsedTime_v2 + +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 +.. autofunction:: cuda.bindings.driver.cuExternalMemoryGetMappedBuffer +.. autofunction:: cuda.bindings.driver.cuExternalMemoryGetMappedMipmappedArray +.. autofunction:: cuda.bindings.driver.cuDestroyExternalMemory +.. autofunction:: cuda.bindings.driver.cuImportExternalSemaphore +.. autofunction:: cuda.bindings.driver.cuSignalExternalSemaphoresAsync +.. autofunction:: cuda.bindings.driver.cuWaitExternalSemaphoresAsync +.. autofunction:: cuda.bindings.driver.cuDestroyExternalSemaphore + +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. + + + +Support for the CU_STREAM_WAIT_VALUE_NOR flag can be queried with ::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V2. + + + +Support for the cuStreamWriteValue64() and cuStreamWaitValue64() functions, as well as for the CU_STREAM_MEM_OP_WAIT_VALUE_64 and CU_STREAM_MEM_OP_WRITE_VALUE_64 flags, can be queried with CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS. + + + +Support for both CU_STREAM_WAIT_VALUE_FLUSH and CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES requires dedicated platform hardware features and can be queried with cuDeviceGetAttribute() and CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES. + + + +Note that all memory pointers passed as parameters to these operations are device pointers. Where necessary a device pointer should be obtained, for example with cuMemHostGetDevicePointer(). + + + +None of the operations accepts pointers to managed memory buffers (cuMemAllocManaged). + + + +Warning: Improper use of these APIs may deadlock the application. Synchronization ordering established through these APIs is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by these APIs should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. + +.. autofunction:: cuda.bindings.driver.cuStreamWaitValue32 +.. autofunction:: cuda.bindings.driver.cuStreamWaitValue64 +.. autofunction:: cuda.bindings.driver.cuStreamWriteValue32 +.. autofunction:: cuda.bindings.driver.cuStreamWriteValue64 +.. autofunction:: cuda.bindings.driver.cuStreamBatchMemOp + +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 + + .. autoattribute:: cuda.bindings.driver.CUfunctionLoadingState.CU_FUNCTION_LOADING_STATE_UNLOADED + + + .. autoattribute:: cuda.bindings.driver.CUfunctionLoadingState.CU_FUNCTION_LOADING_STATE_LOADED + + + .. autoattribute:: cuda.bindings.driver.CUfunctionLoadingState.CU_FUNCTION_LOADING_STATE_MAX + +.. autofunction:: cuda.bindings.driver.cuFuncGetAttribute +.. autofunction:: cuda.bindings.driver.cuFuncSetAttribute +.. autofunction:: cuda.bindings.driver.cuFuncSetCacheConfig +.. autofunction:: cuda.bindings.driver.cuFuncGetModule +.. autofunction:: cuda.bindings.driver.cuFuncGetName +.. autofunction:: cuda.bindings.driver.cuFuncGetParamInfo +.. autofunction:: cuda.bindings.driver.cuFuncIsLoaded +.. autofunction:: cuda.bindings.driver.cuFuncLoad +.. 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 + +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 +.. autofunction:: cuda.bindings.driver.cuGraphAddKernelNode +.. autofunction:: cuda.bindings.driver.cuGraphKernelNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphKernelNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddMemcpyNode +.. autofunction:: cuda.bindings.driver.cuGraphMemcpyNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphMemcpyNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddMemsetNode +.. autofunction:: cuda.bindings.driver.cuGraphMemsetNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphMemsetNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddHostNode +.. autofunction:: cuda.bindings.driver.cuGraphHostNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphHostNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddChildGraphNode +.. autofunction:: cuda.bindings.driver.cuGraphChildGraphNodeGetGraph +.. autofunction:: cuda.bindings.driver.cuGraphAddEmptyNode +.. autofunction:: cuda.bindings.driver.cuGraphAddEventRecordNode +.. autofunction:: cuda.bindings.driver.cuGraphEventRecordNodeGetEvent +.. autofunction:: cuda.bindings.driver.cuGraphEventRecordNodeSetEvent +.. autofunction:: cuda.bindings.driver.cuGraphAddEventWaitNode +.. autofunction:: cuda.bindings.driver.cuGraphEventWaitNodeGetEvent +.. autofunction:: cuda.bindings.driver.cuGraphEventWaitNodeSetEvent +.. autofunction:: cuda.bindings.driver.cuGraphAddExternalSemaphoresSignalNode +.. autofunction:: cuda.bindings.driver.cuGraphExternalSemaphoresSignalNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphExternalSemaphoresSignalNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddExternalSemaphoresWaitNode +.. autofunction:: cuda.bindings.driver.cuGraphExternalSemaphoresWaitNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphExternalSemaphoresWaitNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddBatchMemOpNode +.. autofunction:: cuda.bindings.driver.cuGraphBatchMemOpNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphBatchMemOpNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecBatchMemOpNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddMemAllocNode +.. autofunction:: cuda.bindings.driver.cuGraphMemAllocNodeGetParams +.. autofunction:: cuda.bindings.driver.cuGraphAddMemFreeNode +.. autofunction:: cuda.bindings.driver.cuGraphMemFreeNodeGetParams +.. autofunction:: cuda.bindings.driver.cuDeviceGraphMemTrim +.. autofunction:: cuda.bindings.driver.cuDeviceGetGraphMemAttribute +.. autofunction:: cuda.bindings.driver.cuDeviceSetGraphMemAttribute +.. autofunction:: cuda.bindings.driver.cuGraphClone +.. autofunction:: cuda.bindings.driver.cuGraphNodeFindInClone +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetType +.. autofunction:: cuda.bindings.driver.cuGraphGetNodes +.. autofunction:: cuda.bindings.driver.cuGraphGetRootNodes +.. autofunction:: cuda.bindings.driver.cuGraphGetEdges +.. autofunction:: cuda.bindings.driver.cuGraphGetEdges_v2 +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependencies +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependencies_v2 +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependentNodes +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetDependentNodes_v2 +.. autofunction:: cuda.bindings.driver.cuGraphAddDependencies +.. autofunction:: cuda.bindings.driver.cuGraphAddDependencies_v2 +.. autofunction:: cuda.bindings.driver.cuGraphRemoveDependencies +.. autofunction:: cuda.bindings.driver.cuGraphRemoveDependencies_v2 +.. autofunction:: cuda.bindings.driver.cuGraphDestroyNode +.. autofunction:: cuda.bindings.driver.cuGraphInstantiate +.. autofunction:: cuda.bindings.driver.cuGraphInstantiateWithParams +.. autofunction:: cuda.bindings.driver.cuGraphExecGetFlags +.. autofunction:: cuda.bindings.driver.cuGraphExecKernelNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecMemcpyNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecMemsetNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecHostNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecChildGraphNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecEventRecordNodeSetEvent +.. autofunction:: cuda.bindings.driver.cuGraphExecEventWaitNodeSetEvent +.. autofunction:: cuda.bindings.driver.cuGraphExecExternalSemaphoresSignalNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecExternalSemaphoresWaitNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphNodeSetEnabled +.. autofunction:: cuda.bindings.driver.cuGraphNodeGetEnabled +.. autofunction:: cuda.bindings.driver.cuGraphUpload +.. autofunction:: cuda.bindings.driver.cuGraphLaunch +.. autofunction:: cuda.bindings.driver.cuGraphExecDestroy +.. autofunction:: cuda.bindings.driver.cuGraphDestroy +.. autofunction:: cuda.bindings.driver.cuGraphExecUpdate +.. autofunction:: cuda.bindings.driver.cuGraphKernelNodeCopyAttributes +.. autofunction:: cuda.bindings.driver.cuGraphKernelNodeGetAttribute +.. autofunction:: cuda.bindings.driver.cuGraphKernelNodeSetAttribute +.. autofunction:: cuda.bindings.driver.cuGraphDebugDotPrint +.. autofunction:: cuda.bindings.driver.cuUserObjectCreate +.. autofunction:: cuda.bindings.driver.cuUserObjectRetain +.. autofunction:: cuda.bindings.driver.cuUserObjectRelease +.. autofunction:: cuda.bindings.driver.cuGraphRetainUserObject +.. autofunction:: cuda.bindings.driver.cuGraphReleaseUserObject +.. autofunction:: cuda.bindings.driver.cuGraphAddNode +.. autofunction:: cuda.bindings.driver.cuGraphAddNode_v2 +.. autofunction:: cuda.bindings.driver.cuGraphNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphExecNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphConditionalHandleCreate + +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 +.. autofunction:: cuda.bindings.driver.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags +.. autofunction:: cuda.bindings.driver.cuOccupancyMaxPotentialBlockSize +.. autofunction:: cuda.bindings.driver.cuOccupancyMaxPotentialBlockSizeWithFlags +.. autofunction:: cuda.bindings.driver.cuOccupancyAvailableDynamicSMemPerBlock +.. autofunction:: cuda.bindings.driver.cuOccupancyMaxPotentialClusterSize +.. autofunction:: cuda.bindings.driver.cuOccupancyMaxActiveClusters + +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 +.. autofunction:: cuda.bindings.driver.cuTexObjectDestroy +.. autofunction:: cuda.bindings.driver.cuTexObjectGetResourceDesc +.. autofunction:: cuda.bindings.driver.cuTexObjectGetTextureDesc +.. autofunction:: cuda.bindings.driver.cuTexObjectGetResourceViewDesc + +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 +.. autofunction:: cuda.bindings.driver.cuSurfObjectDestroy +.. autofunction:: cuda.bindings.driver.cuSurfObjectGetResourceDesc + +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 +.. autofunction:: cuda.bindings.driver.cuTensorMapEncodeIm2col +.. autofunction:: cuda.bindings.driver.cuTensorMapEncodeIm2colWide +.. autofunction:: cuda.bindings.driver.cuTensorMapReplaceAddress + +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 +.. autofunction:: cuda.bindings.driver.cuCtxEnablePeerAccess +.. autofunction:: cuda.bindings.driver.cuCtxDisablePeerAccess +.. autofunction:: cuda.bindings.driver.cuDeviceGetP2PAttribute + +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 +.. autofunction:: cuda.bindings.driver.cuGraphicsSubResourceGetMappedArray +.. autofunction:: cuda.bindings.driver.cuGraphicsResourceGetMappedMipmappedArray +.. autofunction:: cuda.bindings.driver.cuGraphicsResourceGetMappedPointer +.. autofunction:: cuda.bindings.driver.cuGraphicsResourceSetMapFlags +.. autofunction:: cuda.bindings.driver.cuGraphicsMapResources +.. autofunction:: cuda.bindings.driver.cuGraphicsUnmapResources + +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 + +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 + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_ENABLE_ON_EXCEPTION + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_TRIGGER_HOST + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_LIGHTWEIGHT + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_ENABLE_USER_TRIGGER + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_FILE + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_PIPE + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_GENERATION_FLAGS + + + .. autoattribute:: cuda.bindings.driver.CUcoredumpSettings.CU_COREDUMP_MAX + +.. autoclass:: cuda.bindings.driver.CUCoredumpGenerationFlags + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_DEFAULT_FLAGS + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_GLOBAL_MEMORY + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_SHARED_MEMORY + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_LOCAL_MEMORY + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_ABORT + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_CONSTBANK_MEMORY + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS + +.. autofunction:: cuda.bindings.driver.cuCoredumpGetAttribute +.. autofunction:: cuda.bindings.driver.cuCoredumpGetAttributeGlobal +.. autofunction:: cuda.bindings.driver.cuCoredumpSetAttribute +.. autofunction:: cuda.bindings.driver.cuCoredumpSetAttributeGlobal + +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, with the ability to pass in a set of resources that they should be initialized with. This allows the developer to represent distinct spatial partitions of the GPU, provision resources for them, and target them via the same programming model that CUDA exposes (streams, kernel launches, etc.). + + + +There are 4 main steps to using these new set of APIs. + +- (1) Start with an initial set of resources, for example via cuDeviceGetDevResource. Only SM type is supported today. + + + + + + + +- (2) Partition this set of resources by providing them as input to a partition API, for example: cuDevSmResourceSplitByCount. + + + + + + + +- (3) Finalize the specification of resources by creating a descriptor via cuDevResourceGenerateDesc. + + + + + + + +- (4) Provision the resources and create a green context via cuGreenCtxCreate. + + + + + + + + + + + +For ``CU_DEV_RESOURCE_TYPE_SM``, the partitions created have minimum SM count requirements, often rounding up and aligning the minCount provided to cuDevSmResourceSplitByCount. The following is a guideline for each architecture and may be subject to change: + +- On Compute Architecture 6.X: The minimum count is 1 SM. + + + + + + + +- On Compute Architecture 7.X: The minimum count is 2 SMs and must be a multiple of 2. + + + + + + + +- On Compute Architecture 8.X: The minimum count is 4 SMs and must be a multiple of 2. + + + + + + + +- On Compute Architecture 9.0+: The minimum count is 8 SMs and must be a multiple of 8. + + + + + + + + + + + +In the future, flags can be provided to tradeoff functional and performance characteristics versus finer grained SM partitions. + + + +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 (like HW connections, see ::CUDA_DEVICE_MAX_CONNECTIONS) that could cause a dependency. Additionally, in certain scenarios, it is possible for the workload to run on more SMs than was provisioned (but never less). The following are two scenarios which can exhibit this behavior: + +- 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 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. + +.. autoclass:: cuda.bindings.driver.CUdevSmResource_st +.. autoclass:: cuda.bindings.driver.CUdevResource_st +.. autoclass:: cuda.bindings.driver.CUdevSmResource +.. autoclass:: cuda.bindings.driver.CUdevResource +.. autoclass:: cuda.bindings.driver.CUgreenCtxCreate_flags + + .. autoattribute:: cuda.bindings.driver.CUgreenCtxCreate_flags.CU_GREEN_CTX_DEFAULT_STREAM + + + Required. Creates a default stream to use inside the green context + +.. autoclass:: cuda.bindings.driver.CUdevSmResourceSplit_flags + + .. autoattribute:: cuda.bindings.driver.CUdevSmResourceSplit_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING + + + .. autoattribute:: cuda.bindings.driver.CUdevSmResourceSplit_flags.CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE + +.. autoclass:: cuda.bindings.driver.CUdevResourceType + + .. autoattribute:: cuda.bindings.driver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_INVALID + + + .. autoattribute:: cuda.bindings.driver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM + + + Streaming multiprocessors related information + +.. autoclass:: cuda.bindings.driver.CUdevResourceDesc +.. autoclass:: cuda.bindings.driver.CUdevSmResource +.. autofunction:: cuda.bindings.driver.cuGreenCtxCreate +.. autofunction:: cuda.bindings.driver.cuGreenCtxDestroy +.. autofunction:: cuda.bindings.driver.cuCtxFromGreenCtx +.. autofunction:: cuda.bindings.driver.cuDeviceGetDevResource +.. autofunction:: cuda.bindings.driver.cuCtxGetDevResource +.. autofunction:: cuda.bindings.driver.cuGreenCtxGetDevResource +.. autofunction:: cuda.bindings.driver.cuDevSmResourceSplitByCount +.. autofunction:: cuda.bindings.driver.cuDevResourceGenerateDesc +.. autofunction:: cuda.bindings.driver.cuGreenCtxRecordEvent +.. autofunction:: cuda.bindings.driver.cuGreenCtxWaitEvent +.. autofunction:: cuda.bindings.driver.cuStreamGetGreenCtx +.. autofunction:: cuda.bindings.driver.cuGreenCtxStreamCreate +.. autoattribute:: cuda.bindings.driver.RESOURCE_ABI_VERSION +.. autoattribute:: cuda.bindings.driver.RESOURCE_ABI_EXTERNAL_BYTES + +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 + + .. autoattribute:: cuda.bindings.driver.CUlogLevel.CU_LOG_LEVEL_ERROR + + + .. autoattribute:: cuda.bindings.driver.CUlogLevel.CU_LOG_LEVEL_WARNING + +.. autoclass:: cuda.bindings.driver.CUlogsCallbackHandle +.. autoclass:: cuda.bindings.driver.CUlogsCallback +.. autoclass:: cuda.bindings.driver.CUlogIterator +.. autofunction:: cuda.bindings.driver.cuLogsRegisterCallback +.. autofunction:: cuda.bindings.driver.cuLogsUnregisterCallback +.. autofunction:: cuda.bindings.driver.cuLogsCurrent +.. autofunction:: cuda.bindings.driver.cuLogsDumpToFile +.. autofunction:: cuda.bindings.driver.cuLogsDumpToMemory + +CUDA Checkpointing +------------------ + +CUDA API versioning support + + + +MANBRIEF CUDA checkpoint and restore functionality of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + +This sections describes the checkpoint and restore functions of the low-level CUDA driver application programming interface. + + + +The CUDA checkpoint and restore API's provide a way to save and restore GPU state for full process checkpoints when used with CPU side process checkpointing solutions. They can also be used to pause GPU work and suspend a CUDA process to allow other applications to make use of GPU resources. + + + +Checkpoint and restore capabilities are currently restricted to Linux. + +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessGetRestoreThreadId +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessGetState +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessLock +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessCheckpoint +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessRestore +.. autofunction:: cuda.bindings.driver.cuCheckpointProcessUnlock + +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 +.. autofunction:: cuda.bindings.driver.cuEGLStreamConsumerConnect +.. autofunction:: cuda.bindings.driver.cuEGLStreamConsumerConnectWithFlags +.. autofunction:: cuda.bindings.driver.cuEGLStreamConsumerDisconnect +.. autofunction:: cuda.bindings.driver.cuEGLStreamConsumerAcquireFrame +.. autofunction:: cuda.bindings.driver.cuEGLStreamConsumerReleaseFrame +.. autofunction:: cuda.bindings.driver.cuEGLStreamProducerConnect +.. autofunction:: cuda.bindings.driver.cuEGLStreamProducerDisconnect +.. autofunction:: cuda.bindings.driver.cuEGLStreamProducerPresentFrame +.. autofunction:: cuda.bindings.driver.cuEGLStreamProducerReturnFrame +.. autofunction:: cuda.bindings.driver.cuGraphicsResourceGetMappedEglFrame +.. autofunction:: cuda.bindings.driver.cuEventCreateFromEGLSync + +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 + + .. autoattribute:: cuda.bindings.driver.CUGLDeviceList.CU_GL_DEVICE_LIST_ALL + + + The CUDA devices for all GPUs used by the current OpenGL context + + + .. autoattribute:: cuda.bindings.driver.CUGLDeviceList.CU_GL_DEVICE_LIST_CURRENT_FRAME + + + The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame + + + .. autoattribute:: cuda.bindings.driver.CUGLDeviceList.CU_GL_DEVICE_LIST_NEXT_FRAME + + + The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame + +.. autofunction:: cuda.bindings.driver.cuGraphicsGLRegisterBuffer +.. autofunction:: cuda.bindings.driver.cuGraphicsGLRegisterImage +.. autofunction:: cuda.bindings.driver.cuGLGetDevices + +VDPAU Interoperability +---------------------- + +MANBRIEF VDPAU interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the VDPAU interoperability functions of the low-level CUDA driver application programming interface. + +.. autofunction:: cuda.bindings.driver.cuVDPAUGetDevice +.. autofunction:: cuda.bindings.driver.cuVDPAUCtxCreate +.. autofunction:: cuda.bindings.driver.cuGraphicsVDPAURegisterVideoSurface +.. autofunction:: cuda.bindings.driver.cuGraphicsVDPAURegisterOutputSurface diff --git a/cuda_bindings_12/docs/source/module/nvfatbin.rst b/cuda_bindings_12/docs/source/module/nvfatbin.rst new file mode 100644 index 00000000000..1455cf6ba50 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/nvfatbin.rst @@ -0,0 +1,89 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. default-role:: cpp:any + +nvfatbin +======== + +Note +---- + +The nvfatbin bindings are not supported on nvFatbin installations <12.4. Ensure the installed CUDA toolkit's nvFatbin version is >=12.4. + +The Tile IR API (:func:`cuda.bindings.nvfatbin.add_tile_ir`) is only available in CUDA 13.1+. + +Functions +--------- + +NvFatbin defines the following functions for creating and populating fatbinaries. + +.. autofunction:: cuda.bindings.nvfatbin.create +.. autofunction:: cuda.bindings.nvfatbin.destroy +.. autofunction:: cuda.bindings.nvfatbin.add_ptx +.. autofunction:: cuda.bindings.nvfatbin.add_cubin +.. autofunction:: cuda.bindings.nvfatbin.add_ltoir +.. autofunction:: cuda.bindings.nvfatbin.add_reloc +.. autofunction:: cuda.bindings.nvfatbin.add_tile_ir +.. autofunction:: cuda.bindings.nvfatbin.size +.. autofunction:: cuda.bindings.nvfatbin.get +.. autofunction:: cuda.bindings.nvfatbin.get_error_string +.. autofunction:: cuda.bindings.nvfatbin.version + +Types +--------- +.. autoclass:: cuda.bindings.nvfatbin.Result + + .. autoattribute:: cuda.bindings.nvfatbin.Result.SUCCESS + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_INTERNAL + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_ELF_ARCH_MISMATCH + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_ELF_SIZE_MISMATCH + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_MISSING_PTX_VERSION + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_NULL_POINTER + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_COMPRESSION_FAILED + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_COMPRESSED_SIZE_EXCEEDED + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_UNRECOGNIZED_OPTION + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_INVALID_ARCH + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_INVALID_NVVM + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_EMPTY_INPUT + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_MISSING_PTX_ARCH + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_PTX_ARCH_MISMATCH + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_MISSING_FATBIN + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_INVALID_INDEX + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_IDENTIFIER_REUSE + + + .. autoattribute:: cuda.bindings.nvfatbin.Result.ERROR_INTERNAL_PTX_OPTION + diff --git a/cuda_bindings_12/docs/source/module/nvjitlink.rst b/cuda_bindings_12/docs/source/module/nvjitlink.rst new file mode 100644 index 00000000000..271fc4424bc --- /dev/null +++ b/cuda_bindings_12/docs/source/module/nvjitlink.rst @@ -0,0 +1,94 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. default-role:: cpp:any + +nvjitlink +========= + +Note +---- + +The nvjitlink bindings are not supported on nvJitLink installations <12.3. Ensure the installed CUDA toolkit's nvJitLink version is >=12.3. + +Functions +--------- + +NvJitLink defines the following functions for linking code objects and querying the info and error logs. + +.. autofunction:: cuda.bindings.nvjitlink.create +.. autofunction:: cuda.bindings.nvjitlink.destroy +.. autofunction:: cuda.bindings.nvjitlink.add_data +.. autofunction:: cuda.bindings.nvjitlink.add_file +.. autofunction:: cuda.bindings.nvjitlink.complete +.. autofunction:: cuda.bindings.nvjitlink.get_linked_cubin_size +.. autofunction:: cuda.bindings.nvjitlink.get_linked_cubin +.. autofunction:: cuda.bindings.nvjitlink.get_linked_ptx_size +.. autofunction:: cuda.bindings.nvjitlink.get_linked_ptx +.. autofunction:: cuda.bindings.nvjitlink.get_error_log_size +.. autofunction:: cuda.bindings.nvjitlink.get_error_log +.. autofunction:: cuda.bindings.nvjitlink.get_info_log_size +.. autofunction:: cuda.bindings.nvjitlink.get_info_log +.. autofunction:: cuda.bindings.nvjitlink.version + +Types +--------- +.. autoclass:: cuda.bindings.nvjitlink.Result + + .. autoattribute:: cuda.bindings.nvjitlink.Result.SUCCESS + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_UNRECOGNIZED_OPTION + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_MISSING_ARCH + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_INVALID_INPUT + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_PTX_COMPILE + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_NVVM_COMPILE + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_INTERNAL + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_THREADPOOL + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_UNRECOGNIZED_INPUT + + + .. autoattribute:: cuda.bindings.nvjitlink.Result.ERROR_FINALIZE + + +.. autoclass:: cuda.bindings.nvjitlink.InputType + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.NONE + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.CUBIN + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.PTX + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.LTOIR + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.FATBIN + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.OBJECT + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.LIBRARY + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.INDEX + + + .. autoattribute:: cuda.bindings.nvjitlink.InputType.ANY diff --git a/cuda_bindings_12/docs/source/module/nvrtc.rst b/cuda_bindings_12/docs/source/module/nvrtc.rst new file mode 100644 index 00000000000..ec7bf2863b4 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/nvrtc.rst @@ -0,0 +1,788 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. This code was automatically generated with version 12.9.0. Do not modify it directly. + +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=94543d1d167795e83519d0d89c96062e57b7ca1809e2188bbfe019d3eca16cb3 +----- +nvrtc +----- + +Error Handling +-------------- + +NVRTC defines the following enumeration type and function for API call error handling. + +.. autoclass:: cuda.bindings.nvrtc.nvrtcResult + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_SUCCESS + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_OUT_OF_MEMORY + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_PROGRAM_CREATION_FAILURE + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_INPUT + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_OPTION + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_COMPILATION + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_INTERNAL_ERROR + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_TIME_FILE_WRITE_FAILED + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE + + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_CANCELLED + +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetErrorString + +General Information Query +------------------------- + +NVRTC defines the following function for general information query. + +.. autofunction:: cuda.bindings.nvrtc.nvrtcVersion +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetNumSupportedArchs +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetSupportedArchs + +Compilation +----------- + +NVRTC defines the following type and functions for actual compilation. + +.. autoclass:: cuda.bindings.nvrtc.nvrtcProgram +.. autofunction:: cuda.bindings.nvrtc.nvrtcCreateProgram +.. autofunction:: cuda.bindings.nvrtc.nvrtcDestroyProgram +.. autofunction:: cuda.bindings.nvrtc.nvrtcCompileProgram +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetPTXSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetPTX +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetCUBINSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetCUBIN +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetNVVMSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetNVVM +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetLTOIRSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetLTOIR +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetOptiXIRSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetOptiXIR +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetProgramLogSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetProgramLog +.. autofunction:: cuda.bindings.nvrtc.nvrtcAddNameExpression +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetLoweredName +.. autofunction:: cuda.bindings.nvrtc.nvrtcSetFlowCallback + +Precompiled header (PCH) (CUDA 12.8+) +------------------------------------- + +NVRTC defines the following function related to PCH. Also see PCH related flags passed to nvrtcCompileProgram. + +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetPCHHeapSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcSetPCHHeapSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetPCHCreateStatus +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetPCHHeapSizeRequired + +Supported Compile Options +------------------------- + +NVRTC supports the compile options below. Option names with two preceding dashs (``--``) are long option names and option names with one preceding dash (``-``) are short option names. Short option names can be used instead of long option names. When a compile option takes an argument, an assignment operator (``=``) is used to separate the compile option argument from the compile option name, e.g., ``"--gpu-architecture=compute_60"``. Alternatively, the compile option name and the argument can be specified in separate strings without an assignment operator, .e.g, ``"--gpu-architecture"`` ``"compute_60"``. Single-character short option names, such as ``-D``, ``-U``, and ``-I``, do not require an assignment operator, and the compile option name and the argument can be present in the same string with or without spaces between them. For instance, ``"-D="``, ``"-D"``, and ``"-D "`` are all supported. + + + +The valid compiler options are: + + + + + +- Compilation targets + + + + + + - ``--gpu-architecture=`` (``-arch``) + +Specify the name of the class of GPU architectures for which the input must be compiled. + + + + + + + + + + + +- Separate compilation / whole-program compilation + + + + + + - ``--device-c`` (``-dc``) + +Generate relocatable code that can be linked with other relocatable device code. It is equivalent to ``--relocatable-device-code=true``. + + + + + + + + - ``--device-w`` (``-dw``) + +Generate non-relocatable code. It is equivalent to ``--relocatable-device-code=false``. + + + + + + + + - ``--relocatable-device-code={true|false}`` (``-rdc``) + +Enable (disable) the generation of relocatable device code. + + + + + + + + - ``--extensible-whole-program`` (``-ewp``) + +Do extensible whole program compilation of device code. + + + + + + + + + +- Debugging support + + + + + + - ``--device-debug`` (``-G``) + +Generate debug information. If ``--dopt`` is not specified, then turns off all optimizations. + + + + + + + + - ``--generate-line-info`` (``-lineinfo``) + +Generate line-number information. + + + + + + + + + +- Code generation + + + + + + - ``--dopt`` ``on`` (``-dopt``) + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--ptxas-options`` (``-Xptxas``) + + + + + + + + - ``--ptxas-options=`` + +Specify options directly to ptxas, the PTX optimizing assembler. + + + + + + + + - ``--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. + + + + + + + + - ``--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``. + + + + + + + + - ``--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``. + + + + + + + + - ``--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`` + + + + + + + + + + - ``--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``. + + + + + + + + - ``--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``. + + + + + + + + - ``--extra-device-vectorization`` (``-extra-device-vectorization``) + +Enables more aggressive device code vectorization in the NVVM optimizer. + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--gen-opt-lto`` (``-gen-opt-lto``) + +Run the optimizer passes before generating the LTO 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``). + +Note: when this option is used the nvrtcGetOptiX API should be used, as PTX or Cubin will not be generated. + + + + + + + + - ``--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. + + + + + + + + - ``--device-stack-protector={true|false}`` (``-device-stack-protector``) + +Enable (disable) the generation of stack canaries in device code. + + + + + + + + - ``--no-cache`` (``-no-cache``) + +Disable the use of cache for both ptx and cubin code generation. + + + + + + + + - ``--frandom-seed`` (``-frandom-seed``) + +The user specified random seed will be used to replace random numbers used in generating symbol names and variable names. The option can be used to generate deterministicly identical ptx and object files. If the input value is a valid number (decimal, octal, or hex), it will be used directly as the random seed. Otherwise, the CRC value of the passed string will be used instead. + + + + + + + + + +- Preprocessing + + + + + + - ``--define-macro=`` (``-D``) + +```` can be either ```` or ````. + + + + + + + + - ``--undefine-macro=`` (``-U``) + +Cancel any previous definition of ````. + + + + + + + + - ``--include-path=`` (``-I``) + +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. + + + + + + + + - ``--pre-include=
`` (``-include``) + +Preinclude ``
`` during preprocessing. + + + + + + + + - ``--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. + + + + + + + + + +- Language Dialect + + + + + + - ``--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 + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + + +- Precompiled header support (CUDA 12.8+) + + + + + + - ``--pch`` (``-pch``) + +Enable automatic PCH processing. + + + + + + + + - ``--create-pch=`` (``-create-pch``) + +Create a PCH file. + + + + + + + + - ``--use-pch=`` (``-use-pch``) + +Use the specified PCH file. + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--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). + + + + + + + + + +- Misc. + + + + + + - ``--disable-warnings`` (``-w``) + +Inhibit all warning messages. + + + + + + + + - ``--restrict`` (``-restrict``) + +Programmer assertion that all kernel pointer parameters are restrict pointers. + + + + + + + + - ``--device-as-default-execution-space`` (``-default-device``) + +Treat entities with no execution space annotation as ``__device__`` entities. + + + + + + + + - ``--device-int128`` (``-device-int128``) + +Allow the ``__int128`` type in device code. Also causes the macro ``__CUDACC_RTC_INT128__`` to be defined. + + + + + + + + - ``--device-float128`` (``-device-float128``) + +Allow the ``__float128`` and ``_Float128`` types in device code. Also causes the macro ``D__CUDACC_RTC_FLOAT128__`` to be defined. + + + + + + + + - ``--optimization-info=`` (``-opt-info``) + +Provide optimization reports for the specified kind of optimization. The following kind tags are supported: + + + + + + + + - ``--display-error-number`` (``-err-no``) + +Display diagnostic number for warning messages. (Default) + + + + + + + + - ``--no-display-error-number`` (``-no-err-no``) + +Disables the display of a diagnostic number for warning messages. + + + + + + + + - ``--diag-error=``,... (``-diag-error``) + +Emit error for specified diagnostic message number(s). Message numbers can be separated by comma. + + + + + + + + - ``--diag-suppress=``,... (``-diag-suppress``) + +Suppress specified diagnostic message number(s). Message numbers can be separated by comma. + + + + + + + + - ``--diag-warn=``,... (``-diag-warn``) + +Emit warning for specified diagnostic message number(s). Message numbers can be separated by comma. + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--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. + + + + + + + + - ``--fdevice-syntax-only`` (``-fdevice-syntax-only``) + +Ends device compilation after front-end syntax checking. This option does not generate valid device code. + + + + + + + + - ``--minimal`` (``-minimal``) + +Omit certain language features to reduce compile time for small programs. In particular, the following are omitted: + + + + + + + + - ``--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. + + + + + + + + - ``--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_12/docs/source/module/nvvm.rst b/cuda_bindings_12/docs/source/module/nvvm.rst new file mode 100644 index 00000000000..9c0f00abdd3 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/nvvm.rst @@ -0,0 +1,55 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. default-role:: cpp:any + +nvvm +==== + +The ``cuda.bindings.nvvm`` Python module wraps the +`libNVVM C API `_. + +Functions +--------- + +.. autofunction:: cuda.bindings.nvvm.version +.. autofunction:: cuda.bindings.nvvm.ir_version +.. autofunction:: cuda.bindings.nvvm.create_program +.. autofunction:: cuda.bindings.nvvm.add_module_to_program +.. autofunction:: cuda.bindings.nvvm.lazy_add_module_to_program +.. autofunction:: cuda.bindings.nvvm.compile_program +.. autofunction:: cuda.bindings.nvvm.verify_program +.. autofunction:: cuda.bindings.nvvm.get_compiled_result_size +.. autofunction:: cuda.bindings.nvvm.get_compiled_result +.. autofunction:: cuda.bindings.nvvm.get_program_log_size +.. autofunction:: cuda.bindings.nvvm.get_program_log + +Types +----- + +.. + The empty lines below are important! + +.. autoclass:: cuda.bindings.nvvm.Result + + .. autoattribute:: cuda.bindings.nvvm.Result.SUCCESS + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_OUT_OF_MEMORY + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_PROGRAM_CREATION_FAILURE + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_IR_VERSION_MISMATCH + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_INVALID_INPUT + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_INVALID_PROGRAM + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_INVALID_IR + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_INVALID_OPTION + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_NO_MODULE_IN_PROGRAM + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_COMPILATION + + .. autoattribute:: cuda.bindings.nvvm.Result.ERROR_CANCELLED diff --git a/cuda_bindings_12/docs/source/module/runtime.rst b/cuda_bindings_12/docs/source/module/runtime.rst new file mode 100644 index 00000000000..271116021e0 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/runtime.rst @@ -0,0 +1,5749 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. This code was automatically generated with version 12.9.0. Do not modify it directly. + +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9471dcb7815306c7978746e132235eac637aad52a8d9aca8ee6c1f492a866769 +------- +runtime +------- + +Data types used by CUDA Runtime +------------------------------- + + + +.. 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.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 + + .. 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMemoryAllocation + + + The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInitializationError + + + The API call failed because the CUDA driver and runtime could not be initialized. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCudartUnloading + + + 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.cudaError_t.cudaErrorProfilerDisabled + + + 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 + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStarted + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStopped + + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidConfiguration + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPitchValue + + + This indicates that one or more of the pitch-related parameters passed to the API call is not within the acceptable range for pitch. + + + .. 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. + + + .. 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. + + [Deprecated] + + + .. 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. + + + .. 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. + + + .. 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. + + + .. 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 + + + This indicated that a previous kernel launch failed. This was previously used for device emulation of kernel launches. + + [Deprecated] + + + .. 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 + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFileScopedSurf + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchPendingCountExceeded + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDeviceFunction + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDevice + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSoftwareValidityNotEstablished + + + 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 indicates an internal startup failure in the CUDA runtime. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidKernelImage + + + This indicates that the device kernel image is invalid. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceUninitialized + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMapBufferObjectFailed + + + This indicates that the buffer object could not be mapped. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnmapBufferObjectFailed + + + This indicates that the buffer object could not be unmapped. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorArrayIsMapped + + + This indicates that the specified array is currently mapped and thus cannot be destroyed. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyMapped + + + This indicates that the resource is already mapped. + + + .. 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyAcquired + + + This indicates that a resource has already been acquired. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMapped + + + This indicates that a resource is not mapped. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsArray + + + This indicates that a mapped resource is not available for access as an array. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsPointer + + + This indicates that a mapped resource is not available for access as a pointer. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorECCUncorrectable + + + This indicates that an uncorrectable ECC error was detected during execution. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedLimit + + + This indicates that the :py:obj:`~.cudaLimit` passed to the API call is not supported by the active device. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceAlreadyInUse + + + This indicates that a call tried to access an exclusive-thread device that is already in use by a different thread. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessUnsupported + + + This error indicates that P2P access is not supported across the given devices. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPtx + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidGraphicsContext + + + This indicates an error with the OpenGL or DirectX context. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNvlinkUncorrectable + + + This indicates that an uncorrectable NVLink error was detected during the execution. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorJitCompilerNotFound + + + 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 + + + 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 + + + This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize. + + + .. 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 + + + 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 + + + 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. + + + .. 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 + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSymbolNotFound + + + 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()`. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalAddress + + + 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 + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchTimeout + + + This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device property :py:obj:`~.kernelExecTimeoutEnabled` for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchIncompatibleTexturing + + + This error indicates a kernel launch that uses an incompatible texturing mode. + + + .. 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()`. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSetOnActiveProcess + + + 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. + + + .. 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. + + + .. 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 + + + 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 + + + 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. + + + .. 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 + + + 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. + + + .. 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCooperativeLaunchTooLarge + + + This error indicates that the number of blocks launched per grid for a kernel that was launched via either :py:obj:`~.cudaLaunchCooperativeKernel` or :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` exceeds the maximum number of blocks as allowed by :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor` or :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times the number of multiprocessors as specified by the device attribute :py:obj:`~.cudaDevAttrMultiProcessorCount`. + + + .. 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. + + + .. 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. + + + .. 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 + + + 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. + + + .. 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsMaxClientsReached + + + 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. + + + .. 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 + + + This error indicates, that the program contains an unsupported interaction between different versions of CUDA Dynamic Parallelism. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnsupported + + + The operation is not permitted when the stream is capturing. + + + .. 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnmatched + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureIsolation + + + A dependency would have been created which crosses the capture sequence boundary. Only implicit in-stream ordering dependencies are allowed to cross the boundary. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureImplicit + + + The operation would have resulted in a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCapturedEvent + + + The operation is not permitted on an event which was last recorded in a capturing stream. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureWrongThread + + + 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. + + + .. 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 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidClusterSize + + + This indicates that a kernel launch error has occurred due to cluster misconfiguration. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFunctionNotLoaded + + + Indiciates a function handle is not loaded when calling an API that requires a loaded function. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceType + + + This error indicates one or more resources passed in are not valid resource types for the operation. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceConfiguration + + + This error indicates one or more resources are insufficient or non-applicable for the operation. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnknown + + + This indicates that an unknown internal error has occurred. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorApiFailureBase + +.. autoclass:: cuda.bindings.runtime.cudaChannelFormatKind + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSigned + + + Signed channel format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + + + Unsigned channel format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindFloat + + + Float channel format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNone + + + No channel format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNV12 + + + Unsigned 8-bit integers, planar 4:2:0 YUV format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 + + + 1 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 + + + 2 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 + + + 4 channel unsigned 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 + + + 1 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 + + + 2 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 + + + 4 channel unsigned 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 + + + 1 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 + + + 2 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 + + + 4 channel signed 8-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 + + + 1 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 + + + 2 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 + + + 4 channel signed 16-bit normalized integer + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 + + + 4 channel unsigned normalized block-compressed (BC1 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB + + + 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 + + + 4 channel unsigned normalized block-compressed (BC2 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB + + + 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 + + + 4 channel unsigned normalized block-compressed (BC3 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB + + + 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 + + + 1 channel unsigned normalized block-compressed (BC4 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 + + + 1 channel signed normalized block-compressed (BC4 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 + + + 2 channel unsigned normalized block-compressed (BC5 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 + + + 2 channel signed normalized block-compressed (BC5 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H + + + 3 channel unsigned half-float block-compressed (BC6H compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H + + + 3 channel signed half-float block-compressed (BC6H compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 + + + 4 channel unsigned normalized block-compressed (BC7 compression) format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB + + + 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 + + + 4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format + +.. autoclass:: cuda.bindings.runtime.cudaMemoryType + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeUnregistered + + + Unregistered memory + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeHost + + + Host memory + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeDevice + + + Device memory + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeManaged + + + Managed memory + +.. autoclass:: cuda.bindings.runtime.cudaMemcpyKind + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToHost + + + Host -> Host + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToDevice + + + Host -> Device + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToHost + + + Device -> Host + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToDevice + + + Device -> Device + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDefault + + + Direction of the transfer is inferred from the pointer values. Requires unified virtual addressing + +.. autoclass:: cuda.bindings.runtime.cudaAccessProperty + + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyNormal + + + Normal cache persistence. + + + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyStreaming + + + Streaming access is less likely to persit from cache. + + + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyPersisting + + + Persisting access is more likely to persist in cache. + +.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureStatus + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusNone + + + Stream is not capturing + + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusActive + + + Stream is actively capturing + + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated + + + Stream is part of a capture sequence that has been invalidated, but not terminated + +.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureMode + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal + + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal + + + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed + +.. autoclass:: cuda.bindings.runtime.cudaSynchronizationPolicy + + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyAuto + + + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicySpin + + + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyYield + + + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync + +.. autoclass:: cuda.bindings.runtime.cudaClusterSchedulingPolicy + + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault + + + the default policy + + + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread + + + spread the blocks within a cluster to the SMs + + + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing + + + allow the hardware to load-balance the blocks in a cluster to the SMs + +.. autoclass:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags + + .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies + + + Add new nodes to the dependency set + + + .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies + + + Replace the dependency set with the new nodes + +.. autoclass:: cuda.bindings.runtime.cudaUserObjectFlags + + .. autoattribute:: cuda.bindings.runtime.cudaUserObjectFlags.cudaUserObjectNoDestructorSync + + + Indicates the destructor execution is not synchronized by any CUDA handle. + +.. autoclass:: cuda.bindings.runtime.cudaUserObjectRetainFlags + + .. autoattribute:: cuda.bindings.runtime.cudaUserObjectRetainFlags.cudaGraphUserObjectMove + + + Transfer references from the caller rather than creating new references. + +.. autoclass:: cuda.bindings.runtime.cudaGraphicsRegisterFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone + + + Default + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly + + + CUDA will not write to this resource + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard + + + CUDA will only write to and will not read from this resource + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore + + + CUDA will bind this resource to a surface reference + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather + + + CUDA will perform texture gather operations on this resource + +.. autoclass:: cuda.bindings.runtime.cudaGraphicsMapFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone + + + Default; Assume resource can be read/written + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly + + + CUDA will not write to this resource + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard + + + CUDA will only write to and will not read from this resource + +.. autoclass:: cuda.bindings.runtime.cudaGraphicsCubeFace + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX + + + Positive X face of cubemap + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX + + + Negative X face of cubemap + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY + + + Positive Y face of cubemap + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY + + + Negative Y face of cubemap + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ + + + Positive Z face of cubemap + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ + + + Negative Z face of cubemap + +.. autoclass:: cuda.bindings.runtime.cudaResourceType + + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeArray + + + Array resource + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeMipmappedArray + + + Mipmapped array resource + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeLinear + + + Linear resource + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypePitch2D + + + Pitch 2D resource + +.. autoclass:: cuda.bindings.runtime.cudaResourceViewFormat + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatNone + + + No resource view format (use underlying resource format) + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar1 + + + 1 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar2 + + + 2 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar4 + + + 4 channel unsigned 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar1 + + + 1 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar2 + + + 2 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar4 + + + 4 channel signed 8-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort1 + + + 1 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort2 + + + 2 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort4 + + + 4 channel unsigned 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort1 + + + 1 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort2 + + + 2 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort4 + + + 4 channel signed 16-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt1 + + + 1 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt2 + + + 2 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt4 + + + 4 channel unsigned 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt1 + + + 1 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt2 + + + 2 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt4 + + + 4 channel signed 32-bit integers + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf1 + + + 1 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf2 + + + 2 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf4 + + + 4 channel 16-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat1 + + + 1 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat2 + + + 2 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat4 + + + 4 channel 32-bit floating point + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1 + + + Block compressed 1 + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2 + + + Block compressed 2 + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3 + + + Block compressed 3 + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4 + + + Block compressed 4 unsigned + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4 + + + Block compressed 4 signed + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5 + + + Block compressed 5 unsigned + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5 + + + Block compressed 5 signed + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H + + + Block compressed 6 unsigned half-float + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H + + + Block compressed 6 signed half-float + + + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7 + + + Block compressed 7 + +.. autoclass:: cuda.bindings.runtime.cudaFuncAttribute + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize + + + Maximum dynamic shared memory size + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout + + + Preferred shared memory-L1 cache split + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet + + + Indicator to enforce valid cluster dimension specification on kernel launch + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth + + + Required cluster width + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight + + + Required cluster height + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth + + + Required cluster depth + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed + + + Whether non-portable cluster scheduling policy is supported + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference + + + Required cluster scheduling policy preference + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMax + +.. autoclass:: cuda.bindings.runtime.cudaFuncCache + + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferNone + + + Default function cache configuration, no preference + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferShared + + + Prefer larger shared memory and smaller L1 cache + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferL1 + + + Prefer larger L1 cache and smaller shared memory + + + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferEqual + + + Prefer equal size L1 cache and shared memory + +.. autoclass:: cuda.bindings.runtime.cudaSharedMemConfig + + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeDefault + + + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeFourByte + + + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeEightByte + +.. autoclass:: cuda.bindings.runtime.cudaSharedCarveout + + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutDefault + + + No preference for shared memory or L1 (default) + + + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxShared + + + Prefer maximum available shared memory, minimum L1 cache + + + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxL1 + + + Prefer maximum available L1 cache, minimum shared memory + +.. autoclass:: cuda.bindings.runtime.cudaComputeMode + + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeDefault + + + Default compute mode (Multiple threads can use :py:obj:`~.cudaSetDevice()` with this device) + + + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusive + + + 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.cudaComputeMode.cudaComputeModeProhibited + + + Compute-prohibited mode (No threads can use :py:obj:`~.cudaSetDevice()` with this device) + + + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusiveProcess + + + 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.cudaLimit.cudaLimitStackSize + + + GPU thread stack size + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPrintfFifoSize + + + GPU printf FIFO size + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMallocHeapSize + + + GPU malloc heap size + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimeSyncDepth + + + GPU device runtime synchronize depth + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimePendingLaunchCount + + + GPU device runtime pending launch count + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMaxL2FetchGranularity + + + A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint + + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPersistingL2CacheSize + + + A size in bytes for L2 persisting lines cache size + +.. autoclass:: cuda.bindings.runtime.cudaMemoryAdvise + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetReadMostly + + + Data will mostly be read and only occassionally be written to + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly + + + Undo the effect of :py:obj:`~.cudaMemAdviseSetReadMostly` + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation + + + Set the preferred location for the data as the specified device + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation + + + Clear the preferred location for the data + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetAccessedBy + + + Data will be accessed by the specified device, so prevent page faults as much as possible + + + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy + + + Let the Unified Memory subsystem decide on the page faulting policy for the specified device + +.. autoclass:: cuda.bindings.runtime.cudaMemRangeAttribute + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly + + + Whether the range will mostly be read and only occassionally be written to + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation + + + The preferred location of the range + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy + + + Memory range has :py:obj:`~.cudaMemAdviseSetAccessedBy` set for specified device + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation + + + The last location to which the range was prefetched + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType + + + The preferred location type of the range + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId + + + The preferred location id of the range + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType + + + The last location type to which the range was prefetched + + + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId + + + The last location id to which the range was prefetched + +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions + + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost + + + :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` and its CUDA Driver API counterpart are supported on the device. + + + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps + + + 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.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone + + + The device does not natively support ordering of GPUDirect RDMA writes. :py:obj:`~.cudaFlushGPUDirectRDMAWrites()` can be leveraged if supported. + + + .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner + + + Natively, the device can consistently consume GPUDirect RDMA writes, although other CUDA devices may not. + + + .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices + + + Any CUDA device in the system can consistently consume GPUDirect RDMA writes to this device. + +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope + + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner + + + Blocks until remote writes are visible to the CUDA device context owning the data. + + + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices + + + Blocks until remote writes are visible to all CUDA device contexts. + +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget + + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice + + + Sets the target for :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` to the currently active CUDA device context. + +.. autoclass:: cuda.bindings.runtime.cudaDeviceAttr + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock + + + Maximum number of threads per block + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimX + + + Maximum block dimension X + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimY + + + Maximum block dimension Y + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimZ + + + Maximum block dimension Z + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimX + + + Maximum grid dimension X + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimY + + + Maximum grid dimension Y + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimZ + + + Maximum grid dimension Z + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock + + + Maximum shared memory available per block in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTotalConstantMemory + + + Memory available on device for constant variables in a CUDA C kernel in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrWarpSize + + + Warp size in threads + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPitch + + + Maximum pitch in bytes allowed by memory copies + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock + + + Maximum number of 32-bit registers available per block + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClockRate + + + Peak clock frequency in kilohertz + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTextureAlignment + + + Alignment requirement for textures + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuOverlap + + + Device can possibly copy memory and execute a kernel concurrently + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiProcessorCount + + + Number of multiprocessors on device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrKernelExecTimeout + + + Specifies whether there is a run time limit on kernels + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIntegrated + + + Device is integrated with host memory + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanMapHostMemory + + + Device can map host memory into CUDA address space + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeMode + + + Compute mode (See :py:obj:`~.cudaComputeMode` for details) + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth + + + Maximum 1D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth + + + Maximum 2D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight + + + Maximum 2D texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth + + + Maximum 3D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight + + + Maximum 3D texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth + + + Maximum 3D texture depth + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth + + + Maximum 2D layered texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight + + + Maximum 2D layered texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers + + + Maximum layers in a 2D layered texture + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSurfaceAlignment + + + Alignment requirement for surfaces + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentKernels + + + Device can possibly execute multiple kernels concurrently + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrEccEnabled + + + Device has ECC support enabled + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciBusId + + + PCI bus ID of the device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDeviceId + + + PCI device ID of the device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTccDriver + + + Device is using TCC driver model + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryClockRate + + + Peak memory clock frequency in kilohertz + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth + + + Global memory bus width in bits + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrL2CacheSize + + + Size of L2 cache in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor + + + Maximum resident threads per multiprocessor + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrAsyncEngineCount + + + Number of asynchronous engines + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrUnifiedAddressing + + + Device shares a unified address space with the host + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth + + + Maximum 1D layered texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers + + + Maximum layers in a 1D layered texture + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth + + + Maximum 2D texture width if cudaArrayTextureGather is set + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight + + + Maximum 2D texture height if cudaArrayTextureGather is set + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt + + + Alternate maximum 3D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt + + + Alternate maximum 3D texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt + + + Alternate maximum 3D texture depth + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDomainId + + + PCI domain ID of the device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTexturePitchAlignment + + + Pitch alignment requirement for textures + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth + + + Maximum cubemap texture width/height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth + + + Maximum cubemap layered texture width/height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers + + + Maximum layers in a cubemap layered texture + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth + + + Maximum 1D surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth + + + Maximum 2D surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight + + + Maximum 2D surface height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth + + + Maximum 3D surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight + + + Maximum 3D surface height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth + + + Maximum 3D surface depth + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth + + + Maximum 1D layered surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers + + + Maximum layers in a 1D layered surface + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth + + + Maximum 2D layered surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight + + + Maximum 2D layered surface height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers + + + Maximum layers in a 2D layered surface + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth + + + Maximum cubemap surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth + + + Maximum cubemap layered surface width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers + + + Maximum layers in a cubemap layered surface + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth + + + Maximum 1D linear texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth + + + Maximum 2D linear texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight + + + Maximum 2D linear texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch + + + Maximum 2D linear texture pitch in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth + + + Maximum mipmapped 2D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight + + + Maximum mipmapped 2D texture height + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor + + + Major compute capability version number + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor + + + Minor compute capability version number + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth + + + Maximum mipmapped 1D texture width + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported + + + Device supports stream priorities + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported + + + Device supports caching globals in L1 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported + + + Device supports caching locals in L1 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor + + + Maximum shared memory available per multiprocessor in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor + + + Maximum number of 32-bit registers available per multiprocessor + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrManagedMemory + + + Device can allocate managed memory on this system + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard + + + Device is on a multi-GPU board + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID + + + Unique identifier for a group of devices on the same multi-GPU board + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported + + + Link between the device and the host supports native atomic operations + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio + + + Ratio of single precision performance (in floating-point operations per second) to double precision performance + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccess + + + Device supports coherently accessing pageable memory without calling cudaHostRegister on it + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess + + + Device can coherently access managed memory concurrently with the CPU + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputePreemptionSupported + + + Device supports Compute Preemption + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem + + + Device can access host registered memory at the same virtual address as the CPU + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved92 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved93 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved94 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCooperativeLaunch + + + Device supports launching cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel` + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch + + + Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin + + + The maximum optin shared memory per block. This value may vary by chip. See :py:obj:`~.cudaFuncSetAttribute` + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites + + + Device supports flushing of outstanding remote writes. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterSupported + + + Device supports host memory registration via :py:obj:`~.cudaHostRegister`. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables + + + Device accesses pageable memory via the host's page tables. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost + + + Host can directly access managed memory on the device without migration. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor + + + Maximum number of blocks per multiprocessor + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize + + + Maximum L2 persisting lines capacity setting in bytes. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize + + + Maximum value of :py:obj:`~.cudaAccessPolicyWindow.num_bytes`. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock + + + Shared memory reserved by CUDA driver per block in bytes + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported + + + Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported + + + 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.cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported + + + External timeline semaphore interop is supported on the device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported + + + Deprecated, External timeline semaphore interop is supported on the device + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported + + + Device supports using the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported + + + Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information) + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions + + + The returned attribute shall be interpreted as a bitmask, where the individual bits are listed in the :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes + + + Handle types supported with mempool based IPC + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClusterLaunch + + + Indicates device supports cluster launch + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported + + + Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved122 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved123 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved124 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIpcEventSupport + + + Device supports IPC Events. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemSyncDomainCount + + + Number of memory synchronization domains the device supports. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved127 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved128 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved129 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaConfig + + + NUMA configuration of a device: value is of type :py:obj:`~.cudaDeviceNumaConfig` enum + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaId + + + NUMA node ID of the GPU memory + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved132 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMpsEnabled + + + Contexts created on this device will be shared via MPS + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaId + + + NUMA ID of the host node closest to the device or -1 when system does not support NUMA + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrD3D12CigSupported + + + Device supports CIG with D3D12. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrVulkanCigSupported + + + Device supports CIG with Vulkan. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciDeviceId + + + The combined 16-bit PCI device ID and 16-bit PCI vendor ID. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciSubsystemId + + + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved141 + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMemoryPoolsSupported + + + Device supports HOST_NUMA location with the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMultinodeIpcSupported + + + Device supports HostNuma location IPC between nodes in a multi-node system. + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax + +.. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies + + + (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) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic + + + (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies + + + (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). + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold + + + (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) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent + + + (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh + + + (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. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent + + + (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh + + + (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. + +.. autoclass:: cuda.bindings.runtime.cudaMemLocationType + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvalid + + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeDevice + + + Location is a device location, thus id is a device ordinal + + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHost + + + Location is host, id is ignored + + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNuma + + + Location is a host NUMA node, thus id is a host NUMA node id + + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent + + + Location is the host NUMA node closest to the current thread's CPU, id is ignored + +.. autoclass:: cuda.bindings.runtime.cudaMemAccessFlags + + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtNone + + + Default, make the address range not accessible + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtRead + + + Make the address range read accessible + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite + + + Make the address range read-write accessible + +.. autoclass:: cuda.bindings.runtime.cudaMemAllocationType + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeInvalid + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypePinned + + + This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeMax + +.. autoclass:: cuda.bindings.runtime.cudaMemAllocationHandleType + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeNone + + + Does not allow any export mechanism. > + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor + + + Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32 + + + Allows a Win32 NT handle to be used for exporting. (HANDLE) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt + + + Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) + + + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric + + + Allows a fabric handle to be used for exporting. (:py:obj:`~.cudaMemFabricHandle_t`) + +.. autoclass:: cuda.bindings.runtime.cudaGraphMemAttributeType + + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent + + + (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh + + + (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.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent + + + (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh + + + (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 + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagDefault + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagPreferOverlapWithCompute + + + Hint to the driver to try and overlap the copy with compute work on the SMs. + +.. autoclass:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderInvalid + + + Default invalid. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderStream + + + Indicates that access to the source pointer must be in stream order. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderDuringApiCall + + + 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.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderAny + + + 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.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderMax + +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DOperandType + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypePointer + + + Memcpy operand is a valid pointer. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeArray + + + Memcpy operand is a CUarray. + + + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeMax + +.. autoclass:: cuda.bindings.runtime.cudaDeviceP2PAttr + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank + + + A relative value indicating the performance of the link between two devices + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported + + + Peer access is enabled + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported + + + Native atomic operation over the link supported + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported + + + Accessing CUDA arrays over the link supported + +.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleType + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd + + + Handle is an opaque file descriptor + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32 + + + Handle is an opaque shared NT handle + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt + + + Handle is an opaque, globally shared handle + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap + + + Handle is a D3D12 heap object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource + + + Handle is a D3D12 committed resource + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource + + + Handle is a shared NT handle to a D3D11 resource + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt + + + Handle is a globally shared handle to a D3D11 resource + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf + + + Handle is an NvSciBuf object + +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd + + + Handle is an opaque file descriptor + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32 + + + Handle is an opaque shared NT handle + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt + + + Handle is an opaque, globally shared handle + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence + + + Handle is a shared NT handle referencing a D3D12 fence object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence + + + Handle is a shared NT handle referencing a D3D11 fence object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync + + + Opaque handle to NvSciSync Object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex + + + Handle is a shared NT handle referencing a D3D11 keyed mutex object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt + + + Handle is a shared KMT handle referencing a D3D11 keyed mutex object + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd + + + Handle is an opaque handle file descriptor referencing a timeline semaphore + + + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 + + + Handle is an opaque handle file descriptor referencing a timeline semaphore + +.. autoclass:: cuda.bindings.runtime.cudaJitOption + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxRegisters + + + Max number of registers that a thread may use. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitThreadsPerBlock + + + 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. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitWallTime + + + Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker + + Option type: float + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBuffer + + + 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 \* + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBufferSizeBytes + + + 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 + + Option type: unsigned int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBuffer + + + 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 \* + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBufferSizeBytes + + + 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 + + Option type: unsigned int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitOptimizationLevel + + + Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations. + + Option type: unsigned int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitFallbackStrategy + + + 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 + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateDebugInfo + + + Specifies whether to create debug information in output (-g) (0: false, default) + + Option type: int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitLogVerbose + + + Generate verbose log messages (0: false, default) + + Option type: int + + Applies to: compiler and linker + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateLineInfo + + + Generate line number information (-lineinfo) (0: false, default) + + Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitCacheMode + + + Specifies whether to enable caching explicitly (-dlcm) + + Choice is based on supplied :py:obj:`~.cudaJit_CacheMode`. + + Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_CacheMode` + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitPositionIndependentCode + + + Generate position independent code (0: false) + + Option type: int + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMinCtaPerSm + + + 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 + + Applies to: compiler only + + + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxThreadsPerBlock + + + 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.cudaJitOption.cudaJitOverrideDirectiveValues + + + 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 + + Applies to: compiler only + +.. autoclass:: cuda.bindings.runtime.cudaLibraryOption + + .. autoattribute:: cuda.bindings.runtime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable + + + .. 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`. + +.. autoclass:: cuda.bindings.runtime.cudaJit_CacheMode + + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionNone + + + Compile with no -dlcm flag specified + + + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCG + + + Compile with L1 cache disabled + + + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCA + + + Compile with L1 cache enabled + +.. autoclass:: cuda.bindings.runtime.cudaJit_Fallback + + .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferPtx + + + Prefer to compile ptx if exact binary match not found + + + .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferBinary + + + Prefer to fall back to compatible binary code if exact match not found + +.. autoclass:: cuda.bindings.runtime.cudaCGScope + + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeInvalid + + + Invalid cooperative group scope + + + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeGrid + + + Scope represented by a grid_group + + + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeMultiGrid + + + Scope represented by a multi_grid_group + +.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault + + + Apply default handle value when graph is launched. + +.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalNodeType + + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeIf + + + 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.cudaGraphConditionalNodeType.cudaGraphCondTypeWhile + + + Conditional 'while' Node. Body executed repeatedly while condition value is non-zero. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeSwitch + + + 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.cudaGraphNodeType.cudaGraphNodeTypeKernel + + + GPU kernel node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemcpy + + + Memcpy node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemset + + + Memset node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeHost + + + Host (executable) node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeGraph + + + Node which executes an embedded graph + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEmpty + + + Empty (no-op) node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeWaitEvent + + + External event wait node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEventRecord + + + External event record node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal + + + External semaphore signal node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait + + + External semaphore wait node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemAlloc + + + Memory allocation node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemFree + + + Memory free node + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeConditional + + + 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 + + can be selectively executed or iterated upon based on the value of a conditional + + variable. + + + + Handles must be created in advance of creating the node + + using :py:obj:`~.cudaGraphConditionalHandleCreate`. + + + + The following restrictions apply to graphs which contain conditional nodes: + + The graph cannot be used in a child node. + + Only one instantiation of the graph may exist at any point in time. + + The graph cannot be cloned. + + + + 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.cudaGraphNodeType.cudaGraphNodeTypeCount + +.. autoclass:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership + + .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipClone + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipMove + + + 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. + + + + 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. + +.. autoclass:: cuda.bindings.runtime.cudaGraphDependencyType + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeDefault + + + This is an ordinary dependency. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeProgrammatic + + + 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 + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess + + + The update succeeded + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateError + + + The update failed for an unexpected reason which is described in the return value of the function + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged + + + The update failed because the topology changed + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged + + + The update failed because a node type changed + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged + + + The update failed because the function of a kernel node changed (CUDA driver < 11.2) + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged + + + The update failed because the parameters changed in a way that is not supported + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported + + + The update failed because something about the node is not supported + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange + + + The update failed because the function of a kernel node changed in an unsupported way + + + .. 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 + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateSuccess + + + Instantiation succeeded + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateError + + + Instantiation failed for an unexpected reason which is described in the return value of the function + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure + + + Instantiation failed due to invalid structure, such as cycles + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported + + + Instantiation for device launch failed because the graph contained an unsupported operation + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported + + + Instantiation for device launch failed due to the nodes belonging to different contexts + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateConditionalHandleUnused + + + One or more conditional handles are not associated with conditional nodes + +.. autoclass:: cuda.bindings.runtime.cudaGraphKernelNodeField + + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid + + + Invalid field + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim + + + Grid dimension update + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam + + + Kernel parameter update + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled + + + Node enable/disable + +.. autoclass:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableDefault + + + Default search mode for driver symbols. + + + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableLegacyStream + + + Search for legacy versions of driver symbols. + + + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream + + + Search for per-thread versions of driver symbols. + +.. autoclass:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult + + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess + + + Search for symbol found a match + + + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound + + + Search for symbol was not found + + + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent + + + Search for symbol was found but version wasn't great enough + +.. autoclass:: cuda.bindings.runtime.cudaGraphDebugDotFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose + + + Output all debug data as if every debug flag is enabled + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams + + + Adds :py:obj:`~.cudaKernelNodeParams` to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams + + + Adds :py:obj:`~.cudaMemcpy3DParms` to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams + + + Adds :py:obj:`~.cudaMemsetParams` to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams + + + Adds :py:obj:`~.cudaHostNodeParams` to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams + + + Adds :py:obj:`~.cudaEvent_t` handle from record and wait nodes to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams + + + Adds :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` values to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams + + + Adds :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes + + + Adds cudaKernelNodeAttrID values to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles + + + Adds node handles and every kernel function handle to output + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams + + + Adds :py:obj:`~.cudaConditionalNodeParams` to output + +.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateFlags + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch + + + Automatically free memory allocated in a graph before relaunching. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload + + + Automatically upload the graph after instantiation. Only supported by + + :py:obj:`~.cudaGraphInstantiateWithParams`. The upload will be performed using the + + stream provided in ``instantiateParams``. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch + + + 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 + + used in conjunction with cudaGraphInstantiateFlagAutoFreeOnLaunch. + + + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority + + + 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 + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault + + + Launch kernels in the default domain + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote + + + Launch kernels in the remote domain + +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeID + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore + + + Ignored entry, for convenient composition + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow + + + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`. + + + .. 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`. + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension + + + Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.clusterDim`. + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference + + + 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. + + 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.cudaLaunchAttributePriority + + + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.priority`. + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap + + + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`. + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain + + + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`. + + + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension + + + 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. + + 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 + + + Valid for launches. Set :py:obj:`~.cudaLaunchAttributeValue.launchCompletionEvent` to record the event. + + 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. + + :py:obj:`~.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`. + + 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.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. + +.. autoclass:: cuda.bindings.runtime.cudaDeviceNumaConfig + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNone + + + The GPU is not a NUMA node + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode + + + 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.cudaSurfaceBoundaryMode + + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeZero + + + Zero boundary mode + + + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeClamp + + + Clamp boundary mode + + + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeTrap + + + Trap boundary mode + +.. autoclass:: cuda.bindings.runtime.cudaSurfaceFormatMode + + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeForced + + + Forced format mode + + + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeAuto + + + Auto format mode + +.. autoclass:: cuda.bindings.runtime.cudaTextureAddressMode + + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeWrap + + + Wrapping address mode + + + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeClamp + + + Clamp to edge address mode + + + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeMirror + + + Mirror address mode + + + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeBorder + + + 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 + + + Read texture as specified element type + + + .. autoattribute:: cuda.bindings.runtime.cudaTextureReadMode.cudaReadModeNormalizedFloat + + + Read texture as normalized float + +.. autoclass:: cuda.bindings.runtime.cudaEglFrameType + + .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypeArray + + + Frame type CUDA array + + + .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypePitch + + + Frame type CUDA pointer + +.. autoclass:: cuda.bindings.runtime.cudaEglResourceLocationFlags + + .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationSysmem + + + Resource location sysmem + + + .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationVidmem + + + Resource location vidmem + +.. autoclass:: cuda.bindings.runtime.cudaEglColorFormat + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar + + + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar + + + Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar + + + Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatARGB + + + R/G/B/A four channels in one surface with BGRA byte ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRGBA + + + R/G/B/A four channels in one surface with ABGR byte ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatL + + + single luminance channel in one surface. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatR + + + single color channel in one surface. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar + + + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV422 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY422 + + + Y, U, V in one surface, interleaved as YUYV in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatABGR + + + R/G/B/A four channels in one surface with RGBA byte ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBGRA + + + R/G/B/A four channels in one surface with ARGB byte ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatA + + + Alpha color format - one channel in one surface. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRG + + + R/G color format - two channels in one surface with GR byte ordering + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV + + + Y, U, V, A four channels in one surface, interleaved as VUYA. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatVYUY_ER + + + Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY_ER + + + Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV_ER + + + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU_ER + + + Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA_ER + + + Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV_ER + + + Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar_ER + + + Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar_ER + + + Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU444Planar_ER + + + Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422Planar_ER + + + Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_ER + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRGGB + + + Bayer format - one channel in one surface with interleaved RGGB ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBGGR + + + Bayer format - one channel in one surface with interleaved BGGR ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGRBG + + + Bayer format - one channel in one surface with interleaved GRBG ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGBRG + + + Bayer format - one channel in one surface with interleaved GBRG ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10RGGB + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer10BGGR + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer10GRBG + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer10GBRG + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer12RGGB + + + Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12BGGR + + + Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GRBG + + + Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GBRG + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer14RGGB + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer14BGGR + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer14GRBG + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer14GBRG + + + Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20RGGB + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer20BGGR + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer20GRBG + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer20GBRG + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU444Planar + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU422Planar + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420Planar + + + 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.cudaEglColorFormat.cudaEglColorFormatBayerIspRGGB + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspBGGR + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGRBG + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGBRG + + + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBCCR + + + Bayer format - one channel in one surface with interleaved BCCR ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRCCB + + + Bayer format - one channel in one surface with interleaved RCCB ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCRBC + + + Bayer format - one channel in one surface with interleaved CRBC ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCBRC + + + Bayer format - one channel in one surface with interleaved CBRC ordering. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10CCCC + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer12BCCR + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer12RCCB + + + Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CRBC + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer12CBRC + + + 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.cudaEglColorFormat.cudaEglColorFormatBayer12CCCC + + + 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.cudaEglColorFormat.cudaEglColorFormatY + + + Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar + + + 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.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_709 + + + 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.cudaEglColorFormat.cudaEglColorFormatY_ER + + + Extended Range Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY_709_ER + + + Extended Range Color format for single Y plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_ER + + + Extended Range Color format for single Y10 plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_709_ER + + + Extended Range Color format for single Y10 plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_ER + + + Extended Range Color format for single Y12 plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_709_ER + + + Extended Range Color format for single Y12 plane. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA + + + Y, U, V, A four channels in one surface, interleaved as AVUY. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU + + + Y, U, V in one surface, interleaved as YVYU in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatVYUY + + + Y, U, V in one surface, interleaved as VYUY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_ER + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_ER + + + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + + + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + + + 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.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_ER + + + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + + + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709_ER + + + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + + + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY2020 + + + Y, U, V in one surface, interleaved as UYVY in one channel. + +.. 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.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.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 + + 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 + +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterPortable + + Pinned memory accessible by all CUDA contexts + +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterMapped + + Map registered memory into device space + +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterIoMemory + + Memory-mapped I/O space + +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterReadOnly + + 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) + +.. autoattribute:: cuda.bindings.runtime.cudaStreamLegacy + + Legacy stream handle + + + + 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 + +.. autoattribute:: cuda.bindings.runtime.cudaStreamPerThread + + Per-thread stream handle + + + + 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 + +.. autoattribute:: cuda.bindings.runtime.cudaEventDefault + + Default event flag + +.. autoattribute:: cuda.bindings.runtime.cudaEventBlockingSync + + Event uses blocking synchronization + +.. autoattribute:: cuda.bindings.runtime.cudaEventDisableTiming + + Event will not record timing data + +.. 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 + + 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 + +.. 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 + + Device schedule flags mask + +.. autoattribute:: cuda.bindings.runtime.cudaDeviceMapHost + + Device flag - Support mapped pinned allocations + +.. 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 + + Device flags mask + +.. autoattribute:: cuda.bindings.runtime.cudaArrayDefault + + Default CUDA array allocation flag + +.. autoattribute:: cuda.bindings.runtime.cudaArrayLayered + + Must be set in cudaMalloc3DArray to create a layered CUDA array + +.. 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 + + Must be set in cudaMallocArray or cudaMalloc3DArray in order to perform texture gather operations on the CUDA array + +.. 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.cudaArraySparse + + Must be set in cudaMallocArray, cudaMalloc3DArray or cudaMallocMipmappedArray in order to create a sparse CUDA array or CUDA mipmapped array + +.. 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 + + Memory can be accessed by any stream on any device + +.. 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 + + Default behavior + +.. 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 + + Device id that represents an invalid device + +.. autoattribute:: cuda.bindings.runtime.cudaInitDeviceFlagsAreValid + + Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice call + +.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPreSync + + If set, each kernel launched as part of :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution. + +.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPostSync + + If set, any subsequent work pushed in a stream that participated in a call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution. + +.. autoattribute:: cuda.bindings.runtime.cudaArraySparsePropertiesSingleMipTail + + Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers + +.. 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.CUDA_IPC_HANDLE_SIZE + + CUDA IPC Handle Size + +.. 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 + + 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.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`. + +.. 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.cudaGraphKernelNodePortDefault + + This port activates when the kernel has finished executing. + +.. 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.cudaGraphKernelNodePortLaunchCompletion + + This port activates when all blocks of the kernel have begun execution. See also :py:obj:`~.cudaLaunchAttributeLaunchCompletionEvent`. + +.. 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.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.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 + + +Device Management +----------------- + +impl_private + + + +MANBRIEF device management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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.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.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 + +Error Handling +-------------- + +MANBRIEF error handling functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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 + +Stream Management +----------------- + +MANBRIEF stream management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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.cudaStreamGetCaptureInfo_v3 +.. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies +.. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies_v2 + +Event Management +---------------- + +MANBRIEF event management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the event management functions of the CUDA runtime application programming interface. + +.. 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 +.. autofunction:: cuda.bindings.runtime.cudaEventElapsedTime_v2 + +External Resource Interoperability +---------------------------------- + +MANBRIEF External resource interoperability functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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 + +Execution Control +----------------- + +MANBRIEF execution control functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the execution control functions of the CUDA runtime application programming interface. + + + +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.cudaLaunchHostFunc + +Occupancy +--------- + +MANBRIEF occupancy calculation functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the occupancy calculation functions of the CUDA runtime application programming interface. + + + +Besides the occupancy calculator functions (cudaOccupancyMaxActiveBlocksPerMultiprocessor and cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags), there are also C++ only occupancy-based launch configuration functions documented in C++ API Routines module. + + + +See cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API) cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), + +.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessor +.. autofunction:: cuda.bindings.runtime.cudaOccupancyAvailableDynamicSMemPerBlock +.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + +Memory Management +----------------- + +MANBRIEF memory management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the memory management functions of the CUDA runtime application programming interface. + + + +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.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.cudaMemPrefetchAsync_v2 +.. autofunction:: cuda.bindings.runtime.cudaMemAdvise +.. autofunction:: cuda.bindings.runtime.cudaMemAdvise_v2 +.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttributes +.. autofunction:: cuda.bindings.runtime.make_cudaPitchedPtr +.. autofunction:: cuda.bindings.runtime.make_cudaPos +.. autofunction:: cuda.bindings.runtime.make_cudaExtent + +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 + + + + + +**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 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. + + + + + +**Supported Platforms** + +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.cudaMallocFromPoolAsync +.. autofunction:: cuda.bindings.runtime.cudaMemPoolExportToShareableHandle +.. autofunction:: cuda.bindings.runtime.cudaMemPoolImportFromShareableHandle +.. autofunction:: cuda.bindings.runtime.cudaMemPoolExportPointer +.. autofunction:: cuda.bindings.runtime.cudaMemPoolImportPointer + +Unified Addressing +------------------ + +MANBRIEF unified addressing functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the unified addressing functions of the CUDA runtime application programming interface. + + + + + +**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). + + + + + +**Supported Platforms** + +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 . + + + + + +**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 cudaPointerGetAttributes() + +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. + + + + + +**Automatic Mapping of Host Allocated Host Memory** + +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. + +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. + + + +Note that this is not the case for memory allocated using the flag cudaHostAllocWriteCombined, as discussed below. + + + + + +**Direct Access of Peer Memory** + +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. + + + + + +**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 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. + + + +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 + +Peer Device Memory Access +------------------------- + +MANBRIEF peer device memory access functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the peer device memory access functions of the CUDA runtime application programming interface. + +.. autofunction:: cuda.bindings.runtime.cudaDeviceCanAccessPeer +.. autofunction:: cuda.bindings.runtime.cudaDeviceEnablePeerAccess +.. autofunction:: cuda.bindings.runtime.cudaDeviceDisablePeerAccess + +OpenGL Interoperability +----------------------- + +impl_private + + + +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. + +.. autoclass:: cuda.bindings.runtime.cudaGLDeviceList + + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListAll + + + The CUDA devices for all GPUs used by the current OpenGL context + + + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListCurrentFrame + + + The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame + + + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListNextFrame + + + The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame + +.. autofunction:: cuda.bindings.runtime.cudaGLGetDevices +.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterImage +.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterBuffer + +Direct3D 9 Interoperability +--------------------------- + + + + +Direct3D 10 Interoperability +---------------------------- + + + + +Direct3D 11 Interoperability +---------------------------- + + + + +VDPAU Interoperability +---------------------- + +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 + +EGL Interoperability +-------------------- + +This section describes the EGL interoperability functions of the CUDA runtime application programming interface. + +.. 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 +------------------------- + +MANBRIEF graphics interoperability functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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 + +Texture Object Management +------------------------- + +MANBRIEF texture object management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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. + +.. 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 +------------------------- + +MANBRIEF surface object management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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 + +Version Management +------------------ + + + +.. autofunction:: cuda.bindings.runtime.cudaDriverGetVersion +.. autofunction:: cuda.bindings.runtime.cudaRuntimeGetVersion +.. autofunction:: cuda.bindings.runtime.getLocalRuntimeVersion + +Graph Management +---------------- + +MANBRIEF graph management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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.cudaGraphGetNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphGetRootNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges +.. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphDestroyNode +.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiate +.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithFlags +.. 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.cudaGraphAddNode_v2 +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate + +Driver Entry Point Access +------------------------- + +MANBRIEF driver entry point access functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the driver entry point access functions of CUDA runtime application programming interface. + +.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPoint +.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPointByVersion + +Library Management +------------------ + +MANBRIEF library management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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 + +C++ API Routines +---------------- +C++-style interface built on top of CUDA runtime API. +impl_private + + + +MANBRIEF C++ high level API functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +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. + + +Interactions with the CUDA Driver API +------------------------------------- + +MANBRIEF interactions between CUDA Driver API and CUDA Runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the interactions between the CUDA Driver API and the CUDA Runtime API + + + + + +**Primary Contexts** + +There exists a one to one relationship between CUDA devices in the CUDA Runtime API and ::CUcontext s in the CUDA Driver API within a process. The specific context which the CUDA Runtime API uses for a device is called the device's primary context. From the perspective of the CUDA Runtime API, a device and its primary context are synonymous. + + + + + +**Initialization and Tear-Down** + +CUDA Runtime API calls operate on the CUDA Driver API ::CUcontext which is current to to the calling host thread. + +The function cudaInitDevice() ensures that the primary context is initialized for the requested device but does not make it current to the calling thread. + +The function cudaSetDevice() initializes the primary context for the specified device and makes it current to the calling thread by calling ::cuCtxSetCurrent(). + +The CUDA Runtime API will automatically initialize the primary context for a device at the first CUDA Runtime API call which requires an active context. 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 for a device will be selected, made current to the calling thread, and initialized. + +The context which the CUDA Runtime API initializes 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. + +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. + +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. + + + + + +**Context Interoperability** + +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 that the implicit one-to-one device-to-context mapping for the process provided by the CUDA Runtime API be used. + +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 cudaPointerGetAttributes() will return the error cudaErrorIncompatibleDriverContext if the pointer being queried was allocated by a non-primary context. 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 pointer query and 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. + +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 contexts (those with a version of 3010 as returned by ::cuCtxGetApiVersion()) is not possible. The CUDA Runtime will return cudaErrorIncompatibleDriverContext in such cases. + + + + + +**Interactions between CUstream and cudaStream_t** + +The types ::CUstream and cudaStream_t are identical and may be used interchangeably. + + + + + +**Interactions between CUevent and cudaEvent_t** + +The types ::CUevent and cudaEvent_t are identical and may be used interchangeably. + + + + + +**Interactions between CUarray and cudaArray_t** + +The types ::CUarray and struct ::cudaArray \* represent the same data type and may be used interchangeably by casting the two types between each other. + +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 . + + + + + +**Interactions between CUgraphicsResource and cudaGraphicsResource_t** + +The types ::CUgraphicsResource and cudaGraphicsResource_t represent the same data type and may be used interchangeably by casting the two types between each other. + +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. + + + + + +**Interactions between CUtexObject and cudaTextureObject_t** + +The types ::CUtexObject and cudaTextureObject_t represent the same data type and may be used interchangeably by casting the two types between each other. + +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. + + + + + +**Interactions between CUsurfObject and cudaSurfaceObject_t** + +The types ::CUsurfObject and cudaSurfaceObject_t represent the same data type and may be used interchangeably by casting the two types between each other. + +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. + + + + + +**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_12/docs/source/module/utils.rst b/cuda_bindings_12/docs/source/module/utils.rst new file mode 100644 index 00000000000..7673b742b59 --- /dev/null +++ b/cuda_bindings_12/docs/source/module/utils.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings.utils + +utils +===== + +Functions +--------- + +.. autosummary:: + :toctree: generated/ + + get_cuda_native_handle + get_minimal_required_cuda_ver_from_ptx_ver + get_ptx_ver diff --git a/cuda_bindings_12/docs/source/motivation.md b/cuda_bindings_12/docs/source/motivation.md new file mode 100644 index 00000000000..de71bee4d08 --- /dev/null +++ b/cuda_bindings_12/docs/source/motivation.md @@ -0,0 +1,41 @@ +# Motivation +## What is CUDA Python? + +NVIDIA’s CUDA Python provides [Cython](https://cython.org/) bindings and Python +wrappers for the driver and runtime API for existing toolkits and libraries to +simplify GPU-based accelerated processing. Python is one of the most popular +programming languages for science, engineering, data analytics, and deep +learning applications. The goal of CUDA Python is to unify +the Python ecosystem with a single set of interfaces that provide full coverage +of and access to the CUDA host APIs from Python. + +## Why CUDA Python? + +CUDA Python provides uniform APIs and bindings for inclusion into existing +toolkits and libraries to simplify GPU-based parallel processing for HPC, data +science, and AI. + +[Numba](https://numba.pydata.org/), a Python compiler from +[Anaconda](https://www.anaconda.com/) that can compile Python code for execution +on CUDA-capable GPUs, provides Python developers with an easy entry into +GPU-accelerated computing and a path for using increasingly sophisticated CUDA +code with a minimum of new syntax and jargon. Numba has its own CUDA driver API +bindings that can now be replaced with CUDA Python. With CUDA Python and Numba, +you get the best of both worlds: rapid iterative development with Python and the +speed of a compiled language targeting both CPUs and NVIDIA GPUs. + +[CuPy](https://cupy.dev/) is a +[NumPy](https://numpy.org/)/[SciPy](https://www.scipy.org/) compatible Array +library, from [Preferred Networks](https://www.preferred.jp/en/), for +GPU-accelerated computing with Python. CUDA Python simplifies the CuPy build +and allows for a faster and smaller memory footprint when importing the CuPy +Python module. In the future, when more CUDA Toolkit libraries are supported, +CuPy will have a lighter maintenance overhead and have fewer wheels to +release. Users benefit from a faster CUDA runtime! + +Our goal is to help unify the Python CUDA ecosystem with a single standard set +of interfaces, providing full coverage of, and access to, the CUDA host APIs +from Python. We want to provide a foundation for the ecosystem to build on top +of in unison to allow composing different accelerated libraries together to +solve the problems at hand. We also want to lower the barrier to entry for +Python developers to utilize NVIDIA GPUs. diff --git a/cuda_bindings_12/docs/source/overview.md b/cuda_bindings_12/docs/source/overview.md new file mode 100644 index 00000000000..c4c31cbb9c0 --- /dev/null +++ b/cuda_bindings_12/docs/source/overview.md @@ -0,0 +1,557 @@ +# Overview + +Python plays a key role within the science, engineering, data analytics, and +deep learning application ecosystem. NVIDIA has long been committed to helping +the Python ecosystem leverage the accelerated massively parallel performance of +GPUs to deliver standardized libraries, tools, and applications. Today, we're +introducing another step towards simplification of the developer experience with +improved Python code portability and compatibility. + +Our goal is to help unify the Python CUDA ecosystem with a single standard set +of low-level interfaces, providing full coverage and access to the CUDA host +APIs from Python. We want to provide an ecosystem foundation to allow +interoperability among different accelerated libraries. Most importantly, it +should be easy for Python developers to use NVIDIA GPUs. + +## `cuda.bindings` workflow + +Because Python is an interpreted language, you need a way to compile the device +code into +[PTX](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html) and +then extract the function to be called at a later point in the application. You +construct your device code in the form of a string and compile it with +[NVRTC](http://docs.nvidia.com/cuda/nvrtc/index.html), a runtime compilation +library for CUDA C++. Using the NVIDIA [Driver +API](http://docs.nvidia.com/cuda/cuda-driver-api/index.html), manually create a +CUDA context and all required resources on the GPU, then launch the compiled +CUDA C++ code and retrieve the results from the GPU. Now that you have an +overview, jump into a commonly used example for parallel programming: +[SAXPY](https://developer.nvidia.com/blog/six-ways-saxpy/). + +The first thing to do is import the [Driver +API](https://docs.nvidia.com/cuda/cuda-driver-api/index.html) and +[NVRTC](https://docs.nvidia.com/cuda/nvrtc/index.html) modules from the `cuda.bindings` +package. Next, we consider how to store host data and pass it to the device. Different +approaches can be used to accomplish this and are described in [Preparing kernel +arguments](https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html#preparing-kernel-arguments). +In this example, we will use NumPy to store host data and pass it to the device, so let's +import this dependency as well. + +```python +from cuda.bindings import driver, nvrtc +import numpy as np +``` + +Error checking is a fundamental best practice when working with low-level interfaces. +The following code snippet lets us validate each API call and raise exceptions in case of error. + +```python +def _cudaGetErrorEnum(error): + if isinstance(error, driver.CUresult): + err, name = driver.cuGetErrorName(error) + return name if err == driver.CUresult.CUDA_SUCCESS else "" + elif isinstance(error, nvrtc.nvrtcResult): + return nvrtc.nvrtcGetErrorString(error)[1] + else: + raise RuntimeError('Unknown error type: {}'.format(error)) + +def checkCudaErrors(result): + if result[0].value: + raise RuntimeError("CUDA error code={}({})".format(result[0].value, _cudaGetErrorEnum(result[0]))) + if len(result) == 1: + return None + elif len(result) == 2: + return result[1] + else: + return result[1:] +``` + +It's common practice to write CUDA kernels near the top of a translation unit, +so write it next. The entire kernel is wrapped in triple quotes to form a +string. The string is compiled later using NVRTC. This is the only part of CUDA +Python that requires some understanding of CUDA C++. For more information, see +[An Even Easier Introduction to +CUDA](https://developer.nvidia.com/blog/even-easier-introduction-cuda/). + +```python +saxpy = """\ +extern "C" __global__ +void saxpy(float a, float *x, float *y, float *out, size_t n) +{ + size_t tid = blockIdx.x * blockDim.x + threadIdx.x; + if (tid < n) { + out[tid] = a * x[tid] + y[tid]; + } +} +""" +``` +Go ahead and compile the kernel into PTX. Remember that this is executed at runtime using NVRTC. There are three basic steps to NVRTC: + +- Create a program from the string. +- Compile the program. +- Extract PTX from the compiled program. + +In the following code example, the Driver API is initialized so that the NVIDIA driver +and GPU are accessible. Next, the GPU is queried for their compute capability. Finally, +the program is compiled to target our local compute capability architecture with FMAD disabled. + +```python +# Initialize CUDA Driver API +checkCudaErrors(driver.cuInit(0)) + +# Retrieve handle for device 0 +cuDevice = checkCudaErrors(driver.cuDeviceGet(0)) + +# Derive target architecture for device 0 +major = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)) +minor = checkCudaErrors(driver.cuDeviceGetAttribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)) +arch_arg = bytes(f'--gpu-architecture=compute_{major}{minor}', 'ascii') + +# Create program +prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(saxpy), b"saxpy.cu", 0, [], [])) + +# Compile program +opts = [b"--fmad=false", arch_arg] +checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, 2, opts)) + +# Get PTX from compilation +ptxSize = checkCudaErrors(nvrtc.nvrtcGetPTXSize(prog)) +ptx = b" " * ptxSize +checkCudaErrors(nvrtc.nvrtcGetPTX(prog, ptx)) +``` + +Before you can use the PTX or do any work on the GPU, you must create a CUDA +context. CUDA contexts are analogous to host processes for the device. In the +following code example, a handle for compute device 0 is passed to +`cuCtxCreate` to designate that GPU for context creation. + +```python +# Create context +context = checkCudaErrors(driver.cuCtxCreate(0, cuDevice)) +``` + +With a CUDA context created on device 0, load the PTX generated earlier into a +module. A module is analogous to dynamically loaded libraries for the device. +After loading into the module, extract a specific kernel with +`cuModuleGetFunction`. It is not uncommon for multiple kernels to reside in PTX. + +```python +# Load PTX as module data and retrieve function +ptx = np.char.array(ptx) +# Note: Incompatible --gpu-architecture would be detected here +module = checkCudaErrors(driver.cuModuleLoadData(ptx.ctypes.data)) +kernel = checkCudaErrors(driver.cuModuleGetFunction(module, b"saxpy")) +``` + +Next, get all your data prepared and transferred to the GPU. For increased +application performance, you can input data on the device to eliminate data +transfers. For completeness, this example shows how you would transfer data to +and from the device. + +```python +NUM_THREADS = 512 # Threads per block +NUM_BLOCKS = 32768 # Blocks per grid + +a = np.array([2.0], dtype=np.float32) +n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32) +bufferSize = n * a.itemsize + +hX = np.random.rand(n).astype(dtype=np.float32) +hY = np.random.rand(n).astype(dtype=np.float32) +hOut = np.zeros(n).astype(dtype=np.float32) +``` + +With the input data `a`, `x`, and `y` created for the SAXPY transform device, +resources must be allocated to store the data using `cuMemAlloc`. To allow for +more overlap between compute and data movement, use the asynchronous function +`cuMemcpyHtoDAsync`. It returns control to the CPU immediately following command +execution. + +Python doesn't have a natural concept of pointers, yet `cuMemcpyHtoDAsync` expects +`void*`. This is where we leverage NumPy's data types to retrieve each host data pointer +by calling `XX.ctypes.data` for the associated XX. + +```python +dXclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) +dYclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) +dOutclass = checkCudaErrors(driver.cuMemAlloc(bufferSize)) + +stream = checkCudaErrors(driver.cuStreamCreate(0)) + +checkCudaErrors(driver.cuMemcpyHtoDAsync( + dXclass, hX.ctypes.data, bufferSize, stream +)) +checkCudaErrors(driver.cuMemcpyHtoDAsync( + dYclass, hY.ctypes.data, bufferSize, stream +)) +``` + +With data prep and resources allocation finished, the kernel is ready to be +launched. To pass the location of the data on the device to the kernel execution +configuration, you must retrieve the device pointer. In the following code +example, we call `int(XXclass)` to retrieve the device pointer value for the +associated XXclass as a Python `int` and wrap it in a `np.array` type. + +```python +dX = np.array([int(dXclass)], dtype=np.uint64) +dY = np.array([int(dYclass)], dtype=np.uint64) +dOut = np.array([int(dOutclass)], dtype=np.uint64) +``` + +The launch API `cuLaunchKernel` also expects a pointer input for the argument list +but this time it's of type `void**`. What this means is that our argument list needs to +be a contiguous array of `void*` elements, where each element is the pointer to a kernel +argument on either host or device. Since we already prepared each of our arguments into a `np.array` type, the +construction of our final contiguous array is done by retrieving the `XX.ctypes.data` +of each kernel argument. + +```python +args = [a, dX, dY, dOut, n] +args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) +``` + +Now the kernel can be launched: + +```python +checkCudaErrors(driver.cuLaunchKernel( + kernel, + NUM_BLOCKS, # grid x dim + 1, # grid y dim + 1, # grid z dim + NUM_THREADS, # block x dim + 1, # block y dim + 1, # block z dim + 0, # dynamic shared memory + stream, # stream + args.ctypes.data, # kernel arguments + 0, # extra (ignore) +)) + +checkCudaErrors(driver.cuMemcpyDtoHAsync( + hOut.ctypes.data, dOutclass, bufferSize, stream +)) +checkCudaErrors(driver.cuStreamSynchronize(stream)) +``` + +The `cuLaunchKernel` function takes the compiled module kernel and execution +configuration parameters. The device code is launched in the same stream as the +data transfers. That ensures that the kernel's compute is performed only after +the data has finished transfer, as all API calls and kernel launches within a +stream are serialized. After the call to transfer data back to the host is +executed, `cuStreamSynchronize` is used to halt CPU execution until all operations +in the designated stream are finished. + +```python +# Assert values are same after running kernel +hZ = a * hX + hY +if not np.allclose(hOut, hZ): + raise ValueError("Error outside tolerance for host-device vectors") +``` + +Perform verification of the data to ensure correctness and finish the code with +memory clean up. + +```python +checkCudaErrors(driver.cuStreamDestroy(stream)) +checkCudaErrors(driver.cuMemFree(dXclass)) +checkCudaErrors(driver.cuMemFree(dYclass)) +checkCudaErrors(driver.cuMemFree(dOutclass)) +checkCudaErrors(driver.cuModuleUnload(module)) +checkCudaErrors(driver.cuCtxDestroy(context)) +``` + +## Performance + +Performance is a primary driver in targeting GPUs in your application. So, how +does the above code compare to its C++ version? Table 1 shows that the results +are nearly identical. [NVIDIA NSight +Systems](https://developer.nvidia.com/nsight-systems) was used to retrieve +kernel performance and [CUDA +Events](https://developer.nvidia.com/blog/how-implement-performance-metrics-cuda-cc/) +was used for application performance. + +The following command was used to profile the applications: + +```{code-block} shell +nsys profile -s none -t cuda --stats=true +``` + +```{list-table} Kernel and application performance comparison. +:header-rows: 1 + +* - + - C++ + - Python +* - Kernel execution + - 352µs + - 352µs +* - Application execution + - 1076ms + - 1080ms +``` + +`cuda.bindings` is also compatible with [NVIDIA Nsight +Compute](https://developer.nvidia.com/nsight-compute), which is an +interactive kernel profiler for CUDA applications. It allows you to have +detailed insights into kernel performance. This is useful when you're trying to +maximize performance ({numref}`Figure 1`). + +```{figure} _static/images/Nsight-Compute-CLI-625x473.png +:name: Figure 1 + +Screenshot of Nsight Compute CLI output of `cuda.bindings` example. +``` + +## Preparing kernel arguments + +The `cuLaunchKernel` API bindings retain low-level CUDA argument preparation requirements: + +* Each kernel argument is a `void*` (i.e. pointer to the argument) +* `kernelParams` is a `void**` (i.e. pointer to a list of kernel arguments) +* `kernelParams` arguments are in contiguous memory + +These requirements can be met with two different approaches, using either NumPy or ctypes. + +### Using NumPy + +NumPy [Array objects](https://numpy.org/doc/stable/reference/arrays.html) can be used to fulfill each of these conditions directly. + +Let's use the following kernel definition as an example: +```python +kernel_string = """\ +typedef struct { + int value; +} testStruct; + +extern "C" __global__ +void testkernel(int i, int *pi, + float f, float *pf, + testStruct s, testStruct *ps) +{ + *pi = i; + *pf = f; + ps->value = s.value; +} +""" +``` + +The first step is to create array objects with types corresponding to your kernel arguments. Primitive NumPy types have the following corresponding kernel types: + +```{list-table} Correspondence between NumPy types and kernel types. +:header-rows: 1 + +* - NumPy type + - Corresponding kernel types + - itemsize (bytes) +* - bool + - bool + - 1 +* - int8 + - char, signed char, int8_t + - 1 +* - int16 + - short, signed short, int16_t + - 2 +* - int32 + - int, signed int, int32_t + - 4 +* - int64 + - long long, signed long long, int64_t + - 8 +* - uint8 + - unsigned char, uint8_t + - 1 +* - uint16 + - unsigned short, uint16_t + - 2 +* - uint32 + - unsigned int, uint32_t + - 4 +* - uint64 + - unsigned long long, uint64_t + - 8 +* - float16 + - half + - 2 +* - float32 + - float + - 4 +* - float64 + - double + - 8 +* - complex64 + - float2, cuFloatComplex, complex<float> + - 8 +* - complex128 + - double2, cuDoubleComplex, complex<double> + - 16 +``` + +Furthermore, custom NumPy types can be used to support both platform-dependent types and user-defined structures as kernel arguments. + +This example uses the following types: +* `int` is `np.uint32` +* `float` is `np.float32` +* `int*`, `float*` and `testStruct*` are `np.intp` +* `testStruct` is a custom user type `np.dtype([("value", np.int32)], align=True)` + +Note how all three pointers are `np.intp` since the pointer values are always a representation of an address space. + +Putting it all together: +```python +# Define a custom type +testStruct = np.dtype([("value", np.int32)], align=True) + +# Allocate device memory +pInt = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.int32).itemsize)) +pFloat = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.float32).itemsize)) +pStruct = checkCudaErrors(cudart.cudaMalloc(testStruct.itemsize)) + +# Collect all input kernel arguments into a single tuple for further processing +kernelValues = ( + np.array(1, dtype=np.uint32), + np.array([pInt], dtype=np.intp), + np.array(123.456, dtype=np.float32), + np.array([pFloat], dtype=np.intp), + np.array([5], testStruct), + np.array([pStruct], dtype=np.intp), +) +``` + +The final step is to construct a `kernelParams` argument that fulfills all of the launch API conditions. This is made easy because each array object comes +with a [ctypes](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html#numpy.ndarray.ctypes) data attribute that returns the underlying `void*` pointer value. + +By having the final array object contain all pointers, we fulfill the contiguous array requirement: + +```python +kernelParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) +``` + +The launch API supports [Buffer Protocol](https://docs.python.org/3/c-api/buffer.html) objects, therefore we can pass the array object directly. + +```python +checkCudaErrors(cuda.cuLaunchKernel( + kernel, + 1, 1, 1, # grid dim + 1, 1, 1, # block dim + 0, stream, # shared mem and stream + kernelParams=kernelParams, + extra=0, +)) +``` + +### Using ctypes + +The [ctypes](https://docs.python.org/3/library/ctypes.html) approach relaxes the parameter preparation requirement by delegating the contiguous memory requirement to the API launch call. + +Let's use the same kernel definition as the previous section for the example. + +The ctypes approach treats the `kernelParams` argument as a pair of two tuples: `kernel_values` and `kernel_types`. + +* `kernel_values` contain Python values to be used as an input to your kernel +* `kernel_types` contain the data types that your kernel_values should be converted into + +The ctypes [fundamental data types](https://docs.python.org/3/library/ctypes.html#fundamental-data-types) documentation describes the compatibility between different Python types and C types. +Furthermore, [custom data types](https://docs.python.org/3/library/ctypes.html#calling-functions-with-your-own-custom-data-types) can be used to support kernels with custom types. + +For this example the result becomes: + +```python +# Define a custom type +class testStruct(ctypes.Structure): + _fields_ = [("value", ctypes.c_int)] + +# Allocate device memory +pInt = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_int))) +pFloat = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(ctypes.c_float))) +pStruct = checkCudaErrors(cudart.cudaMalloc(ctypes.sizeof(testStruct))) + +# Collect all input kernel arguments into a single tuple for further processing +kernelValues = ( + 1, + pInt, + 123.456, + pFloat, + testStruct(5), + pStruct, +) +kernelTypes = ( + ctypes.c_int, + ctypes.c_void_p, + ctypes.c_float, + ctypes.c_void_p, + None, + ctypes.c_void_p, +) +``` + +Values that are set to `None` have a special meaning: + +1. The value supports a callable `getPtr` that returns the pointer address of the underlining C object address (e.g. all CUDA C types that are exposed to Python as Python classes) +2. The value is an instance of `ctypes.Structure` +3. The value is an `Enum` + +In all three cases, the API call will fetch the underlying pointer value and construct a contiguous array with other kernel parameters. + +With the setup complete, the kernel can be launched: + +```python +checkCudaErrors(cuda.cuLaunchKernel( + kernel, + 1, 1, 1, # grid dim + 1, 1, 1, # block dim + 0, stream, # shared mem and stream + kernelParams=(kernelValues, kernelTypes), + extra=0, +)) +``` + +### CUDA objects + +Certain CUDA kernels use native CUDA types as their parameters such as `cudaTextureObject_t`. These types require special handling since they're neither a primitive ctype nor a custom user type. Since `cuda.bindings` exposes each of them as Python classes, they each implement `getPtr()` and `__int__()`. These two callables used to support the NumPy and ctypes approach. The difference between each call is further described under [Tips and Tricks](https://nvidia.github.io/cuda-python/cuda-bindings/latest/tips_and_tricks.html#). + +For this example, lets use the `transformKernel` from [examples/0_Introduction/simpleCubemapTexture_test.py](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings_12/examples/0_Introduction/simpleCubemapTexture_test.py): + +```python +simpleCubemapTexture = """\ +extern "C" +__global__ void transformKernel(float *g_odata, int width, cudaTextureObject_t tex) +{ + ... +} +""" + +def main(): + ... + d_data = checkCudaErrors(cudart.cudaMalloc(size)) + width = 64 + tex = checkCudaErrors(cudart.cudaCreateTextureObject(texRes, texDescr, None)) + ... +``` + +For NumPy, we can convert these CUDA types by leveraging the `__int__()` call to fetch the address of the underlying `cudaTextureObject_t` C object and wrapping it in a NumPy object array of type `np.intp`: + +```python +kernelValues = ( + np.array([d_data], dtype=np.intp), + np.array(width, dtype=np.uint32), + np.array([int(tex)], dtype=np.intp), +) +kernelArgs = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp) +``` + +For ctypes, we leverage the special handling of `None` type since each Python class already implements `getPtr()`: + +```python +kernelValues = ( + d_data, + width, + tex, +) +kernelTypes = ( + ctypes.c_void_p, + ctypes.c_int, + None, +) +kernelArgs = (kernelValues, kernelTypes) +``` diff --git a/cuda_bindings_12/docs/source/release.rst b/cuda_bindings_12/docs/source/release.rst new file mode 100644 index 00000000000..f844bfc251d --- /dev/null +++ b/cuda_bindings_12/docs/source/release.rst @@ -0,0 +1,11 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Release Notes +============= + +.. toctree:: + :maxdepth: 3 + :glob: + + release/*[0-9]-notes diff --git a/cuda_bindings_12/docs/source/release/11.4.0-notes.md b/cuda_bindings_12/docs/source/release/11.4.0-notes.md new file mode 100644 index 00000000000..9eaa4eff0a2 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.4.0-notes.md @@ -0,0 +1,42 @@ +# CUDA Python 11.4.0 Release notes + +Released on August 16, 2021 + +## Highlights +- Initial EA release for CUDA Python +- Supports all platforms that CUDA is supported +- Supports all CUDA 11.x releases +- Low-level CUDA Cython bindings and Python wrappers + +## Limitations + +- Source code release only; Python packages coming in a future release. + +### CUDA Functions Not Supported in this Release + +- cudaGetTextureReference +- cudaGetSurfaceReference +- cudaBindTexture +- cudaBindTexture2D +- cudaBindTextureToArray +- cudaBindTextureToMipmappedArray +- cudaLaunchKernel +- cudaLaunchCooperativeKernel +- cudaLaunchCooperativeKernelMultiDevice +- cudaMemcpyToSymbol +- cudaMemcpyFromSymbol +- cudaMemcpyToSymbolAsync +- cudaMemcpyFromSymbolAsync +- cudaGetSymbolAddress +- cudaGetSymbolSize +- cudaUnbindTexture +- cudaGetTextureAlignmentOffset +- cudaBindSurfaceToArray +- cudaGetFuncBySymbol +- cudaSetValidDevices +- cudaGraphExecMemcpyNodeSetParamsFromSymbol +- cudaGraphExecMemcpyNodeSetParamsToSymbol +- cudaGraphAddMemcpyNodeToSymbol +- cudaGraphAddMemcpyNodeFromSymbol +- cudaGraphMemcpyNodeSetParamsToSymbol +- cudaGraphMemcpyNodeSetParamsFromSymbol diff --git a/cuda_bindings_12/docs/source/release/11.5.0-notes.md b/cuda_bindings_12/docs/source/release/11.5.0-notes.md new file mode 100644 index 00000000000..130cb17d070 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.5.0-notes.md @@ -0,0 +1,110 @@ +# CUDA Python 11.5.0 Release notes + +Released on October 18, 2021 + +## Highlights +- PyPi support +- Conda support +- GA release for CUDA Python +- Supports all platforms that CUDA is supported +- Supports all CUDA 11.x releases +- Low-level CUDA Cython bindings and Python wrappers + +## Limitations + +- Changing default stream not supported; coming in future release + +### CUDA Functions Not Supported in this Release + +- cudaGetTextureReference +- cudaGetSurfaceReference +- cudaBindTexture +- cudaBindTexture2D +- cudaBindTextureToArray +- cudaBindTextureToMipmappedArray +- cudaLaunchKernel +- cudaLaunchCooperativeKernel +- cudaLaunchCooperativeKernelMultiDevice +- cudaMemcpyToSymbol +- cudaMemcpyFromSymbol +- cudaMemcpyToSymbolAsync +- cudaMemcpyFromSymbolAsync +- cudaGetSymbolAddress +- cudaGetSymbolSize +- cudaUnbindTexture +- cudaGetTextureAlignmentOffset +- cudaBindSurfaceToArray +- cudaGetFuncBySymbol +- cudaSetValidDevices +- cudaGraphExecMemcpyNodeSetParamsFromSymbol +- cudaGraphExecMemcpyNodeSetParamsToSymbol +- cudaGraphAddMemcpyNodeToSymbol +- cudaGraphAddMemcpyNodeFromSymbol +- cudaGraphMemcpyNodeSetParamsToSymbol +- cudaGraphMemcpyNodeSetParamsFromSymbol +- cudaProfilerInitialize +- cudaProfilerStart +- cudaProfilerStop +- cuProfilerInitialize +- cuProfilerStart +- cuProfilerStop +- EGL + - cuGraphicsEGLRegisterImage + - cuEGLStreamConsumerConnect + - cuEGLStreamConsumerConnectWithFlags + - cuEGLStreamConsumerDisconnect + - cuEGLStreamConsumerAcquireFrame + - cuEGLStreamConsumerReleaseFrame + - cuEGLStreamProducerConnect + - cuEGLStreamProducerDisconnect + - cuEGLStreamProducerPresentFrame + - cuEGLStreamProducerReturnFrame + - cuGraphicsResourceGetMappedEglFrame + - cuEventCreateFromEGLSync + - cudaGraphicsEGLRegisterImage + - cudaEGLStreamConsumerConnect + - cudaEGLStreamConsumerConnectWithFlags + - cudaEGLStreamConsumerDisconnect + - cudaEGLStreamConsumerAcquireFrame + - cudaEGLStreamConsumerReleaseFrame + - cudaEGLStreamProducerConnect + - cudaEGLStreamProducerDisconnect + - cudaEGLStreamProducerPresentFrame + - cudaEGLStreamProducerReturnFrame + - cudaGraphicsResourceGetMappedEglFrame + - cudaEventCreateFromEGLSync +- GL + - cuGraphicsGLRegisterBuffer + - cuGraphicsGLRegisterImage + - cuWGLGetDevice + - cuGLGetDevices + - cuGLCtxCreate + - cuGLInit + - cuGLRegisterBufferObject + - cuGLMapBufferObject + - cuGLUnmapBufferObject + - cuGLUnregisterBufferObject + - cuGLSetBufferObjectMapFlags + - cuGLMapBufferObjectAsync + - cuGLUnmapBufferObjectAsync + - cudaGLGetDevices + - cudaGraphicsGLRegisterImage + - cudaGraphicsGLRegisterBuffer + - cudaWGLGetDevice + - cudaGLSetGLDevice + - cudaGLRegisterBufferObject + - cudaGLMapBufferObject + - cudaGLUnmapBufferObject + - cudaGLUnregisterBufferObject + - cudaGLSetBufferObjectMapFlags + - cudaGLMapBufferObjectAsync + - cudaGLUnmapBufferObjectAsync +- VDPAU + - cuVDPAUGetDevice + - cuVDPAUCtxCreate + - cuGraphicsVDPAURegisterVideoSurface + - cuGraphicsVDPAURegisterOutputSurface + - cudaVDPAUGetDevice + - cudaVDPAUSetVDPAUDevice + - cudaGraphicsVDPAURegisterVideoSurface + - cudaGraphicsVDPAURegisterOutputSurface diff --git a/cuda_bindings_12/docs/source/release/11.6.0-notes.md b/cuda_bindings_12/docs/source/release/11.6.0-notes.md new file mode 100644 index 00000000000..664da162491 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.6.0-notes.md @@ -0,0 +1,73 @@ +# CUDA Python 11.6.0 Release notes + +Released on Januray 12, 2022 + +## Highlights +- Support CUDA Toolkit 11.6 +- Support Profiler APIs +- Support Graphic APIs (EGL, GL, VDPAU) +- Support changing default stream +- Relaxed primitive interoperability + +### Default stream + +Changing default stream to Per-Thread-Default-Stream (PTDS) is done through environment variable before execution: + +```{code-block} shell +export CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1 +``` + +When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See [Stream Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html) for an explanation of the legacy and per-thread default streams. + +### Primitive interoperability + +APIs accepting classes that wrap a primitive value are now interoperable with the underlining value. + +Example 1: Structure member handles interoperability. + +```{code-block} python +>>> waitParams = cuda.CUstreamMemOpWaitValueParams_st() +>>> waitParams.value64 = 1 +>>> waitParams.value64 + +>>> waitParams.value64 = cuda.cuuint64_t(2) +>>> waitParams.value64 + +``` + +Example 2: Function signature handles interoperability. + +```{code-block} python +>>> cudart.cudaStreamQuery(cudart.cudaStreamNonBlocking) +(,) +>>> cudart.cudaStreamQuery(cudart.cudaStream_t(cudart.cudaStreamNonBlocking)) +(,) +``` + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice + +```{note} Deprecated APIs are removed from tracking +``` diff --git a/cuda_bindings_12/docs/source/release/11.6.1-notes.md b/cuda_bindings_12/docs/source/release/11.6.1-notes.md new file mode 100644 index 00000000000..ddd6ff51011 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.6.1-notes.md @@ -0,0 +1,31 @@ +# CUDA Python 11.6.1 Release notes + +Released on March 18, 2022 + +## Highlights +- Fix string decomposition for WSL library load + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.7.0-notes.md b/cuda_bindings_12/docs/source/release/11.7.0-notes.md new file mode 100644 index 00000000000..22500c7a238 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.7.0-notes.md @@ -0,0 +1,31 @@ +# CUDA Python 11.7.0 Release notes + +Released on May 11, 2022 + +## Highlights +- Support CUDA Toolkit 11.7 + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.7.1-notes.md b/cuda_bindings_12/docs/source/release/11.7.1-notes.md new file mode 100644 index 00000000000..2997c9da56c --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.7.1-notes.md @@ -0,0 +1,47 @@ +# CUDA Python 11.7.1 Release notes + +Released on June 29, 2022 + +## Highlights +- Fix error propagation in CUDA Runtime bindings +- Resolves [issue #22](https://github.com/NVIDIA/cuda-python/issues/22) + +## Limitations + +### Source builds + +CUDA Python no longer re-declares CUDA types, instead it uses the types from CUDA C headers. As such source builds now need to access to latest CTK headers. In particular: +1. "$CUDA_HOME/include" has latest CTK headers +2. CTK headers have all types defined + +(2) Certain CUDA types are not declared on mobile platforms and may face a "has not been declared" error during source builds. A temporary workaround is to use the headers found in [https://gitlab.com/nvidia/headers/cuda](https://gitlab.com/nvidia/headers/cuda). In particular CUDA Python needs the following headers and their dependencies: +- cuda.h +- cudaProfiler.h +- driver_types.h +- cuda_runtime.h +- nvrtc.h + +This a short-term limitation and will be relaxed in a future release. + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.0-notes.md b/cuda_bindings_12/docs/source/release/11.8.0-notes.md new file mode 100644 index 00000000000..c5bf9f71c32 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.0-notes.md @@ -0,0 +1,40 @@ +# CUDA Python 11.8.0 Release notes + +Released on October 3, 2022 + +## Highlights +- Support CUDA Toolkit 11.8 +- Source builds allow for missing types and APIs +- Resolves source builds for mobile platforms +- Resolves [issue #24](https://github.com/NVIDIA/cuda-python/issues/24) + +### Source Builds + +CUDA Python source builds now parse CUDA headers located in $CUDA_HOME directory, enabling/disabling types and APIs if defined. Therefore this removes the need for CTK headers to have all types defined. By allowing minor variations, previous [11.7.1 mobile platform workaround](https://nvidia.github.io/cuda-python/release/11.7.1-notes.html#source-builds) is no longer needed. + +It's still required that source builds use the latest CTK headers (i.e. “$CUDA_HOME/include” has latest CTK headers). + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.1-notes.md b/cuda_bindings_12/docs/source/release/11.8.1-notes.md new file mode 100644 index 00000000000..f7c2e7d4501 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.1-notes.md @@ -0,0 +1,32 @@ +# CUDA Python 11.8.1 Release notes + +Released on November 4, 2022 + +## Highlights +- Resolves [issue #27](https://github.com/NVIDIA/cuda-python/issues/27) +- Update install instructions to use latest CTK + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.2-notes.md b/cuda_bindings_12/docs/source/release/11.8.2-notes.md new file mode 100644 index 00000000000..f9d16556528 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.2-notes.md @@ -0,0 +1,31 @@ +# CUDA Python 11.8.2 Release notes + +Released on May 18, 2023 + +## Highlights +- Open libcuda.so.1 instead of libcuda.so + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.3-notes.md b/cuda_bindings_12/docs/source/release/11.8.3-notes.md new file mode 100644 index 00000000000..a8ff840c1e2 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.3-notes.md @@ -0,0 +1,33 @@ +# CUDA Python 11.8.3 Release notes + +Released on October 23, 2023 + +## Highlights +- Compatability with Cython 3 +- New API cudart.getLocalRuntimeVersion() +- Modernize build config + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.4-notes.md b/cuda_bindings_12/docs/source/release/11.8.4-notes.md new file mode 100644 index 00000000000..13767998f02 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.4-notes.md @@ -0,0 +1,54 @@ +# CUDA Python 11.8.4 Release notes + +Released on October 7, 2024 + +## Highlights +- Resolve [Issue #89](https://github.com/NVIDIA/cuda-python/issues/89): Fix getLocalRuntimeVersion searching for wrong libcudart version +- Resolve [Issue #90](https://github.com/NVIDIA/cuda-python/issues/90): Use new layout in preperation for cuda-python becoming a metapackage + +## CUDA namespace cleanup with a new module layout + +[Issue #75](https://github.com/NVIDIA/cuda-python/issues/75) explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. + +Before this change, `cuda-python` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert `cuda-python` into a metapackage where we use `cuda` as a namespace with existing bindings code moved to a `cuda_bindings` subpackage. + +This patch release applies the new module layout for the bindings as follows: +- `cuda.cuda` -> `cuda.bindings.driver` +- `cuda.ccuda` -> `cuda.bindings.cydriver` +- `cuda.cudart` -> `cuda.bindings.runtime` +- `cuda.ccudart` -> `cuda.bindings.cyruntime` +- `cuda.nvrtc` -> `cuda.bindings.nvrtc` +- `cuda.cnvrtc` -> `cuda.bindings.cynvrtc` + +Deprecation warnings are turned on as a notice to switch to the new module layout. + +```{note} This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. +``` + +## Limitations + +### Know issues +- [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215) + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.5-notes.md b/cuda_bindings_12/docs/source/release/11.8.5-notes.md new file mode 100644 index 00000000000..37498b115fb --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.5-notes.md @@ -0,0 +1,33 @@ +# CUDA Python 11.8.5 Release notes + +Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. + +## Highlights +- Resolve [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215): module `cuda.ccudart` has no attribute `__pyx_capi__` +- Resolve [Issue #226](https://github.com/NVIDIA/cuda-python/issues/226): top-level Cython source files not packaged + + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/11.8.6-notes.md b/cuda_bindings_12/docs/source/release/11.8.6-notes.md new file mode 100644 index 00000000000..cdbc82e3d2c --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.6-notes.md @@ -0,0 +1,29 @@ +# `cuda-bindings` 11.8.6 Release notes + +Released on January 24, 2025. + + +## Highlights + +- Support Python 3.13 +- Add an optional dependency on the CUDA NVRTC wheel +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) + + +## Wheels support for optional dependencies + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 + +Installing these dependencies with `cuda-python` can be done using: +```{code-block} shell +pip install cuda-python[all] +``` +Same applies to `cuda-bindings`. + + +## Discovery and loading of shared library dependencies from wheels + +Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. diff --git a/cuda_bindings_12/docs/source/release/11.8.7-notes.rst b/cuda_bindings_12/docs/source/release/11.8.7-notes.rst new file mode 100644 index 00000000000..ab38253ceeb --- /dev/null +++ b/cuda_bindings_12/docs/source/release/11.8.7-notes.rst @@ -0,0 +1,27 @@ +.. 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 +====================================== + +Released on May 5, 2025. + + +Highlights +---------- + +* The ``cuda.bindings.nvvm`` Python module was added, wrapping the + `libNVVM C API `_. + + +Bug fixes +--------- + +* Fix segfault when converting char* NULL to bytes + + +Known issues +------------ + +* Compute-sanitizer may report ``CUDA_ERROR_INVALID_CONTEXT`` when calling certain CUDA + runtime APIs such as ``cudaGetDevice()``. This is fixed in ``cuda-bindings`` 12.9.0. diff --git a/cuda_bindings_12/docs/source/release/12.0.0-notes.md b/cuda_bindings_12/docs/source/release/12.0.0-notes.md new file mode 100644 index 00000000000..9f2ae258710 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.0.0-notes.md @@ -0,0 +1,33 @@ +# CUDA Python 12.0.0 Release notes + +Released on December 8, 2022 + +## Highlights +- Rebase to CUDA Toolkit 12.0 +- Fix example from [MR28](https://github.com/NVIDIA/cuda-python/pull/28) +- Apply [MR35](https://github.com/NVIDIA/cuda-python/pull/35) + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/12.1.0-notes.md b/cuda_bindings_12/docs/source/release/12.1.0-notes.md new file mode 100644 index 00000000000..94310bb513e --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.1.0-notes.md @@ -0,0 +1,34 @@ +# CUDA Python 12.1.0 Release notes + +Released on February 28, 2023 + +## Highlights +- Rebase to CUDA Toolkit 12.1 +- Resolve [Issue #41](https://github.com/NVIDIA/cuda-python/issues/41): Add support for Python 3.11 +- Resolve [Issue #42](https://github.com/NVIDIA/cuda-python/issues/42): Dropping Python 3.7 +- Resolve [Issue #43](https://github.com/NVIDIA/cuda-python/issues/43): Trim Conda package dependencies + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/12.2.0-notes.md b/cuda_bindings_12/docs/source/release/12.2.0-notes.md new file mode 100644 index 00000000000..39e37b9a8df --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.2.0-notes.md @@ -0,0 +1,33 @@ +# CUDA Python 12.2.0 Release notes + +Released on June 28, 2023 + +## Highlights +- Rebase to CUDA Toolkit 12.2 +- Resolve [Issue #44](https://github.com/NVIDIA/cuda-python/issues/44): nogil must be at the end of the function signature line +- Resolve [Issue #45](https://github.com/NVIDIA/cuda-python/issues/45): Error with pyparsing when no CUDA is found + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/12.2.1-notes.md b/cuda_bindings_12/docs/source/release/12.2.1-notes.md new file mode 100644 index 00000000000..3a89af85c22 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.2.1-notes.md @@ -0,0 +1,31 @@ +# CUDA Python 12.2.1 Release notes + +Released on January 8, 2024 + +## Highlights +- Compatibility with Cython 3 + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice diff --git a/cuda_bindings_12/docs/source/release/12.3.0-notes.md b/cuda_bindings_12/docs/source/release/12.3.0-notes.md new file mode 100644 index 00000000000..15bcdb97804 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.3.0-notes.md @@ -0,0 +1,36 @@ +# CUDA Python 12.3.0 Release notes + +Released on October 19, 2023 + +## Highlights +- Rebase to CUDA Toolkit 12.3 +- Resolve [Issue #16](https://github.com/NVIDIA/cuda-python/issues/16): cuda.cudart.cudaRuntimeGetVersion() hard-codes the runtime version, rather than querying the runtime + - New API cudart.getLocalRuntimeVersion() +- Resolve [Issue #48](https://github.com/NVIDIA/cuda-python/issues/48): Dropping Python 3.8 +- Resolve [Issue #51](https://github.com/NVIDIA/cuda-python/issues/51): Dropping package releases for ppc64 on PYPI and conda-nvidia channel + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName diff --git a/cuda_bindings_12/docs/source/release/12.4.0-notes.md b/cuda_bindings_12/docs/source/release/12.4.0-notes.md new file mode 100644 index 00000000000..191ecc644e3 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.4.0-notes.md @@ -0,0 +1,34 @@ +# CUDA Python 12.4.0 Release notes + +Released on March 5, 2024 + +## Highlights +- Rebase to CUDA Toolkit 12.4 +- Add PyPI/Conda support for Python 12 + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings_12/docs/source/release/12.5.0-notes.md b/cuda_bindings_12/docs/source/release/12.5.0-notes.md new file mode 100644 index 00000000000..b0e527a8a7f --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.5.0-notes.md @@ -0,0 +1,34 @@ +# CUDA Python 12.5.0 Release notes + +Released on May 21, 2024 + +## Highlights +- Rebase to CUDA Toolkit 12.5 +- Resolve [Issue #58](https://github.com/NVIDIA/cuda-python/issues/58): Interop between CUdeviceptr and Runtime + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings_12/docs/source/release/12.6.0-notes.md b/cuda_bindings_12/docs/source/release/12.6.0-notes.md new file mode 100644 index 00000000000..466e2eec11b --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.6.0-notes.md @@ -0,0 +1,36 @@ +# CUDA Python 12.6.0 Release notes + +Released on August 1, 2024 + +## Highlights +- Rebase to CUDA Toolkit 12.6 +- Resolve [Issue #32](https://github.com/NVIDIA/cuda-python/issues/32): Add 'pywin32' as Windows requirement +- Resolve [Issue #72](https://github.com/NVIDIA/cuda-python/issues/72): Allow both lists and tuples as parameter +- Resolve [Issue #73](https://github.com/NVIDIA/cuda-python/issues/73): Fix 'cuLibraryLoadData' processing of parameters + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings_12/docs/source/release/12.6.1-notes.md b/cuda_bindings_12/docs/source/release/12.6.1-notes.md new file mode 100644 index 00000000000..360047125e3 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.6.1-notes.md @@ -0,0 +1,56 @@ +# CUDA Python 12.6.1 Release notes + +Released on October 7, 2024 + +## Highlights +- Resolve [Issue #90](https://github.com/NVIDIA/cuda-python/issues/90): Use new layout in preparation for cuda-python becoming a metapackage +- Resolve [Issue #75](https://github.com/NVIDIA/cuda-python/issues/75): CUDA namespace cleanup + +## CUDA namespace cleanup with a new module layout + +[Issue #75](https://github.com/NVIDIA/cuda-python/issues/75) explains in detail what the new module layout is, what problem it fixes and how it impacts the users. However for the sake of completeness, this release notes will highlight key points of this change. + +Before this change, `cuda-python` was tightly coupled to CUDA Toolkit releases and all new features would inherit this coupling regardless of their applicability. As we develop new features, this coupling was becoming overly restrictive and motivated a new solution: Convert `cuda-python` into a metapackage where we use `cuda` as a namespace with existing bindings code moved to a `cuda_bindings` subpackage. + +This patch release applies the new module layout for the bindings as follows: +- `cuda.cuda` -> `cuda.bindings.driver` +- `cuda.ccuda` -> `cuda.bindings.cydriver` +- `cuda.cudart` -> `cuda.bindings.runtime` +- `cuda.ccudart` -> `cuda.bindings.cyruntime` +- `cuda.nvrtc` -> `cuda.bindings.nvrtc` +- `cuda.cnvrtc` -> `cuda.bindings.cynvrtc` + +Deprecation warnings are turned on as a notice to switch to the new module layout. + +```{note} This is non-breaking, backwards compatible change. All old module path will continue work as they "forward" user calls towards the new layout. +``` + +## Limitations + +### Know issues +- [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215) + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings_12/docs/source/release/12.6.2-notes.md b/cuda_bindings_12/docs/source/release/12.6.2-notes.md new file mode 100644 index 00000000000..938b9f5a618 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.6.2-notes.md @@ -0,0 +1,35 @@ +# CUDA Python 12.6.2 Release notes + +Released on November 5, 2024. Post 1 rebuild released on November 12, 2024. + +## Highlights +- Resolve [Issue #215](https://github.com/NVIDIA/cuda-python/issues/215): module `cuda.ccudart` has no attribute `__pyx_capi__` +- Resolve [Issue #226](https://github.com/NVIDIA/cuda-python/issues/226): top-level Cython source files not packaged + + +## Limitations + +### CUDA Functions Not Supported in this Release + +- Symbol APIs + - cudaGraphExecMemcpyNodeSetParamsFromSymbol + - cudaGraphExecMemcpyNodeSetParamsToSymbol + - cudaGraphAddMemcpyNodeToSymbol + - cudaGraphAddMemcpyNodeFromSymbol + - cudaGraphMemcpyNodeSetParamsToSymbol + - cudaGraphMemcpyNodeSetParamsFromSymbol + - cudaMemcpyToSymbol + - cudaMemcpyFromSymbol + - cudaMemcpyToSymbolAsync + - cudaMemcpyFromSymbolAsync + - cudaGetSymbolAddress + - cudaGetSymbolSize + - cudaGetFuncBySymbol +- Launch Options + - cudaLaunchKernel + - cudaLaunchCooperativeKernel + - cudaLaunchCooperativeKernelMultiDevice +- cudaSetValidDevices +- cudaVDPAUSetVDPAUDevice +- cudaFuncGetName +- cudaFuncGetParamInfo diff --git a/cuda_bindings_12/docs/source/release/12.8.0-notes.md b/cuda_bindings_12/docs/source/release/12.8.0-notes.md new file mode 100644 index 00000000000..c93f2d9df9f --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.8.0-notes.md @@ -0,0 +1,36 @@ +# `cuda-bindings` 12.8.0 Release notes + +Released on January 24, 2025. + + +## Highlights + +- Support Python 3.13 +- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) +- Add optional dependencies on CUDA NVRTC and nvJitLink wheels +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) + + +## Wheels support for optional dependencies + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 +- nvidia-nvjitlink-cu12 + +Installing these dependencies with `cuda-python` can be done using: +```{code-block} shell +pip install cuda-python[all] +``` +Same applies to `cuda-bindings`. + + +## Discovery and loading of shared library dependencies from wheels + +Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. + + +## Known issues + +- Updating from older versions (v12.6.2.post1 and below) via `pip install -U cuda-python` might not work. Please do a clean re-installation by uninstalling `pip uninstall -y cuda-python` followed by installing `pip install cuda-python`. diff --git a/cuda_bindings_12/docs/source/release/12.9.0-notes.rst b/cuda_bindings_12/docs/source/release/12.9.0-notes.rst new file mode 100644 index 00000000000..40b6c0ac853 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.0-notes.rst @@ -0,0 +1,42 @@ +.. 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 +====================================== + +Released on May 5, 2025 + + +Highlights +---------- + +* The ``cuda.bindings.nvvm`` Python module was added, wrapping the + `libNVVM C API `_ +* Source build error checking added for missing required headers +* Statically link CUDA Runtime instead of reimplementing it +* Move stream callback wrappers to the Python layer +* Return code construction is made faster + + +Bug fixes +--------- + +* Fix segfault when converting char* NULL to bytes +* Failed API calls return None for non error code tuple elements +* Compute-sanitizer may report ``CUDA_ERROR_INVALID_CONTEXT`` when calling certain CUDA + runtime APIs such as ``cudaGetDevice()`` + + +Miscellaneous +------------- + +* Benchmark suite is updated +* Improvements in the introductory code samples +* Fix performance hint warnings raised by Cython 3 +* Improvements in the Overview page + + +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_12/docs/source/release/12.9.1-notes.rst b/cuda_bindings_12/docs/source/release/12.9.1-notes.rst new file mode 100644 index 00000000000..bb536b8a135 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.1-notes.rst @@ -0,0 +1,51 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.1 Release notes +====================================== + +Released on Aug 6, 2025 + + +Highlights +---------- + +* A utility module :mod:`cuda.bindings.utils` is added + + * Using ``int(cuda_obj)`` to retrieve the underlying address of a CUDA object is deprecated and + subject to future removal. Please switch to use :func:`~cuda.bindings.utils.get_cuda_native_handle` + instead. + +* The ``cuda.bindings.cufile`` Python module was added, wrapping the + `cuFile C APIs `_. + Supported on Linux only. + + * Currently using this module requires NumPy to be present. Any recent NumPy 1.x or 2.x should work. + +* Python bindings in every module, including ``driver``, ``runtime``, and ``nvrtc``, now have the GIL + released before calling the underlying C APIs. + + +Bug fixes +--------- + +* Fix a library loading bug that preferred shared libraries without a SOVERSION. + + +Miscellaneous +------------- + +* All Python bindings now have the GIL released when calling into the underlying C APIs. +* Added PTX utilities including :func:`~utils.get_minimal_required_cuda_ver_from_ptx_ver` and :func:`~utils.get_ptx_ver`. +* Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. +* Add a binding to ``nvvmGetErrorString()``. +* Build the bindings with Cython profile hooks disabled. +* The internal pathfinder module is now isolated to a standalone package ``cuda-pathfinder`` and made as a required dependency. + + +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_12/docs/source/release/12.9.2-notes.rst b/cuda_bindings_12/docs/source/release/12.9.2-notes.rst new file mode 100644 index 00000000000..11d3bf0af31 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.2-notes.rst @@ -0,0 +1,21 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.2 Release notes +====================================== + +Released on Aug 18, 2025 + + +Highlights +---------- + +* Make populating the internal symbol table thread-safe. + + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. diff --git a/cuda_bindings_12/docs/source/release/12.9.3-notes.rst b/cuda_bindings_12/docs/source/release/12.9.3-notes.rst new file mode 100644 index 00000000000..66876a7f3eb --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.3-notes.rst @@ -0,0 +1,29 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.3 Release notes +====================================== + +Released on Oct 9, 2025 + + +Highlights +---------- + +* This is the last release that officially supports Python 3.9. +* Python 3.14 is supported. +* **Experimental** free-threaded builds for Python 3.13/3.14 are made available. Any bugs can be reported to `our GitHub repo `_. More details are available in our :ref:`support` docs. +* Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. +* The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. +* On Windows, the ``pywin32`` dependency has been removed. The necessary Windows API functions are now accessed directly. +* Updated the ``cuda.bindings.runtime`` module to statically link against the CUDA Runtime library from CUDA Toolkit 12.9.1. +* ``cyruntime.getLocalRuntimeVersion`` now uses pathfinder to find the CUDA runtime. + + +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``. +* The graphics APIs in ``cuda.bindings.runtime`` are inadvertently disabled in 12.9.3. Users needing these APIs should update to 12.9.4. diff --git a/cuda_bindings_12/docs/source/release/12.9.4-notes.rst b/cuda_bindings_12/docs/source/release/12.9.4-notes.rst new file mode 100644 index 00000000000..79abcd35dba --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.4-notes.rst @@ -0,0 +1,23 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.4 Release notes +====================================== + + + +Highlights +---------- + + +Bug fixes +--------- + +* The graphics APIs in ``cuda.bindings.runtime`` were inadvertently disabled in 12.9.3. This has been fixed. + +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_12/docs/source/release/12.9.5-notes.rst b/cuda_bindings_12/docs/source/release/12.9.5-notes.rst new file mode 100644 index 00000000000..13c49394a29 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.5-notes.rst @@ -0,0 +1,29 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.5 Release notes +====================================== + +Highlights +---------- + +* Added ``__cuda_stream__`` protocol support to ``driver.CUStream`` class, enabling better interoperability with libraries that expect this protocol. +* Python 3.9 support was dropped (end of life). + +Bug fixes +--------- + +* Fixed ``cuStreamBeginCaptureToGraph`` to allow the ``dependencyData`` argument to be optional, matching the underlying CUDA API behavior. + +Experimental +------------ + +* Experimental NVML bindings were added under ``cuda.bindings._nvml``. + +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``. +* The graphics APIs in ``cuda.bindings.runtime`` are inadvertently disabled in 12.9.3. Users needing these APIs should update to 12.9.4 or higher. diff --git a/cuda_bindings_12/docs/source/release/12.9.6-notes.rst b/cuda_bindings_12/docs/source/release/12.9.6-notes.rst new file mode 100644 index 00000000000..1589796ed9a --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.9.6-notes.rst @@ -0,0 +1,64 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.6 Release notes +====================================== + +Highlights +---------- + +* ``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 `_) +* Add ``nvFatbin`` bindings. + (`PR #1467 `_) +* Performance improvement: ``cuda.bindings`` now uses a faster ``enum`` + implementation, rather than the standard library's ``enum.IntEnum``. + This leads to much faster import times, and slightly faster attribute access + times. + (`PR #1581 `_) +* Multiple performance improvements cumulatively reducing Python-to-C call + overhead through faster ``void *`` conversion, faster result returning, + optimized enum-to-vector conversion, and stack-allocated small arrays. + +Bugfixes +-------- + +* Fixed an issue where the ``CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`` attribute was + retrieved as an unsigned int, rather than a signed int. + (`PR #1451 `_) +* Fixed a use-after-free in ``_HelperInputVoidPtr`` properties when backed by + Python buffer objects. + (`PR #1629 `_) + +Miscellaneous +------------- + +* Faster ``void *`` conversion using stack-allocated buffers instead of heap + allocation. + (`PR #1616 `_) +* Faster returning of results from driver, runtime, and NVRTC bindings. + (`PR #1647 `_, + `PR #1656 `_) +* Faster conversion of enum sequences to vectors by eliminating temporary + Python objects. + (`PR #1667 `_) +* Stack-allocated small numeric arrays in driver bindings, reducing heap + allocation overhead. + (`PR #1545 `_) +* NVML bindings now use ``cuda_pathfinder`` for library discovery, consistent + with other CUDA libraries. + (`PR #1661 `_) +* ``CUDA_HOME`` is no longer required at metadata resolution time (e.g. + ``pip install --dry-run``, ``uv lock``); it is only needed at actual build time. + (`PR #1652 `_) + +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_12/docs/source/release/12.9.7-notes.rst b/cuda_bindings_12/docs/source/release/12.9.7-notes.rst new file mode 100644 index 00000000000..842f1f3923e --- /dev/null +++ b/cuda_bindings_12/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_12/docs/source/release/12.X.Y-notes.rst b/cuda_bindings_12/docs/source/release/12.X.Y-notes.rst new file mode 100644 index 00000000000..f5e5d00a172 --- /dev/null +++ b/cuda_bindings_12/docs/source/release/12.X.Y-notes.rst @@ -0,0 +1,47 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.X.Y Release notes +====================================== + +Released on MM DD, 2025 + + +Highlights +---------- + +* A utility module :mod:`cuda.bindings.utils` is added + + * Using ``int(cuda_obj)`` to retrieve the underlying address of a CUDA object is deprecated and + subject to future removal. Please switch to use :func:`~cuda.bindings.utils.get_cuda_native_handle` + instead. + +* The ``cuda.bindings.cufile`` Python module was added, wrapping the + `cuFile C APIs `_. + Supported on Linux only. + + * Currently using this module requires NumPy to be present. Any recent NumPy 1.x or 2.x should work. + +* Python bindings in every module, including ``driver``, ``runtime``, and ``nvrtc``, now have the GIL + released before calling the underlying C APIs. + +* The Python overhead of calling functions in CUDA bindings in ``driver``, + ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. + +Bug fixes +--------- + + +Miscellaneous +------------- + +* Added PTX utilities including :func:`~utils.get_minimal_required_cuda_ver_from_ptx_ver` and :func:`~utils.get_ptx_ver`. +* Common CUDA objects such as :class:`~runtime.cudaStream_t` now compare equal if the underlying address is the same. + + +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_12/docs/source/support.rst b/cuda_bindings_12/docs/source/support.rst new file mode 100644 index 00000000000..3470a340f7e --- /dev/null +++ b/cuda_bindings_12/docs/source/support.rst @@ -0,0 +1,31 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +``cuda.bindings`` Support Policy +================================ + +The ``cuda.bindings`` module has the following support policy: + +1. The module shares the same ``major.minor`` version with the CUDA Toolkit. The patch version (the + third number in the version string), however, is reserved to reflect Python-only changes and + is out of sync with the Toolkit patch version. +2. The module is actively maintained to support the latest CUDA major version and its prior major + version. Both active source trees live on the main branch so applicable fixes can update the + CUDA 12 and CUDA 13 packages in one change. +3. The module supports `CUDA minor version compatibility`_, meaning that ``cuda.bindings`` 12.x + supports any Toolkit 12.y. (Whether or not a binding API would actually correctly function + depends on the underlying driver and the Toolkit versions, as described in the compatibility + documentation.) +4. The module supports all Python versions following the `CPython EOL schedule`_. As of writing + Python 3.10 - 3.14 are supported. +5. The module exposes a Cython layer from which types and functions could be ``cimport``'d. While + we strive to keep this layer stable, due to Cython limitations a new *minor* release of this + module could require Cython layer users to rebuild their projects and update their pinning to + this module. + +The NVIDIA CUDA Python team reserves rights to amend the above support policy. Any major changes, +however, will be announced to the users in advance. + + +.. _CUDA minor version compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/#minor-version-compatibility +.. _CPython EOL schedule: https://devguide.python.org/versions/ diff --git a/cuda_bindings_12/docs/source/tips_and_tricks.rst b/cuda_bindings_12/docs/source/tips_and_tricks.rst new file mode 100644 index 00000000000..d54006d78f9 --- /dev/null +++ b/cuda_bindings_12/docs/source/tips_and_tricks.rst @@ -0,0 +1,47 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Tips and Tricks +--------------- + +Getting the address of underlying C objects from the low-level bindings +======================================================================= + +All CUDA C types are exposed to Python as Python classes. For example, the :class:`~cuda.bindings.driver.CUstream` type is exposed as a class with methods :meth:`~cuda.bindings.driver.CUstream.getPtr()` and :meth:`~cuda.bindings.driver.CUstream.__int__()` implemented. + +There is an important distinction between the ``getPtr()`` method and the behaviour of ``__int__()``. Since a ``CUstream`` is itself just a pointer, calling ``instance_of_CUstream.getPtr()`` returns the pointer *to* the pointer, instead of the value of the ``CUstream`` C object that is the pointer to the underlying stream handle. ``int(instance_of_CUstream)`` returns the value of the ``CUstream`` converted to a Python int and is the actual address of the underlying handle. + +.. warning:: + + Using ``int(cuda_obj)`` to retrieve the underlying address of a CUDA object is deprecated and + subject to future removal. Please switch to use :func:`~cuda.bindings.utils.get_cuda_native_handle` + instead. + + +Lifetime management of the CUDA objects +======================================= + +All of the Python classes do not manage the lifetime of the underlying CUDA C objects. It is the user's responsibility to use the appropriate APIs to explicitly destruct the objects following the CUDA Programming Guide. + + +Getting and setting attributes of extension types +================================================= + +While the bindings outwardly present the attributes of extension types in a pythonic way, they can't always be interacted with in a Pythonic style. Often the getters/setters (__getitem__(), __setitem__()) are actually a translation step to convert values between Python and C. For example, in some cases, attempting to modify an attribute in place, will lead to unexpected behavior due to the design of the underlying implementation. For this reason, users should use the getters and setters directly when interacting with extension types. + +An example of this is the :class:`~cuda.bindings.driver.CULaunchConfig` type. + +.. code-block:: python + + cfg = cuda.CUlaunchConfig() + + cfg.numAttrs += 1 + attr = cuda.CUlaunchAttribute() + + ... + + # This works. We are passing the new attribute to the setter + drv_cfg.attrs = [attr] + + # This does not work. We are only modifying the returned attribute in place + drv_cfg.attrs.append(attr) diff --git a/cuda_bindings_12/docs/versions.json b/cuda_bindings_12/docs/versions.json new file mode 100644 index 00000000000..76c66eca88a --- /dev/null +++ b/cuda_bindings_12/docs/versions.json @@ -0,0 +1,9 @@ +{ + "latest" : "latest", + "13.0.1" : "13.0.1", + "13.0.0" : "13.0.0", + "12.9.0" : "12.9.0", + "12.8.0" : "12.8.0", + "12.6.2" : "12.6.2", + "12.6.1" : "12.6.1" +} diff --git a/cuda_bindings_12/examples/0_Introduction/clock_nvrtc_test.py b/cuda_bindings_12/examples/0_Introduction/clock_nvrtc_test.py new file mode 100644 index 00000000000..ab9f4f2d996 --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/clock_nvrtc_test.py @@ -0,0 +1,117 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import platform + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice + +from cuda import cuda + +clock_nvrtc = """\ +extern "C" __global__ void timedReduction(const float *hinput, float *output, clock_t *timer) +{ + // __shared__ float shared[2 * blockDim.x]; + extern __shared__ float shared[]; + + const int tid = threadIdx.x; + const int bid = blockIdx.x; + + if (tid == 0) timer[bid] = clock(); + + // Copy hinput. + shared[tid] = hinput[tid]; + shared[tid + blockDim.x] = hinput[tid + blockDim.x]; + + // Perform reduction to find minimum. + for (int d = blockDim.x; d > 0; d /= 2) + { + __syncthreads(); + + if (tid < d) + { + float f0 = shared[tid]; + float f1 = shared[tid + d]; + + if (f1 < f0) + { + shared[tid] = f1; + } + } + } + + // Write result. + if (tid == 0) output[bid] = shared[0]; + + __syncthreads(); + + if (tid == 0) timer[bid+gridDim.x] = clock(); +} +""" + +NUM_BLOCKS = 64 +NUM_THREADS = 256 + + +def elems_to_bytes(nelems, dt): + return nelems * np.dtype(dt).itemsize + + +def main(): + print("CUDA Clock sample") + + if platform.machine() == "armv7l": + print("clock_nvrtc is not supported on ARMv7 - waiving sample") + return + + timer = np.empty(NUM_BLOCKS * 2, dtype="int64") + hinput = np.empty(NUM_THREADS * 2, dtype="float32") + + for i in range(0, NUM_THREADS * 2): + hinput[i] = i + + devID = findCudaDevice() + kernelHelper = common.KernelHelper(clock_nvrtc, devID) + kernel_addr = kernelHelper.getFunction(b"timedReduction") + + dinput = checkCudaErrors(cuda.cuMemAlloc(hinput.nbytes)) + doutput = checkCudaErrors(cuda.cuMemAlloc(elems_to_bytes(NUM_BLOCKS, np.float32))) + dtimer = checkCudaErrors(cuda.cuMemAlloc(timer.nbytes)) + checkCudaErrors(cuda.cuMemcpyHtoD(dinput, hinput, hinput.nbytes)) + + args = ((dinput, doutput, dtimer), (None, None, None)) + shared_memory_nbytes = elems_to_bytes(2 * NUM_THREADS, np.float32) + + grid_dims = (NUM_BLOCKS, 1, 1) + block_dims = (NUM_THREADS, 1, 1) + + checkCudaErrors( + cuda.cuLaunchKernel( + kernel_addr, + *grid_dims, # grid dim + *block_dims, # block dim + shared_memory_nbytes, + 0, # shared mem, stream + args, + 0, + ) + ) # arguments + + checkCudaErrors(cuda.cuCtxSynchronize()) + checkCudaErrors(cuda.cuMemcpyDtoH(timer, dtimer, timer.nbytes)) + checkCudaErrors(cuda.cuMemFree(dinput)) + checkCudaErrors(cuda.cuMemFree(doutput)) + checkCudaErrors(cuda.cuMemFree(dtimer)) + + avgElapsedClocks = 0.0 + + for i in range(0, NUM_BLOCKS): + avgElapsedClocks += timer[i + NUM_BLOCKS] - timer[i] + + avgElapsedClocks = avgElapsedClocks / NUM_BLOCKS + print(f"Average clocks/block = {avgElapsedClocks}") + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/simpleCubemapTexture_test.py b/cuda_bindings_12/examples/0_Introduction/simpleCubemapTexture_test.py new file mode 100644 index 00000000000..4ca0f29f5dd --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/simpleCubemapTexture_test.py @@ -0,0 +1,220 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import sys +import time + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice + +from cuda import cuda, cudart + +simpleCubemapTexture = """\ +extern "C" +__global__ void transformKernel(float *g_odata, int width, cudaTextureObject_t tex) +{ + // calculate this thread's data point + unsigned int x = blockIdx.x*blockDim.x + threadIdx.x; + unsigned int y = blockIdx.y*blockDim.y + threadIdx.y; + + // 0.5f offset and division are necessary to access the original data points + // in the texture (such that bilinear interpolation will not be activated). + // For details, see also CUDA Programming Guide, Appendix D + + float u = ((x+0.5f) / (float) width) * 2.f - 1.f; + float v = ((y+0.5f) / (float) width) * 2.f - 1.f; + + float cx, cy, cz; + + for (unsigned int face = 0; face < 6; face ++) + { + //Layer 0 is positive X face + if (face == 0) + { + cx = 1; + cy = -v; + cz = -u; + } + //Layer 1 is negative X face + else if (face == 1) + { + cx = -1; + cy = -v; + cz = u; + } + //Layer 2 is positive Y face + else if (face == 2) + { + cx = u; + cy = 1; + cz = v; + } + //Layer 3 is negative Y face + else if (face == 3) + { + cx = u; + cy = -1; + cz = -v; + } + //Layer 4 is positive Z face + else if (face == 4) + { + cx = u; + cy = -v; + cz = 1; + } + //Layer 4 is negative Z face + else if (face == 5) + { + cx = -u; + cy = -v; + cz = -1; + } + + // read from texture, do expected transformation and write to global memory + g_odata[face*width*width + y*width + x] = -texCubemap(tex, cx, cy, cz); + } +} +""" + + +def main(): + # Use command-line specified CUDA device, otherwise use device with highest Gflops/s + devID = findCudaDevice() + + # Get number of SMs on this GPU + deviceProps = checkCudaErrors(cudart.cudaGetDeviceProperties(devID)) + print( + f"CUDA device [{deviceProps.name}] has {deviceProps.multiProcessorCount} Multi-Processors SM {deviceProps.major}.{deviceProps.minor}" + ) + if deviceProps.major < 2: + print("Test requires SM 2.0 or higher for support of Texture Arrays. Test will exit...") + sys.exit() + + # Generate input data for layered texture + width = 64 + num_faces = 6 + num_layers = 1 + cubemap_size = width * width * num_faces + h_data = np.arange(cubemap_size * num_layers, dtype="float32") + size = h_data.nbytes + + # This is the expected transformation of the input data (the expected output) + h_data_ref = np.repeat(np.arange(num_layers, dtype=h_data.dtype), cubemap_size) - h_data + + # Allocate device memory for result + d_data = checkCudaErrors(cudart.cudaMalloc(size)) + + # Allocate array and copy image data + channelDesc = checkCudaErrors( + cudart.cudaCreateChannelDesc(32, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat) + ) + cu_3darray = checkCudaErrors( + cudart.cudaMalloc3DArray( + channelDesc, + cudart.make_cudaExtent(width, width, num_faces), + cudart.cudaArrayCubemap, + ) + ) + width_nbytes = h_data[:width].nbytes + myparms = cudart.cudaMemcpy3DParms() + myparms.srcPos = cudart.make_cudaPos(0, 0, 0) + myparms.dstPos = cudart.make_cudaPos(0, 0, 0) + myparms.srcPtr = cudart.make_cudaPitchedPtr(h_data, width_nbytes, width, width) + myparms.dstArray = cu_3darray + myparms.extent = cudart.make_cudaExtent(width, width, num_faces) + myparms.kind = cudart.cudaMemcpyKind.cudaMemcpyHostToDevice + checkCudaErrors(cudart.cudaMemcpy3D(myparms)) + + texRes = cudart.cudaResourceDesc() + texRes.resType = cudart.cudaResourceType.cudaResourceTypeArray + texRes.res.array.array = cu_3darray + + texDescr = cudart.cudaTextureDesc() + texDescr.normalizedCoords = True + texDescr.filterMode = cudart.cudaTextureFilterMode.cudaFilterModeLinear + texDescr.addressMode[0] = cudart.cudaTextureAddressMode.cudaAddressModeWrap + texDescr.addressMode[1] = cudart.cudaTextureAddressMode.cudaAddressModeWrap + texDescr.addressMode[2] = cudart.cudaTextureAddressMode.cudaAddressModeWrap + texDescr.readMode = cudart.cudaTextureReadMode.cudaReadModeElementType + + tex = checkCudaErrors(cudart.cudaCreateTextureObject(texRes, texDescr, None)) + dimBlock = cudart.dim3() + dimBlock.x = 8 + dimBlock.y = 8 + dimBlock.z = 1 + dimGrid = cudart.dim3() + dimGrid.x = width / dimBlock.x + dimGrid.y = width / dimBlock.y + dimGrid.z = 1 + + print( + f"Covering Cubemap data array of {width}~3 x {num_layers}: Grid size is {dimGrid.x} x {dimGrid.y}, each block has 8 x 8 threads" + ) + + kernelHelper = common.KernelHelper(simpleCubemapTexture, devID) + _transformKernel = kernelHelper.getFunction(b"transformKernel") + kernelArgs = ((d_data, width, tex), (ctypes.c_void_p, ctypes.c_int, None)) + checkCudaErrors( + cuda.cuLaunchKernel( + _transformKernel, + dimGrid.x, + dimGrid.y, + dimGrid.z, # grid dim + dimBlock.x, + dimBlock.y, + dimBlock.z, # block dim + 0, + 0, # shared mem and stream + kernelArgs, + 0, + ) + ) # arguments + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + start = time.time() + + # Execute the kernel + checkCudaErrors( + cuda.cuLaunchKernel( + _transformKernel, + dimGrid.x, + dimGrid.y, + dimGrid.z, # grid dim + dimBlock.x, + dimBlock.y, + dimBlock.z, # block dim + 0, + 0, # shared mem and stream + kernelArgs, + 0, + ) + ) # arguments + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + stop = time.time() + print(f"Processing time: {stop - start:.3f} msec") + print(f"{cubemap_size / ((stop - start + 1) / 1000.0) / 1e6:.2f} Mtexlookups/sec") + + # Allocate mem for the result on host side + h_odata = np.empty_like(h_data) + # Copy result from device to host + checkCudaErrors(cudart.cudaMemcpy(h_odata, d_data, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost)) + + checkCudaErrors(cudart.cudaDestroyTextureObject(tex)) + checkCudaErrors(cudart.cudaFree(d_data)) + checkCudaErrors(cudart.cudaFreeArray(cu_3darray)) + + print("Comparing kernel output to expected data") + MIN_EPSILON_ERROR = 5.0e-3 + if np.max(np.abs(h_odata - h_data_ref)) > MIN_EPSILON_ERROR: + print("Failed") + sys.exit(-1) + print("Passed") + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/simpleP2P_test.py b/cuda_bindings_12/examples/0_Introduction/simpleP2P_test.py new file mode 100644 index 00000000000..9f6d053eba9 --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/simpleP2P_test.py @@ -0,0 +1,248 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import platform +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors + +from cuda import cuda, cudart + +simplep2p = """\ +extern "C" +__global__ void SimpleKernel(float *src, float *dst) +{ + // Just a dummy kernel, doing enough for us to verify that everything + // worked + const int idx = blockIdx.x * blockDim.x + threadIdx.x; + dst[idx] = src[idx] * 2.0f; +} +""" + + +def main(): + print("Starting...") + + if platform.system() == "Darwin": + print("simpleP2P is not supported on Mac OSX - waiving sample") + return + + if platform.machine() == "armv7l": + print("simpleP2P is not supported on ARMv7 - waiving sample") + return + + if platform.machine() == "aarch64": + print("simpleP2P is not supported on aarch64 - waiving sample") + return + + if platform.machine() == "sbsa": + print("simpleP2P is not supported on sbsa - waiving sample") + return + + # Number of GPUs + print("Checking for multiple GPUs...") + gpu_n = checkCudaErrors(cudart.cudaGetDeviceCount()) + 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 + + prop = [checkCudaErrors(cudart.cudaGetDeviceProperties(i)) for i in range(gpu_n)] + # Check possibility for peer access + print("\nChecking GPU(s) for support of peer to peer memory access...") + + p2pCapableGPUs = [-1, -1] + for i in range(gpu_n): + p2pCapableGPUs[0] = i + for j in range(gpu_n): + if i == j: + continue + i_access_j = checkCudaErrors(cudart.cudaDeviceCanAccessPeer(i, j)) + j_access_i = checkCudaErrors(cudart.cudaDeviceCanAccessPeer(j, i)) + print( + "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( + prop[i].name, i, prop[j].name, j, "Yes" if i_access_j else "No" + ) + ) + print( + "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( + prop[j].name, j, prop[i].name, i, "Yes" if i_access_j else "No" + ) + ) + if i_access_j and j_access_i: + p2pCapableGPUs[1] = j + break + if p2pCapableGPUs[1] != -1: + break + + if p2pCapableGPUs[0] == -1 or p2pCapableGPUs[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 + + # Use first pair of p2p capable GPUs detected + gpuid = [p2pCapableGPUs[0], p2pCapableGPUs[1]] + + # Enable peer access + print(f"Enabling peer access between GPU{gpuid[0]} and GPU{gpuid[1]}...") + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + checkCudaErrors(cudart.cudaDeviceEnablePeerAccess(gpuid[1], 0)) + checkCudaErrors(cudart.cudaSetDevice(gpuid[1])) + checkCudaErrors(cudart.cudaDeviceEnablePeerAccess(gpuid[0], 0)) + + # Allocate buffers + buf_size = 1024 * 1024 * 16 * np.dtype(np.float32).itemsize + print(f"Allocating buffers ({int(buf_size / 1024 / 1024)}MB on GPU{gpuid[0]}, GPU{gpuid[1]} and CPU Host)...") + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + g0 = checkCudaErrors(cudart.cudaMalloc(buf_size)) + checkCudaErrors(cudart.cudaSetDevice(gpuid[1])) + g1 = checkCudaErrors(cudart.cudaMalloc(buf_size)) + h0 = checkCudaErrors(cudart.cudaMallocHost(buf_size)) # Automatically portable with UVA + + # Create CUDA event handles + print("Creating event handles...") + eventflags = cudart.cudaEventBlockingSync + start_event = checkCudaErrors(cudart.cudaEventCreateWithFlags(eventflags)) + stop_event = checkCudaErrors(cudart.cudaEventCreateWithFlags(eventflags)) + + # P2P memcopy() benchmark + checkCudaErrors(cudart.cudaEventRecord(start_event, cudart.cudaStream_t(0))) + + for i in range(100): + # With UVA we don't need to specify source and target devices, the + # runtime figures this out by itself from the pointers + # Ping-pong copy between GPUs + if i % 2 == 0: + checkCudaErrors(cudart.cudaMemcpy(g1, g0, buf_size, cudart.cudaMemcpyKind.cudaMemcpyDefault)) + else: + checkCudaErrors(cudart.cudaMemcpy(g0, g1, buf_size, cudart.cudaMemcpyKind.cudaMemcpyDefault)) + + checkCudaErrors(cudart.cudaEventRecord(stop_event, cudart.cudaStream_t(0))) + checkCudaErrors(cudart.cudaEventSynchronize(stop_event)) + time_memcpy = checkCudaErrors(cudart.cudaEventElapsedTime(start_event, stop_event)) + print( + f"cudaMemcpyPeer / cudaMemcpy between GPU{gpuid[0]} and GPU{gpuid[1]}: {(1.0 / (time_memcpy / 1000.0)) * (100.0 * buf_size) / 1024.0 / 1024.0 / 1024.0:.2f}GB/s" + ) + + # Prepare host buffer and copy to GPU 0 + print(f"Preparing host buffer and memcpy to GPU{gpuid[0]}...") + + h0_local = (ctypes.c_float * int(buf_size / np.dtype(np.float32).itemsize)).from_address(h0) + for i in range(int(buf_size / np.dtype(np.float32).itemsize)): + h0_local[i] = i % 4096 + + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + checkCudaErrors(cudart.cudaMemcpy(g0, h0, buf_size, cudart.cudaMemcpyKind.cudaMemcpyDefault)) + + # Kernel launch configuration + threads = cudart.dim3() + threads.x = 512 + threads.y = 1 + threads.z = 1 + blocks = cudart.dim3() + blocks.x = (buf_size / np.dtype(np.float32).itemsize) / threads.x + blocks.y = 1 + blocks.z = 1 + + # Run kernel on GPU 1, reading input from the GPU 0 buffer, writing + # output to the GPU 1 buffer + print(f"Run kernel on GPU{gpuid[1]}, taking source data from GPU{gpuid[0]} and writing to GPU{gpuid[1]}...") + checkCudaErrors(cudart.cudaSetDevice(gpuid[1])) + + kernelHelper = [None] * 2 + _simpleKernel = [None] * 2 + kernelArgs = [None] * 2 + + kernelHelper[1] = common.KernelHelper(simplep2p, gpuid[1]) + _simpleKernel[1] = kernelHelper[1].getFunction(b"SimpleKernel") + kernelArgs[1] = ((g0, g1), (ctypes.c_void_p, ctypes.c_void_p)) + checkCudaErrors( + cuda.cuLaunchKernel( + _simpleKernel[1], + blocks.x, + blocks.y, + blocks.z, + threads.x, + threads.y, + threads.z, + 0, + 0, + kernelArgs[1], + 0, + ) + ) + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + # Run kernel on GPU 0, reading input from the GPU 1 buffer, writing + # 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]}...") + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + kernelHelper[0] = common.KernelHelper(simplep2p, gpuid[0]) + _simpleKernel[0] = kernelHelper[0].getFunction(b"SimpleKernel") + kernelArgs[0] = ((g1, g0), (ctypes.c_void_p, ctypes.c_void_p)) + checkCudaErrors( + cuda.cuLaunchKernel( + _simpleKernel[0], + blocks.x, + blocks.y, + blocks.z, + threads.x, + threads.y, + threads.z, + 0, + 0, + kernelArgs[0], + 0, + ) + ) + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + # Copy data back to host and verify + print(f"Copy data back to host from GPU{gpuid[0]} and verify results...") + checkCudaErrors(cudart.cudaMemcpy(h0, g0, buf_size, cudart.cudaMemcpyKind.cudaMemcpyDefault)) + + error_count = 0 + + for i in range(int(buf_size / np.dtype(np.float32).itemsize)): + # Re-generate input data and apply 2x '* 2.0f' computation of both + # kernel runs + if h0_local[i] != float(i % 4096) * 2.0 * 2.0: + print(f"Verification error @ element {i}: val = {h0_local[i]}, ref = {float(i % 4096) * 2.0 * 2.0}\n") + error_count += 1 + if error_count > 10: + break + + # Disable peer access (also unregisters memory for non-UVA cases) + print("Disabling peer access...") + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + checkCudaErrors(cudart.cudaDeviceDisablePeerAccess(gpuid[1])) + checkCudaErrors(cudart.cudaSetDevice(gpuid[1])) + checkCudaErrors(cudart.cudaDeviceDisablePeerAccess(gpuid[0])) + + # Cleanup and shutdown + print("Shutting down...") + checkCudaErrors(cudart.cudaEventDestroy(start_event)) + checkCudaErrors(cudart.cudaEventDestroy(stop_event)) + checkCudaErrors(cudart.cudaSetDevice(gpuid[0])) + checkCudaErrors(cudart.cudaFree(g0)) + checkCudaErrors(cudart.cudaSetDevice(gpuid[1])) + checkCudaErrors(cudart.cudaFree(g1)) + checkCudaErrors(cudart.cudaFreeHost(h0)) + + for i in range(gpu_n): + checkCudaErrors(cudart.cudaSetDevice(i)) + + if error_count != 0: + print("Test failed!") + sys.exit(-1) + print("Test passed!") + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/simpleZeroCopy_test.py b/cuda_bindings_12/examples/0_Introduction/simpleZeroCopy_test.py new file mode 100644 index 00000000000..356a5ac56b1 --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/simpleZeroCopy_test.py @@ -0,0 +1,186 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import platform +import random as rnd +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors +from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt + +from cuda import cuda, cudart + +simpleZeroCopy = """\ +extern "C" +__global__ void vectorAddGPU(float *a, float *b, float *c, int N) +{ + int idx = blockIdx.x*blockDim.x + threadIdx.x; + + if (idx < N) + { + c[idx] = a[idx] + b[idx]; + } +} +""" + + +def main(): + idev = 0 + bPinGenericMemory = False + + if platform.system() == "Darwin": + print("simpleZeroCopy is not supported on Mac OSX - waiving sample") + return + + if platform.machine() == "armv7l": + print("simpleZeroCopy is not supported on ARMv7 - waiving sample") + return + + if platform.machine() == "aarch64": + print("simpleZeroCopy is not supported on aarch64 - waiving sample") + return + + if platform.machine() == "sbsa": + print("simpleZeroCopy is not supported on sbsa - waiving sample") + return + + if checkCmdLineFlag("help"): + print("Usage: simpleZeroCopy [OPTION]\n") + print("Options:") + print(" device=[device #] Specify the device to be used") + print(" use_generic_memory (optional) use generic page-aligned for system memory") + return + + # Get the device selected by the user or default to 0, and then set it. + if checkCmdLineFlag("device="): + deviceCount = cudart.cudaGetDeviceCount() + idev = int(getCmdLineArgumentInt("device=")) + + if idev >= deviceCount or idev < 0: + print(f"Device number {idev} is invalid, will use default CUDA device 0.") + idev = 0 + + if checkCmdLineFlag("use_generic_memory"): + bPinGenericMemory = True + + if bPinGenericMemory: + print("> Using Generic System Paged Memory (malloc)") + else: + print("> Using CUDA Host Allocated (cudaHostAlloc)") + + checkCudaErrors(cudart.cudaSetDevice(idev)) + + # Verify the selected device supports mapped memory and set the device flags for mapping host memory. + deviceProp = checkCudaErrors(cudart.cudaGetDeviceProperties(idev)) + + if not deviceProp.canMapHostMemory: + print(f"Device {idev} does not support mapping CPU host memory!") + return + + checkCudaErrors(cudart.cudaSetDeviceFlags(cudart.cudaDeviceMapHost)) + + # Allocate mapped CPU memory + + nelem = 1048576 + num_bytes = nelem * np.dtype(np.float32).itemsize + + if bPinGenericMemory: + a = np.empty(nelem, dtype=np.float32) + b = np.empty(nelem, dtype=np.float32) + c = np.empty(nelem, dtype=np.float32) + + checkCudaErrors(cudart.cudaHostRegister(a, num_bytes, cudart.cudaHostRegisterMapped)) + checkCudaErrors(cudart.cudaHostRegister(b, num_bytes, cudart.cudaHostRegisterMapped)) + checkCudaErrors(cudart.cudaHostRegister(c, num_bytes, cudart.cudaHostRegisterMapped)) + else: + flags = cudart.cudaHostAllocMapped + a_ptr = checkCudaErrors(cudart.cudaHostAlloc(num_bytes, flags)) + b_ptr = checkCudaErrors(cudart.cudaHostAlloc(num_bytes, flags)) + c_ptr = checkCudaErrors(cudart.cudaHostAlloc(num_bytes, flags)) + + a = (ctypes.c_float * nelem).from_address(a_ptr) + b = (ctypes.c_float * nelem).from_address(b_ptr) + c = (ctypes.c_float * nelem).from_address(c_ptr) + + # Initialize the vectors + for n in range(nelem): + a[n] = rnd.random() + b[n] = rnd.random() + + # Get the device pointers for the pinned CPU memory mapped into the GPU memory space + d_a = checkCudaErrors(cudart.cudaHostGetDevicePointer(a, 0)) + d_b = checkCudaErrors(cudart.cudaHostGetDevicePointer(b, 0)) + d_c = checkCudaErrors(cudart.cudaHostGetDevicePointer(c, 0)) + + # Call the GPU kernel using the CPU pointers residing in CPU mapped memory + print("> vectorAddGPU kernel will add vectors using mapped CPU memory...") + block = cudart.dim3() + block.x = 256 + block.y = 1 + block.z = 1 + grid = cudart.dim3() + grid.x = math.ceil(nelem / float(block.x)) + grid.y = 1 + grid.z = 1 + kernelHelper = common.KernelHelper(simpleZeroCopy, idev) + _vectorAddGPU = kernelHelper.getFunction(b"vectorAddGPU") + kernelArgs = ( + (d_a, d_b, d_c, nelem), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int), + ) + checkCudaErrors( + cuda.cuLaunchKernel( + _vectorAddGPU, + grid.x, + grid.y, + grid.z, + block.x, + block.y, + block.z, + 0, + cuda.CU_STREAM_LEGACY, + kernelArgs, + 0, + ) + ) + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + print("> Checking the results from vectorAddGPU() ...") + # Compare the results + errorNorm = 0.0 + refNorm = 0.0 + + for n in range(nelem): + ref = a[n] + b[n] + diff = c[n] - ref + errorNorm += diff * diff + refNorm += ref * ref + + errorNorm = math.sqrt(errorNorm) + refNorm = math.sqrt(refNorm) + + # Memory clean up + + print("Releasing CPU memory...") + + if bPinGenericMemory: + checkCudaErrors(cudart.cudaHostUnregister(a)) + checkCudaErrors(cudart.cudaHostUnregister(b)) + checkCudaErrors(cudart.cudaHostUnregister(c)) + else: + checkCudaErrors(cudart.cudaFreeHost(a)) + checkCudaErrors(cudart.cudaFreeHost(b)) + checkCudaErrors(cudart.cudaFreeHost(c)) + + if errorNorm / refNorm >= 1.0e-7: + print("FAILED") + sys.exit(-1) + print("PASSED") + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/systemWideAtomics_test.py b/cuda_bindings_12/examples/0_Introduction/systemWideAtomics_test.py new file mode 100644 index 00000000000..170170d5dbe --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/systemWideAtomics_test.py @@ -0,0 +1,248 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import os +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice + +from cuda import cuda, cudart + +systemWideAtomics = """\ +#define LOOP_NUM 50 + +extern "C" +__global__ void atomicKernel(int *atom_arr) { + unsigned int tid = blockDim.x * blockIdx.x + threadIdx.x; + + for (int i = 0; i < LOOP_NUM; i++) { + // Atomic addition + atomicAdd_system(&atom_arr[0], 10); + + // Atomic exchange + atomicExch_system(&atom_arr[1], tid); + + // Atomic maximum + atomicMax_system(&atom_arr[2], tid); + + // Atomic minimum + atomicMin_system(&atom_arr[3], tid); + + // Atomic increment (modulo 17+1) + atomicInc_system((unsigned int *)&atom_arr[4], 17); + + // Atomic decrement + atomicDec_system((unsigned int *)&atom_arr[5], 137); + + // Atomic compare-and-swap + atomicCAS_system(&atom_arr[6], tid - 1, tid); + + // Bitwise atomic instructions + + // Atomic AND + atomicAnd_system(&atom_arr[7], 2 * tid + 7); + + // Atomic OR + atomicOr_system(&atom_arr[8], 1 << tid); + + // Atomic XOR + atomicXor_system(&atom_arr[9], tid); + } +} +""" + +LOOP_NUM = 50 + + +#! Compute reference data set +#! Each element is multiplied with the number of threads / array length +#! @param reference reference data, computed but preallocated +#! @param idata input data as provided to device +#! @param len number of elements in reference / idata +def verify(testData, length): + val = 0 + + for i in range(length * LOOP_NUM): + val += 10 + + if val != testData[0]: + print(f"atomicAdd failed val = {val} testData = {testData[0]}") + return False + + val = 0 + found = False + for i in range(length): + # second element should be a member of [0, len) + if i == testData[1]: + found = True + break + + if not found: + print("atomicExch failed") + return False + + val = -(1 << 8) + + for i in range(length): + # third element should be len-1 + val = max(val, i) + + if val != testData[2]: + print("atomicMax failed") + return False + + val = 1 << 8 + + for i in range(length): + val = min(val, i) + + if val != testData[3]: + print("atomicMin failed") + return False + + limit = 17 + val = 0 + + for i in range(length * LOOP_NUM): + val = 0 if val >= limit else val + 1 + + if val != testData[4]: + print("atomicInc failed") + return False + + limit = 137 + val = 0 + + for i in range(length * LOOP_NUM): + val = limit if (val == 0) or (val > limit) else val - 1 + + if val != testData[5]: + print("atomicDec failed") + return False + + found = False + + for i in range(length): + # seventh element should be a member of [0, len) + if i == testData[6]: + found = True + break + + if not found: + print("atomicCAS failed") + return False + + val = 0xFF + + for i in range(length): + # 8th element should be 1 + val &= 2 * i + 7 + + if val != testData[7]: + print("atomicAnd failed") + return False + + # 9th element should be 0xff + val = -1 + if val != testData[8]: + print("atomicOr failed") + return False + + val = 0xFF + + for i in range(length): + # 11th element should be 0xff + val ^= i + + if val != testData[9]: + print("atomicXor failed") + return False + + return True + + +def main(): + if os.name == "nt": + print("Atomics not supported on Windows") + return + + # set device + dev_id = findCudaDevice() + device_prop = checkCudaErrors(cudart.cudaGetDeviceProperties(dev_id)) + + if not device_prop.managedMemory: + # This samples requires being run on a device that supports Unified Memory + print("Unified Memory not supported on this device") + return + + if device_prop.computeMode == cudart.cudaComputeMode.cudaComputeModeProhibited: + # This sample requires being run with a default or process exclusive mode + print("This sample requires a device in either default or process exclusive mode") + return + + if device_prop.major < 6: + print("Requires a minimum CUDA compute 6.0 capability, waiving testing.") + return + + numThreads = 256 + numBlocks = 64 + numData = 10 + + if device_prop.pageableMemoryAccess: + print("CAN access pageable memory") + atom_arr_h = (ctypes.c_int * numData)(0) + atom_arr = ctypes.addressof(atom_arr_h) + else: + print("CANNOT access pageable memory") + atom_arr = checkCudaErrors( + cudart.cudaMallocManaged(np.dtype(np.int32).itemsize * numData, cudart.cudaMemAttachGlobal) + ) + atom_arr_h = (ctypes.c_int * numData).from_address(atom_arr) + + for i in range(numData): + atom_arr_h[i] = 0 + + # To make the AND and XOR tests generate something other than 0... + atom_arr_h[7] = atom_arr_h[9] = 0xFF + + kernelHelper = common.KernelHelper(systemWideAtomics, dev_id) + _atomicKernel = kernelHelper.getFunction(b"atomicKernel") + kernelArgs = ((atom_arr,), (ctypes.c_void_p,)) + checkCudaErrors( + cuda.cuLaunchKernel( + _atomicKernel, + numBlocks, + 1, + 1, # grid dim + numThreads, + 1, + 1, # block dim + 0, + cuda.CU_STREAM_LEGACY, # shared mem and stream + kernelArgs, + 0, + ) + ) # arguments + # NOTE: Python doesn't have an equivalent system atomic operations + # atomicKernel_CPU(atom_arr_h, numBlocks * numThreads) + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + # Compute & verify reference solution + testResult = verify(atom_arr_h, numThreads * numBlocks) + + if device_prop.pageableMemoryAccess: + pass + else: + checkCudaErrors(cudart.cudaFree(atom_arr)) + + print("systemWideAtomics completed, returned {}".format("OK" if testResult else "ERROR!")) + if not testResult: + sys.exit(-1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/vectorAddDrv_test.py b/cuda_bindings_12/examples/0_Introduction/vectorAddDrv_test.py new file mode 100644 index 00000000000..0d0f9634e60 --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/vectorAddDrv_test.py @@ -0,0 +1,116 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV + +from cuda import cuda + +vectorAddDrv = """\ +/* Vector addition: C = A + B. + * + * This sample is a very basic sample that implements element by element + * vector addition. It is the same as the sample illustrating Chapter 3 + * of the programming guide with some additions like error checking. + * + */ + +// Device code +extern "C" __global__ void VecAdd_kernel(const float *A, const float *B, float *C, int N) +{ + int i = blockDim.x * blockIdx.x + threadIdx.x; + + if (i < N) + C[i] = A[i] + B[i]; +} +""" + + +def main(): + print("Vector Addition (Driver API)") + N = 50000 + nbytes = N * np.dtype(np.float32).itemsize + + # Initialize + checkCudaErrors(cuda.cuInit(0)) + cuDevice = findCudaDeviceDRV() + # Create context + cuContext = checkCudaErrors(cuda.cuCtxCreate(0, cuDevice)) + + uvaSupported = checkCudaErrors( + cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice) + ) + if not uvaSupported: + print("Accessing pageable memory directly requires UVA") + return + + kernelHelper = common.KernelHelper(vectorAddDrv, int(cuDevice)) + _VecAdd_kernel = kernelHelper.getFunction(b"VecAdd_kernel") + + # Allocate input vectors h_A and h_B in host memory + h_A = np.random.rand(N).astype(dtype=np.float32) + h_B = np.random.rand(N).astype(dtype=np.float32) + h_C = np.random.rand(N).astype(dtype=np.float32) + + # Allocate vectors in device memory + d_A = checkCudaErrors(cuda.cuMemAlloc(nbytes)) + d_B = checkCudaErrors(cuda.cuMemAlloc(nbytes)) + d_C = checkCudaErrors(cuda.cuMemAlloc(nbytes)) + + # Copy vectors from host memory to device memory + checkCudaErrors(cuda.cuMemcpyHtoD(d_A, h_A, nbytes)) + checkCudaErrors(cuda.cuMemcpyHtoD(d_B, h_B, nbytes)) + + if True: + # Grid/Block configuration + threadsPerBlock = 256 + blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock + + kernelArgs = ((d_A, d_B, d_C, N), (None, None, None, ctypes.c_int)) + + # Launch the CUDA kernel + checkCudaErrors( + cuda.cuLaunchKernel( + _VecAdd_kernel, + blocksPerGrid, + 1, + 1, + threadsPerBlock, + 1, + 1, + 0, + 0, + kernelArgs, + 0, + ) + ) + else: + pass + + # Copy result from device memory to host memory + # h_C contains the result in host memory + checkCudaErrors(cuda.cuMemcpyDtoH(h_C, d_C, nbytes)) + + for i in range(N): + sum_all = h_A[i] + h_B[i] + if math.fabs(h_C[i] - sum_all) > 1e-7: + break + + # Free device memory + checkCudaErrors(cuda.cuMemFree(d_A)) + checkCudaErrors(cuda.cuMemFree(d_B)) + checkCudaErrors(cuda.cuMemFree(d_C)) + + checkCudaErrors(cuda.cuCtxDestroy(cuContext)) + print("{}".format("Result = PASS" if i + 1 == N else "Result = FAIL")) + if i + 1 != N: + sys.exit(-1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/0_Introduction/vectorAddMMAP_test.py b/cuda_bindings_12/examples/0_Introduction/vectorAddMMAP_test.py new file mode 100644 index 00000000000..24bd26ab860 --- /dev/null +++ b/cuda_bindings_12/examples/0_Introduction/vectorAddMMAP_test.py @@ -0,0 +1,308 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import platform +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDeviceDRV + +from cuda import cuda + +vectorAddMMAP = """\ +/* Vector addition: C = A + B. + * + * This sample is a very basic sample that implements element by element + * vector addition. It is the same as the sample illustrating Chapter 3 + * of the programming guide with some additions like error checking. + * + */ + +// Device code +extern "C" __global__ void VecAdd_kernel(const float *A, const float *B, float *C, int N) +{ + int i = blockDim.x * blockIdx.x + threadIdx.x; + + if (i < N) + C[i] = A[i] + B[i]; +} +""" + + +def round_up(x, y): + return int((x - 1) / y + 1) * y + + +def getBackingDevices(cuDevice): + num_devices = checkCudaErrors(cuda.cuDeviceGetCount()) + + backingDevices = [cuDevice] + for dev in range(num_devices): + # The mapping device is already in the backingDevices vector + if int(dev) == int(cuDevice): + continue + + # Only peer capable devices can map each others memory + capable = checkCudaErrors(cuda.cuDeviceCanAccessPeer(cuDevice, dev)) + if not capable: + continue + + # The device needs to support virtual address management for the required apis to work + attributeVal = checkCudaErrors( + cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED, + cuDevice, + ) + ) + if attributeVal == 0: + continue + + backingDevices.append(cuda.CUdevice(dev)) + return backingDevices + + +def simpleMallocMultiDeviceMmap(size, residentDevices, mappingDevices, align=0): + min_granularity = 0 + + # Setup the properties common for all the chunks + # The allocations will be device pinned memory. + # This property structure describes the physical location where the memory will be allocated via cuMemCreate allong with additional properties + # In this case, the allocation will be pinnded device memory local to a given device. + prop = cuda.CUmemAllocationProp() + prop.type = cuda.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + prop.location.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + + # Get the minimum granularity needed for the resident devices + # (the max of the minimum granularity of each participating device) + for device in residentDevices: + prop.location.id = device + status, granularity = cuda.cuMemGetAllocationGranularity( + prop, cuda.CUmemAllocationGranularity_flags.CU_MEM_ALLOC_GRANULARITY_MINIMUM + ) + if status != cuda.CUresult.CUDA_SUCCESS: + return status, None, None + if min_granularity < granularity: + min_granularity = granularity + + # Get the minimum granularity needed for the accessing devices + # (the max of the minimum granularity of each participating device) + for device in mappingDevices: + prop.location.id = device + status, granularity = cuda.cuMemGetAllocationGranularity( + prop, cuda.CUmemAllocationGranularity_flags.CU_MEM_ALLOC_GRANULARITY_MINIMUM + ) + if status != cuda.CUresult.CUDA_SUCCESS: + return status, None, None + if min_granularity < granularity: + min_granularity = granularity + + # Round up the size such that we can evenly split it into a stripe size tha meets the granularity requirements + # Essentially size = N * residentDevices.size() * min_granularity is the requirement, + # since each piece of the allocation will be stripeSize = N * min_granularity + # and the min_granularity requirement applies to each stripeSize piece of the allocation. + size = round_up(size, len(residentDevices) * min_granularity) + stripeSize = size / len(residentDevices) + + # Return the rounded up size to the caller for use in the free + allocationSize = size + + # Reserve the required contiguous VA space for the allocations + status, dptr = cuda.cuMemAddressReserve(size, align, cuda.CUdeviceptr(0), 0) + if status != cuda.CUresult.CUDA_SUCCESS: + simpleFreeMultiDeviceMmap(dptr, size) + return status, None, None + + # Create and map the backings on each gpu + # note: reusing CUmemAllocationProp prop from earlier with prop.type & prop.location.type already specified. + for idx in range(len(residentDevices)): + # Set the location for this chunk to this device + prop.location.id = residentDevices[idx] + + # Create the allocation as a pinned allocation on this device + status, allocationHandle = cuda.cuMemCreate(stripeSize, prop, 0) + if status != cuda.CUresult.CUDA_SUCCESS: + simpleFreeMultiDeviceMmap(dptr, size) + return status, None, None + + # Assign the chunk to the appropriate VA range and release the handle. + # After mapping the memory, it can be referenced by virtual address. + # Since we do not need to make any other mappings of this memory or export it, + # we no longer need and can release the allocationHandle. + # The allocation will be kept live until it is unmapped. + (status,) = cuda.cuMemMap(int(dptr) + (stripeSize * idx), stripeSize, 0, allocationHandle, 0) + + # the handle needs to be released even if the mapping failed. + (status2,) = cuda.cuMemRelease(allocationHandle) + if status != cuda.CUresult.CUDA_SUCCESS: + # cuMemRelease should not have failed here + # as the handle was just allocated successfully + # however return an error if it does. + status = status2 + + # Cleanup in case of any mapping failures. + if status != cuda.CUresult.CUDA_SUCCESS: + simpleFreeMultiDeviceMmap(dptr, size) + return status, None, None + + # Each accessDescriptor will describe the mapping requirement for a single device + accessDescriptors = [cuda.CUmemAccessDesc()] * len(mappingDevices) + + # Prepare the access descriptor array indicating where and how the backings should be visible. + for idx in range(len(mappingDevices)): + # Specify which device we are adding mappings for. + accessDescriptors[idx].location.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + accessDescriptors[idx].location.id = mappingDevices[idx] + + # Specify both read and write access. + accessDescriptors[idx].flags = cuda.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + + # Apply the access descriptors to the whole VA range. + (status,) = cuda.cuMemSetAccess(dptr, size, accessDescriptors, len(accessDescriptors)) + if status != cuda.CUresult.CUDA_SUCCESS: + simpleFreeMultiDeviceMmap(dptr, size) + return status, None, None + + return (status, dptr, allocationSize) + + +def simpleFreeMultiDeviceMmap(dptr, size): + # Unmap the mapped virtual memory region + # Since the handles to the mapped backing stores have already been released + # by cuMemRelease, and these are the only/last mappings referencing them, + # The backing stores will be freed. + # Since the memory has been unmapped after this call, accessing the specified + # va range will result in a fault (unitll it is remapped). + status = cuda.cuMemUnmap(dptr, size) + if status[0] != cuda.CUresult.CUDA_SUCCESS: + return status + + # Free the virtual address region. This allows the virtual address region + # to be reused by future cuMemAddressReserve calls. This also allows the + # virtual address region to be used by other allocation made through + # opperating system calls like malloc & mmap. + status = cuda.cuMemAddressFree(dptr, size) + if status[0] != cuda.CUresult.CUDA_SUCCESS: + return status + return status + + +def main(): + print("Vector Addition (Driver API)") + + if platform.system() == "Darwin": + print("vectorAddMMAP is not supported on Mac OSX - waiving sample") + return + + if platform.machine() == "armv7l": + print("vectorAddMMAP is not supported on ARMv7 - waiving sample") + return + + if platform.machine() == "aarch64": + print("vectorAddMMAP is not supported on aarch64 - waiving sample") + return + + if platform.machine() == "sbsa": + print("vectorAddMMAP is not supported on sbsa - waiving sample") + return + + N = 50000 + size = N * np.dtype(np.float32).itemsize + + # Initialize + checkCudaErrors(cuda.cuInit(0)) + + cuDevice = findCudaDeviceDRV() + + # Check that the selected device supports virtual address management + attributeVal = checkCudaErrors( + cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED, + cuDevice, + ) + ) + print(f"Device {cuDevice} VIRTUAL ADDRESS MANAGEMENT SUPPORTED = {attributeVal}.") + if not attributeVal: + print(f"Device {cuDevice} doesn't support VIRTUAL ADDRESS MANAGEMENT.") + return + + # The vector addition happens on cuDevice, so the allocations need to be mapped there. + mappingDevices = [cuDevice] + + # Collect devices accessible by the mapping device (cuDevice) into the backingDevices vector. + backingDevices = getBackingDevices(cuDevice) + + # Create context + cuContext = checkCudaErrors(cuda.cuCtxCreate(0, cuDevice)) + + kernelHelper = common.KernelHelper(vectorAddMMAP, int(cuDevice)) + _VecAdd_kernel = kernelHelper.getFunction(b"VecAdd_kernel") + + # Allocate input vectors h_A and h_B in host memory + h_A = np.random.rand(size).astype(dtype=np.float32) + h_B = np.random.rand(size).astype(dtype=np.float32) + h_C = np.random.rand(size).astype(dtype=np.float32) + + # Allocate vectors in device memory + # note that a call to cuCtxEnablePeerAccess is not needed even though + # the backing devices and mapping device are not the same. + # This is because the cuMemSetAccess call explicitly specifies + # the cross device mapping. + # cuMemSetAccess is still subject to the constraints of cuDeviceCanAccessPeer + # for cross device mappings (hence why we checked cuDeviceCanAccessPeer earlier). + d_A, allocationSize = checkCudaErrors(simpleMallocMultiDeviceMmap(size, backingDevices, mappingDevices)) + d_B, _ = checkCudaErrors(simpleMallocMultiDeviceMmap(size, backingDevices, mappingDevices)) + d_C, _ = checkCudaErrors(simpleMallocMultiDeviceMmap(size, backingDevices, mappingDevices)) + + # Copy vectors from host memory to device memory + checkCudaErrors(cuda.cuMemcpyHtoD(d_A, h_A, size)) + checkCudaErrors(cuda.cuMemcpyHtoD(d_B, h_B, size)) + + # Grid/Block configuration + threadsPerBlock = 256 + blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock + + kernelArgs = ((d_A, d_B, d_C, N), (None, None, None, ctypes.c_int)) + + # Launch the CUDA kernel + checkCudaErrors( + cuda.cuLaunchKernel( + _VecAdd_kernel, + blocksPerGrid, + 1, + 1, + threadsPerBlock, + 1, + 1, + 0, + 0, + kernelArgs, + 0, + ) + ) + + # Copy result from device memory to host memory + # h_C contains the result in host memory + checkCudaErrors(cuda.cuMemcpyDtoH(h_C, d_C, size)) + + # Verify result + for i in range(N): + sum_all = h_A[i] + h_B[i] + if math.fabs(h_C[i] - sum_all) > 1e-7: + break + + checkCudaErrors(simpleFreeMultiDeviceMmap(d_A, allocationSize)) + checkCudaErrors(simpleFreeMultiDeviceMmap(d_B, allocationSize)) + checkCudaErrors(simpleFreeMultiDeviceMmap(d_C, allocationSize)) + + checkCudaErrors(cuda.cuCtxDestroy(cuContext)) + + print("{}".format("Result = PASS" if i + 1 == N else "Result = FAIL")) + if i + 1 != N: + sys.exit(-1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py b/cuda_bindings_12/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py new file mode 100644 index 00000000000..d7cd51b9f4d --- /dev/null +++ b/cuda_bindings_12/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py @@ -0,0 +1,248 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import platform +import random as rnd +import sys + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice +from common.helper_string import checkCmdLineFlag + +from cuda import cuda, cudart + +streamOrderedAllocation = """\ +/* Add two vectors on the GPU */ +extern "C" +__global__ void vectorAddGPU(const float *a, const float *b, float *c, int N) +{ + int idx = blockIdx.x*blockDim.x + threadIdx.x; + + if (idx < N) { + c[idx] = a[idx] + b[idx]; + } +} +""" + +MAX_ITER = 20 + + +def basicStreamOrderedAllocation(dev, nelem, a, b, c): + num_bytes = nelem * np.dtype(np.float32).itemsize + + print("Starting basicStreamOrderedAllocation()") + checkCudaErrors(cudart.cudaSetDevice(dev)) + stream = checkCudaErrors(cudart.cudaStreamCreateWithFlags(cudart.cudaStreamNonBlocking)) + + d_a = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + d_b = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + d_c = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(d_a, a, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(d_b, b, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + + block = cudart.dim3() + block.x = 256 + block.y = 1 + block.z = 1 + grid = cudart.dim3() + grid.x = math.ceil(nelem / float(block.x)) + grid.y = 1 + grid.z = 1 + + kernelArgs = ( + (d_a, d_b, d_c, nelem), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int), + ) + checkCudaErrors( + cuda.cuLaunchKernel( + _vectorAddGPU, + grid.x, + grid.y, + grid.z, # grid dim + block.x, + block.y, + block.z, # block dim + 0, + stream, # shared mem and stream + kernelArgs, + 0, + ) + ) # arguments + + checkCudaErrors(cudart.cudaFreeAsync(d_a, stream)) + checkCudaErrors(cudart.cudaFreeAsync(d_b, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(c, d_c, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost, stream)) + checkCudaErrors(cudart.cudaFreeAsync(d_c, stream)) + checkCudaErrors(cudart.cudaStreamSynchronize(stream)) + + # Compare the results + print("> Checking the results from vectorAddGPU() ...") + errorNorm = 0.0 + refNorm = 0.0 + + for n in range(nelem): + ref = a[n] + b[n] + diff = c[n] - ref + errorNorm += diff * diff + refNorm += ref * ref + + errorNorm = math.sqrt(errorNorm) + refNorm = math.sqrt(refNorm) + + if errorNorm / refNorm < 1.0e-6: + print("basicStreamOrderedAllocation PASSED") + + checkCudaErrors(cudart.cudaStreamDestroy(stream)) + + return errorNorm / refNorm < 1.0e-6 + + +# streamOrderedAllocationPostSync(): demonstrates If the application wants the memory to persist in the pool beyond +# synchronization, then it sets the release threshold on the pool. This way, when the application reaches the "steady state", +# it is no longer allocating/freeing memory from the OS. +def streamOrderedAllocationPostSync(dev, nelem, a, b, c): + num_bytes = nelem * np.dtype(np.float32).itemsize + + print("Starting streamOrderedAllocationPostSync()") + checkCudaErrors(cudart.cudaSetDevice(dev)) + stream = checkCudaErrors(cudart.cudaStreamCreateWithFlags(cudart.cudaStreamNonBlocking)) + start = checkCudaErrors(cudart.cudaEventCreate()) + end = checkCudaErrors(cudart.cudaEventCreate()) + + memPool = checkCudaErrors(cudart.cudaDeviceGetDefaultMemPool(dev)) + thresholdVal = cuda.cuuint64_t(ctypes.c_uint64(-1).value) + # Set high release threshold on the default pool so that cudaFreeAsync will not actually release memory to the system. + # By default, the release threshold for a memory pool is set to zero. This implies that the CUDA driver is + # allowed to release a memory chunk back to the system as long as it does not contain any active suballocations. + checkCudaErrors( + cudart.cudaMemPoolSetAttribute( + memPool, + cudart.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold, + thresholdVal, + ) + ) + # Record teh start event + checkCudaErrors(cudart.cudaEventRecord(start, stream)) + for _i in range(MAX_ITER): + d_a = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + d_b = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + d_c = checkCudaErrors(cudart.cudaMallocAsync(num_bytes, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(d_a, a, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(d_b, b, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + + block = cudart.dim3() + block.x = 256 + block.y = 1 + block.z = 1 + grid = cudart.dim3() + grid.x = math.ceil(nelem / float(block.x)) + grid.y = 1 + grid.z = 1 + + kernelArgs = ( + (d_a, d_b, d_c, nelem), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int), + ) + checkCudaErrors( + cuda.cuLaunchKernel( + _vectorAddGPU, + grid.x, + grid.y, + grid.z, # grid dim + block.x, + block.y, + block.z, # block dim + 0, + stream, # shared mem and stream + kernelArgs, + 0, + ) + ) # arguments + + checkCudaErrors(cudart.cudaFreeAsync(d_a, stream)) + checkCudaErrors(cudart.cudaFreeAsync(d_b, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(c, d_c, num_bytes, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost, stream)) + checkCudaErrors(cudart.cudaFreeAsync(d_c, stream)) + checkCudaErrors(cudart.cudaStreamSynchronize(stream)) + checkCudaErrors(cudart.cudaEventRecord(end, stream)) + # Wait for the end event to complete + checkCudaErrors(cudart.cudaEventSynchronize(end)) + + msecTotal = checkCudaErrors(cudart.cudaEventElapsedTime(start, end)) + print(f"Total elapsed time = {msecTotal} ms over {MAX_ITER} iterations") + + # Compare the results + print("> Checking the results from vectorAddGPU() ...") + errorNorm = 0.0 + refNorm = 0.0 + + for n in range(nelem): + ref = a[n] + b[n] + diff = c[n] - ref + errorNorm += diff * diff + refNorm += ref * ref + + errorNorm = math.sqrt(errorNorm) + refNorm = math.sqrt(refNorm) + + if errorNorm / refNorm < 1.0e-6: + print("streamOrderedAllocationPostSync PASSED") + + checkCudaErrors(cudart.cudaStreamDestroy(stream)) + + return errorNorm / refNorm < 1.0e-6 + + +def main(): + if platform.system() == "Darwin": + print("streamOrderedAllocation is not supported on Mac OSX - waiving sample") + return + + cuda.cuInit(0) + if checkCmdLineFlag("help"): + print("Usage: streamOrderedAllocation [OPTION]\n") + print("Options:") + print(" device=[device #] Specify the device to be used") + return + + dev = findCudaDevice() + + version = checkCudaErrors(cudart.cudaDriverGetVersion()) + if version < 11030: + isMemPoolSupported = False + else: + isMemPoolSupported = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED, dev) + ) + if not isMemPoolSupported: + print("Waiving execution as device does not support Memory Pools") + return + + global _vectorAddGPU + kernelHelper = common.KernelHelper(streamOrderedAllocation, dev) + _vectorAddGPU = kernelHelper.getFunction(b"vectorAddGPU") + + # Allocate CPU memory + nelem = 1048576 + nelem * np.dtype(np.float32).itemsize + + a = np.zeros(nelem, dtype="float32") + b = np.zeros(nelem, dtype="float32") + c = np.zeros(nelem, dtype="float32") + # Initialize the vectors + for i in range(nelem): + a[i] = rnd.random() + b[i] = rnd.random() + + ret1 = basicStreamOrderedAllocation(dev, nelem, a, b, c) + ret2 = streamOrderedAllocationPostSync(dev, nelem, a, b, c) + + if not ret1 or not ret2: + sys.exit(-1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py b/cuda_bindings_12/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py new file mode 100644 index 00000000000..37a83047124 --- /dev/null +++ b/cuda_bindings_12/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py @@ -0,0 +1,1240 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import platform +import sys +from enum import Enum + +import numpy as np +import pytest +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice +from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt + +from cuda import cuda, cudart + +blockSize = 16 + + +class kernels(Enum): + AsyncCopyMultiStageLargeChunk = 0 + AsyncCopyLargeChunk = 1 + AsyncCopyLargeChunkAWBarrier = 2 + AsyncCopyMultiStageSharedState = 3 + AsyncCopyMultiStage = 4 + AsyncCopySingleStage = 5 + Naive = 6 + NaiveLargeChunk = 7 + + +kernelNames = [ + "AsyncCopyMultiStageLargeChunk", + "AsyncCopyLargeChunk", + "AsyncCopyLargeChunkAWBarrier", + "AsyncCopyMultiStageSharedState", + "AsyncCopyMultiStage", + "AsyncCopySingleStage", + "Naive", + "NaiveLargeChunk", +] + +globalToShmemAsyncCopy = """\ +#line __LINE__ +#if __CUDA_ARCH__ >= 700 +#include +#endif +#include +#include +#include +namespace cg = cooperative_groups; + +#define BLOCK_SIZE 16 +#define BLOCK_SIZE_X 16 + +// Multi Stage memcpy_async pipeline with large chunk copy +extern "C" +__global__ void MatrixMulAsyncCopyMultiStageLargeChunk(float* __restrict__ C, + const float* __restrict__ A, + const float* __restrict__ B, int wA, + int wB) { + // Requires BLOCK_SIZE % 4 == 0 + + // Multi-stage pipeline version + constexpr size_t maxPipelineStages = 4; + + // Declaration of the shared memory array As used to + // store the sub-matrix of A for each stage + __shared__ alignas(alignof(float4)) float As[maxPipelineStages][BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B for each stage + __shared__ alignas(alignof(float4)) float Bs[maxPipelineStages][BLOCK_SIZE][BLOCK_SIZE]; + + float Csub = 0.0; + + // Index of the first sub-matrix of A processed by the block + const int aBegin = wA * (BLOCK_SIZE) * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + const int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + const int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + const int t4x = threadIdx.x * 4; + const auto shape4 = cuda::aligned_size_t(sizeof(float4)); + + cuda::pipeline pipe = cuda::make_pipeline(); + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin, i = 0, aStage = aBegin, bStage = bBegin, iStage = 0; a <= aEnd; a += aStep, b += bStep, ++i ) { + // Load the matrices from device memory to shared memory; each thread loads + // one element of each matrix + for ( ; aStage <= a + aStep * maxPipelineStages ; aStage += aStep, bStage += bStep, ++iStage ) + { + pipe.producer_acquire(); + if ( aStage <= aEnd && t4x < BLOCK_SIZE ) + { + // Rotating buffer + const int j = iStage % maxPipelineStages; + cuda::memcpy_async(&As[j][threadIdx.y][t4x], &A[aStage + wA * threadIdx.y + t4x], shape4, pipe); + cuda::memcpy_async(&Bs[j][threadIdx.y][t4x], &B[aStage + wA * threadIdx.y + t4x], shape4, pipe); + } + pipe.producer_commit(); + } + + pipe.consumer_wait(); + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + // Rotating buffer + const int j = i % maxPipelineStages; + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix + #pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[j][threadIdx.y][k] * Bs[j][k][threadIdx.x]; + } + pipe.consumer_release(); + + // Don't have to synchronize because maxPipelineStages is greater than one + // therefore next iteration is loading to a different buffer. + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} + +// Single Stage memcpy_async pipeline with Large copy chunk (float4) +extern "C" +__global__ void MatrixMulAsyncCopyLargeChunk(float* __restrict__ C, + const float* __restrict__ A, + const float* __restrict__ B, int wA, + int wB) { + // Requires BLOCK_SIZE % 4 == 0 + + // Declaration of the shared memory array As used to + // store the sub-matrix of A + __shared__ alignas(alignof(float4)) float As[BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B + __shared__ alignas(alignof(float4)) float Bs[BLOCK_SIZE][BLOCK_SIZE]; + + // Index of the first sub-matrix of A processed by the block + int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + // Single-stage pipeline version + float Csub = 0.0; + + const int t4x = threadIdx.x * 4; + const auto shape4 = cuda::aligned_size_t(sizeof(float4)); + cuda::pipeline pipe = cuda::make_pipeline(); + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin; a <= aEnd; a += aStep, b += bStep) { + // Load the matrices from device memory to shared memory; + // a subset of threads loads a contiguous chunk of elements. + + // Previously, per-thread: + // As[ty][tx] = A[a + wA * ty + tx]; + // Bs[ty][tx] = B[b + wB * ty + tx]; + + // Now, one fourth of the threads load four elements of each matrix + if ( t4x < BLOCK_SIZE ) { + + pipe.producer_acquire(); + + cuda::memcpy_async(&As[threadIdx.y][t4x], &A[a + wA * threadIdx.y + t4x], shape4, pipe); + cuda::memcpy_async(&Bs[threadIdx.y][t4x], &B[a + wA * threadIdx.y + t4x], shape4, pipe); + + pipe.producer_commit(); + pipe.consumer_wait(); + } + + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix +#pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[threadIdx.y][k] * Bs[k][threadIdx.x]; + } + + pipe.consumer_release(); + + // Synchronize to make sure that the preceding + // computation is done before overwriting the + // shared memory sub-matrix buffers As and Bs in the next iteration. + __syncthreads(); + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} + +// Single Stage memcpy_async pipeline with Large copy chunk (float4) using arrive-wait barrier +extern "C" +__global__ void MatrixMulAsyncCopyLargeChunkAWBarrier(float* __restrict__ C, + const float* __restrict__ A, + const float* __restrict__ B, int wA, + int wB) { +#if __CUDA_ARCH__ >= 700 +#pragma diag_suppress static_var_with_dynamic_init + // Requires BLOCK_SIZE % 4 == 0 + + __shared__ cuda::barrier bar; + + // Declaration of the shared memory array As used to + // store the sub-matrix of A + __shared__ alignas(alignof(float4)) float As[BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B + __shared__ alignas(alignof(float4)) float Bs[BLOCK_SIZE][BLOCK_SIZE]; + + if (threadIdx.x == 0) { + init(&bar, blockDim.x*blockDim.y); + } + __syncthreads(); + + // Index of the first sub-matrix of A processed by the block + int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + float Csub = 0.0; + + const int t4x = threadIdx.x * 4; + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin; a <= aEnd; a += aStep, b += bStep) { + // Load the matrices from device memory to shared memory; + // a subset of threads loads a contiguous chunk of elements. + + // Now, one fourth of the threads load four elements of each matrix + if ( t4x < BLOCK_SIZE ) { + float4 * const A4s = reinterpret_cast(& As[threadIdx.y][t4x]); + float4 * const B4s = reinterpret_cast(& Bs[threadIdx.y][t4x]); + const float4 * const A4 = reinterpret_cast(& A[a + wA * threadIdx.y + t4x]); + const float4 * const B4 = reinterpret_cast(& B[a + wA * threadIdx.y + t4x]); + + cuda::memcpy_async(A4s, A4, sizeof(float4), bar); + cuda::memcpy_async(B4s, B4, sizeof(float4), bar); + } + + // Synchronize to make sure the matrices are loaded + bar.arrive_and_wait(); + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix +#pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[threadIdx.y][k] * Bs[k][threadIdx.x]; + } + + // Synchronize to make sure that the preceding + // computation is done before overwriting the + // shared memory sub-matrix buffers As and Bs in the next iteration. + bar.arrive_and_wait(); + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +#endif +} + +// Single Stage memcpy_async pipeline with float copy +extern "C" + __global__ void MatrixMulAsyncCopySingleStage(float *C, const float *A, + const float *B, int wA, + int wB) { + + // Declaration of the shared memory array As used to + // store the sub-matrix of A + __shared__ float As[BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B + __shared__ float Bs[BLOCK_SIZE][BLOCK_SIZE]; + + // Index of the first sub-matrix of A processed by the block + int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + // Single-stage pipeline version + float Csub = 0.0; + + cuda::pipeline pipe = cuda::make_pipeline(); + const auto shape1 = cuda::aligned_size_t(sizeof(float)); + + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin; a <= aEnd; a += aStep, b += bStep) { + // Load the matrices from device memory to shared memory; each thread loads + // one element of each matrix + { + pipe.producer_acquire(); + + cuda::memcpy_async(&As[threadIdx.y][threadIdx.x], &A[a + wA * threadIdx.y + threadIdx.x], shape1, pipe); + cuda::memcpy_async(&Bs[threadIdx.y][threadIdx.x], &B[b + wB * threadIdx.y + threadIdx.x], shape1, pipe); + + pipe.producer_commit(); + } + + pipe.consumer_wait(); + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix +#pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[threadIdx.y][k] * Bs[k][threadIdx.x]; + } + + // Synchronize to make sure that the preceding + // computation is done before overwriting the + // shared memory sub-matrix buffers As and Bs in the next iteration. + __syncthreads(); + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} + +// Multi Stage memcpy_async thread_scope_thread pipeline with single-element async-copy +extern "C" +__global__ void MatrixMulAsyncCopyMultiStage(float* __restrict__ C, + const float* __restrict__ A, + const float* __restrict__ B, int wA, + int wB) { + // Multi-stage pipeline version + constexpr size_t maxPipelineStages = 4; + + // Declaration of the shared memory array As used to + // store the sub-matrix of A for each stage + __shared__ float As[maxPipelineStages][BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B for each stage + __shared__ float Bs[maxPipelineStages][BLOCK_SIZE][BLOCK_SIZE]; + + float Csub = 0.0; + + // Index of the first sub-matrix of A processed by the block + const int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + const int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + const int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + cuda::pipeline pipe = cuda::make_pipeline(); + const auto shape1 = cuda::aligned_size_t(sizeof(float)); + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin, i = 0, aStage = aBegin, bStage = bBegin, iStage = 0; a <= aEnd; a += aStep, b += bStep, ++i ) { + // Load the matrices from device memory to shared memory; each thread loads + // one element of each matrix + + for ( ; aStage <= a + aStep * maxPipelineStages ; aStage += aStep, bStage += bStep, ++iStage ) + { + if ( aStage <= aEnd ) + { + // Rotating buffer + const int j = iStage % maxPipelineStages; + + pipe.producer_acquire(); + + cuda::memcpy_async(&As[j][threadIdx.y][threadIdx.x], &A[aStage + wA * threadIdx.y + threadIdx.x], shape1, pipe); + cuda::memcpy_async(&Bs[j][threadIdx.y][threadIdx.x], &B[bStage + wB * threadIdx.y + threadIdx.x], shape1, pipe); + + pipe.producer_commit(); + } + } + pipe.consumer_wait(); + + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + const int j = i % maxPipelineStages; + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[j][threadIdx.y][k] * Bs[j][k][threadIdx.x]; + } + + pipe.consumer_release(); + // Don't have to synchronize because maxPipelineStages is greater than one + // therefore next iteration is loading to a different buffer. + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} + +// Multi Stage shared state memcpy_async pipeline thread_scope_block +// with parititioned producer & consumer, here we've 1 warp as producer +// group which issues memcpy_async operations and rest all warps are part of +// consumer group which perform gemm computation on the loaded matrices by producer. +extern "C" +__global__ void MatrixMulAsyncCopyMultiStageSharedState(float* __restrict__ C, + const float* __restrict__ A, + const float* __restrict__ B, int wA, + int wB) { + // Multi-stage pipeline version + constexpr size_t maxPipelineStages = 4; + + // Declaration of the shared memory array As used to + // store the sub-matrix of A for each stage + __shared__ float As[maxPipelineStages][BLOCK_SIZE_X][BLOCK_SIZE_X]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B for each stage + __shared__ float Bs[maxPipelineStages][BLOCK_SIZE_X][BLOCK_SIZE_X]; + + float Csub = 0.0; + + // Index of the first sub-matrix of A processed by the block + const int aBegin = wA * BLOCK_SIZE_X * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + const int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + constexpr int aStep = BLOCK_SIZE_X; + + // Index of the first sub-matrix of B processed by the block + const int bBegin = BLOCK_SIZE_X * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE_X * wB; + + auto cta = cg::this_thread_block(); + + const auto shape1 = cuda::aligned_size_t(sizeof(float)); + __shared__ cuda::pipeline_shared_state shared_state; + constexpr int consumer_row_count = BLOCK_SIZE_X; + + const auto thread_role = (cta.thread_index().y < consumer_row_count) + ? cuda::pipeline_role::consumer + : cuda::pipeline_role::producer; + auto pipe = cuda::make_pipeline(cta, &shared_state, thread_role); + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin, i = 0, aStage = aBegin, bStage = bBegin, iStage = 0; + a <= aEnd; a += aStep, b += bStep, ++i) { + if (threadIdx.y >= consumer_row_count) { + // this is a whole producer warp because threadIdx.y >= 16 where 16 == consumer_row_count, + // which loads the matrices from device memory to shared memory; + for (; aStage <= a + aStep * maxPipelineStages; aStage += aStep, bStage += bStep, ++iStage) { + if (aStage <= aEnd) { + // Rotating buffer + const int j = iStage % maxPipelineStages; + const int strideRows = (blockDim.y - consumer_row_count); + pipe.producer_acquire(); + for (int rowId = threadIdx.y - consumer_row_count; rowId < BLOCK_SIZE_X; rowId += strideRows) { + cuda::memcpy_async(&As[j][rowId][threadIdx.x], + &A[aStage + wA * rowId + threadIdx.x], shape1, pipe); + cuda::memcpy_async(&Bs[j][rowId][threadIdx.x], + &B[bStage + wB * rowId + threadIdx.x], shape1, pipe); + } + pipe.producer_commit(); + } + } + } + else { + // this is a whole set of consumer group because threadIdx.y < consumer_row_count where consumer_row_count == 16, + // which computes gemm operation on matrices loaded in shared memory by producer warp. + const int j = i % maxPipelineStages; + // Synchronize consumer group to make sure the matrices are loaded by producer group. + pipe.consumer_wait(); + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix + #pragma unroll + for (int k = 0; k < BLOCK_SIZE_X; ++k) { + Csub += As[j][threadIdx.y][k] * Bs[j][k][threadIdx.x]; + } + pipe.consumer_release(); + } + } + + // Write the block sub-matrix to device memory; + // each thread writes four element + if (threadIdx.y < consumer_row_count) + { + const int c = wB * BLOCK_SIZE_X * blockIdx.y + BLOCK_SIZE_X * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; + } +} + +/** + * Matrix multiplication (CUDA Kernel) on the device: C = A * B + * wA is A's width and wB is B's width + */ + extern "C" + __global__ void MatrixMulNaive(float *C, float *A, + float *B, int wA, + int wB) { + // Declaration of the shared memory array As used to + // store the sub-matrix of A + __shared__ float As[BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B + __shared__ float Bs[BLOCK_SIZE][BLOCK_SIZE]; + + // Index of the first sub-matrix of A processed by the block + int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + // Csub is used to store the element of the block sub-matrix + // that is computed by the thread + float Csub = 0; + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin; + a <= aEnd; + a += aStep, b += bStep) { + + // Load the matrices from device memory + // to shared memory; each thread loads + // one element of each matrix + As[threadIdx.y][threadIdx.x] = A[a + wA * threadIdx.y + threadIdx.x]; + Bs[threadIdx.y][threadIdx.x] = B[b + wB * threadIdx.y + threadIdx.x]; + + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix +#pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[threadIdx.y][k] * Bs[k][threadIdx.x]; + } + + // Synchronize to make sure that the preceding + // computation is done before loading two new + // sub-matrices of A and B in the next iteration + __syncthreads(); + } + + // Write the block sub-matrix to device memory; + // each thread writes one element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} + +extern "C" +__global__ void MatrixMulNaiveLargeChunk(float *C, float *A, + float *B, int wA, + int wB) { + // Declaration of the shared memory array As used to + // store the sub-matrix of A + __shared__ alignas(alignof(float4)) float As[BLOCK_SIZE][BLOCK_SIZE]; + + // Declaration of the shared memory array Bs used to + // store the sub-matrix of B + __shared__ alignas(alignof(float4)) float Bs[BLOCK_SIZE][BLOCK_SIZE]; + + int t4x = threadIdx.x * 4 ; + + // Index of the first sub-matrix of A processed by the block + int aBegin = wA * BLOCK_SIZE * blockIdx.y; + + // Index of the last sub-matrix of A processed by the block + int aEnd = aBegin + wA - 1; + + // Step size used to iterate through the sub-matrices of A + int aStep = BLOCK_SIZE; + + // Index of the first sub-matrix of B processed by the block + int bBegin = BLOCK_SIZE * blockIdx.x; + + // Step size used to iterate through the sub-matrices of B + int bStep = BLOCK_SIZE * wB; + + // Csub is used to store the element of the block sub-matrix + // that is computed by the thread + float Csub = 0; + + // Loop over all the sub-matrices of A and B + // required to compute the block sub-matrix + for (int a = aBegin, b = bBegin; + a <= aEnd; + a += aStep, b += bStep) { + + // Load the matrices from device memory + // to shared memory; + + // One fourth of the threads load four elements of each matrix + if ( t4x < BLOCK_SIZE ) { + float4 * const A4s = reinterpret_cast(& As[threadIdx.y][t4x]); + float4 * const B4s = reinterpret_cast(& Bs[threadIdx.y][t4x]); + const float4 * const A4 = reinterpret_cast(& A[a + wA * threadIdx.y + t4x]); + const float4 * const B4 = reinterpret_cast(& B[a + wA * threadIdx.y + t4x]); + *A4s = *A4 ; + *B4s = *B4 ; + } + + // Synchronize to make sure the matrices are loaded + __syncthreads(); + + // Multiply the two matrices together; + // each thread computes one element + // of the block sub-matrix +#pragma unroll + for (int k = 0; k < BLOCK_SIZE; ++k) { + Csub += As[threadIdx.y][k] * Bs[k][threadIdx.x]; + } + + // Synchronize to make sure that the preceding + // computation is done before loading two new + // sub-matrices of A and B in the next iteration + __syncthreads(); + } + + // Write the block sub-matrix to device memory; + // each thread writes one element + int c = wB * BLOCK_SIZE * blockIdx.y + BLOCK_SIZE * blockIdx.x; + C[c + wB * threadIdx.y + threadIdx.x] = Csub; +} +""" + + +def ConstantInit(data, size, val): + p_data = (ctypes.c_float * size).from_address(data) + for i in range(size): + p_data[i] = val + + +# +# Run matrix multiplication using CUDA +# +def MatrixMultiply(dimsA, dimsB, kernel_number): + # Allocate host memory for matricies A and B + size_A = dimsA.x * dimsA.y + mem_size_A = np.dtype(np.float32).itemsize * size_A + h_A = checkCudaErrors(cudart.cudaMallocHost(mem_size_A)) + size_B = dimsB.x * dimsB.y + mem_size_B = np.dtype(np.float32).itemsize * size_B + h_B = checkCudaErrors(cudart.cudaMallocHost(mem_size_B)) + + # Initialize host memory + valB = 2.10 + ConstantInit(h_A, size_A, 1.0) + ConstantInit(h_B, size_B, valB) + + # Allocate Device Memory + + # Allocate host matrix C + dimsC = cudart.dim3() + dimsC.x = dimsB.x + dimsC.y = dimsA.y + dimsC.z = 1 + mem_size_C = dimsC.x * dimsC.y * np.dtype(np.float32).itemsize + h_C = checkCudaErrors(cudart.cudaMallocHost(mem_size_C)) + + if h_C == 0: + print("Failed to allocate host matri C!") + exit(-1) + + d_A = checkCudaErrors(cudart.cudaMalloc(mem_size_A)) + d_B = checkCudaErrors(cudart.cudaMalloc(mem_size_B)) + d_C = checkCudaErrors(cudart.cudaMalloc(mem_size_C)) + # Allocate CUDA events that we'll use for timing + start = checkCudaErrors(cudart.cudaEventCreate()) + stop = checkCudaErrors(cudart.cudaEventCreate()) + + stream = checkCudaErrors(cudart.cudaStreamCreateWithFlags(cudart.cudaStreamNonBlocking)) + + # Copy host memory to device + checkCudaErrors(cudart.cudaMemcpyAsync(d_A, h_A, mem_size_A, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + checkCudaErrors(cudart.cudaMemcpyAsync(d_B, h_B, mem_size_B, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, stream)) + checkCudaErrors(cudart.cudaMemsetAsync(d_C, 0, mem_size_C, stream)) + + # Setup execution parameters + threads = cudart.dim3() + threads.x = threads.y = blockSize + threads.z = 1 + grid = cudart.dim3() + grid.x = dimsB.x / threads.x + grid.y = dimsA.y / threads.y + grid.z = 1 + + # Here the block size is 16x18, where first 16 rows are consumer thread group + # and last 2 rows (1 warp) is producer thread group + threadsSharedStateKernel = cudart.dim3() + threadsSharedStateKernel.x = blockSize + threadsSharedStateKernel.y = blockSize + 2 + threadsSharedStateKernel.z = 1 + gridSharedStateKernel = cudart.dim3() + gridSharedStateKernel.x = dimsB.x / threadsSharedStateKernel.x + gridSharedStateKernel.y = dimsA.y / threadsSharedStateKernel.x + + print(f"Running kernel = {kernel_number} - {kernelNames[kernel_number.value]}") + # Create and start timer + print("Computing result using CUDA Kernel...") + + # Performs warmup operation using matrixMul CUDA kernel + kernelArguments = ( + (d_C, d_A, d_B, dimsA.x, dimsB.x), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_int), + ) + if kernel_number == kernels.AsyncCopyMultiStageLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStageLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyLargeChunkAWBarrier: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyLargeChunkAWBarrier, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyMultiStageSharedState: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStageSharedState, + gridSharedStateKernel.x, + gridSharedStateKernel.y, + gridSharedStateKernel.z, # grid dim + threadsSharedStateKernel.x, + threadsSharedStateKernel.y, + threadsSharedStateKernel.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyMultiStage: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStage, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopySingleStage: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopySingleStage, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.Naive: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulNaive, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.NaiveLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulNaiveLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + + print("done") + checkCudaErrors(cudart.cudaStreamSynchronize(stream)) + + # Execute the kernel + nIter = 100 + + # Record the start event + checkCudaErrors(cudart.cudaEventRecord(start, stream)) + + if kernel_number == kernels.AsyncCopyMultiStageLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStageLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyLargeChunkAWBarrier: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyLargeChunkAWBarrier, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyMultiStageSharedState: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStageSharedState, + gridSharedStateKernel.x, + gridSharedStateKernel.y, + gridSharedStateKernel.z, # grid dim + threadsSharedStateKernel.x, + threadsSharedStateKernel.y, + threadsSharedStateKernel.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopyMultiStage: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopyMultiStage, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.AsyncCopySingleStage: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulAsyncCopySingleStage, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.Naive: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulNaive, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + elif kernel_number == kernels.NaiveLargeChunk: + checkCudaErrors( + cuda.cuLaunchKernel( + _MatrixMulNaiveLargeChunk, + grid.x, + grid.y, + grid.z, # grid dim + threads.x, + threads.y, + threads.z, # block dim + 0, # shared mem + stream, # stream + kernelArguments, + 0, + ) + ) # arguments + + # Record the stop event + checkCudaErrors(cudart.cudaEventRecord(stop, stream)) + + # Wait for the stop event to complete + checkCudaErrors(cudart.cudaEventSynchronize(stop)) + + msecTotal = checkCudaErrors(cudart.cudaEventElapsedTime(start, stop)) + + # Compute and print the performance + msecPerMatrixMul = msecTotal / nIter + flopsPerMatrixMul = 2.0 * dimsA.x * dimsA.y * dimsB.x + gigaFlops = (flopsPerMatrixMul * 1.0e-9) / (msecPerMatrixMul / 1000.0) + + print( + f"Performance= {gigaFlops:.2f} GFlop/s, Time= {msecPerMatrixMul:.2f} msec, Size= {flopsPerMatrixMul:.0f} Ops, WorkgroupSize= {threads.x * threads.y} threads/block" + ) + + # Copy result from device to host + checkCudaErrors(cudart.cudaMemcpyAsync(h_C, d_C, mem_size_C, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost, stream)) + checkCudaErrors(cudart.cudaStreamSynchronize(stream)) + + print("Checking computed result for correctness: ") + correct = True + + # test relative error by the formula + # |_cpu - _gpu|/<|x|, |y|> < eps + eps = 1.0e-6 + + h_C_local = (ctypes.c_float * (dimsC.x * dimsC.y)).from_address(h_C) + for i in range(dimsC.x * dimsC.y): + abs_err = math.fabs(h_C_local[i] - (dimsA.x * valB)) + dot_length = dimsA.x + abs_val = math.fabs(h_C_local[i]) + rel_err = abs_err / abs_val / dot_length + + if rel_err > eps: + print(f"Error! Matrix[{i:.5f}]={h_C_local[i]:.8f} ref={dimsA.x * valB:.8f} err term is > {rel_err}") + correct = False + + print("Result = PASS" if correct else "Result = FAIL") + + # Clean up memory + checkCudaErrors(cudart.cudaFreeHost(h_A)) + checkCudaErrors(cudart.cudaFreeHost(h_B)) + checkCudaErrors(cudart.cudaFreeHost(h_C)) + checkCudaErrors(cudart.cudaFree(d_A)) + checkCudaErrors(cudart.cudaFree(d_B)) + checkCudaErrors(cudart.cudaFree(d_C)) + checkCudaErrors(cudart.cudaEventDestroy(start)) + checkCudaErrors(cudart.cudaEventDestroy(stop)) + print( + "\nNOTE: The CUDA Samples are not meant for performance " + "measurements. Results may vary when GPU Boost is enabled." + ) + if correct: + return 0 + return -1 + + +def checkKernelCompiles(): + kernel_headers = """\ + #line __LINE__ + #if __CUDA_ARCH__ >= 700 + #include + #endif + #include + #include + #include + """ + try: + common.KernelHelper(kernel_headers, findCudaDevice()) + except: + # Filters out test from automation for two reasons + # 1. Headers are not found + # 2. Incompatible device + return False + return True + + +@pytest.mark.skipif(not checkKernelCompiles(), reason="Automation filter against incompatible kernel") +def main(): + print("[globalToShmemAsyncCopy] - Starting...") + + if platform.machine() == "qnx": + print("globalToShmemAsyncCopy is not supported on QNX - waiving sample") + return + + version = checkCudaErrors(cuda.cuDriverGetVersion()) + if version < 11010: + print("CUDA Toolkit 11.1 or greater is required") + return + + if checkCmdLineFlag("help") or checkCmdLineFlag("?"): + print("Usage device=n (n >= 0 for deviceID)") + print(" wA=WidthA hA=HeightA (Width x Height of Matrix A)") + print(" wB=WidthB hB=HeightB (Width x Height of Matrix B)") + print(" kernel=kernel_number (0 - AsyncCopyMultiStageLargeChunk; 1 - AsyncCopyLargeChunk)") + print(" (2 - AsyncCopyLargeChunkAWBarrier; 3 - AsyncCopyMultiStageSharedState)") + print( + " (4 - AsyncCopyMultiStage; 5 - AsyncCopySingleStage; 6 - Naive without memcpy_async)" + ) + print(" (7 - NaiveLargeChunk without memcpy_async)") + print(" Note: Outer matrix dimensions of A & B matrices must be equal.") + return + + # This will pick the best possible CUDA capable device, otherwise + # override the device ID based on input provided at the command line + devID = findCudaDevice() + + matrixBlock = 32 + dimsA = cudart.dim3() + dimsA.x = dimsA.y = 10 * 4 * matrixBlock + dimsA.z = 1 + dimsB = cudart.dim3() + dimsB.x = dimsB.y = 10 * 4 * matrixBlock + dimsB.z = 1 + + # width of Matrix A + if checkCmdLineFlag("wA="): + dimsA.x = int(getCmdLineArgumentInt("wA=")) + + # height of Matrix A + if checkCmdLineFlag("hA="): + dimsA.y = int(getCmdLineArgumentInt("hA=")) + + # width of Matrix B + if checkCmdLineFlag("wB="): + dimsB.x = int(getCmdLineArgumentInt("wB=")) + + # height of Matrix B + if checkCmdLineFlag("hB="): + dimsB.y = int(getCmdLineArgumentInt("hB=")) + + if dimsA.x != dimsB.y: + print(f"Error: outer matrix dimensions must be equal. ({dimsA.x} != {dimsB.y})") + sys.exit(-1) + + selected_kernel = kernels.AsyncCopyMultiStageLargeChunk + + # kernel to run - default (AsyncCopyMultiStageLargeChunk == 0) + if checkCmdLineFlag("kernel="): + kernel_number = int(getCmdLineArgumentInt("kernel=")) + if kernel_number < 8: + selected_kernel = kernels(kernel_number) + else: + print("Error: kernel number should be between 0 to 7, you have entered %d".format()) + sys.exit(-1) + + major = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, devID) + ) + if major < 7: + print("globalToShmemAsyncCopy requires SM 7.0 or higher. Exiting...") + return + + print(f"MatrixA({dimsA.x},{dimsA.y}), MatrixB({dimsB.x},{dimsB.y})") + + global _MatrixMulAsyncCopyMultiStageLargeChunk + global _MatrixMulAsyncCopyLargeChunk + global _MatrixMulAsyncCopyLargeChunkAWBarrier + global _MatrixMulAsyncCopyMultiStageSharedState + global _MatrixMulAsyncCopyMultiStage + global _MatrixMulAsyncCopySingleStage + global _MatrixMulNaive + global _MatrixMulNaiveLargeChunk + kernelHelper = common.KernelHelper(globalToShmemAsyncCopy, devID) + _MatrixMulAsyncCopyMultiStageLargeChunk = kernelHelper.getFunction(b"MatrixMulAsyncCopyMultiStageLargeChunk") + _MatrixMulAsyncCopyLargeChunk = kernelHelper.getFunction(b"MatrixMulAsyncCopyLargeChunk") + _MatrixMulAsyncCopyLargeChunkAWBarrier = kernelHelper.getFunction(b"MatrixMulAsyncCopyLargeChunkAWBarrier") + _MatrixMulAsyncCopyMultiStageSharedState = kernelHelper.getFunction(b"MatrixMulAsyncCopyMultiStageSharedState") + _MatrixMulAsyncCopyMultiStage = kernelHelper.getFunction(b"MatrixMulAsyncCopyMultiStage") + _MatrixMulAsyncCopySingleStage = kernelHelper.getFunction(b"MatrixMulAsyncCopySingleStage") + _MatrixMulNaive = kernelHelper.getFunction(b"MatrixMulNaive") + _MatrixMulNaiveLargeChunk = kernelHelper.getFunction(b"MatrixMulNaiveLargeChunk") + + matrix_result = MatrixMultiply(dimsA, dimsB, selected_kernel) + + if matrix_result != 0: + sys.exit(-1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/3_CUDA_Features/simpleCudaGraphs_test.py b/cuda_bindings_12/examples/3_CUDA_Features/simpleCudaGraphs_test.py new file mode 100644 index 00000000000..91aec2010ba --- /dev/null +++ b/cuda_bindings_12/examples/3_CUDA_Features/simpleCudaGraphs_test.py @@ -0,0 +1,416 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import random as rnd + +import numpy as np +import pytest +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice + +from cuda import cuda, cudart + +THREADS_PER_BLOCK = 512 +GRAPH_LAUNCH_ITERATIONS = 3 + +simpleCudaGraphs = """\ +#include +#include + +namespace cg = cooperative_groups; + +#define THREADS_PER_BLOCK 512 +#define GRAPH_LAUNCH_ITERATIONS 3 + +extern "C" +__global__ void reduce(float *inputVec, double *outputVec, size_t inputSize, + size_t outputSize) { + __shared__ double tmp[THREADS_PER_BLOCK]; + + cg::thread_block cta = cg::this_thread_block(); + size_t globaltid = blockIdx.x * blockDim.x + threadIdx.x; + + double temp_sum = 0.0; + for (int i = globaltid; i < inputSize; i += gridDim.x * blockDim.x) { + temp_sum += (double)inputVec[i]; + } + tmp[cta.thread_rank()] = temp_sum; + + cg::sync(cta); + + cg::thread_block_tile<32> tile32 = cg::tiled_partition<32>(cta); + + double beta = temp_sum; + double temp; + + for (int i = tile32.size() / 2; i > 0; i >>= 1) { + if (tile32.thread_rank() < i) { + temp = tmp[cta.thread_rank() + i]; + beta += temp; + tmp[cta.thread_rank()] = beta; + } + cg::sync(tile32); + } + cg::sync(cta); + + if (cta.thread_rank() == 0 && blockIdx.x < outputSize) { + beta = 0.0; + for (int i = 0; i < cta.size(); i += tile32.size()) { + beta += tmp[i]; + } + outputVec[blockIdx.x] = beta; + } +} + +extern "C" +__global__ void reduceFinal(double *inputVec, double *result, + size_t inputSize) { + __shared__ double tmp[THREADS_PER_BLOCK]; + + cg::thread_block cta = cg::this_thread_block(); + size_t globaltid = blockIdx.x * blockDim.x + threadIdx.x; + + double temp_sum = 0.0; + for (int i = globaltid; i < inputSize; i += gridDim.x * blockDim.x) { + temp_sum += (double)inputVec[i]; + } + tmp[cta.thread_rank()] = temp_sum; + + cg::sync(cta); + + cg::thread_block_tile<32> tile32 = cg::tiled_partition<32>(cta); + + // do reduction in shared mem + if ((blockDim.x >= 512) && (cta.thread_rank() < 256)) { + tmp[cta.thread_rank()] = temp_sum = temp_sum + tmp[cta.thread_rank() + 256]; + } + + cg::sync(cta); + + if ((blockDim.x >= 256) && (cta.thread_rank() < 128)) { + tmp[cta.thread_rank()] = temp_sum = temp_sum + tmp[cta.thread_rank() + 128]; + } + + cg::sync(cta); + + if ((blockDim.x >= 128) && (cta.thread_rank() < 64)) { + tmp[cta.thread_rank()] = temp_sum = temp_sum + tmp[cta.thread_rank() + 64]; + } + + cg::sync(cta); + + if (cta.thread_rank() < 32) { + // Fetch final intermediate sum from 2nd warp + if (blockDim.x >= 64) temp_sum += tmp[cta.thread_rank() + 32]; + // Reduce final warp using shuffle + for (int offset = tile32.size() / 2; offset > 0; offset /= 2) { + temp_sum += tile32.shfl_down(temp_sum, offset); + } + } + // write result for this block to global mem + if (cta.thread_rank() == 0) result[0] = temp_sum; +} +""" + + +def init_input(a, size): + ctypes.c_float.from_address(a) + a_list = ctypes.pointer(ctypes.c_float.from_address(a)) + for i in range(0, size): + a_list[i] = rnd.random() + + +def cudaGraphsManual(inputVec_h, inputVec_d, outputVec_d, result_d, inputSize, numOfBlocks): + result_h = ctypes.c_double(0.0) + nodeDependencies = [] + + streamForGraph = checkCudaErrors(cudart.cudaStreamCreate()) + + kernelNodeParams = cuda.CUDA_KERNEL_NODE_PARAMS() + memcpyParams = cudart.cudaMemcpy3DParms() + memsetParams = cudart.cudaMemsetParams() + + memcpyParams.srcArray = None + memcpyParams.srcPos = cudart.make_cudaPos(0, 0, 0) + memcpyParams.srcPtr = cudart.make_cudaPitchedPtr( + inputVec_h, np.dtype(np.float32).itemsize * inputSize, inputSize, 1 + ) + memcpyParams.dstArray = None + memcpyParams.dstPos = cudart.make_cudaPos(0, 0, 0) + memcpyParams.dstPtr = cudart.make_cudaPitchedPtr( + inputVec_d, np.dtype(np.float32).itemsize * inputSize, inputSize, 1 + ) + memcpyParams.extent = cudart.make_cudaExtent(np.dtype(np.float32).itemsize * inputSize, 1, 1) + memcpyParams.kind = cudart.cudaMemcpyKind.cudaMemcpyHostToDevice + + memsetParams.dst = outputVec_d + memsetParams.value = 0 + memsetParams.pitch = 0 + memsetParams.elementSize = np.dtype(np.float32).itemsize # elementSize can be max 4 bytes + memsetParams.width = numOfBlocks * 2 + memsetParams.height = 1 + + graph = checkCudaErrors(cudart.cudaGraphCreate(0)) + + memcpyNode = checkCudaErrors(cudart.cudaGraphAddMemcpyNode(graph, None, 0, memcpyParams)) + memsetNode = checkCudaErrors(cudart.cudaGraphAddMemsetNode(graph, None, 0, memsetParams)) + + nodeDependencies.append(memsetNode) + nodeDependencies.append(memcpyNode) + + kernelArgs = ( + (inputVec_d, outputVec_d, inputSize, numOfBlocks), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_uint), + ) + + kernelNodeParams.func = _reduce + kernelNodeParams.gridDimX = numOfBlocks + kernelNodeParams.gridDimY = kernelNodeParams.gridDimZ = 1 + kernelNodeParams.blockDimX = THREADS_PER_BLOCK + kernelNodeParams.blockDimY = kernelNodeParams.blockDimZ = 1 + kernelNodeParams.sharedMemBytes = 0 + kernelNodeParams.kernelParams = kernelArgs + # kernelNodeParams.extra = None + + kernelNode = checkCudaErrors( + cuda.cuGraphAddKernelNode(graph, nodeDependencies, len(nodeDependencies), kernelNodeParams) + ) + + nodeDependencies.clear() + nodeDependencies.append(kernelNode) + + memsetParams = cudart.cudaMemsetParams() + memsetParams.dst = result_d + memsetParams.value = 0 + memsetParams.elementSize = np.dtype(np.float32).itemsize + memsetParams.width = 2 + memsetParams.height = 1 + memsetNode = checkCudaErrors(cudart.cudaGraphAddMemsetNode(graph, None, 0, memsetParams)) + + nodeDependencies.append(memsetNode) + + kernelNodeParams = cuda.CUDA_KERNEL_NODE_PARAMS() + kernelNodeParams.func = _reduceFinal + kernelNodeParams.gridDimX = kernelNodeParams.gridDimY = kernelNodeParams.gridDimZ = 1 + kernelNodeParams.blockDimX = THREADS_PER_BLOCK + kernelNodeParams.blockDimY = kernelNodeParams.blockDimZ = 1 + kernelNodeParams.sharedMemBytes = 0 + kernelArgs2 = ( + (outputVec_d, result_d, numOfBlocks), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint), + ) + kernelNodeParams.kernelParams = kernelArgs2 + # kernelNodeParams.extra = None + + kernelNode = checkCudaErrors( + cuda.cuGraphAddKernelNode(graph, nodeDependencies, len(nodeDependencies), kernelNodeParams) + ) + + nodeDependencies.clear() + nodeDependencies.append(kernelNode) + + memcpyParams = cudart.cudaMemcpy3DParms() + + memcpyParams.srcArray = None + memcpyParams.srcPos = cudart.make_cudaPos(0, 0, 0) + memcpyParams.srcPtr = cudart.make_cudaPitchedPtr(result_d, np.dtype(np.float64).itemsize, 1, 1) + memcpyParams.dstArray = None + memcpyParams.dstPos = cudart.make_cudaPos(0, 0, 0) + memcpyParams.dstPtr = cudart.make_cudaPitchedPtr(result_h, np.dtype(np.float64).itemsize, 1, 1) + memcpyParams.extent = cudart.make_cudaExtent(np.dtype(np.float64).itemsize, 1, 1) + memcpyParams.kind = cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost + memcpyNode = checkCudaErrors( + cudart.cudaGraphAddMemcpyNode(graph, nodeDependencies, len(nodeDependencies), memcpyParams) + ) + + nodeDependencies.clear() + nodeDependencies.append(memcpyNode) + + # WIP: Host nodes + + nodes, numNodes = checkCudaErrors(cudart.cudaGraphGetNodes(graph)) + print(f"\nNum of nodes in the graph created manually = {numNodes}") + + graphExec = checkCudaErrors(cudart.cudaGraphInstantiate(graph, 0)) + + clonedGraph = checkCudaErrors(cudart.cudaGraphClone(graph)) + clonedGraphExec = checkCudaErrors(cudart.cudaGraphInstantiate(clonedGraph, 0)) + + for _i in range(GRAPH_LAUNCH_ITERATIONS): + checkCudaErrors(cudart.cudaGraphLaunch(graphExec, streamForGraph)) + + checkCudaErrors(cudart.cudaStreamSynchronize(streamForGraph)) + + print("Cloned Graph Output..") + for _i in range(GRAPH_LAUNCH_ITERATIONS): + checkCudaErrors(cudart.cudaGraphLaunch(clonedGraphExec, streamForGraph)) + + checkCudaErrors(cudart.cudaStreamSynchronize(streamForGraph)) + + checkCudaErrors(cudart.cudaGraphExecDestroy(graphExec)) + checkCudaErrors(cudart.cudaGraphExecDestroy(clonedGraphExec)) + checkCudaErrors(cudart.cudaGraphDestroy(graph)) + checkCudaErrors(cudart.cudaGraphDestroy(clonedGraph)) + checkCudaErrors(cudart.cudaStreamDestroy(streamForGraph)) + + +def cudaGraphsUsingStreamCapture(inputVec_h, inputVec_d, outputVec_d, result_d, inputSize, numOfBlocks): + result_h = ctypes.c_double(0.0) + + stream1 = checkCudaErrors(cudart.cudaStreamCreate()) + stream2 = checkCudaErrors(cudart.cudaStreamCreate()) + stream3 = checkCudaErrors(cudart.cudaStreamCreate()) + streamForGraph = checkCudaErrors(cudart.cudaStreamCreate()) + + forkStreamEvent = checkCudaErrors(cudart.cudaEventCreate()) + memsetEvent1 = checkCudaErrors(cudart.cudaEventCreate()) + memsetEvent2 = checkCudaErrors(cudart.cudaEventCreate()) + + checkCudaErrors(cudart.cudaStreamBeginCapture(stream1, cudart.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal)) + + checkCudaErrors(cudart.cudaEventRecord(forkStreamEvent, stream1)) + checkCudaErrors(cudart.cudaStreamWaitEvent(stream2, forkStreamEvent, 0)) + checkCudaErrors(cudart.cudaStreamWaitEvent(stream3, forkStreamEvent, 0)) + + checkCudaErrors( + cudart.cudaMemcpyAsync( + inputVec_d, + inputVec_h, + np.dtype(np.float32).itemsize * inputSize, + cudart.cudaMemcpyKind.cudaMemcpyDefault, + stream1, + ) + ) + + checkCudaErrors(cudart.cudaMemsetAsync(outputVec_d, 0, np.dtype(np.float64).itemsize * numOfBlocks, stream2)) + + checkCudaErrors(cudart.cudaEventRecord(memsetEvent1, stream2)) + + checkCudaErrors(cudart.cudaMemsetAsync(result_d, 0, np.dtype(np.float64).itemsize, stream3)) + checkCudaErrors(cudart.cudaEventRecord(memsetEvent2, stream3)) + + checkCudaErrors(cudart.cudaStreamWaitEvent(stream1, memsetEvent1, 0)) + + kernelArgs = ( + (inputVec_d, outputVec_d, inputSize, numOfBlocks), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t, ctypes.c_uint), + ) + checkCudaErrors( + cuda.cuLaunchKernel( + _reduce, + numOfBlocks, + 1, + 1, + THREADS_PER_BLOCK, + 1, + 1, + 0, + stream1, + kernelArgs, + 0, + ) + ) + + checkCudaErrors(cudart.cudaStreamWaitEvent(stream1, memsetEvent2, 0)) + + kernelArgs2 = ( + (outputVec_d, result_d, numOfBlocks), + (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint), + ) + checkCudaErrors(cuda.cuLaunchKernel(_reduceFinal, 1, 1, 1, THREADS_PER_BLOCK, 1, 1, 0, stream1, kernelArgs2, 0)) + + checkCudaErrors( + cudart.cudaMemcpyAsync( + result_h, + result_d, + np.dtype(np.float64).itemsize, + cudart.cudaMemcpyKind.cudaMemcpyDefault, + stream1, + ) + ) + + # WIP: Host nodes + + graph = checkCudaErrors(cudart.cudaStreamEndCapture(stream1)) + + nodes, numNodes = checkCudaErrors(cudart.cudaGraphGetNodes(graph)) + print(f"\nNum of nodes in the graph created using stream capture API = {numNodes}") + + graphExec = checkCudaErrors(cudart.cudaGraphInstantiate(graph, 0)) + + clonedGraph = checkCudaErrors(cudart.cudaGraphClone(graph)) + clonedGraphExec = checkCudaErrors(cudart.cudaGraphInstantiate(clonedGraph, 0)) + + for _i in range(GRAPH_LAUNCH_ITERATIONS): + checkCudaErrors(cudart.cudaGraphLaunch(graphExec, streamForGraph)) + + checkCudaErrors(cudart.cudaStreamSynchronize(streamForGraph)) + + print("Cloned Graph Output..") + for _i in range(GRAPH_LAUNCH_ITERATIONS): + checkCudaErrors(cudart.cudaGraphLaunch(clonedGraphExec, streamForGraph)) + + checkCudaErrors(cudart.cudaStreamSynchronize(streamForGraph)) + + checkCudaErrors(cudart.cudaGraphExecDestroy(graphExec)) + checkCudaErrors(cudart.cudaGraphExecDestroy(clonedGraphExec)) + checkCudaErrors(cudart.cudaGraphDestroy(graph)) + checkCudaErrors(cudart.cudaGraphDestroy(clonedGraph)) + checkCudaErrors(cudart.cudaStreamDestroy(stream1)) + checkCudaErrors(cudart.cudaStreamDestroy(stream2)) + checkCudaErrors(cudart.cudaStreamDestroy(streamForGraph)) + + +def checkKernelCompiles(): + kernel_headers = """\ + #include + """ + try: + common.KernelHelper(kernel_headers, findCudaDevice()) + except: + # Filters out test from automation when CG header has issues compiling + # Automation issue is observed when CG headers are obtained through PYPI packages + # The problem is that these headers and their dependencies are segmented between + # multiple packages, and NVRTC requires that you specify the path to each segemented + # include path. + return False + return True + + +@pytest.mark.skipif(not checkKernelCompiles(), reason="Automation filter against incompatible kernel") +def main(): + size = 1 << 24 # number of elements to reduce + maxBlocks = 512 + + # This will pick the best possible CUDA capable device + devID = findCudaDevice() + + global _reduce + global _reduceFinal + kernelHelper = common.KernelHelper(simpleCudaGraphs, devID) + _reduce = kernelHelper.getFunction(b"reduce") + _reduceFinal = kernelHelper.getFunction(b"reduceFinal") + + print(f"{size} elements") + print(f"threads per block = {THREADS_PER_BLOCK}") + print(f"Graph Launch iterations = {GRAPH_LAUNCH_ITERATIONS}") + + inputVec_h = checkCudaErrors(cudart.cudaMallocHost(size * np.dtype(np.float32).itemsize)) + inputVec_d = checkCudaErrors(cudart.cudaMalloc(size * np.dtype(np.float32).itemsize)) + outputVec_d = checkCudaErrors(cudart.cudaMalloc(maxBlocks * np.dtype(np.float64).itemsize)) + result_d = checkCudaErrors(cudart.cudaMalloc(np.dtype(np.float64).itemsize)) + + init_input(inputVec_h, size) + + cudaGraphsManual(inputVec_h, inputVec_d, outputVec_d, result_d, size, maxBlocks) + cudaGraphsUsingStreamCapture(inputVec_h, inputVec_d, outputVec_d, result_d, size, maxBlocks) + + checkCudaErrors(cudart.cudaFree(inputVec_d)) + checkCudaErrors(cudart.cudaFree(outputVec_d)) + checkCudaErrors(cudart.cudaFree(result_d)) + checkCudaErrors(cudart.cudaFreeHost(inputVec_h)) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py b/cuda_bindings_12/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py new file mode 100644 index 00000000000..96aae9e5f58 --- /dev/null +++ b/cuda_bindings_12/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py @@ -0,0 +1,357 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math +import platform +import sys +from random import random + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors, findCudaDevice + +from cuda import cuda, cudart + +conjugateGradientMultiBlockCG = """\ +#line __LINE__ +#include +#include +namespace cg = cooperative_groups; + + +__device__ void gpuSpMV(int *I, int *J, float *val, int nnz, int num_rows, + float alpha, float *inputVecX, float *outputVecY, + cg::thread_block &cta, const cg::grid_group &grid) { + for (int i = grid.thread_rank(); i < num_rows; i += grid.size()) { + int row_elem = I[i]; + int next_row_elem = I[i + 1]; + int num_elems_this_row = next_row_elem - row_elem; + + float output = 0.0; + for (int j = 0; j < num_elems_this_row; j++) { + // I or J or val arrays - can be put in shared memory + // as the access is random and reused in next calls of gpuSpMV function. + output += alpha * val[row_elem + j] * inputVecX[J[row_elem + j]]; + } + + outputVecY[i] = output; + } +} + +__device__ void gpuSaxpy(float *x, float *y, float a, int size, + const cg::grid_group &grid) { + for (int i = grid.thread_rank(); i < size; i += grid.size()) { + y[i] = a * x[i] + y[i]; + } +} + +__device__ void gpuDotProduct(float *vecA, float *vecB, double *result, + int size, const cg::thread_block &cta, + const cg::grid_group &grid) { + extern __shared__ double tmp[]; + + double temp_sum = 0.0; + for (int i = grid.thread_rank(); i < size; i += grid.size()) { + temp_sum += static_cast(vecA[i] * vecB[i]); + } + + cg::thread_block_tile<32> tile32 = cg::tiled_partition<32>(cta); + + temp_sum = cg::reduce(tile32, temp_sum, cg::plus()); + + if (tile32.thread_rank() == 0) { + tmp[tile32.meta_group_rank()] = temp_sum; + } + + cg::sync(cta); + + if (tile32.meta_group_rank() == 0) { + temp_sum = tile32.thread_rank() < tile32.meta_group_size() ? tmp[tile32.thread_rank()] : 0.0; + temp_sum = cg::reduce(tile32, temp_sum, cg::plus()); + + if (tile32.thread_rank() == 0) { + atomicAdd(result, temp_sum); + } + } +} + +__device__ void gpuCopyVector(float *srcA, float *destB, int size, + const cg::grid_group &grid) { + for (int i = grid.thread_rank(); i < size; i += grid.size()) { + destB[i] = srcA[i]; + } +} + +__device__ void gpuScaleVectorAndSaxpy(const float *x, float *y, float a, float scale, int size, + const cg::grid_group &grid) { + for (int i = grid.thread_rank(); i < size; i += grid.size()) { + y[i] = a * x[i] + scale * y[i]; + } +} + +extern "C" __global__ void gpuConjugateGradient(int *I, int *J, float *val, + float *x, float *Ax, float *p, + float *r, double *dot_result, + int nnz, int N, float tol) { + cg::thread_block cta = cg::this_thread_block(); + cg::grid_group grid = cg::this_grid(); + + int max_iter = 10000; + + float alpha = 1.0; + float alpham1 = -1.0; + float r0 = 0.0, r1, b, a, na; + + gpuSpMV(I, J, val, nnz, N, alpha, x, Ax, cta, grid); + + cg::sync(grid); + + gpuSaxpy(Ax, r, alpham1, N, grid); + + cg::sync(grid); + + gpuDotProduct(r, r, dot_result, N, cta, grid); + + cg::sync(grid); + + r1 = *dot_result; + + int k = 1; + while (r1 > tol * tol && k <= max_iter) { + if (k > 1) { + b = r1 / r0; + gpuScaleVectorAndSaxpy(r, p, alpha, b, N, grid); + } else { + gpuCopyVector(r, p, N, grid); + } + + cg::sync(grid); + + gpuSpMV(I, J, val, nnz, N, alpha, p, Ax, cta, grid); + + if (threadIdx.x == 0 && blockIdx.x == 0) *dot_result = 0.0; + + cg::sync(grid); + + gpuDotProduct(p, Ax, dot_result, N, cta, grid); + + cg::sync(grid); + + a = r1 / *dot_result; + + gpuSaxpy(p, x, a, N, grid); + na = -a; + gpuSaxpy(Ax, r, na, N, grid); + + r0 = r1; + + cg::sync(grid); + if (threadIdx.x == 0 && blockIdx.x == 0) *dot_result = 0.0; + + cg::sync(grid); + + gpuDotProduct(r, r, dot_result, N, cta, grid); + + cg::sync(grid); + + r1 = *dot_result; + k++; + } +} +""" + + +def genTridiag(I, J, val, N, nz): + I[0] = 0 + J[0] = 0 + J[1] = 0 + + val[0] = float(random()) + 10.0 + val[1] = float(random()) + + for i in range(1, N): + if i > 1: + I[i] = I[i - 1] + 3 + else: + I[1] = 2 + + start = (i - 1) * 3 + 2 + J[start] = i - 1 + J[start + 1] = i + + if i < N - 1: + J[start + 2] = i + 1 + + val[start] = val[start - 1] + val[start + 1] = float(random()) + 10.0 + + if i < N - 1: + val[start + 2] = float(random()) + I[N] = nz + + +THREADS_PER_BLOCK = 512 +sSDKname = "conjugateGradientMultiBlockCG" + + +def main(): + tol = 1e-5 + + print(f"Starting [{sSDKname}]...\n") + # WAIVE: Due to bug in NVRTC + return + + if platform.system() == "Darwin": + print("conjugateGradientMultiBlockCG is not supported on Mac OSX - waiving sample") + return + + if platform.machine() == "armv7l": + print("conjugateGradientMultiBlockCG is not supported on ARMv7 - waiving sample") + return + + if platform.machine() == "qnx": + print("conjugateGradientMultiBlockCG is not supported on QNX - waiving sample") + return + + # This will pick the best possible CUDA capable device + devID = findCudaDevice() + deviceProp = checkCudaErrors(cudart.cudaGetDeviceProperties(devID)) + + if not deviceProp.managedMemory: + # This sample requires being run on a device that supports Unified Memory + print("Unified Memory not supported on this device") + return + + # This sample requires being run on a device that supports Cooperative Kernel + # Launch + if not deviceProp.cooperativeLaunch: + print(f"\nSelected GPU {devID:%d} does not support Cooperative Kernel Launch, Waiving the run") + return + + # Statistics about the GPU device + print( + f"> GPU device has {deviceProp.multiProcessorCount:%d} Multi-Processors, SM {deviceProp.major:%d}.{deviceProp.minor:%d} compute capabilities\n" + ) + + # Get kernel + kernelHelper = common.KernelHelper(conjugateGradientMultiBlockCG, devID) + _gpuConjugateGradient = kernelHelper.getFunction(b"gpuConjugateGradient") + + # Generate a random tridiagonal symmetric matrix in CSR format + N = 1048576 + nz = (N - 2) * 3 + 4 + + I = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.int32).itemsize * (N + 1), cudart.cudaMemAttachGlobal)) + J = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.int32).itemsize * nz, cudart.cudaMemAttachGlobal)) + val = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * nz, cudart.cudaMemAttachGlobal)) + I_local = (ctypes.c_int * (N + 1)).from_address(I) + J_local = (ctypes.c_int * nz).from_address(J) + val_local = (ctypes.c_float * nz).from_address(val) + + genTridiag(I_local, J_local, val_local, N, nz) + + x = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * N, cudart.cudaMemAttachGlobal)) + rhs = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * N, cudart.cudaMemAttachGlobal)) + dot_result = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float64).itemsize, cudart.cudaMemAttachGlobal)) + 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 + + # temp memory for CG + r = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * N, cudart.cudaMemAttachGlobal)) + p = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * N, cudart.cudaMemAttachGlobal)) + Ax = checkCudaErrors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * N, cudart.cudaMemAttachGlobal)) + r_local = (ctypes.c_float * N).from_address(r) + + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + start = checkCudaErrors(cudart.cudaEventCreate()) + stop = checkCudaErrors(cudart.cudaEventCreate()) + + for i in range(N): + r_local[i] = rhs_local[i] = 1.0 + x_local[i] = 0.0 + + kernelArgs_value = (I, J, val, x, Ax, p, r, dot_result, nz, N, tol) + kernelArgs_types = ( + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_int, + ctypes.c_int, + ctypes.c_float, + ) + kernelArgs = (kernelArgs_value, kernelArgs_types) + + sMemSize = np.dtype(np.float64).itemsize * ((THREADS_PER_BLOCK / 32) + 1) + numThreads = THREADS_PER_BLOCK + numBlocksPerSm = checkCudaErrors( + cuda.cuOccupancyMaxActiveBlocksPerMultiprocessor(_gpuConjugateGradient, numThreads, sMemSize) + ) + numSms = deviceProp.multiProcessorCount + dimGrid = cudart.dim3() + dimGrid.x = numSms * numBlocksPerSm + dimGrid.y = 1 + dimGrid.z = 1 + dimBlock = cudart.dim3() + dimBlock.x = THREADS_PER_BLOCK + dimBlock.y = 1 + dimBlock.z = 1 + + checkCudaErrors(cudart.cudaEventRecord(start, 0)) + checkCudaErrors( + cuda.cuLaunchCooperativeKernel( + _gpuConjugateGradient, + dimGrid.x, + dimGrid.y, + dimGrid.z, + dimBlock.x, + dimBlock.y, + dimBlock.z, + 0, + 0, + kernelArgs, + ) + ) + checkCudaErrors(cudart.cudaEventRecord(stop, 0)) + checkCudaErrors(cudart.cudaDeviceSynchronize()) + + time = checkCudaErrors(cudart.cudaEventElapsedTime(start, stop)) + print(f"GPU Final, residual = {math.sqrt(dot_result_local):e}, kernel execution time = {time:f} ms") + + err = 0.0 + for i 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]] + + diff = math.fabs(rsum - rhs_local[i]) + + if diff > err: + err = diff + + checkCudaErrors(cudart.cudaFree(I)) + checkCudaErrors(cudart.cudaFree(J)) + checkCudaErrors(cudart.cudaFree(val)) + checkCudaErrors(cudart.cudaFree(x)) + checkCudaErrors(cudart.cudaFree(rhs)) + checkCudaErrors(cudart.cudaFree(r)) + checkCudaErrors(cudart.cudaFree(p)) + checkCudaErrors(cudart.cudaFree(Ax)) + checkCudaErrors(cudart.cudaFree(dot_result)) + checkCudaErrors(cudart.cudaEventDestroy(start)) + checkCudaErrors(cudart.cudaEventDestroy(stop)) + + print(f"Test Summary: Error amount = {err:f}") + print("&&&& conjugateGradientMultiBlockCG %s\n" % ("PASSED" if math.sqrt(dot_result_local) < tol else "FAILED")) + + if math.sqrt(dot_result_local) >= tol: + sys.exit(-1) diff --git a/cuda_bindings_12/examples/common/common.py b/cuda_bindings_12/examples/common/common.py new file mode 100644 index 00000000000..2701ac18842 --- /dev/null +++ b/cuda_bindings_12/examples/common/common.py @@ -0,0 +1,65 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os + +import numpy as np +from common.helper_cuda import checkCudaErrors + +from cuda import cuda, cudart, nvrtc + + +class KernelHelper: + def __init__(self, code, devID): + prog = checkCudaErrors(nvrtc.nvrtcCreateProgram(str.encode(code), b"sourceCode.cu", 0, None, None)) + CUDA_HOME = os.getenv("CUDA_HOME") + if CUDA_HOME is None: + CUDA_HOME = os.getenv("CUDA_PATH") + if CUDA_HOME is None: + raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") + include_dirs = os.path.join(CUDA_HOME, "include") + + # Initialize CUDA + checkCudaErrors(cudart.cudaFree(0)) + + major = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, devID) + ) + minor = checkCudaErrors( + cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, devID) + ) + _, nvrtc_minor = checkCudaErrors(nvrtc.nvrtcVersion()) + use_cubin = nvrtc_minor >= 1 + prefix = "sm" if use_cubin else "compute" + arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii") + + try: + opts = [ + b"--fmad=true", + arch_arg, + f"--include-path={include_dirs}".encode(), + b"--std=c++11", + b"-default-device", + ] + checkCudaErrors(nvrtc.nvrtcCompileProgram(prog, len(opts), opts)) + except RuntimeError as err: + logSize = checkCudaErrors(nvrtc.nvrtcGetProgramLogSize(prog)) + log = b" " * logSize + checkCudaErrors(nvrtc.nvrtcGetProgramLog(prog, log)) + print(log.decode()) + print(err) + exit(-1) + + if use_cubin: + dataSize = checkCudaErrors(nvrtc.nvrtcGetCUBINSize(prog)) + data = b" " * dataSize + checkCudaErrors(nvrtc.nvrtcGetCUBIN(prog, data)) + else: + dataSize = checkCudaErrors(nvrtc.nvrtcGetPTXSize(prog)) + data = b" " * dataSize + checkCudaErrors(nvrtc.nvrtcGetPTX(prog, data)) + + self.module = checkCudaErrors(cuda.cuModuleLoadData(np.char.array(data))) + + def getFunction(self, name): + return checkCudaErrors(cuda.cuModuleGetFunction(self.module, name)) diff --git a/cuda_bindings_12/examples/common/helper_cuda.py b/cuda_bindings_12/examples/common/helper_cuda.py new file mode 100644 index 00000000000..3268e4e82e2 --- /dev/null +++ b/cuda_bindings_12/examples/common/helper_cuda.py @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from common.helper_string import checkCmdLineFlag, getCmdLineArgumentInt + +from cuda import cuda, cudart, nvrtc + + +def _cudaGetErrorEnum(error): + if isinstance(error, cuda.CUresult): + err, name = cuda.cuGetErrorName(error) + return name if err == cuda.CUresult.CUDA_SUCCESS else "" + elif isinstance(error, cudart.cudaError_t): + return cudart.cudaGetErrorName(error)[1] + elif isinstance(error, nvrtc.nvrtcResult): + return nvrtc.nvrtcGetErrorString(error)[1] + else: + raise RuntimeError(f"Unknown error type: {error}") + + +def checkCudaErrors(result): + if result[0].value: + raise RuntimeError(f"CUDA error code={result[0].value}({_cudaGetErrorEnum(result[0])})") + if len(result) == 1: + return None + elif len(result) == 2: + return result[1] + else: + return result[1:] + + +def findCudaDevice(): + devID = 0 + if checkCmdLineFlag("device="): + devID = getCmdLineArgumentInt("device=") + checkCudaErrors(cudart.cudaSetDevice(devID)) + return devID + + +def findCudaDeviceDRV(): + devID = 0 + if checkCmdLineFlag("device="): + devID = getCmdLineArgumentInt("device=") + checkCudaErrors(cuda.cuInit(0)) + cuDevice = checkCudaErrors(cuda.cuDeviceGet(devID)) + return cuDevice diff --git a/cuda_bindings_12/examples/common/helper_string.py b/cuda_bindings_12/examples/common/helper_string.py new file mode 100644 index 00000000000..5c48ffc964e --- /dev/null +++ b/cuda_bindings_12/examples/common/helper_string.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys + + +def checkCmdLineFlag(stringRef): + return any(stringRef == i and k < len(sys.argv) - 1 for i, k in enumerate(sys.argv)) + + +def getCmdLineArgumentInt(stringRef): + for i, k in enumerate(sys.argv): + if stringRef == i and k < len(sys.argv) - 1: + return sys.argv[k + 1] + return 0 diff --git a/cuda_bindings_12/examples/extra/isoFDModelling_test.py b/cuda_bindings_12/examples/extra/isoFDModelling_test.py new file mode 100644 index 00000000000..3c5d4ee6b3a --- /dev/null +++ b/cuda_bindings_12/examples/extra/isoFDModelling_test.py @@ -0,0 +1,790 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import time + +import numpy as np +from common import common +from common.helper_cuda import checkCudaErrors + +from cuda import cuda, cudart + +isoPropagator = """\ +extern "C" +__global__ void injectSource(float *__restrict__ in, float *__restrict__ src, int it) +{ + if (threadIdx.x == 0) + in[0] = src[it]; +} + +extern "C" +__global__ void createVelocity(float *__restrict__ vel, float vmult, int nz, int nx, int stride) +{ + int ix = blockIdx.x * blockDim.x + threadIdx.x; + int iy = blockIdx.y * blockDim.y + threadIdx.y; + + int idx_out = iy * nx + ix; + for (int iz = 0; iz < nz ; iz++) { + vel[idx_out] = 3.0f * 3.0f * vmult; + idx_out += stride; + } +} + +extern "C" +__global__ void createSource(float *__restrict__ x, float dt, float freq, int nt) +{ + int istart = (int) (60.0f/dt); // start max at 30 ms + float pi2 = 2.0f * 3.141592654f; + float agauss = 0.5f * freq; + + for ( int i=threadIdx.x; i < nt; ++ i) { + float arg = 1.0e-3 * fabsf(i - istart) * agauss; + x[i] = 1000.0f * expf(-2.0f * arg * arg) * cosf(pi2 * arg); + } +} + +extern "C" +__global__ void fwd_3D_orderX2k(float *g_curr_1, float *g_prev_1, float *g_vsq_1, + int nz, int dimx, int stride); + +#define radius 4 +#define diameter (2*radius+1) +#define BDIMX 32 +#define BDIMY 16 + +inline __device__ void advance(float2 *field, const int num_points) { + #pragma unroll + for (int i = 0; i < num_points; i++) + field[i] = field[i + 1]; +} + +__global__ void fwd_3D_orderX2k(float *g_curr_1, float *g_prev_1, float *g_vsq_1, + int nz, int nx, int stride) { + stride = stride / 2; + nx = nx / 2; + const float c_coeff[5] = {-3.0f * 2.847222222f, + 1.600000f, + -0.200000f, + 0.025396825f, + -0.001785f}; + + float2 *g_prev = (float2 *)g_prev_1; + float2 *g_curr = (float2 *)g_curr_1; + float2 *g_vsq = (float2 *)g_vsq_1; + __shared__ float s_data[BDIMY + 2 * radius][2 * BDIMX + 2 * (radius + (radius % 2))]; + + int ix = blockIdx.x * blockDim.x + threadIdx.x; + int iy = blockIdx.y * blockDim.y + threadIdx.y; + + int offset = -radius * stride; + + int idx_out = iy * nx + ix; + int idx_in = idx_out + offset; + + float2 local_input[diameter], tmp1, tmp2; + + int tx = 2 * threadIdx.x + radius + (radius % 2); + int ty = threadIdx.y + radius; + + #pragma unroll + for (int i = 1; i < diameter; i++) { + local_input[i] = g_curr[idx_in]; + idx_in += stride; + } + + for (int iz = 0; iz < nz ; iz++) { + advance(local_input, diameter - 1); + local_input[diameter - 1] = g_curr[idx_in]; + + // update the data slice in smem + s_data[ty][tx] = local_input[radius].x; + s_data[ty][tx + 1] = local_input[radius].y; + + // halo above/below + if (threadIdx.y < radius) { + tmp1 = (g_curr[idx_out - radius * nx]); + s_data[threadIdx.y][tx] = tmp1.x; + s_data[threadIdx.y][tx + 1] = tmp1.y; + } + + if (threadIdx.y >= radius && threadIdx.y < 2 * radius) { + tmp1 = (g_curr[idx_out + (BDIMY - radius) * nx]); + s_data[threadIdx.y + BDIMY][tx] = tmp1.x; + s_data[threadIdx.y + BDIMY][tx + 1] = tmp1.y; + } + + // halo left/right + if (threadIdx.x < (radius + 1) / 2) { + tmp1 = (g_curr[idx_out - (radius + 1) / 2]); + s_data[ty][tx - radius - (radius % 2)] = tmp1.x; + s_data[ty][tx - radius - (radius % 2) + 1] = tmp1.y; + + tmp2 = (g_curr[idx_out + BDIMX]); + s_data[ty][tx + 2 * BDIMX] = tmp2.x; + s_data[ty][tx + 2 * BDIMX + 1] = tmp2.y; + } + __syncthreads(); + + // compute the output values + float2 temp, div; + + temp.x = 2.f * local_input[radius].x - g_prev[idx_out].x; + temp.y = 2.f * local_input[radius].y - g_prev[idx_out].y; + + div.x = c_coeff[0] * local_input[radius].x; + div.y = c_coeff[0] * local_input[radius].y; + + #pragma unroll + for (int d = 1; d <= radius; d++) { + div.x += c_coeff[d] * (local_input[radius + d].x + local_input[radius - d].x + s_data[ty - d][tx] + + s_data[ty + d][tx] + s_data[ty][tx - d] + s_data[ty][tx + d]); + div.y += c_coeff[d] * (local_input[radius + d].y + local_input[radius - d].y + s_data[ty - d][tx + 1] + + s_data[ty + d][tx + 1] + s_data[ty][tx - d + 1] + s_data[ty][tx + d + 1]); + } + + g_prev[idx_out].x = temp.x + div.x * g_vsq[idx_out].x; + g_prev[idx_out].y = temp.y + div.y * g_vsq[idx_out].y; + + __syncthreads(); + + idx_out += stride; + idx_in += stride; + } +} +""" + +display_graph = False +verbose_prints = False + + +def align_nx(nx, blk, nops): + n_align = (int)((nx - 1) / blk) + 1 + n_align *= blk + n_align += 2 * nops + n_align = (int)((n_align - 1) / 64) + 1 + n_align *= 64 + return (int)(n_align) + + +def align_ny(ny, blk, nops): + n_align = (int)((ny - 1) / blk) + 1 + n_align *= blk + n_align += 2 * nops + return (int)(n_align) + + +# +# this class contains the input params +# +class params: + def __init__(self): + self.BDIMX = 32 # tiles x y for fd operators + self.BDIMY = 16 + self.FD_ORDER = 4 + self.lead = 64 - self.FD_ORDER + self.nx = align_nx(700, 2 * self.BDIMX, self.FD_ORDER) + self.ny = align_ny(600, self.BDIMY, self.FD_ORDER) + self.blkx = (int)((self.nx - 2 * self.FD_ORDER) / (2 * self.BDIMX)) + self.blky = (int)((self.ny - 2 * self.FD_ORDER) / self.BDIMY) + + self.nz = 200 + self.delta = 25.0 + self.dt = 0.3 * 1000.0 * self.delta / 4500.0 + self.tmax_propag = 1000.0 + self.nt = int(self.tmax_propag / self.dt) + self.freqMax = 3.5 * 1000.0 / (4.0 * self.delta) + print( + "dt= ", + self.dt, + " delta= ", + self.delta, + " nt= ", + self.nt, + " freq max= ", + self.freqMax, + ) + + +# +# this class contains all the kernels to be used bu propagator +# +class cudaKernels: + def __init__(self, cntx): + checkCudaErrors(cuda.cuInit(0)) + checkCudaErrors(cuda.cuCtxSetCurrent(cntx)) + dev = checkCudaErrors(cuda.cuCtxGetDevice()) + + self.kernelHelper = common.KernelHelper(isoPropagator, int(dev)) + + # kernel to create a source fnction with some max frequency + self.creatSource = self.kernelHelper.getFunction(b"createSource") + # create a velocity to try things: just a sphere on the middle 4500 m/s and 2500 m/s all around + self.createVelocity = self.kernelHelper.getFunction(b"createVelocity") + + # kernel to propagate the wavefield by 1 step in time + self.fdPropag = self.kernelHelper.getFunction(b"fwd_3D_orderX2k") + + # kernel to propagate the wavefield by 1 step in time + self.injectSource = self.kernelHelper.getFunction(b"injectSource") + + +# +# this class contains: propagator, source creation, velocity creation +# injection of data and domain exchange +# +class propagator: + def __init__(self, params, _dev): + print("init object for device ", _dev) + self.dev = _dev + + checkCudaErrors(cuda.cuInit(0)) + self.cuDevice = checkCudaErrors(cuda.cuDeviceGet(_dev)) + self.context = checkCudaErrors(cuda.cuCtxCreate(0, self.cuDevice)) + self.waveOut = 0 + self.waveIn = 0 + self.streamCenter = checkCudaErrors(cuda.cuStreamCreate(0)) + self.streamHalo = checkCudaErrors(cuda.cuStreamCreate(0)) + self.params = params + + def __del__(self): + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + checkCudaErrors(cuda.cuStreamDestroy(self.streamHalo)) + checkCudaErrors(cuda.cuStreamDestroy(self.streamCenter)) + if self.waveIn != 0: + checkCudaErrors(cuda.cuMemFree(self.waveIn)) + if self.waveOut != 0: + checkCudaErrors(cuda.cuMemFree(self.waveOut)) + checkCudaErrors(cuda.cuCtxDestroy(self.context)) + + # + # swap waveIn with waveOut + # + def swap(self): + if verbose_prints: + print("swap in out ", int(self.waveIn), " ", int(self.waveOut)) + i = int(self.waveIn) + j = int(self.waveOut) + a = i + i = j + j = a + self.waveIn = cuda.CUdeviceptr(i) + self.waveOut = cuda.CUdeviceptr(j) + + # + # allocate the device memory + # + def allocate(self): + nel = self.params.nx * self.params.ny * self.params.nz + n = np.array(nel, dtype=np.uint32) + + bufferSize = n * np.dtype(np.float32).itemsize + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + + self.velocity = checkCudaErrors(cuda.cuMemAlloc(bufferSize)) + checkCudaErrors(cuda.cuMemsetD32(self.velocity, 0, n)) + + nel += self.params.lead + n = np.array(nel, dtype=np.uint32) ## we need to align at the beginning of the tile + + bufferSize = n * np.dtype(np.float32).itemsize + self.waveIn = checkCudaErrors(cuda.cuMemAlloc(bufferSize)) + checkCudaErrors(cuda.cuMemsetD32(self.waveIn, 0, n)) + + self.waveOut = checkCudaErrors(cuda.cuMemAlloc(bufferSize)) + checkCudaErrors(cuda.cuMemsetD32(self.waveOut, 0, n)) + + n = np.array(self.params.nt, dtype=np.uint32) + bufferSize = n * np.dtype(np.float32).itemsize + self.source = checkCudaErrors(cuda.cuMemAlloc(bufferSize)) + checkCudaErrors(cuda.cuMemsetD32(self.source, 0, n)) + + # + # create source data + # + def createSource(self, kernel): + print("creating source on device ", self.dev) + + buf = np.array([int(self.source)], dtype=np.uint64) + nt = np.array(self.params.nt, dtype=np.uint32) + dt = np.array(self.params.dt, dtype=np.float32) + freq = np.array(self.params.freqMax, dtype=np.float32) + + args = [buf, dt, freq, nt] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.creatSource, + 1, + 1, + 1, # grid dim + 1024, + 1, + 1, # block dim + 0, + self.streamHalo, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + checkCudaErrors(cuda.cuStreamSynchronize(self.streamHalo)) + + # + # inject source function: ony on the domain 0 + # + def injectSource(self, kernel, iter): + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + + if self.dev != 0: + return + + wavein = np.array([int(self.waveIn)], dtype=np.uint64) + src = np.array([int(self.source)], dtype=np.uint64) + offset_sourceInject = ( + self.params.lead + + (int)(self.params.nz / 2) * self.params.nx * self.params.ny + + (int)(self.params.ny / 2) * self.params.nx + + (int)(self.params.nx / 2) + ) + offset_sourceInject *= np.dtype(np.float32).itemsize + + np_it = np.array(iter, dtype=np.uint32) + + args = [wavein + offset_sourceInject, src, np_it] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.injectSource, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + self.streamHalo, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + + # + # create velocity + # + def createVelocity(self, kernel): + print("running create velocity on device ", self.dev) + + offset_velocity = ( + self.params.FD_ORDER * self.params.nx * self.params.ny + + self.params.FD_ORDER * self.params.nx + + self.params.FD_ORDER + ) + offset_velocity *= np.dtype(np.float32).itemsize + + vel = np.array([int(self.velocity)], dtype=np.uint64) + dx_dt2 = (self.params.dt * self.params.dt) / (self.params.delta * self.params.delta) + + stride = self.params.nx * self.params.ny + np_dx_dt2 = np.array(dx_dt2, dtype=np.float32) + np_nz = np.array((self.params.nz - 2 * self.params.FD_ORDER), dtype=np.uint32) + np_nx = np.array(self.params.nx, dtype=np.uint32) + np_stride = np.array(stride, dtype=np.uint32) + + args = [vel + offset_velocity, np_dx_dt2, np_nz, np_nx, np_stride] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + + # do halo up + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.createVelocity, + self.params.blkx, + self.params.blky, + 1, # grid dim + 2 * self.params.BDIMX, + self.params.BDIMY, + 1, # block dim + 0, + self.streamHalo, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + checkCudaErrors(cuda.cuStreamSynchronize(self.streamHalo)) + + # + # execute the center part of propagation + # + def executeCenter(self, kernel): + if verbose_prints: + print("running center on device ", self.dev) + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + offset_velocity = ( + 2 * self.params.FD_ORDER * self.params.nx * self.params.ny + + self.params.FD_ORDER * self.params.nx + + self.params.FD_ORDER + ) + + offset_wave = self.params.lead + offset_velocity + + offset_wave *= np.dtype(np.float32).itemsize + offset_velocity *= np.dtype(np.float32).itemsize + + wavein = np.array([int(self.waveIn)], dtype=np.uint64) + waveout = np.array([int(self.waveOut)], dtype=np.uint64) + + vel = np.array([int(self.velocity)], dtype=np.uint64) + stride = self.params.nx * self.params.ny + np_nz = np.array(self.params.nz - 4 * self.params.FD_ORDER, dtype=np.uint32) + np_nx = np.array(self.params.nx, dtype=np.uint32) + np_stride = np.array(stride, dtype=np.uint32) + + args = [ + wavein + offset_wave, + waveout + offset_wave, + vel + offset_velocity, + np_nz, + np_nx, + np_stride, + ] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + + # do center propagation from 2 * fd_order to nz - 2 * fd_order + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.fdPropag, + self.params.blkx, + self.params.blky, + 1, # grid dim + self.params.BDIMX, + self.params.BDIMY, + 1, # block dim + 0, + self.streamCenter, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + + # + # execute the halo part of propagation + # + def executeHalo(self, kernel): + if verbose_prints: + print("running halos on device ", self.dev) + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + + offset_velocity = ( + self.params.FD_ORDER * self.params.nx * self.params.ny + + self.params.FD_ORDER * self.params.nx + + self.params.FD_ORDER + ) + + offset_wave = self.params.lead + offset_velocity + + offset_wave *= np.dtype(np.float32).itemsize + offset_velocity *= np.dtype(np.float32).itemsize + + wavein = np.array([int(self.waveIn)], dtype=np.uint64) + waveout = np.array([int(self.waveOut)], dtype=np.uint64) + + vel = np.array([int(self.velocity)], dtype=np.uint64) + stride = self.params.nx * self.params.ny + np_nz = np.array(self.params.FD_ORDER, dtype=np.uint32) + np_nx = np.array(self.params.nx, dtype=np.uint32) + np_stride = np.array(stride, dtype=np.uint32) + + args = [ + wavein + offset_wave, + waveout + offset_wave, + vel + offset_velocity, + np_nz, + np_nx, + np_stride, + ] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + + # do halo up + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.fdPropag, + self.params.blkx, + self.params.blky, + 1, # grid dim + self.params.BDIMX, + self.params.BDIMY, + 1, # block dim + 0, + self.streamHalo, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + + # do halo down + offset_velocity = ( + (self.params.nz - 2 * self.params.FD_ORDER) * self.params.nx * self.params.ny + + self.params.FD_ORDER * self.params.nx + + self.params.FD_ORDER + ) + offset_wave = self.params.lead + offset_velocity + + offset_wave *= np.dtype(np.float32).itemsize + offset_velocity *= np.dtype(np.float32).itemsize + + args = [ + wavein + offset_wave, + waveout + offset_wave, + vel + offset_velocity, + np_nz, + np_nx, + np_stride, + ] + args = np.array([arg.ctypes.data for arg in args], dtype=np.uint64) + checkCudaErrors( + cuda.cuLaunchKernel( + kernel.fdPropag, + self.params.blkx, + self.params.blky, + 1, # grid dim + self.params.BDIMX, + self.params.BDIMY, + 1, # block dim + 0, + self.streamHalo, # shared mem and stream + args.ctypes.data, + 0, + ) + ) # arguments + + # + # exchange the halos + # + def exchangeHalo(self, propag): + if verbose_prints: + print("exchange halos on device ", self.dev, "with dev ", propag.dev) + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + + # + # the following variables don't change + # + nstride = self.params.nx * self.params.ny + + devS = self.context + devD = propag.context + + n_exch = self.params.FD_ORDER * nstride + n_exch *= np.dtype(np.float32).itemsize + + if self.dev < propag.dev: + # exchange up + offsetS = self.params.lead + (self.params.nz - 2 * self.params.FD_ORDER) * nstride + offsetD = propag.params.lead + + offsetS *= np.dtype(np.float32).itemsize + offsetD *= np.dtype(np.float32).itemsize + + waveD = cuda.CUdeviceptr(int(propag.waveOut) + offsetD) + waveS = cuda.CUdeviceptr(int(self.waveOut) + offsetS) + + checkCudaErrors(cuda.cuMemcpyPeerAsync(waveD, devD, waveS, devS, n_exch, self.streamHalo)) + else: + # exchange down + offsetS = self.params.lead + self.params.FD_ORDER * nstride + offsetD = propag.params.lead + (propag.params.nz - propag.params.FD_ORDER) * nstride + + offsetS *= np.dtype(np.float32).itemsize + offsetD *= np.dtype(np.float32).itemsize + + waveD = cuda.CUdeviceptr(int(propag.waveOut) + offsetD) + waveS = cuda.CUdeviceptr(int(self.waveOut) + offsetS) + + checkCudaErrors(cuda.cuMemcpyPeerAsync(waveD, devD, waveS, devS, n_exch, self.streamHalo)) + + # + # sync stream + # + def syncStream(self, stream): + checkCudaErrors(cuda.cuCtxSetCurrent(self.context)) + checkCudaErrors(cuda.cuStreamSynchronize(stream)) + + +def main(): + checkCudaErrors(cuda.cuInit(0)) + + # Number of GPUs + print("Checking for multiple GPUs...") + gpu_n = checkCudaErrors(cuda.cuDeviceGetCount()) + 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 + + prop = [checkCudaErrors(cudart.cudaGetDeviceProperties(i)) for i in range(gpu_n)] + # Check possibility for peer access + print("\nChecking GPU(s) for support of peer to peer memory access...") + + p2pCapableGPUs = [-1, -1] + for i in range(gpu_n): + p2pCapableGPUs[0] = i + for j in range(gpu_n): + if i == j: + continue + i_access_j = checkCudaErrors(cudart.cudaDeviceCanAccessPeer(i, j)) + j_access_i = checkCudaErrors(cudart.cudaDeviceCanAccessPeer(j, i)) + print( + "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( + prop[i].name, i, prop[j].name, j, "Yes" if i_access_j else "No" + ) + ) + print( + "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( + prop[j].name, j, prop[i].name, i, "Yes" if i_access_j else "No" + ) + ) + if i_access_j and j_access_i: + p2pCapableGPUs[1] = j + break + if p2pCapableGPUs[1] != -1: + break + + if p2pCapableGPUs[0] == -1 or p2pCapableGPUs[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 + + # Use first pair of p2p capable GPUs detected + gpuid = [p2pCapableGPUs[0], p2pCapableGPUs[1]] + + # + # init device + # + pars = params() + + # + # create propagators + # + propags = [] + kerns = [] + + # + # create kernels and propagators that are going to be used on device + # + for i in gpuid: + p = propagator(pars, i) + k = cudaKernels(p.context) + propags.append(p) + kerns.append(k) + + # allocate resources in device + for propag, kern in zip(propags, kerns): + propag.allocate() + propag.createSource(kern) + propag.createVelocity(kern) + + # + # loop over time iterations + # + start = time.time() + for it in range(pars.nt): + for propag in propags: + propag.syncStream(propag.streamHalo) + + for propag, kern in zip(propags, kerns): + propag.injectSource(kern, it) + + for propag, kern in zip(propags, kerns): + propag.executeHalo(kern) + + for propag in propags: + propag.syncStream(propag.streamHalo) + + propags[1].exchangeHalo(propags[0]) + + propags[0].exchangeHalo(propags[1]) + + for propag, kern in zip(propags, kerns): + propag.executeCenter(kern) + + for propag in propags: + propag.syncStream(propag.streamCenter) + + for propag in propags: + propag.swap() + + end = time.time() + npoints = (pars.nz - 2 * pars.FD_ORDER) * (pars.blkx * 2 * pars.BDIMX) * (pars.blky * pars.BDIMY) + + nops = 1.0e-9 * pars.nt * npoints / (end - start) + + print("this code generates ", nops, " GPoints/sec / device ") + + # + # get the result out of gpu + # + nz = 2 * (int)(pars.nz - 2 * pars.FD_ORDER) + print(" nz= ", nz, " nx= ", pars.nx) + hOut = np.zeros((nz, pars.nx), dtype="float32") + + istart = 0 + for propag in propags: + checkCudaErrors(cuda.cuCtxSetCurrent(propag.context)) + offset = pars.lead + pars.FD_ORDER * pars.nx * pars.ny + (int)(pars.ny / 2) * pars.nx + + for j in range(pars.nz - 2 * pars.FD_ORDER): + ptr = cuda.CUdeviceptr(int(propag.waveOut) + offset * 4) + + checkCudaErrors( + cuda.cuMemcpyDtoH( + hOut[istart].ctypes.data, + ptr, + pars.nx * np.dtype(np.float32).itemsize, + ) + ) + offset += pars.nx * pars.ny + istart += 1 + + # + # delete kernels and propagatrs + # + for propag in propags: + del propag + + if display_graph: + nrows = nz + ncols = pars.nx + dbz = hOut + dbz = np.reshape(dbz, (nrows, ncols)) + + ## + ## those are to plot results + ## + import matplotlib.pyplot as plt + + fig, ax = plt.subplots() + title = "test fd kernels up to " + str(pars.tmax_propag) + " ms " + plt.title(title, fontsize=20) + im = ax.imshow( + dbz, + interpolation="bilinear", + cmap=plt.get_cmap("Greys"), + aspect="auto", + origin="upper", + extent=[1, pars.nx, nz, 1], + vmax=abs(dbz).max(), + vmin=-abs(dbz).max(), + ) + + fig.colorbar(im, ax=ax) + + plt.show() + + print("Done") + + +if __name__ == "__main__": + display_graph = True + verbose_prints = True + main() diff --git a/cuda_bindings_12/examples/extra/jit_program_test.py b/cuda_bindings_12/examples/extra/jit_program_test.py new file mode 100644 index 00000000000..f5f4a557666 --- /dev/null +++ b/cuda_bindings_12/examples/extra/jit_program_test.py @@ -0,0 +1,179 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes + +import numpy as np + +from cuda import cuda, nvrtc + + +def ASSERT_DRV(err): + if isinstance(err, cuda.CUresult): + if err != cuda.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"Cuda Error: {err}") + elif isinstance(err, nvrtc.nvrtcResult): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(f"Nvrtc Error: {err}") + else: + raise RuntimeError(f"Unknown error type: {err}") + + +saxpy = """\ +extern "C" __global__ +void saxpy(float a, float *x, float *y, float *out, size_t n) +{ + size_t tid = blockIdx.x * blockDim.x + threadIdx.x; + if (tid < n) { + out[tid] = a * x[tid] + y[tid]; + } +} +""" + + +def main(): + # Init + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + + # Device + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + + # Ctx + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + + # Create program + err, prog = nvrtc.nvrtcCreateProgram(str.encode(saxpy), b"saxpy.cu", 0, None, None) + ASSERT_DRV(err) + + # Get target architecture + err, major = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice + ) + ASSERT_DRV(err) + err, minor = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice + ) + ASSERT_DRV(err) + err, nvrtc_major, nvrtc_minor = nvrtc.nvrtcVersion() + ASSERT_DRV(err) + use_cubin = nvrtc_minor >= 1 + prefix = "sm" if use_cubin else "compute" + arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii") + + # Compile program + opts = [b"--fmad=false", arch_arg] + (err,) = nvrtc.nvrtcCompileProgram(prog, len(opts), opts) + ASSERT_DRV(err) + + # Get log from compilation + err, logSize = nvrtc.nvrtcGetProgramLogSize(prog) + ASSERT_DRV(err) + log = b" " * logSize + (err,) = nvrtc.nvrtcGetProgramLog(prog, log) + ASSERT_DRV(err) + print(log.decode()) + + # Get data from compilation + if use_cubin: + err, dataSize = nvrtc.nvrtcGetCUBINSize(prog) + ASSERT_DRV(err) + data = b" " * dataSize + (err,) = nvrtc.nvrtcGetCUBIN(prog, data) + ASSERT_DRV(err) + else: + err, dataSize = nvrtc.nvrtcGetPTXSize(prog) + ASSERT_DRV(err) + data = b" " * dataSize + (err,) = nvrtc.nvrtcGetPTX(prog, data) + ASSERT_DRV(err) + + # Load data as module data and retrieve function + data = np.char.array(data) + err, module = cuda.cuModuleLoadData(data) + ASSERT_DRV(err) + err, kernel = cuda.cuModuleGetFunction(module, b"saxpy") + ASSERT_DRV(err) + + # Test the kernel + NUM_THREADS = 128 + NUM_BLOCKS = 32 + + a = np.float32(2.0) + n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32) + bufferSize = n * a.itemsize + + err, dX = cuda.cuMemAlloc(bufferSize) + ASSERT_DRV(err) + err, dY = cuda.cuMemAlloc(bufferSize) + ASSERT_DRV(err) + err, dOut = cuda.cuMemAlloc(bufferSize) + ASSERT_DRV(err) + + hX = np.random.rand(n).astype(dtype=np.float32) + hY = np.random.rand(n).astype(dtype=np.float32) + hOut = np.zeros(n).astype(dtype=np.float32) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + (err,) = cuda.cuMemcpyHtoDAsync(dX, hX, bufferSize, stream) + ASSERT_DRV(err) + (err,) = cuda.cuMemcpyHtoDAsync(dY, hY, bufferSize, stream) + ASSERT_DRV(err) + + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + + # Assert values are different before running kernel + hZ = a * hX + hY + if np.allclose(hOut, hZ): + raise ValueError("Error inside tolerence for host-device vectors") + + arg_values = (a, dX, dY, dOut, n) + arg_types = (ctypes.c_float, None, None, None, ctypes.c_size_t) + (err,) = cuda.cuLaunchKernel( + kernel, + NUM_BLOCKS, + 1, + 1, # grid dim + NUM_THREADS, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + (arg_values, arg_types), + 0, + ) # arguments + ASSERT_DRV(err) + + (err,) = cuda.cuMemcpyDtoHAsync(hOut, dOut, bufferSize, stream) + ASSERT_DRV(err) + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + + # Assert values are same after running kernel + hZ = a * hX + hY + if not np.allclose(hOut, hZ): + raise ValueError("Error outside tolerence for host-device vectors") + + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + + (err,) = cuda.cuMemFree(dX) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(dY) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(dOut) + ASSERT_DRV(err) + + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings_12/examples/extra/numba_emm_plugin.py b/cuda_bindings_12/examples/extra/numba_emm_plugin.py new file mode 100644 index 00000000000..35b760b2656 --- /dev/null +++ b/cuda_bindings_12/examples/extra/numba_emm_plugin.py @@ -0,0 +1,162 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +"""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 import cuda +from numba.cuda import ( + GetIpcHandleMixin, + HostOnlyCUDAMemoryManager, + MemoryInfo, + MemoryPointer, +) + +from cuda import cuda 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_12/examples/pytest.ini b/cuda_bindings_12/examples/pytest.ini new file mode 100644 index 00000000000..ff4c88d066c --- /dev/null +++ b/cuda_bindings_12/examples/pytest.ini @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[pytest] +python_files = *_test.py +python_functions = main +pythonpath = . diff --git a/cuda_bindings_12/pixi.lock b/cuda_bindings_12/pixi.lock new file mode 100644 index 00000000000..88da31d8f73 --- /dev/null +++ b/cuda_bindings_12/pixi.lock @@ -0,0 +1,12946 @@ +version: 7 +platforms: +- name: linux-64 + virtual-packages: + - __unix=0=0 + - __linux=4.18 + - __glibc=2.28 + - __archspec=0=x86_64 +- name: linux-aarch64 + virtual-packages: + - __unix=0=0 + - __linux=4.18 + - __glibc=2.28 + - __archspec=0=aarch64 +- name: win-64 + virtual-packages: + - __win=10.0 + - __archspec=0=x86_64 +environments: + cu12: + channels: + - url: https://conda.anaconda.org/conda-forge/ + indexes: + - https://pypi.org/simple + 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/alsa-lib-1.2.16.1-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aom-3.14.1-pl5321h039972f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.46.1-default_hfdba357_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-he90730b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-16.1.0-h5a3cd76_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/linux-64/cuda-cudart-static-12.9.79-h5888daf_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/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/linux-64/cython-3.2.9-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 + - conda: https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-9.0.1-gpl_hc45e1dd_900.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.18.3-h4db4eae_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/freetype-2.14.3-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.16-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-16.1.0-hc6a0c74_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-16.1.0-hceef32b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gdk-pixbuf-2.44.8-h68053f1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/glslang-16.5.0-h718be3e_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gmp-6.3.0-hfd2156b_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.15-h54a6638_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-16.1.0-hc6a0c74_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-16.1.0-he33a5f8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-14.3.1-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/intel-gmmlib-22.10.0-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/intel-media-driver-26.1.6-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lame-4.0-h770b6ad_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.19.1-h0c24ade_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lerc-4.2.0-hdb68285_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/level-zero-1.29.0-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libabseil-20260526.0-cxx17_h7b12aa8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libass-0.17.5-h434b012_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-9_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.2.0-h39a168f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.2.0-ha411449_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.2.0-h018ffa1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.78-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-9_h0358290_openblas.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-hd45a770_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdovi-3.4.0-ha23c83e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.129-h7cc23a3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libflac-1.5.0-he200343_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype-2.14.3-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype6-2.14.3-h5e6c136_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-16.1.0-h69a702a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-16.1.0-h69a702a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-16.1.0-h79bb938_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgl-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglib-2.88.3-h45c3219_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglvnd-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglx-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-14.3.1-h23af247_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-devel-14.3.1-h23af247_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwloc-2.13.0-default_he001693_1000.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwy-1.4.0-h3a9caae_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.18-h0cb94f2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.2.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libjxl-0.12.0-heb2dce7_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-9_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-12.9.82-hecca717_2.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.34-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-batch-plugin-2026.3.0-h9f30d58_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-plugin-2026.3.0-h9f30d58_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-hetero-plugin-2026.3.0-hfeb6f35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-cpu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-gpu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-npu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-ir-frontend-2026.3.0-hfeb6f35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-onnx-frontend-2026.3.0-h6c33c14_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-paddle-frontend-2026.3.0-h6c33c14_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-pytorch-frontend-2026.3.0-h0542e35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-frontend-2026.3.0-h565fa1b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-lite-frontend-2026.3.0-h0542e35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopus-1.6.1-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpciaccess-0.19-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libplacebo-7.360.1-hc50b9dd_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.58-h922cc85_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-7.35.1-h2840a7c_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/librsvg-2.62.3-h4c96295_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-16.1.0-hf2715c6_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsndfile-1.2.2-hbc6d301_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-16.1.0-hdf11a46_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.2-h9d88235_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libunwind-1.8.3-h65a8314_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liburing-2.14-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libusb-1.0.29-h73b1eb8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libva-2.24.1-he1eb515_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvorbis-1.3.7-h54a6638_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvpl-2.16.0-h54a6638_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvpx-1.15.2-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvulkan-loader-1.4.357.0-h5279c79_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.6.0-hd42ef1d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-hb83e432_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxkbcommon-1.13.2-h51789e4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-16-2.15.3-hca6bf5a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.15.3-h49c6c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/mpg123-1.33.7-h8142553_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.5.2-py314h2b28147_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ocl-icd-2.3.4-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/opencl-headers-2025.06.13-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openh264-2.6.0-h65dd3cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pango-1.58.2-hda50119_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb03c661_1003.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pugixml-1.15-h3f63f65_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pulseaudio-client-17.0-h9a6aba3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.7-h399a421_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-63.0-h192683f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sdl2-2.32.56-h54a6638_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sdl3-3.4.14-hdeec2a5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/shaderc-2026.3-h1b60276_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.2-h03e3b7b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/spirv-tools-2026.3-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/svt-av1-4.2.0-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-2023.0.0-hab88423_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.26.0-h1964d1d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/x264-1!164.3095-h166bdaf_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/x265-3.5-h924138e_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/xkeyboard-config-2.48-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.2-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.6-h0d788c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.13-he1eb515_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.12-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxcursor-1.2.3-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.5-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.7-h7cc23a3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxfixes-6.0.2-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxi-1.8.3-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrandr-1.5.5-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.12-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxscrnsaver-1.2.4-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxtst-1.2.5-hb9d3cd8_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.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-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/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_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/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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/noarch/libgcc-devel_linux-64-16.1.0-h59071f9_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-16.1.0-h41cdd0d_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wayland-protocols-1.49-hd8ed1ab_0.conda + - conda_source: cuda-bindings[2ed80673] @ . + - conda_source: cuda-pathfinder[a267834f] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + 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/linux-aarch64/alsa-lib-1.2.16.1-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/aom-3.14.1-pl5321h8fffa31_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_impl_linux-aarch64-2.46.1-default_h5f4c503_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cairo-1.18.4-h0b6afd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/conda-gcc-specs-16.1.0-h4acae54_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-12.9.86-he9431aa_106.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-12.9.79-h16bee8c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py314hc6b4731_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 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ffmpeg-9.0.1-gpl_hcd1c4d7_900.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fontconfig-2.18.3-ha4b22b4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/freetype-2.14.3-h8af1aa0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fribidi-1.0.16-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc-16.1.0-hfdd745d_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_impl_linux-aarch64-16.1.0-h998876f_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gdk-pixbuf-2.44.8-hb26ce08_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/glslang-16.5.0-hfeb5c2c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gmp-6.3.0-h4d6b352_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/graphite2-1.3.15-h7ac5ae9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx-16.1.0-hfdd745d_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_impl_linux-aarch64-16.1.0-hd5c6868_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/harfbuzz-14.3.1-h8af1aa0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lame-4.0-h7ce06ba_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lcms2-2.19.1-h9d5b58d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lerc-4.2.0-h52b7260_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libabseil-20260526.0-cxx17_h6983b43_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libass-0.17.5-hac26362_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-9_haddc8a3_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlicommon-1.2.0-h384ecca_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlidec-1.2.0-h011f0d3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlienc-1.2.0-hb247b97_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.78-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-9_hd72aa62_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdeflate-1.25-hfa851ae_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdovi-3.4.0-hf71c8f5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdrm-2.4.129-h5bc82ec_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libegl-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libflac-1.5.0-he9c94f4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype-2.14.3-h8af1aa0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype6-2.14.3-h9cc7050_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-ng-16.1.0-he9431aa_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-16.1.0-he9431aa_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-16.1.0-h47adacf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgl-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglib-2.88.3-had1c41b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglvnd-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglx-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-14.3.1-h8f7ccb3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-devel-14.3.1-h8f7ccb3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwloc-2.13.0-default_ha95e27d_1000.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwy-1.4.0-h9b45113_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libiconv-1.18-h1ea5142_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjpeg-turbo-3.2.0-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjxl-0.12.0-h7a31cfc_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-9_h88aeb00_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-12.9.82-h8f3c8d4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-12.9.86-h8f3c8d4_2.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.34-pthreads_h9d3fd7e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-2026.3.0-h18f7da6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-arm-cpu-plugin-2026.3.0-h18f7da6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-batch-plugin-2026.3.0-ha92a2b9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-plugin-2026.3.0-ha92a2b9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-hetero-plugin-2026.3.0-h243f116_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-ir-frontend-2026.3.0-h243f116_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-onnx-frontend-2026.3.0-hfb90a0c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-paddle-frontend-2026.3.0-hfb90a0c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-pytorch-frontend-2026.3.0-ha85bb2c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-frontend-2026.3.0-hba97658_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-lite-frontend-2026.3.0-ha85bb2c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopus-1.6.1-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpciaccess-0.19-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libplacebo-7.360.1-ha018e38_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpng-1.6.58-hf9b7768_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libprotobuf-7.35.1-h30ec8a2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/librsvg-2.62.3-hf685517_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsanitizer-16.1.0-h2510bd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsndfile-1.2.2-h7354dbf_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-ng-16.1.0-hdbbeba8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libtiff-4.7.2-hdb009f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libunwind-1.8.3-h6470e1d_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liburing-2.14-hfefdfc9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libusb-1.0.29-h06eaf92_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvorbis-1.3.7-h7ac5ae9_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvpx-1.15.2-hfae3067_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvulkan-loader-1.4.357.0-h8b8848b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libwebp-base-1.6.0-ha2e29f5_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcb-1.17.0-h3f04742_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxkbcommon-1.13.2-he51e330_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-16-2.15.3-h79dcc73_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-2.15.3-h869d058_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/mpg123-1.33.7-h2b27223_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.5.2-py314he1698a1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openh264-2.6.0-h663e864_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pango-1.58.2-h8547ced_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pcre2-10.47-hf841c20_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pixman-0.46.4-h7ac5ae9_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pthread-stubs-0.4-he30d5cf_1003.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pugixml-1.15-h6ef32b0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pulseaudio-client-17.0-hcf98165_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.7-h6bfacdd_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-63.0-h1f0f388_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl2-2.32.56-h7ac5ae9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl3-3.4.14-had2c13b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/shaderc-2026.3-h9a39c52_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/snappy-1.2.2-he774c54_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/spirv-tools-2026.3-hfefdfc9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/svt-av1-4.2.0-hfae3067_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tbb-2023.0.0-h57272ed_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/wayland-1.26.0-hb3e8f30_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x264-1!164.3095-h4e544f5_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x265-3.5-hdd96247_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xkeyboard-config-2.48-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libice-1.1.2-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libsm-1.2.6-hf23e593_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libx11-1.8.13-h63a1b12_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxau-1.0.12-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxcursor-1.2.3-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxdmcp-1.1.5-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxext-1.3.7-h5bc82ec_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxfixes-6.0.2-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxi-1.8.3-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrandr-1.5.5-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrender-0.9.12-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxscrnsaver-1.2.4-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxtst-1.2.5-h57736b2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/arm-variant-1.2.0-sbsa.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.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-12.9.27-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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-aarch64-4.18.0-h05a177a_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-aarch64-16.1.0-hd673532_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-aarch64-16.1.0-h2445e1f_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-aarch64-2.28-h585391f_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda_source: cuda-bindings[eb5d0330] @ . + - conda_source: cuda-pathfinder[6ab29be5] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + win-64: + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.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_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/noarch/cuda-cudart-dev_win-64-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/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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/libgcc-devel_win-64-16.1.0-hecf7705_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_win-64-16.1.0-hc76ffd0_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/m2w64-sysroot_win-64-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-crt-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-headers-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-he206cdd_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-winpthreads-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/aom-3.14.1-pl5321h06fc181_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/binutils_impl_win-64-2.46.1-default_ha84baeb_102.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cairo-1.18.4-h477c42c_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/conda-gcc-specs-16.1.0-h851ee6d_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/win-64/cuda-cudart-static-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/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/win-64/cython-3.2.9-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/win-64/ffmpeg-9.0.1-gpl_h893bb9d_900.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/fontconfig-2.18.3-hd47e2ca_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/freetype-2.14.3-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/fribidi-1.0.16-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gcc-16.1.0-hb5e953d_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gcc_impl_win-64-16.1.0-h0942c35_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gdk-pixbuf-2.44.8-h1f5b9c4_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/glib-2.88.3-h89924da_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/glib-tools-2.88.3-hf027272_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/graphite2-1.3.15-h5112557_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gxx-16.1.0-hb5e953d_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gxx_impl_win-64-16.1.0-he3d2c83_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/harfbuzz-14.3.1-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/icu-78.3-h5112557_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/lame-4.0-h0c5f640_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/ld_impl_win-64-2.46.1-default_hfd38196_102.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/lerc-4.2.0-hd936e49_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-9_h8455456_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlicommon-1.2.0-hf02afa3_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlidec-1.2.0-h84f9c24_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlienc-1.2.0-he2a975b_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-9_h2a3cdd5_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libdeflate-1.25-h1a1d4e4_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype-2.14.3-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype6-2.14.3-hdbac1cb_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-16.1.0-h110b43a_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libglib-2.88.3-he810d59_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-16.1.0-h8ee18e1_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-14.3.1-h03b5201_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-devel-14.3.1-h03b5201_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwloc-2.13.0-default_h049141e_1000.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwy-1.4.0-h2419aca_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libintl-0.22.5-h5728263_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libintl-devel-0.22.5-h5728263_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libjpeg-turbo-3.2.0-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libjxl-0.12.0-h932607e_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-9_hf9ab0e9_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-12.9.82-hac47afa_2.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/libogg-1.3.5-h2466b09_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libopus-1.6.1-h6a83c73_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libpng-1.6.58-hdc8cecf_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/librsvg-2.62.3-h15cfe45_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libstdcxx-16.1.0-hae5796f_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libtiff-4.7.2-h8f73337_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libusb-1.0.29-h1839187_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libvorbis-1.3.7-h5112557_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libvulkan-loader-1.4.357.0-h477610d_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libwebp-base-1.6.0-h4d5522a_1.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.3-h3cfd58e_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.3-h8ef44ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.8-h4fa8253_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/m2-conda-epoch-20250515-0_x86_64.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2026.1.0-hac47afa_234.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mpg123-1.33.7-h365c5b5_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.5.2-py314h02f10f6_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openh264-2.6.0-h1eab103_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pango-1.58.2-h13911b6_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pcre2-10.47-hd2b5f0e_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pixman-0.46.4-h5112557_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.7-h53f6dd8_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sdl2-2.32.56-h5112557_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sdl3-3.4.14-h5112557_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/svt-av1-4.2.0-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2023.0.0-hd3d4ead_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.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/win-64/vc-14.5-ha367084_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.51.36247-h633cb9f_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/x264-1!164.3095-h8ffe710_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/win-64/x265-3.5-h2d74725_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/win-64/zlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda + - conda_source: cuda-bindings[eb437e7d] @ . + - conda_source: cuda-pathfinder[26c7b66e] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + default: + channels: + - url: https://conda.anaconda.org/conda-forge/ + indexes: + - https://pypi.org/simple + 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/alsa-lib-1.2.16.1-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/aom-3.14.1-pl5321h039972f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.46.1-default_hfdba357_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-he90730b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-16.1.0-h5a3cd76_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/linux-64/cuda-cudart-static-12.9.79-h5888daf_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/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/linux-64/cython-3.2.9-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 + - conda: https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-9.0.1-gpl_hc45e1dd_900.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.18.3-h4db4eae_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/freetype-2.14.3-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.16-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-16.1.0-hc6a0c74_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-16.1.0-hceef32b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gdk-pixbuf-2.44.8-h68053f1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/glslang-16.5.0-h718be3e_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gmp-6.3.0-hfd2156b_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.15-h54a6638_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-16.1.0-hc6a0c74_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-16.1.0-he33a5f8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-14.3.1-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/intel-gmmlib-22.10.0-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/intel-media-driver-26.1.6-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lame-4.0-h770b6ad_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.19.1-h0c24ade_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/lerc-4.2.0-hdb68285_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/level-zero-1.29.0-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libabseil-20260526.0-cxx17_h7b12aa8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libass-0.17.5-h434b012_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-9_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.2.0-h39a168f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.2.0-ha411449_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.2.0-h018ffa1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.78-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-9_h0358290_openblas.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-hd45a770_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdovi-3.4.0-ha23c83e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.129-h7cc23a3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libflac-1.5.0-he200343_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype-2.14.3-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype6-2.14.3-h5e6c136_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-16.1.0-h69a702a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-16.1.0-h69a702a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-16.1.0-h79bb938_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgl-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglib-2.88.3-h45c3219_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglvnd-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libglx-1.7.0-ha4b6fd6_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-14.3.1-h23af247_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-devel-14.3.1-h23af247_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwloc-2.13.0-default_he001693_1000.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwy-1.4.0-h3a9caae_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.18-h0cb94f2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.2.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libjxl-0.12.0-heb2dce7_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-9_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-12.9.82-hecca717_2.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.34-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-batch-plugin-2026.3.0-h9f30d58_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-plugin-2026.3.0-h9f30d58_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-hetero-plugin-2026.3.0-hfeb6f35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-cpu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-gpu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-npu-plugin-2026.3.0-hb2f3c86_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-ir-frontend-2026.3.0-hfeb6f35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-onnx-frontend-2026.3.0-h6c33c14_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-paddle-frontend-2026.3.0-h6c33c14_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-pytorch-frontend-2026.3.0-h0542e35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-frontend-2026.3.0-h565fa1b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-lite-frontend-2026.3.0-h0542e35_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopus-1.6.1-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpciaccess-0.19-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libplacebo-7.360.1-hc50b9dd_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.58-h922cc85_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-7.35.1-h2840a7c_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/librsvg-2.62.3-h4c96295_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-16.1.0-hf2715c6_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsndfile-1.2.2-hbc6d301_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-16.1.0-hdf11a46_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.2-h9d88235_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libunwind-1.8.3-h65a8314_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liburing-2.14-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libusb-1.0.29-h73b1eb8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libva-2.24.1-he1eb515_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvorbis-1.3.7-h54a6638_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvpl-2.16.0-h54a6638_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvpx-1.15.2-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libvulkan-loader-1.4.357.0-h5279c79_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.6.0-hd42ef1d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-hb83e432_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxkbcommon-1.13.2-h51789e4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-16-2.15.3-hca6bf5a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.15.3-h49c6c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/mpg123-1.33.7-h8142553_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.5.2-py314h2b28147_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ocl-icd-2.3.4-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/opencl-headers-2025.06.13-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openh264-2.6.0-h65dd3cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pango-1.58.2-hda50119_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb03c661_1003.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pugixml-1.15-h3f63f65_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pulseaudio-client-17.0-h9a6aba3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.7-h399a421_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-63.0-h192683f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sdl2-2.32.56-h54a6638_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sdl3-3.4.14-hdeec2a5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/shaderc-2026.3-h1b60276_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.2-h03e3b7b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/spirv-tools-2026.3-hb700be7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/svt-av1-4.2.0-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-2023.0.0-hab88423_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.26.0-h1964d1d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/x264-1!164.3095-h166bdaf_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/x265-3.5-h924138e_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-64/xkeyboard-config-2.48-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.2-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.6-h0d788c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.13-he1eb515_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.12-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxcursor-1.2.3-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.5-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.7-h7cc23a3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxfixes-6.0.2-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxi-1.8.3-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrandr-1.5.5-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.12-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxscrnsaver-1.2.4-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxtst-1.2.5-hb9d3cd8_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.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-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/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_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/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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/noarch/libgcc-devel_linux-64-16.1.0-h59071f9_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-16.1.0-h41cdd0d_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wayland-protocols-1.49-hd8ed1ab_0.conda + - conda_source: cuda-bindings[2ed80673] @ . + - conda_source: cuda-pathfinder[a267834f] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + 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/linux-aarch64/alsa-lib-1.2.16.1-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/aom-3.14.1-pl5321h8fffa31_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_impl_linux-aarch64-2.46.1-default_h5f4c503_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cairo-1.18.4-h0b6afd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/conda-gcc-specs-16.1.0-h4acae54_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-12.9.86-he9431aa_106.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-12.9.79-h16bee8c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py314hc6b4731_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 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ffmpeg-9.0.1-gpl_hcd1c4d7_900.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fontconfig-2.18.3-ha4b22b4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/freetype-2.14.3-h8af1aa0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fribidi-1.0.16-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc-16.1.0-hfdd745d_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_impl_linux-aarch64-16.1.0-h998876f_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gdk-pixbuf-2.44.8-hb26ce08_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/glslang-16.5.0-hfeb5c2c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gmp-6.3.0-h4d6b352_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/graphite2-1.3.15-h7ac5ae9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx-16.1.0-hfdd745d_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_impl_linux-aarch64-16.1.0-hd5c6868_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/harfbuzz-14.3.1-h8af1aa0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lame-4.0-h7ce06ba_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lcms2-2.19.1-h9d5b58d_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lerc-4.2.0-h52b7260_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libabseil-20260526.0-cxx17_h6983b43_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libass-0.17.5-hac26362_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-9_haddc8a3_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlicommon-1.2.0-h384ecca_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlidec-1.2.0-h011f0d3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlienc-1.2.0-hb247b97_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.78-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-9_hd72aa62_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdeflate-1.25-hfa851ae_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdovi-3.4.0-hf71c8f5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdrm-2.4.129-h5bc82ec_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libegl-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libflac-1.5.0-he9c94f4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype-2.14.3-h8af1aa0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype6-2.14.3-h9cc7050_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-ng-16.1.0-he9431aa_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-16.1.0-he9431aa_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-16.1.0-h47adacf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgl-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglib-2.88.3-had1c41b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglvnd-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglx-1.7.0-hd24410f_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-14.3.1-h8f7ccb3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-devel-14.3.1-h8f7ccb3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwloc-2.13.0-default_ha95e27d_1000.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwy-1.4.0-h9b45113_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libiconv-1.18-h1ea5142_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjpeg-turbo-3.2.0-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjxl-0.12.0-h7a31cfc_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-9_h88aeb00_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-12.9.82-h8f3c8d4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-12.9.86-h8f3c8d4_2.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.34-pthreads_h9d3fd7e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-2026.3.0-h18f7da6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-arm-cpu-plugin-2026.3.0-h18f7da6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-batch-plugin-2026.3.0-ha92a2b9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-plugin-2026.3.0-ha92a2b9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-hetero-plugin-2026.3.0-h243f116_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-ir-frontend-2026.3.0-h243f116_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-onnx-frontend-2026.3.0-hfb90a0c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-paddle-frontend-2026.3.0-hfb90a0c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-pytorch-frontend-2026.3.0-ha85bb2c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-frontend-2026.3.0-hba97658_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-lite-frontend-2026.3.0-ha85bb2c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopus-1.6.1-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpciaccess-0.19-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libplacebo-7.360.1-ha018e38_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpng-1.6.58-hf9b7768_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libprotobuf-7.35.1-h30ec8a2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/librsvg-2.62.3-hf685517_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsanitizer-16.1.0-h2510bd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsndfile-1.2.2-h7354dbf_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-ng-16.1.0-hdbbeba8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libtiff-4.7.2-hdb009f0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libunwind-1.8.3-h6470e1d_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liburing-2.14-hfefdfc9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libusb-1.0.29-h06eaf92_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvorbis-1.3.7-h7ac5ae9_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvpx-1.15.2-hfae3067_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvulkan-loader-1.4.357.0-h8b8848b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libwebp-base-1.6.0-ha2e29f5_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcb-1.17.0-h3f04742_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxkbcommon-1.13.2-he51e330_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-16-2.15.3-h79dcc73_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-2.15.3-h869d058_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/mpg123-1.33.7-h2b27223_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.5.2-py314he1698a1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openh264-2.6.0-h663e864_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pango-1.58.2-h8547ced_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pcre2-10.47-hf841c20_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pixman-0.46.4-h7ac5ae9_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pthread-stubs-0.4-he30d5cf_1003.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pugixml-1.15-h6ef32b0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pulseaudio-client-17.0-hcf98165_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.7-h6bfacdd_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-63.0-h1f0f388_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl2-2.32.56-h7ac5ae9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl3-3.4.14-had2c13b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/shaderc-2026.3-h9a39c52_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/snappy-1.2.2-he774c54_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/spirv-tools-2026.3-hfefdfc9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/svt-av1-4.2.0-hfae3067_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tbb-2023.0.0-h57272ed_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/wayland-1.26.0-hb3e8f30_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x264-1!164.3095-h4e544f5_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x265-3.5-hdd96247_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xkeyboard-config-2.48-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libice-1.1.2-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libsm-1.2.6-hf23e593_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libx11-1.8.13-h63a1b12_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxau-1.0.12-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxcursor-1.2.3-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxdmcp-1.1.5-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxext-1.3.7-h5bc82ec_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxfixes-6.0.2-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxi-1.8.3-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrandr-1.5.5-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrender-0.9.12-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxscrnsaver-1.2.4-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxtst-1.2.5-h57736b2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/arm-variant-1.2.0-sbsa.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.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-12.9.27-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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-aarch64-4.18.0-h05a177a_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-aarch64-16.1.0-hd673532_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-aarch64-16.1.0-h2445e1f_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-aarch64-2.28-h585391f_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda_source: cuda-bindings[eb5d0330] @ . + - conda_source: cuda-pathfinder[6ab29be5] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + win-64: + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.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_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/noarch/cuda-cudart-dev_win-64-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/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_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/libgcc-devel_win-64-16.1.0-hecf7705_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_win-64-16.1.0-hc76ffd0_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/m2w64-sysroot_win-64-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-crt-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-headers-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-he206cdd_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-winpthreads-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_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/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/aom-3.14.1-pl5321h06fc181_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/binutils_impl_win-64-2.46.1-default_ha84baeb_102.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cairo-1.18.4-h477c42c_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/conda-gcc-specs-16.1.0-h851ee6d_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/win-64/cuda-cudart-static-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/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/win-64/cython-3.2.9-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/win-64/ffmpeg-9.0.1-gpl_h893bb9d_900.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/fontconfig-2.18.3-hd47e2ca_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/freetype-2.14.3-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/fribidi-1.0.16-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gcc-16.1.0-hb5e953d_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gcc_impl_win-64-16.1.0-h0942c35_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gdk-pixbuf-2.44.8-h1f5b9c4_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/glib-2.88.3-h89924da_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/glib-tools-2.88.3-hf027272_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/graphite2-1.3.15-h5112557_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gxx-16.1.0-hb5e953d_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/gxx_impl_win-64-16.1.0-he3d2c83_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/harfbuzz-14.3.1-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/icu-78.3-h5112557_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/lame-4.0-h0c5f640_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/ld_impl_win-64-2.46.1-default_hfd38196_102.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/lerc-4.2.0-hd936e49_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-9_h8455456_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlicommon-1.2.0-hf02afa3_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlidec-1.2.0-h84f9c24_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlienc-1.2.0-he2a975b_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-9_h2a3cdd5_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libdeflate-1.25-h1a1d4e4_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype-2.14.3-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype6-2.14.3-hdbac1cb_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-16.1.0-h110b43a_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libglib-2.88.3-he810d59_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-16.1.0-h8ee18e1_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-14.3.1-h03b5201_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-devel-14.3.1-h03b5201_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwloc-2.13.0-default_h049141e_1000.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwy-1.4.0-h2419aca_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libintl-0.22.5-h5728263_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libintl-devel-0.22.5-h5728263_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libjpeg-turbo-3.2.0-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libjxl-0.12.0-h932607e_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-9_hf9ab0e9_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-12.9.82-hac47afa_2.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/libogg-1.3.5-h2466b09_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libopus-1.6.1-h6a83c73_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libpng-1.6.58-hdc8cecf_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/librsvg-2.62.3-h15cfe45_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libstdcxx-16.1.0-hae5796f_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libtiff-4.7.2-h8f73337_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libusb-1.0.29-h1839187_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libvorbis-1.3.7-h5112557_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libvulkan-loader-1.4.357.0-h477610d_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libwebp-base-1.6.0-h4d5522a_1.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.3-h3cfd58e_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.3-h8ef44ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.8-h4fa8253_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/m2-conda-epoch-20250515-0_x86_64.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2026.1.0-hac47afa_234.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mpg123-1.33.7-h365c5b5_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.5.2-py314h02f10f6_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openh264-2.6.0-h1eab103_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pango-1.58.2-h13911b6_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pcre2-10.47-hd2b5f0e_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pixman-0.46.4-h5112557_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.7-h53f6dd8_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sdl2-2.32.56-h5112557_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sdl3-3.4.14-h5112557_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/svt-av1-4.2.0-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2023.0.0-hd3d4ead_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.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/win-64/vc-14.5-ha367084_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.51.36247-h633cb9f_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/x264-1!164.3095-h8ffe710_2.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/win-64/x265-3.5-h2d74725_3.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/win-64/zlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda + - conda_source: cuda-bindings[eb437e7d] @ . + - conda_source: cuda-pathfinder[26c7b66e] @ ../cuda_pathfinder + - pypi: ../cuda_python_test_helpers + docs: + channels: + - url: https://conda.anaconda.org/conda-forge/ + indexes: + - https://pypi.org/simple + 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/backports.zstd-1.7.0-py312h3f22e6b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.2.0-py312he9c40d5_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-12.9.7-py312h6ec95bb_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-crt-tools-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/linux-64/cuda-cudart-static-12.9.79-h5888daf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvcc-impl-12.9.86-h85509e4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvcc-tools-12.9.86-he02047a_2.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-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/cython-3.2.9-py312h68e6be4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/debugpy-1.8.21-py312h8285ef7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/greenlet-3.5.5-py312h8285ef7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-h7cc23a3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-hbc21106_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-9_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.78-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-9_h0358290_openblas.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/libedit-3.1.20250104-pl5321h373387f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-16.1.0-h69a702a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-16.1.0-h79bb938_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-9_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb03c661_1.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-12.9.86-hecca717_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvptxcompiler-dev-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.34-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.22-h280c20c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.38-h280c20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb03c661_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/markupsafe-3.0.3-py312h8a5da7c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/msgpack-python-1.2.1-py312h0a2e395_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.5.2-py312h33ff503_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/psutil-7.2.2-py312h5253ce2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.13-h8ab3286_1_cpython.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_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-63.0-h192683f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rpds-py-2026.6.3-py312h192e038_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.18.0-py312h54fa4ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sqlalchemy-2.0.52-py312h5253ce2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.8-py312h4c3975b_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-h09e67af_11.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.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.2-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/noarch/beautifulsoup4-4.15.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.4-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.7.22-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.4.2-pyhc90fa1f_0.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_1.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/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_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/noarch/cuda-nvcc-dev_linux-64-12.9.86-he91c749_2.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/noarch/cuda-pathfinder-1.6.1-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.6.0-pyhd8ed1ab_0.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-pyhcf101f3_1.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.32.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/furo-2025.12.19-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.2.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.19-pyhcf101f3_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-9.0.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-7.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-7.1.0-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.3.0-pyha191276_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.16.1-pyh53cf698_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.20.0-pyhcf101f3_0.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.9.1-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/noarch/libnvptxcompiler-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.2.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.6.1-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/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.1.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.11.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.11.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio2-1.7.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.7-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.2.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.11.3-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.53-pyha770c72_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/pydata-sphinx-theme-0.19.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-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.1.1-pyhc364b38_2.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.22.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.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.34.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/roman-5.2-pyhcf101f3_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/noarch/setuptools-84.0.0-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.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.9.2-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-basic-ng-1.0.0b2-pyhd8ed1ab_3.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.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.3.0-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-2.0.0-pyhd8ed1ab_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/noarch/tinycss2-1.5.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.16.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.16.0-h69aa097_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.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-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.8.2-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.48.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-4.1.0-pyhcf101f3_0.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/linux-aarch64/backports.zstd-1.7.0-py312h22d1088_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/brotli-python-1.2.0-py312h41c1d46_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-bindings-12.9.7-py312hdebd348_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-crt-tools-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvcc-impl-12.9.86-h614329b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvcc-tools-12.9.86-h614329b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py312hbda70bc_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/debugpy-1.8.21-py312hf55c4e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/greenlet-3.5.5-py312hf55c4e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/keyutils-1.6.3-h5bc82ec_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/krb5-1.22.2-h095d8e5_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-9_haddc8a3_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.78-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-9_hd72aa62_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libedit-3.1.20250104-pl5321hc48eb74_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-16.1.0-he9431aa_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-16.1.0-h47adacf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-9_h88aeb00_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-he30d5cf_1.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-12.9.86-h8f3c8d4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvptxcompiler-dev-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.34-pthreads_h9d3fd7e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsodium-1.0.22-h80f16a2_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcrypt-4.4.38-h80f16a2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/make-4.4.1-he30d5cf_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/markupsafe-3.0.3-py312hd077ced_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/msgpack-python-1.2.1-py312h1683e8e_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.5.2-py312hce9e0af_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/psutil-7.2.2-py312hd41f8a7_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.12.13-ha505bbe_1_cpython.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_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-63.0-h1f0f388_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rpds-py-2026.6.3-py312h00f41f5_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.18.0-py312ha7f05e0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sqlalchemy-2.0.52-py312h2fc9c67_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tornado-6.5.8-py312hefbd42c_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-hec9560f_11.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.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.2-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/noarch/beautifulsoup4-4.15.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.4-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.7.22-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.4.2-pyhc90fa1f_0.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_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-12.9.27-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvcc-dev_linux-aarch64-12.9.86-h4310d6a_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.6.1-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.6.0-pyhd8ed1ab_0.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-pyhcf101f3_1.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.32.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/furo-2025.12.19-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.2.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.19-pyhcf101f3_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-9.0.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-7.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-7.1.0-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.3.0-pyha191276_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.16.1-pyh53cf698_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.20.0-pyhcf101f3_0.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.9.1-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/noarch/libnvptxcompiler-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.2.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.6.1-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/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.1.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.11.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.11.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio2-1.7.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.7-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.2.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.11.3-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.53-pyha770c72_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/pydata-sphinx-theme-0.19.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-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.1.1-pyhc364b38_2.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.22.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.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.34.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/roman-5.2-pyhcf101f3_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/noarch/setuptools-84.0.0-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.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.9.2-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-basic-ng-1.0.0b2-pyhd8ed1ab_3.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.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.3.0-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-2.0.0-pyhd8ed1ab_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/noarch/tinycss2-1.5.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.16.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.16.0-h69aa097_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.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-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.8.2-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.48.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-4.1.0-pyhcf101f3_0.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/noarch/_python_abi3_support-1.0-hd8ed1ab_3.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.2-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/noarch/beautifulsoup4-4.15.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.4-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.7.22-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.4.2-pyh6dadd2b_0.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_1.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/noarch/cuda-cudart-dev_win-64-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/noarch/cuda-nvcc-dev_win-64-12.9.86-h36c15f3_2.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/noarch/cuda-pathfinder-1.6.1-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.6.0-pyhd8ed1ab_0.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-pyhcf101f3_1.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.32.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/furo-2025.12.19-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.2.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.19-pyhcf101f3_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-9.0.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-7.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-7.1.0-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.3.0-pyh6dadd2b_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.16.1-pyhe2676ad_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.20.0-pyhcf101f3_0.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.9.1-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/noarch/libnvptxcompiler-dev_win-64-12.9.86-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.2.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.6.1-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/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.1.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.11.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.11.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio2-1.7.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.7-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.2.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.11.3-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.53-pyha770c72_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/pydata-sphinx-theme-0.19.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-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.1.1-pyhc364b38_2.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.22.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.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.34.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/roman-5.2-pyhcf101f3_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/noarch/setuptools-84.0.0-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.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.9.2-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-basic-ng-1.0.0b2-pyhd8ed1ab_3.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.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.3.0-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-2.0.0-pyhd8ed1ab_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/noarch/tinycss2-1.5.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.16.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.16.0-h69aa097_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.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-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.8.2-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.48.0-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/noarch/zipp-4.1.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/backports.zstd-1.7.0-py312h06d0912_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py312ha763cb9_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-bindings-12.9.7-py312ha085c13_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-crt-tools-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/win-64/cuda-cudart-static-12.9.79-he0c23c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvcc-impl-12.9.86-h53cbb54_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvcc-tools-12.9.86-he0c23c2_2.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-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/cython-3.2.9-py312hd245ac3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/debugpy-1.8.21-py312ha1a9051_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/greenlet-3.5.5-py312ha1a9051_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/krb5-1.22.2-h719d79b_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-9_h8455456_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-9_h2a3cdd5_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-16.1.0-h110b43a_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-16.1.0-h8ee18e1_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwloc-2.13.0-default_h049141e_1000.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-9_hf9ab0e9_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_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/libnvptxcompiler-dev-12.9.86-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsodium-1.0.22-h6a83c73_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.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.3-h692994f_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.3-hbc0d294_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.8-h4fa8253_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/make-4.4.1-hba3369d_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/markupsafe-3.0.3-py312h05f76fc_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2026.1.0-hac47afa_234.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/msgpack-python-1.2.1-py312h78d62e6_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.5.2-py312ha3f287d_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py312he5662c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.13-hb12b558_1_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pywin32-312-py312h829343e_0.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_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/rpds-py-2026.6.3-py312hd944d65_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.18.0-py312h9b3c559_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sqlalchemy-2.0.52-py312he5662c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2023.0.0-hd3d4ead_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tornado-6.5.8-py312he06e257_0.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/win-64/vc-14.5-ha367084_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.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-h3a581c9_11.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.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/_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 + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 28948 + timestamp: 1770939786096 +- conda: https://conda.anaconda.org/conda-forge/linux-64/alsa-lib-1.2.16.1-hb03c661_0.conda + sha256: cf93ca0f1f107e95a35969a4622684e08fcb8cf37f8cf4a1e9e424828386c921 + md5: 8904e09bda369377b3dd07e2ac828c5d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - alsa-lib >=1.2.16.1,<1.3.0a0 + size: 592377 + timestamp: 1781521980743 +- conda: https://conda.anaconda.org/conda-forge/linux-64/aom-3.14.1-pl5321h039972f_1.conda + sha256: b1d972a9b949a88babee681437535550b3ca5dbca6a23a40dffeb7900fec19fd + md5: 5a78a69eb3b50f24b379e9d2a93163ae + depends: + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - aom >=3.14.1,<3.15.0a0 + size: 3103347 + timestamp: 1780752473089 +- conda: https://conda.anaconda.org/conda-forge/linux-64/backports.zstd-1.7.0-py312h3f22e6b_0.conda + sha256: c10df0467f534472f0aa39013850d6dd9dd38ea5a6fb5c0812afb6f3fc768924 + md5: e7eb25765bdf21397cc6e30828871625 + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - 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 + run_exports: {} + size: 240967 + timestamp: 1786861419155 +- conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.46.1-default_hfdba357_102.conda + sha256: fb7bf36984a37ce7e4714d1d1da0bd0e3bfc679520f5cdc184afc676fd4b5da2 + md5: a0c5e0b7f58c8ceeb08e5bc41251d5a2 + depends: + - ld_impl_linux-64 2.46.1 default_hbd61a6d_102 + - sysroot_linux-64 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 3713752 + timestamp: 1784214522814 +- conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.46.1-default_h4852527_102.conda + sha256: 08d7238663fc408ba2ab60b02fa3d06a7ca9d872962e03e90c7e0fdecb7ed1d0 + md5: 32fd07abe84eb14f17c7f5cc6fa8df82 + depends: + - binutils_impl_linux-64 2.46.1 default_hfdba357_102 + license: GPL-3.0-only + license_family: GPL + run_exports: {} + size: 36337 + timestamp: 1784214551894 +- conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.2.0-py312he9c40d5_3.conda + sha256: 32ae6e002843704af9f39395f3116815fa66f2b27de1bd9044fb2a2d53fbe3d3 + md5: d176f3ed2824f930b524c45eb8f158bb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libstdcxx >=15 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - libbrotlicommon 1.2.0 h39a168f_3 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=compressed-mapping + run_exports: {} + size: 367032 + timestamp: 1786622975850 +- conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_10.conda + sha256: 1a0d382c515ebf55f8ee1f38c8b81bc95af5c2acc42ad53b66bc5df932032f96 + md5: e675fabcf81499adc7edf58124fb1e01 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: bzip2-1.0.6 + license_family: BSD + purls: [] + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + size: 257808 + timestamp: 1785906269155 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-he90730b_1.conda + sha256: 06525fa0c4e4f56e771a3b986d0fdf0f0fc5a3270830ee47e127a5105bde1b9a + md5: bb6c4808bfa69d6f7f6b07e5846ced37 + depends: + - __glibc >=2.17,<3.0.a0 + - fontconfig >=2.15.0,<3.0a0 + - fonts-conda-ecosystem + - icu >=78.1,<79.0a0 + - libexpat >=2.7.3,<3.0a0 + - libfreetype >=2.14.1 + - libfreetype6 >=2.14.1 + - libgcc >=14 + - libglib >=2.86.3,<3.0a0 + - libpng >=1.6.53,<1.7.0a0 + - libstdcxx >=14 + - libxcb >=1.17.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - pixman >=0.46.4,<1.0a0 + - xorg-libice >=1.1.2,<2.0a0 + - xorg-libsm >=1.2.6,<2.0a0 + - xorg-libx11 >=1.8.12,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxrender >=0.9.12,<0.10.0a0 + license: LGPL-2.1-only or MPL-1.1 + purls: [] + run_exports: + weak: + - cairo >=1.18.4,<2.0a0 + size: 989514 + timestamp: 1766415934926 +- conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-16.1.0-h5a3cd76_2.conda + sha256: 1e30eb3d63f41b052f6888edaad63c25183f90e8edb53c2855af5f582487fe13 + md5: 357356e180fda1269caa9823f847cbb8 + depends: + - gcc_impl_linux-64 >=16.1.0,<16.1.1.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 32391 + timestamp: 1787165557922 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-12.9.7-py312h6ec95bb_1.conda + sha256: db9d54a9205d424e670226187120f0e784c43a7a0c626eccb61289783933a1c2 + md5: 343c1eee3ba82710b12e1a90df90dc22 + depends: + - python + - cuda-pathfinder >=1.5.5,<2 + - cuda-version >=12,<13.0a0 + - cuda-nvrtc >=12,<13.0a0 + - cuda-nvcc-impl >=12,<13.0a0 + - libcufile >=1,<2.0a0 + - libnvjitlink >=12.3,<13 + - libgcc >=14 + - libstdcxx >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + constrains: + - cuda-cudart >=12,<13.0a0 + - libnvfatbin >=12,<13.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + run_exports: {} + size: 5123472 + timestamp: 1782354988736 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-crt-tools-12.9.86-ha770c72_2.conda + sha256: 2da9964591af14ba11b2379bed01d56e7185260ee0998d1a939add7fb752db45 + md5: 503a94e20d2690d534d676a764a1852c + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 29138 + timestamp: 1753975252445 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-12.9.79-h5888daf_0.conda + sha256: 57d1294ecfaf9dc8cdb5fc4be3e63ebc7614538bddb5de53cfd9b1b7de43aed5 + md5: cb15315d19b58bd9cd424084e58ad081 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart_linux-64 12.9.79 h3f2d84a_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23242 + timestamp: 1749218416505 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-12.9.79-h5888daf_0.conda + sha256: 04d8235cb3cb3510c0492c3515a9d1a6053b50ef39be42b60cafb05044b5f4c6 + md5: ba38a7c3b4c14625de45784b773f0c71 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart 12.9.79 h5888daf_0 + - cuda-cudart-dev_linux-64 12.9.79 h3f2d84a_0 + - cuda-cudart-static 12.9.79 h5888daf_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 23687 + timestamp: 1749218464010 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-12.9.79-h5888daf_0.conda + sha256: 6261e1d9af80e1ec308e3e5e2ff825d189ef922d24093beaf6efca12e67ce060 + md5: d3c4ac48f4967f09dd910d9c15d40c81 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart-static_linux-64 12.9.79 h3f2d84a_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23283 + timestamp: 1749218442382 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvcc-impl-12.9.86-h85509e4_2.conda + sha256: 961cf20d411b7685cd744e6c6ed35efea547d095c62151d6f3053d9931bb994d + md5: 67458d2685e7503933efa550f3ee40f3 + depends: + - cuda-cudart >=12.9.79,<13.0a0 + - cuda-cudart-dev + - cuda-nvcc-dev_linux-64 12.9.86 he91c749_2 + - cuda-nvcc-tools 12.9.86 he02047a_2 + - cuda-nvvm-impl 12.9.86 h4bc722e_2 + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev 12.9.86 ha770c72_2 + constrains: + - gcc_impl_linux-64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27215 + timestamp: 1753975546846 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvcc-tools-12.9.86-he02047a_2.conda + sha256: 0e849be7b5e4832ca218ec2c48a9ba3a15a984f629e2e54f38a53f4f57220341 + md5: dc256c9864c2e8e9c817fbca1c84a4bc + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-crt-tools 12.9.86 ha770c72_2 + - cuda-nvvm-tools 12.9.86 h4bc722e_2 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + - libstdcxx >=12 + constrains: + - gcc_impl_linux-64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27380012 + timestamp: 1753975454194 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-12.9.86-hecca717_1.conda + sha256: 68f81268c25befa9b70dc49af469ab0eb131960e3700b9a4edb46a32da343a28 + md5: 53f0062e2243b26e43ddac0b5267c6a3 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 67168282 + timestamp: 1760723629347 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-dev-12.9.86-hecca717_1.conda + sha256: ae620051c16eabf7720a47c5115634d64f7703d32124555ad0afccfd4b8d7cf4 + md5: 0d28090f4e63410e20397c7975612837 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc 12.9.86 hecca717_1 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - cuda-nvrtc-static >=12.9.86 + license: LicenseRef-NVIDIA-End-User-License-Agreement + run_exports: + weak: + - cuda-nvrtc >=12.9.86,<13.0a0 + size: 36819 + timestamp: 1760723845601 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-12.9.86-h69a702a_6.conda + sha256: 5c70d91e6d30eb6000ea036558a20fd0b1bc13cdd2c04fd5dbf94d9caa0a7fbc + md5: 704956f67e44ddf046565ead01f9efcd + depends: + - cuda-nvvm-dev_linux-64 12.9.86.* + - cuda-nvvm-impl 12.9.86.* + - cuda-nvvm-tools 12.9.86.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 25475 + timestamp: 1771619493286 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-12.9.86-h4bc722e_2.conda + sha256: f4d34556174e4faa9d374ba2244707082870e1bbc1bb441ad3d9d2cea37da6af + md5: 82125dd3c0c4aa009faa00e2829b93d8 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 21425520 + timestamp: 1753975283188 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-12.9.86-h4bc722e_2.conda + sha256: 45f5e881ed0d973132a5475a0b5c066db6e748ef3a831a14dba8374b252e0067 + md5: f9af26e4079adcd72688a8e8dbecb229 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 24246736 + timestamp: 1753975332907 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-12.9.79-h7938cbb_1.conda + sha256: 4f679dfbf2bf2d17abb507f31b0176c0e3572337b5005b9e36179948a53988ac + md5: 90d09865fb37d11d510444e34ebe6a09 + depends: + - cuda-cudart-dev + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23668 + timestamp: 1761098836058 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.9-py312h68e6be4_0.conda + sha256: 13e37a868e52933951b3f80fd5fe953742804499f2ee2b9a123e74070c265c0d + md5: 7311d3a6721eec7d76f4a84045f1ddfd + 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 + run_exports: {} + size: 3731635 + timestamp: 1785016112258 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.9-py314h1807b08_0.conda + sha256: 46b24c9a7de27f16a36942d74fd305064a408da959c6e885680cb072ca5bcaed + md5: 09bf9e0921002ec563b5e7c710caada2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cython?source=hash-mapping + run_exports: {} + size: 3818345 + timestamp: 1786935119541 +- conda: https://conda.anaconda.org/conda-forge/linux-64/dav1d-1.2.1-hd590300_0.conda + sha256: 22053a5842ca8ee1cf8e1a817138cdb5e647eb2c46979f84153f6ad7bde73020 + md5: 418c6ca5929a611cbd69204907a83995 + depends: + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - dav1d >=1.2.1,<1.2.2.0a0 + size: 760229 + timestamp: 1685695754230 +- conda: https://conda.anaconda.org/conda-forge/linux-64/dbus-1.16.2-h24cb091_1.conda + sha256: 8bb557af1b2b7983cf56292336a1a1853f26555d9c6cecf1e5b2b96838c9da87 + md5: ce96f2f470d39bd96ce03945af92e280 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - libzlib >=1.3.1,<2.0a0 + - libglib >=2.86.2,<3.0a0 + - libexpat >=2.7.3,<3.0a0 + license: AFL-2.1 OR GPL-2.0-or-later + purls: [] + run_exports: + weak: + - dbus >=1.16.2,<2.0a0 + size: 447649 + timestamp: 1764536047944 +- conda: https://conda.anaconda.org/conda-forge/linux-64/debugpy-1.8.21-py312h8285ef7_0.conda + sha256: b8dbe25820064a099f315bbb8f45f5bac3fddb63e96af3cbf0c93a830733ef34 + md5: e6778419a1851f6e15820558abddfa04 + 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/debugpy?source=hash-mapping + run_exports: {} + size: 2821960 + timestamp: 1780390159181 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-9.0.1-gpl_hc45e1dd_900.conda + sha256: 3848776a096b92665b6419ea5bd7867a3bd5e512bf8a328ef1264e4609dcae4d + md5: 21be8a374cbd1a1c75c75a9179b604e8 + depends: + - __glibc >=2.17,<3.0.a0 + - alsa-lib >=1.2.16.1,<1.3.0a0 + - aom >=3.14.1,<3.15.0a0 + - bzip2 >=1.0.8,<2.0a0 + - dav1d >=1.2.1,<1.2.2.0a0 + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + - gmp >=6.3.0,<7.0a0 + - lame >=4.0,<4.1.0a0 + - libass >=0.17.5,<0.17.6.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libharfbuzz >=14.3.0 + - libiconv >=1.18,<2.0a0 + - libjxl >=0.12.0,<0.13.0a0 + - liblzma >=5.8.3,<6.0a0 + - libopenvino >=2026.3.0,<2026.3.1.0a0 + - libopenvino-auto-batch-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-auto-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-hetero-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-intel-cpu-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-intel-gpu-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-intel-npu-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-ir-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-onnx-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-paddle-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-pytorch-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-tensorflow-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-tensorflow-lite-frontend >=2026.3.0,<2026.3.1.0a0 + - libopus >=1.6.1,<2.0a0 + - libplacebo >=7.360.1,<7.361.0a0 + - librsvg >=2.62.3,<3.0a0 + - libstdcxx >=15 + - libva >=2.24.1,<3.0a0 + - libvorbis >=1.3.7,<1.4.0a0 + - libvpl >=2.16.0,<2.17.0a0 + - libvpx >=1.15.2,<1.16.0a0 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - libwebp-base >=1.6.0,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - libxml2 + - libxml2-16 >=2.14.6 + - libzlib >=1.3.2,<2.0a0 + - openh264 >=2.6.0,<2.6.1.0a0 + - openssl >=3.5.7,<4.0a0 + - pulseaudio-client >=17.0,<17.1.0a0 + - sdl2 >=2.32.56,<3.0a0 + - svt-av1 >=4.2.0,<4.2.1.0a0 + - x264 >=1!164.3095,<1!165 + - x265 >=3.5,<3.6.0a0 + - xorg-libx11 >=1.8.13,<2.0a0 + constrains: + - __cuda >=12.8 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - ffmpeg >=9.0.1,<10.0a0 + size: 13764967 + timestamp: 1786704879493 +- conda: https://conda.anaconda.org/conda-forge/linux-64/fontconfig-2.18.3-h4db4eae_1.conda + sha256: 5a3eb10b18a97223ab06b3a7f0d7f56658db2f2800e2f2af95836fe3bf55ba63 + md5: 922776b528a470ab5afa81fd42abfa1d + depends: + - __glibc >=2.17,<3.0.a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libuuid >=2.42.2,<3.0a0 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + size: 296288 + timestamp: 1786667377340 +- conda: https://conda.anaconda.org/conda-forge/linux-64/freetype-2.14.3-ha770c72_2.conda + sha256: 612a8e0c1a6ecae23da54d81ef395f6ebb5c8e4468ec2611593ebce75876a4e0 + md5: 2d0ea23b23603e07ca47f23f949f67b6 + depends: + - libfreetype 2.14.3 ha770c72_2 + - libfreetype6 2.14.3 h5e6c136_2 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: + weak: + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + size: 175239 + timestamp: 1786641011029 +- conda: https://conda.anaconda.org/conda-forge/linux-64/fribidi-1.0.16-hb03c661_1.conda + sha256: 4846a3ca0402f3fe33ad84ed50ab213c6aafde4a0faef3c5002f6bf753e21671 + md5: 1cd10eda5692519d01bb20e086e214c9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - fribidi >=1.0.16,<2.0a0 + size: 61782 + timestamp: 1785912528684 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-16.1.0-hc6a0c74_2.conda + sha256: 28d90e9cdbcd419c8920b1aa5a5c0123692cfc0c66d1aba440bef723e08d234f + md5: 81548459a06e0742193e46908b2dfd7f + depends: + - conda-gcc-specs + - gcc_impl_linux-64 16.1.0 hceef32b_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 29266 + timestamp: 1787165672919 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-16.1.0-hceef32b_2.conda + sha256: 13de2dde37ff5271325fd00872a7c754b12d9e21f879093ed32b916ac4edba2a + md5: 3ab6cd4599e8ba71760ac99ec2791358 + depends: + - binutils_impl_linux-64 >=2.46.1 + - libgcc >=16.1.0 + - libgcc-devel_linux-64 16.1.0 h59071f9_102 + - libgomp >=16.1.0 + - libsanitizer 16.1.0 hf2715c6_2 + - libstdcxx >=16.1.0 + - libstdcxx-devel_linux-64 16.1.0 h41cdd0d_102 + - sysroot_linux-64 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 85033227 + timestamp: 1787165439877 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-16.1.0-h5fd2508_1.conda + sha256: c5dbb64ba518cad32636d4eba8ab93452468de5b35449e68a4596a232d9b1ce1 + md5: 1b100ff2d40abfb288564b4d541e5651 + depends: + - gcc_impl_linux-64 16.1.0.* + - binutils_linux-64 + - sysroot_linux-64 + license: BSD-3-Clause + license_family: BSD + run_exports: + strong: + - libgcc >=16 + size: 29776 + timestamp: 1787166205890 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gdk-pixbuf-2.44.8-h68053f1_0.conda + sha256: 4345423572cb80f13acbe52987a880576046a0b42c4e22e3a85e0198ee02aab0 + md5: 10dab6a745f32ceeac6c9e00d9979797 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libjpeg-turbo >=3.2.0,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libtiff >=4.7.2,<4.8.0a0 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - gdk-pixbuf >=2.44.8,<3.0a0 + size: 579757 + timestamp: 1786715266831 +- conda: https://conda.anaconda.org/conda-forge/linux-64/glslang-16.5.0-h718be3e_1.conda + sha256: b213106181aa7bb52e202ddaef411f106a2e9d641f1ee618fd7ce9e30b265f9b + md5: 3e8c7b2e4ddda1d61b8b3afa01be7d97 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - spirv-tools >=2026,<2027.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - glslang >=16,<17.0a0 + size: 1395808 + timestamp: 1785879900020 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gmp-6.3.0-hfd2156b_3.conda + sha256: f36c336efc874f346a53a9011f67e997f9faac505562cc18c13b6d399cfe61c7 + md5: 576e32739f323438bf69ab006c21be7b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: GPL-2.0-or-later OR LGPL-3.0-or-later + purls: [] + run_exports: + weak: + - gmp >=6.3.0,<7.0a0 + size: 493498 + timestamp: 1786629164954 +- conda: https://conda.anaconda.org/conda-forge/linux-64/graphite2-1.3.15-h54a6638_1.conda + sha256: 7fa3b6a9c081fa3e545573152a788d061a0a0ba57df7251cc0f4f75225fc93e7 + md5: f9fe2984587fa8235a6af6004760cd18 + depends: + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + license: LGPL-2.0-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - graphite2 >=1.3.15,<2.0a0 + size: 102835 + timestamp: 1786118485753 +- conda: https://conda.anaconda.org/conda-forge/linux-64/greenlet-3.5.5-py312h8285ef7_0.conda + sha256: dd501d5a23203ce6d770044270c46e132973c7f8aa515a6dd097a11bb2e5a800 + md5: ddf5a875fe09a244a1f64329272bdc32 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/greenlet?source=compressed-mapping + run_exports: {} + size: 275998 + timestamp: 1786384044080 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-16.1.0-hc6a0c74_2.conda + sha256: c892dfe5d8206dc4a28a6dbe6320de27c47aaf332dce425179e3f9c8583508d8 + md5: 39c0beea3d46e6d468d5d18cffd5ffb7 + depends: + - conda-gcc-specs + - gcc 16.1.0 hc6a0c74_2 + - gxx_impl_linux-64 16.1.0 he33a5f8_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 28729 + timestamp: 1787165769807 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-16.1.0-he33a5f8_2.conda + sha256: 23fcc35dadc706af11c55a0f49484ed0a4f65eeb893b19d1a3666cabc750832c + md5: e7c7ddb0a745833c1b9273612fabcdba + depends: + - gcc_impl_linux-64 16.1.0 hceef32b_2 + - libstdcxx-devel_linux-64 16.1.0 h41cdd0d_102 + - sysroot_linux-64 + - tzdata + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 17515260 + timestamp: 1787165632737 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-16.1.0-h63736ef_1.conda + sha256: 30cff74a8875ffd2affa658715bac10868918889c5e58c0696a5135ca7445d7e + md5: 074d51fab78a50c4568d0d3571fa4494 + depends: + - gxx_impl_linux-64 16.1.0.* + - gcc_linux-64 ==16.1.0 h5fd2508_1 + - binutils_linux-64 + - sysroot_linux-64 + license: BSD-3-Clause + license_family: BSD + run_exports: + strong: + - libstdcxx >=16 + - libgcc >=16 + size: 28164 + timestamp: 1787166205890 +- conda: https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-14.3.1-ha770c72_0.conda + sha256: d2b22411323270acf8199070fe3377d72f36830f467f09fb2f5bcd4dc3ef77dd + md5: 15971d7910faa28aa5b0b2560b9a3bab + depends: + - libharfbuzz-devel 14.3.1 h23af247_0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 11076 + timestamp: 1786970900409 +- conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + sha256: 9f07834f0c546ab14d885ce0366285f61f44e326c0edd1fc63b8294e113ae432 + md5: 72a381cbad04f24b1c2a43ef707f45b4 + depends: + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - icu >=78.3,<79.0a0 + size: 14459115 + timestamp: 1786545741408 +- conda: https://conda.anaconda.org/conda-forge/linux-64/intel-gmmlib-22.10.0-hb700be7_0.conda + sha256: bc231d69eb6663db0e09738fb916c5e5507147cf1ac60f364f964004e0b29bab + md5: 10909406c1b0e4b57f9f4f0eb0999af8 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - intel-gmmlib >=22.10.0,<23.0a0 + size: 1013714 + timestamp: 1774422680665 +- conda: https://conda.anaconda.org/conda-forge/linux-64/intel-media-driver-26.1.6-hecca717_0.conda + sha256: 7cbd7fda22db70c64af64c9173434a4ede58e4f220bda52a044e469aa94c65cb + md5: aaf7c3db8c7c4533deb5449d3ba1c51f + depends: + - __glibc >=2.17,<3.0.a0 + - intel-gmmlib >=22.10.0,<23.0a0 + - libgcc >=14 + - libstdcxx >=14 + - libva >=2.23.0,<3.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - intel-media-driver >=26.1.6,<26.2.0a0 + size: 8782375 + timestamp: 1776080148587 +- conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-h7cc23a3_1.conda + sha256: dd053c96dcb0dcfd59422aefea9d2fe937a190167f34fba7893ec1e10a7e8963 + md5: ba55d1b89fd7775e67de8291029b4059 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - keyutils >=1.6.3,<2.0a0 + size: 135295 + timestamp: 1786739238128 +- conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-hbc21106_2.conda + sha256: 2a5c38c85e63df84c4e69ee71439841ce570d259ae3060627bb9a49a938d66f4 + md5: 53318d715316929a574f83591308b1f8 + 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 >=15 + - libstdcxx >=15 + - openssl >=3.5.7,<4.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - krb5 >=1.22.2,<1.23.0a0 + size: 1394333 + timestamp: 1786762112514 +- conda: https://conda.anaconda.org/conda-forge/linux-64/lame-4.0-h770b6ad_1.conda + sha256: 560a8561c5cc1f3c05b1e91d93436eb14fe55beb29c27e02623b42960d64d91f + md5: 5aecb65b6ecfee6f878e6789a8a779de + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - mpg123 >=1.33.7,<1.34.0a0 + license: LGPL-2.0-only + license_family: LGPL + purls: [] + run_exports: + weak: + - lame >=4.0,<4.1.0a0 + size: 304210 + timestamp: 1786292506120 +- conda: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.19.1-h0c24ade_1.conda + sha256: 112b5b9462572d970f4abd2912f76a25ee7db158b1e7260163d91dd8a630db84 + md5: 8b3ce45e929cd8e8e5f4d18586b56d8b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libjpeg-turbo >=3.1.4.1,<4.0a0 + - libtiff >=4.7.1,<4.8.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - lcms2 >=2.19.1,<3.0a0 + size: 251971 + timestamp: 1780211695895 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + sha256: 27d83f1188cd19bcb7754a078b3fa7f4cfb8527f8eb2fde54dd01fc529d1adec + md5: 449500f2c089da11c40f5c21312e3e07 + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-64 2.46.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 745303 + timestamp: 1784214507189 +- conda: https://conda.anaconda.org/conda-forge/linux-64/lerc-4.2.0-hdb68285_0.conda + sha256: bf9fdebf55d8bc99d83531cdffda00703f4dc5f93a1a956768c147362c72feda + md5: fb9d356b1a57d6d54768be7ebd5fce09 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - lerc >=4.2.0,<5.0a0 + size: 271158 + timestamp: 1785036167977 +- conda: https://conda.anaconda.org/conda-forge/linux-64/level-zero-1.29.0-hb700be7_0.conda + sha256: d87cfc5eaa08eefff97d891ecb49faa958fcfc32a425767796269c4100d4e516 + md5: f3c3bc77c96af553f761af0e78bc8d9d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 875773 + timestamp: 1780142086148 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libabseil-20260526.0-cxx17_h7b12aa8_1.conda + sha256: 32933de2d4fa6e6ffd949052815b49cb65a0649ad70007155c533ab97ea8cefd + md5: c4393db381bffa0a83a8d9e47b238106 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - abseil-cpp =20260526.0 + - libabseil-static =20260526.0=cxx17* + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - libabseil >=20260526.0,<20260527.0a0 + - libabseil =*=cxx17* + size: 1437712 + timestamp: 1780524559298 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libass-0.17.5-h434b012_0.conda + sha256: 24d4b59a0267e1c159c3af82df106b42faeefccceba3c489044c93abf113c503 + md5: c1cb4d6e8a6e3f724740dee5346fc8b4 + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libzlib >=1.3.2,<2.0a0 + - fribidi >=1.0.16,<2.0a0 + - fontconfig >=2.18.1,<3.0a0 + - fonts-conda-ecosystem + - libiconv >=1.18,<2.0a0 + - harfbuzz >=14.2.1 + license: ISC + purls: [] + run_exports: + weak: + - libass >=0.17.5,<0.17.6.0a0 + size: 154964 + timestamp: 1782298715788 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-9_h4a7cf45_openblas.conda + build_number: 9 + sha256: 39c7b3c5427b435c9c059ede9da61d46d42574e5b846ad37fdc3af4a5eab1e48 + md5: f5c4b041925dea221dc4bad2e50569d9 + depends: + - libopenblas >=0.3.34,<0.3.35.0a0 + - libopenblas >=0.3.34,<1.0a0 + constrains: + - blas 2.309 openblas + - libcblas 3.11.0 9*_openblas + - liblapack 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + - mkl <2027 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libblas >=3.11.0,<4.0a0 + size: 18033 + timestamp: 1786059035239 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.2.0-h39a168f_3.conda + sha256: e5864f257f839ffc27d681659bac95901f524f602b9121e5dcc5e2df18437f2d + md5: 7a2499a177753582fb7ae7e9dc4a908a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlicommon >=1.2.0,<1.3.0a0 + size: 80265 + timestamp: 1786622773969 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlidec-1.2.0-ha411449_3.conda + sha256: dad31b6d104973deb89710929a35651033aad692d4e7793cdb5b786a9bd54678 + md5: 6ab3315dc56618d652c1da42a648a129 + depends: + - __glibc >=2.17,<3.0.a0 + - libbrotlicommon 1.2.0 h39a168f_3 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlidec >=1.2.0,<1.3.0a0 + size: 34828 + timestamp: 1786622783405 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlienc-1.2.0-h018ffa1_3.conda + sha256: d37124d0f51816e7d5e3a94bfc9ed3d6174d077f9b4f832d20c5a08b52bebf1f + md5: 2ac965638d4c6b2b38383bb1aebaf543 + depends: + - __glibc >=2.17,<3.0.a0 + - libbrotlicommon 1.2.0 h39a168f_3 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlienc >=1.2.0,<1.3.0a0 + size: 298639 + timestamp: 1786622792145 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.78-h084b8d7_1.conda + sha256: 8cb25174d6b6fac95d31e86cfe41faffc8ee9dacbf2bfd22e6c23377e8f338c1 + md5: 5db514adf5f843126ff846d1510f22a4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libcap >=2.78,<2.79.0a0 + size: 124306 + timestamp: 1786025967663 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-9_h0358290_openblas.conda + build_number: 9 + sha256: 4c532a70ea9aeff2fa1aabaa4828ebc00c2ed12b22aa8ba19da5302b882fc82b + md5: 092c5649f3727af436ab0f67f48c3811 + depends: + - libblas 3.11.0 9_h4a7cf45_openblas + constrains: + - blas 2.309 openblas + - liblapack 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libcblas >=3.11.0,<4.0a0 + size: 17998 + timestamp: 1786059041397 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.14.1.1-hbc026e6_1.conda + sha256: 5fa43e8a8d335fc0c3a6aeb2e7b0debc7d8495b8a60a56ac30f23b0e852ab74a + md5: cab1818eada3952ed09c8dcbb7c26af7 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=59.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 969845 + timestamp: 1761098818759 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-dev-1.14.1.1-hecca717_1.conda + sha256: 3a7c726419017319df149ff67ea3efae37d668ecfc1aa2ac3273b21c4c76d68b + md5: 74a93e4c8fd24d535abc546c6fee2155 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12.9,<12.10.0a0 + - libcufile 1.14.1.1 hbc026e6_1 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - libcufile-static >=1.14.1.1 + license: LicenseRef-NVIDIA-End-User-License-Agreement + run_exports: + weak: + - libcufile >=1.14.1.1,<2.0a0 + size: 36377 + timestamp: 1761098841141 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.25-hd45a770_1.conda + sha256: 82e134c8a08b1eed9a2ed8ab578b89aa1730dcde3dea8dd87645ed0637878e54 + md5: 40f9b31aa9cf007789867df0decd0492 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdeflate >=1.25,<1.26.0a0 + size: 73710 + timestamp: 1785908694612 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libdovi-3.4.0-ha23c83e_0.conda + sha256: cea351b57c30d70e288b53ea69a1dcf6b750992f5d7717a7fc364072fa1209e7 + md5: 4377d220f09344452b227d699cacce4f + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdovi >=3.4.0,<4.0a0 + size: 404998 + timestamp: 1784281566921 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.129-h7cc23a3_0.conda + sha256: ea46b0ca0fa16af1f8b329b740e6cd8b4577c5378fa8717b28a885f70668633d + md5: 64cc91512b6278c315349dc13c53f680 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libpciaccess >=0.19,<0.20.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdrm >=2.4.129,<2.5.0a0 + size: 313461 + timestamp: 1786684701973 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h373387f_1.conda + sha256: 6473eb8caf2aae830f37caa93db9b26dddf7ac84b63229e8bf7fc0e5c3ab95b0 + md5: 50708d3b951d0f8e2d7f2df5b5edc040 + depends: + - ncurses + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - ncurses >=6.6,<7.0a0 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libedit >=3.1.20250104,<3.2.0a0 + size: 135098 + timestamp: 1786616658086 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_3.conda + sha256: 9a25ea93e8272785405a21d30f84e620befb1d545f6dfaae18f06103b5df0443 + md5: 75e9f795be506c96dd43cb09c7c8d557 + depends: + - __glibc >=2.17,<3.0.a0 + - libglvnd 1.7.0 ha4b6fd6_3 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 46500 + timestamp: 1779728188901 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + sha256: 16feffd9ddbbe5b718515d38ee376c685ba95491cd901244e24671d20b952a77 + md5: b24d3c612f71e7aa74158d92106318b2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - expat 2.8.1.* + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 77856 + timestamp: 1781203599810 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + sha256: ac38603008bf1e99b8ed379b1a656a67a70e2841f2b6a069c630cdf6316012d2 + md5: 0abe40a9880086ca4d2e5daf09dceff9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libffi >=3.7.0,<3.8.0a0 + size: 67576 + timestamp: 1783520858222 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libflac-1.5.0-he200343_1.conda + sha256: e755e234236bdda3d265ae82e5b0581d259a9279e3e5b31d745dc43251ad64fb + md5: 47595b9d53054907a00d95e4d47af1d6 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - libogg >=1.3.5,<1.4.0a0 + - libstdcxx >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libflac >=1.5.0,<1.6.0a0 + size: 424563 + timestamp: 1764526740626 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype-2.14.3-ha770c72_2.conda + sha256: fb12ecb46c30d18d928c0e8fc346ab13b5f6fc8a9cacae4f2f4bb188782586f5 + md5: f8054e759d0ddddaf34a5c8fedc900a1 + depends: + - libfreetype6 >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 8407 + timestamp: 1786641007099 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libfreetype6-2.14.3-h5e6c136_2.conda + sha256: ec607dd5445dd17ff6bf8b7fe6832e5504c226dd91d3aaea7ba83569808b0ce4 + md5: b72a266a9317036fd0464cb98b027cd0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - freetype >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 387671 + timestamp: 1786641006460 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + sha256: 4b733b68027a638fd24a38aaed1ebb05e055bef694970fab745b1c7678ca16f1 + md5: b230041fd4acdd1127ef5870174310ef + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + constrains: + - libgcc-ng ==16.1.0=*_2 + - libgomp 16.1.0 he0feb66_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 1056637 + timestamp: 1787165351282 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-16.1.0-h69a702a_2.conda + sha256: 23bfa3ade2de6e0b9af4a04cacd0d4d526c80a16686f264498475339f01d17d3 + md5: be5ca38a4a2ddfda85ad7aae7d67238a + depends: + - libgcc 16.1.0 ha9f2e26_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - libgcc + size: 28293 + timestamp: 1787165356218 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-16.1.0-h69a702a_2.conda + sha256: f608de89b2579d0e3ffa748476ad50e26ef3f9adf9ebbb619db679663cbf88ac + md5: 85c8f13b26afe335c9df928995f56683 + depends: + - libgfortran5 16.1.0 h79bb938_2 + constrains: + - libgfortran-ng ==16.1.0=*_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 28257 + timestamp: 1787165383846 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-16.1.0-h79bb938_2.conda + sha256: 627b865f5ba4da4d5508e90453d9419f28ed8a72f8577086681b589cf9579fab + md5: 60fe1556f159aad832acef6bf8a5102d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=16.1.0 + constrains: + - libgfortran 16.1.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 2538899 + timestamp: 1787165364214 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgl-1.7.0-ha4b6fd6_3.conda + sha256: ec353b3076ed8e357ed961d0e9ff6997491cade0e603de5bd18a2e301ac78ebd + md5: f25206d7322c0e9648e8b83694d143ab + depends: + - __glibc >=2.17,<3.0.a0 + - libglvnd 1.7.0 ha4b6fd6_3 + - libglx 1.7.0 ha4b6fd6_3 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 133469 + timestamp: 1779728207669 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libglib-2.88.3-h45c3219_1.conda + sha256: 4499458124bcf0bd45e8bd17576f9f007cb1373cb3b01659105443f522bab45c + md5: 533cb021c1bfeba9f720e669cd863fdf + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - pcre2 >=10.47,<10.48.0a0 + - libzlib >=1.3.2,<2.0a0 + - libiconv >=1.18,<2.0a0 + - libffi >=3.7.0,<3.8.0a0 + constrains: + - glib >2.66 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libglib >=2.88.3,<3.0a0 + size: 4755172 + timestamp: 1786457663614 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libglvnd-1.7.0-ha4b6fd6_3.conda + sha256: e019ebe4e3f5cdf23e2f5e58ddf7ade27988c53820115b17b98f218ebcc87748 + md5: eb83f3f8cecc3e9bff9e250817fc69b6 + depends: + - __glibc >=2.17,<3.0.a0 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 133586 + timestamp: 1779728183422 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libglx-1.7.0-ha4b6fd6_3.conda + sha256: 2f74713c9ca408ea84e88a30a9028153e7b553e8bb42e06139eac9a753c27da9 + md5: ec3c4350aa0261bf7f87b8ca15c8e80e + depends: + - __glibc >=2.17,<3.0.a0 + - libglvnd 1.7.0 ha4b6fd6_3 + - xorg-libx11 >=1.8.13,<2.0a0 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 76586 + timestamp: 1779728199059 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + sha256: 7d4d1891d5fe5d75a73dd7268e8f2d7c11b7b637dea901a429f8056511960267 + md5: 583bc8fce86ce542fa9a25c5b4d71e80 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 640468 + timestamp: 1787165281830 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-14.3.1-h23af247_0.conda + sha256: a4eac5a21b84e0fc753b72de01781f634fc9ab70fd32a28d6a40a19700c9188a + md5: 29709e61096dd490fff9e833e4c869f6 + depends: + - __glibc >=2.17,<3.0.a0 + - cairo >=1.18.4,<2.0a0 + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libstdcxx >=15 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 1353639 + timestamp: 1786970872936 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libharfbuzz-devel-14.3.1-h23af247_0.conda + sha256: 9d9d620141102dcb580d8f42d1a6c9e7e691a8dfa0284783e712679723067d15 + md5: e0f17ce01589ffa7d773be573e97b36c + depends: + - __glibc >=2.17,<3.0.a0 + - cairo >=1.18.4,<2.0a0 + - freetype + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz 14.3.1 h23af247_0 + - libpng >=1.6.58,<1.7.0a0 + - libstdcxx >=15 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 2114382 + timestamp: 1786970892473 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libhwloc-2.13.0-default_he001693_1000.conda + sha256: 5041d295813dfb84652557839825880aae296222ab725972285c5abe3b6e4288 + md5: c197985b58bc813d26b42881f0021c82 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - libxml2 + - libxml2-16 >=2.14.6 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libhwloc >=2.13.0,<2.13.1.0a0 + size: 2436378 + timestamp: 1770953868164 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libhwy-1.4.0-h3a9caae_0.conda + sha256: 02ab5e50c3921e88ad4dd0bc8f3fe282d2d7d03a20203d3281954b94641deb3d + md5: 9544a7225c8366ea2c397aad5fb53470 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: Apache-2.0 OR BSD-3-Clause + purls: [] + run_exports: + weak: + - libhwy >=1.4.0,<1.5.0a0 + size: 1431901 + timestamp: 1784325535334 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.18-h0cb94f2_3.conda + sha256: f943117edb9cd4d9c61cc972eee5a34291dc55ea7a6e9e38da104995841cbcb6 + md5: f92233bf33e24a25668bb2119e2c51f9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + license: LGPL-2.1-only + purls: [] + run_exports: + weak: + - libiconv >=1.18,<2.0a0 + size: 789471 + timestamp: 1787033836207 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libjpeg-turbo-3.2.0-hb03c661_1.conda + sha256: bba8538e6538ed58a8479b332337b96986561f975d06cfa2039a016c2d246ee4 + md5: 898d1c9793eaa52efc4727bd84d2e39a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - jpeg <0.0.0a + license: IJG AND BSD-3-Clause AND Zlib + purls: [] + run_exports: + weak: + - libjpeg-turbo >=3.2.0,<4.0a0 + size: 650434 + timestamp: 1785896381946 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libjxl-0.12.0-heb2dce7_2.conda + sha256: 965e59ea776344e93a416f7e0ba309810470a61c0e0c65f1eb90be0e808d7e9c + md5: 485788d339785bac87fe86315b4a0627 + depends: + - libgcc >=15 + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=15 + - libhwy >=1.4.0,<1.5.0a0 + - libbrotlienc >=1.2.0,<1.3.0a0 + - libbrotlidec >=1.2.0,<1.3.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libjxl >=0.12.0,<0.13.0a0 + size: 1886013 + timestamp: 1786691380980 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-9_h47877c9_openblas.conda + build_number: 9 + sha256: ea989e2dabd21d296a5a4ec515e695645aefcdf778ffdb5eeea515421d243ab5 + md5: e51473c2b7e1f9cb61daafccfd912abf + depends: + - libblas 3.11.0 9_h4a7cf45_openblas + constrains: + - blas 2.309 openblas + - libcblas 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - liblapack >=3.11.0,<3.12.0a0 + size: 18021 + timestamp: 1786059046733 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + sha256: 9787df8c22a59c9a70d3e5a10db9ad663485e75e9ccc3f09bd092cb7b95e0dab + md5: 1390b7c5ac0b1d8e447bc5efa6d3c8c2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - xz 5.8.3.* + license: 0BSD + purls: [] + run_exports: + weak: + - liblzma >=5.8.3,<6.0a0 + size: 112995 + timestamp: 1786348617826 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda + sha256: 46820b4a835e175940ae20bec00fdddaff804cda27a1408ab1b95e77a2196437 + md5: fcfed1dc5053eb1901b66e7b1fc32588 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 92759 + timestamp: 1786650399772 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb03c661_1.conda + sha256: d0f2fd77aad83641c11bc3686bac677e99869f1d62b99e5064c9d99af8bfde6a + md5: eeaf53e3c9593d63ffee5ad97182858e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - libnl >=3.11.0,<4.0a0 + size: 735004 + timestamp: 1787038268022 +- 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: [] + run_exports: + weak: + - libnsl >=2.0.1,<2.1.0a0 + size: 33731 + timestamp: 1750274110928 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-12.9.82-hecca717_2.conda + sha256: e044659e3a7e0a3168951fe8c4d7ad0e3b243211037d326d4e62540c75ce010a + md5: 1812ac6d93b3d1079881ccac0615e273 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 818431 + timestamp: 1782920268840 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-12.9.86-hecca717_2.conda + sha256: 3b1c851f4fc42d347ce1c1606bdd195343a47f121e0fceb7a1f1e5aa1d497da9 + md5: 3461b0f2d5cbb7973d361f9e85241d98 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=12,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 30515495 + timestamp: 1760723776293 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvptxcompiler-dev-12.9.86-ha770c72_2.conda + sha256: 1e7a7b34f8639a5feb75ba864127059e4d83edfe1a516547f0dbb9941e7b8f8b + md5: 3fd926c321c6dbf386aa14bd8b125bfb + depends: + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev_linux-64 12.9.86 ha770c72_2 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27046 + timestamp: 1753975516342 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libogg-1.3.5-hd0c01bc_1.conda + sha256: ffb066ddf2e76953f92e06677021c73c85536098f1c21fcd15360dbc859e22e4 + md5: 68e52064ed3897463c0e958ab5c8f91b + depends: + - libgcc >=13 + - __glibc >=2.17,<3.0.a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libogg >=1.3.5,<1.4.0a0 + size: 218500 + timestamp: 1745825989535 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.34-pthreads_h94d23a6_0.conda + sha256: 23392fc4f4e5ba230fcd1ef825878ba5ca7ee4f6259fac0cbb13299134b7bf7a + md5: c282d68f272927612462b5d626838ef1 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.34,<0.3.35.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libopenblas >=0.3.34,<1.0a0 + size: 5952629 + timestamp: 1784287497473 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2026.3.0-hb2f3c86_0.conda + sha256: b52a974c4414aaf035ea9925e2f584d4a5b54194a7944978650a36c0153a8d9c + md5: 103554a12a2f6666aaaa360d30513911 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino >=2026.3.0,<2026.3.1.0a0 + size: 6958517 + timestamp: 1786130942671 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-batch-plugin-2026.3.0-h9f30d58_0.conda + sha256: d70333e5fb2cab7518ba7db2fab371a98670a1b74e7bd53b49e18f1d55e67e38 + md5: 9728955c5c968923cdaf79317837ded4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 115265 + timestamp: 1786130964003 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-auto-plugin-2026.3.0-h9f30d58_0.conda + sha256: c9d1c80ec9b267cbbcbf234a358087ea42903f3bccdbbc7c663782943b4679ca + md5: 5fcbc9ef55adbffc1b804ae9c5f0e8d2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 251255 + timestamp: 1786130975924 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-hetero-plugin-2026.3.0-hfeb6f35_0.conda + sha256: b0614ed14c8896c3c60d06522a40d5e4414024112fe88e6eab62afcbfb259a03 + md5: 00addda23f9daf34d787e8b445d81256 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 224643 + timestamp: 1786130986082 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-cpu-plugin-2026.3.0-hb2f3c86_0.conda + sha256: 2306149a9b5fbac3a7f4217c868c504cb1706691ef9f63c4d6b0661cd84e160c + md5: 7559b02ec79104bb3e60658310815b4e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 13897562 + timestamp: 1786130996462 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-gpu-plugin-2026.3.0-hb2f3c86_0.conda + sha256: 1442f41ff6ae171aba788c6e3bf1b156759b9f239d06a974f723b56e8bcb067b + md5: e9fed808af5cab2c1cf79c4a1c5fc399 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - ocl-icd >=2.3.4,<3.0a0 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 12124352 + timestamp: 1786131034750 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-intel-npu-plugin-2026.3.0-hb2f3c86_0.conda + sha256: 1634885934423c4ffbaee56d9699190adc67334eab92b370f9015e5fc1247e58 + md5: 2402c917805aa66fd8604fc0b7292ec7 + depends: + - __glibc >=2.17,<3.0.a0 + - level-zero >=1.29.0,<2.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 2802782 + timestamp: 1786131067457 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-ir-frontend-2026.3.0-hfeb6f35_0.conda + sha256: 4bca7d1b71182b1c95a82e77ad01402b261dac603acd9200f5b492e65bc8ca3d + md5: 2254de1e118bb39c876297b941c41d7b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-ir-frontend >=2026.3.0,<2026.3.1.0a0 + size: 205085 + timestamp: 1786131080935 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-onnx-frontend-2026.3.0-h6c33c14_0.conda + sha256: f07168ce6d25aa529458c5c548df0b0e8b4033c8093a22aed92ee818c2e06679 + md5: 5a81c93a4ef5fe765fdc72ea0bb8ee48 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-onnx-frontend >=2026.3.0,<2026.3.1.0a0 + size: 2106186 + timestamp: 1786131093355 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-paddle-frontend-2026.3.0-h6c33c14_0.conda + sha256: 3f28b4438c3014c5b05d196cf4abbb7214dc5877b887100f7663eff722347713 + md5: 5ad8dacb488082db12c72422c3deba74 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-paddle-frontend >=2026.3.0,<2026.3.1.0a0 + size: 690800 + timestamp: 1786131106085 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-pytorch-frontend-2026.3.0-h0542e35_0.conda + sha256: 9ae24b2df1aeda9aedfcc6ba08fcf1ba34b169481ff874288310282ce5659d07 + md5: 7e0fd6af38383ab7bd71dc6af22355f3 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-pytorch-frontend >=2026.3.0,<2026.3.1.0a0 + size: 1236788 + timestamp: 1786131116811 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-frontend-2026.3.0-h565fa1b_0.conda + sha256: d1a027725dc6d6c2558e9e2b5ea65f99e982ec6adf575cef49be1ab5ecae8a47 + md5: e76e8e113e406442c0ca41284f6c3f0d + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + - snappy >=1.2.2,<1.3.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-tensorflow-frontend >=2026.3.0,<2026.3.1.0a0 + size: 1289288 + timestamp: 1786131128541 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-tensorflow-lite-frontend-2026.3.0-h0542e35_0.conda + sha256: 0a48ed163e475f3eff7ee358921f1393bbc769a58412c3b84cf27d86d1253440 + md5: e4318029124b4cacb8a2bfe884613676 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libopenvino 2026.3.0 hb2f3c86_0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-tensorflow-lite-frontend >=2026.3.0,<2026.3.1.0a0 + size: 511389 + timestamp: 1786131139830 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopus-1.6.1-h280c20c_0.conda + sha256: f1061a26213b9653bbb8372bfa3f291787ca091a9a3060a10df4d5297aad74fd + md5: 2446ac1fe030c2aa6141386c1f5a6aed + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libopus >=1.6.1,<2.0a0 + size: 324993 + timestamp: 1768497114401 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libpciaccess-0.19-hb03c661_1.conda + sha256: addc80c69d362a9e6c40305c493139a8e9ee504b2f45a6687dbdaa9da3c6183c + md5: 35fa2b34bbced424e6976d30f5fde576 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libpciaccess >=0.19,<0.20.0a0 + size: 30070 + timestamp: 1785971678815 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libplacebo-7.360.1-hc50b9dd_1.conda + sha256: 7fa90c06b81559cb56ea7806a6696fb4902a1acc20bbaff1bd3a4a75b3ffa0d5 + md5: 4a750e2ae0d52d003bb1e3421581585e + depends: + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libdovi >=3.4.0,<4.0a0 + - lcms2 >=2.19.1,<3.0a0 + - shaderc >=2026.3,<2026.4.0a0 + - libvulkan-loader >=1.4.341.0,<2.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libplacebo >=7.360.1,<7.361.0a0 + size: 550759 + timestamp: 1784287829706 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.58-h922cc85_1.conda + sha256: c19eefb87d70d9b4b0629fa48414a155a47a1be4f04583ae71ed8c5a9a32fdcb + md5: fcf71c8d979148873f6f8ad4cfc73d86 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - libzlib >=1.3.2,<2.0a0 + license: zlib-acknowledgement + purls: [] + run_exports: + weak: + - libpng >=1.6.58,<1.7.0a0 + size: 316643 + timestamp: 1786616563127 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libprotobuf-7.35.1-h2840a7c_2.conda + sha256: b5ac3938186516c1091b96414c34f90255da2a3bbd736a0712b22bbf4b5ebf02 + md5: 729db8acaadb9a5e5bb2dc3d9ac84ae4 + depends: + - __glibc >=2.17,<3.0.a0 + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libstdcxx >=14 + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libprotobuf >=7.35.1,<7.35.2.0a0 + size: 3774596 + timestamp: 1783168720126 +- conda: https://conda.anaconda.org/conda-forge/linux-64/librsvg-2.62.3-h4c96295_0.conda + sha256: 5571bd8239d71961d4e3ce972f865b3ea95a91ce0b53d5749fe2dd24254ddbda + md5: 492c8d9b1c564c2e948b6cb4ba0f8261 + depends: + - __glibc >=2.17,<3.0.a0 + - cairo >=1.18.4,<2.0a0 + - fontconfig >=2.18.0,<3.0a0 + - fonts-conda-ecosystem + - gdk-pixbuf >=2.44.6,<3.0a0 + - harfbuzz >=14.2.0 + - libgcc >=14 + - libglib >=2.88.1,<3.0a0 + - libxml2-16 >=2.14.6 + - pango >=1.56.4,<2.0a0 + constrains: + - __glibc >=2.17 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - librsvg >=2.62.3,<3.0a0 + size: 3476570 + timestamp: 1780450632624 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-16.1.0-hf2715c6_2.conda + sha256: 6f93ba4dc464c082e760f642e80ed7573707bc95887eacb0aa862fbd6a6f0fd3 + md5: e8f551ba141d88e3caa3ab22ec296fb5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=16.1.0 + - libstdcxx >=16.1.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + weak: + - libsanitizer 16.1.0 + size: 7962096 + timestamp: 1787165391989 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsndfile-1.2.2-hbc6d301_3.conda + sha256: 3503121a77d76e33f668916b69d4b20cb6a21f62aa4351d1506271ae9d184c61 + md5: a2bc10137c845d9c45067f3c53aad6e5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - libvorbis >=1.3.7,<1.4.0a0 + - libopus >=1.6.1,<2.0a0 + - lame >=4.0,<4.1.0a0 + - mpg123 >=1.33.7,<1.34.0a0 + - libogg >=1.3.5,<1.4.0a0 + - libflac >=1.5.0,<1.6.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libsndfile >=1.2.2,<1.3.0a0 + size: 387942 + timestamp: 1786538522787 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.22-h280c20c_1.conda + sha256: b677bbf1c339d894757c3dcfbb2f88649e499e4991d70ae09a1466da9a6c92d6 + md5: 965e4d531b588b2e42f66fd8e48b056c + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: ISC + purls: [] + run_exports: + weak: + - libsodium >=1.0.22,<1.0.23.0a0 + size: 269272 + timestamp: 1779163468406 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + sha256: f20d70da54e5b31dd4a51fb1efeaafafd5ab6dd8d7ac9d1438eaa2526ac4ed3d + md5: e72bbec309c2b0f37823ee7d4fabfcd3 + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=78.3,<79.0a0 + - libgcc >=15 + - libzlib >=1.3.2,<2.0a0 + license: blessing + purls: [] + run_exports: + weak: + - libsqlite >=3.53.4,<4.0a0 + size: 974348 + timestamp: 1787051145557 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + sha256: af96a5fcf1ce0659d257ababc1b8d0bbb698250e8140c6b8352f60d3be075392 + md5: d4883ac53b4074ca17e5c567bb8008f1 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc 16.1.0 ha9f2e26_2 + constrains: + - libstdcxx-ng ==16.1.0=*_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 6630263 + timestamp: 1787165375778 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-16.1.0-hdf11a46_2.conda + sha256: f096fb41c6ad3ef41c479ebce001329a531e0862c9a88979203597b610383158 + md5: 8531022ddd724933da9dc3d426a5ad9d + depends: + - libstdcxx 16.1.0 h934c35e_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - libstdcxx + size: 28339 + timestamp: 1787165409751 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-h084b8d7_1.conda + sha256: 2293884d59cf0436c37fc0a4bad71011a8de2a6913610d1c701a7703377c1f75 + md5: ea0da9c20bbb221b530810c3c68bbe62 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.78,<2.79.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 493022 + timestamp: 1780084748140 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.2-h9d88235_0.conda + sha256: b31346e1c01ab40a170e91147092ee8fd92b1dee3c66ee47ef025571c879b159 + md5: c1fcb4a88bc15a9f77ad8d27d7af1df9 + depends: + - __glibc >=2.17,<3.0.a0 + - lerc >=4.1.0,<5.0a0 + - libdeflate >=1.25,<1.26.0a0 + - libgcc >=14 + - libjpeg-turbo >=3.1.4.1,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libstdcxx >=14 + - libwebp-base >=1.6.0,<2.0a0 + - libzlib >=1.3.2,<2.0a0 + - zstd >=1.5.7,<1.6.0a0 + license: HPND + purls: [] + run_exports: + weak: + - libtiff >=4.7.2,<4.8.0a0 + size: 452337 + timestamp: 1783084902636 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-h084b8d7_1.conda + sha256: 287d05680e49eea51b8145fbf34bc213c0618b04f32e450e9da5d715e5134e38 + md5: 89e5671a076d99516a6acd72a35b1640 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.78,<2.79.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 145969 + timestamp: 1780084753104 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libunwind-1.8.3-h65a8314_0.conda + sha256: 71c8b9d5c72473752a0bb6e91b01dd209a03916cb71f36cc6a564e3a2a132d7a + md5: e179a69edd30d75c0144d7a380b88f28 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libunwind >=1.8.3,<1.9.0a0 + size: 75995 + timestamp: 1757032240102 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liburing-2.14-hb700be7_0.conda + sha256: 3d17b7aa90610afc65356e9e6149aeac0b2df19deda73a51f0a09cf04fd89286 + md5: 56f65185b520e016d29d01657ac02c0d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - liburing >=2.14,<2.15.0a0 + size: 154203 + timestamp: 1770566529700 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libusb-1.0.29-h73b1eb8_0.conda + sha256: 89c84f5b26028a9d0f5c4014330703e7dff73ba0c98f90103e9cef6b43a5323c + md5: d17e3fb595a9f24fa9e149239a33475d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libudev1 >=257.4 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libusb >=1.0.29,<2.0a0 + size: 89551 + timestamp: 1748856210075 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + sha256: 9b1bdce27a7e31f7d241aeecff67a1f3101d52a2b1e33ccc2cdf2613072bf81f + md5: 01bb81d12c957de066ea7362007df642 + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libuuid >=2.42.2,<3.0a0 + size: 40017 + timestamp: 1781625522462 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libva-2.24.1-he1eb515_0.conda + sha256: 16a76abbb4fd1de4516ac4a3d06cbf1f561bc8049ca72b04dcac395eee74d017 + md5: eb1b7f8bfdea40eef150c4a1d37df09e + depends: + - __glibc >=2.17,<3.0.a0 + - libdrm >=2.4.127,<2.5.0a0 + - libegl >=1.7.0,<2.0a0 + - libgcc >=14 + - libgl >=1.7.0,<2.0a0 + - libglx >=1.7.0,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - wayland >=1.25.0,<2.0a0 + - wayland-protocols + - xorg-libx11 >=1.8.13,<2.0a0 + - xorg-libxext >=1.3.7,<2.0a0 + - xorg-libxfixes >=6.0.2,<7.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libva >=2.24.1,<3.0a0 + size: 222717 + timestamp: 1783519315031 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libvorbis-1.3.7-h54a6638_2.conda + sha256: ca494c99c7e5ecc1b4cd2f72b5584cef3d4ce631d23511184411abcbb90a21a5 + md5: b4ecbefe517ed0157c37f8182768271c + depends: + - libogg + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + - libogg >=1.3.5,<1.4.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libvorbis >=1.3.7,<1.4.0a0 + size: 285894 + timestamp: 1753879378005 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libvpl-2.16.0-h54a6638_0.conda + sha256: 38850657dd6835613ef16b34895a54bea98bc7639db6a649c886b331635714fc + md5: 9f6b0090c3902b2c763a16f7dace7b6e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - intel-media-driver >=26.1.2,<26.2.0a0 + - libva >=2.23.0,<3.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libvpl >=2.16.0,<2.17.0a0 + size: 287992 + timestamp: 1772980546550 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libvpx-1.15.2-hecca717_0.conda + sha256: 8e1119977f235b488ab32d540c018d3fd1eccefc3dd3859921a0ff555d8c10d2 + md5: 10f5008f1c89a40b09711b5a9cdbd229 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libvpx >=1.15.2,<1.16.0a0 + size: 1070048 + timestamp: 1762010217363 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libvulkan-loader-1.4.357.0-h5279c79_0.conda + sha256: 1e30138cff1e6ba5739ce3ec787b24ef22ac6e2008d8a2073df334e9e5f8690b + md5: 9d8c72f797f6f2d1c32897603d70824c + depends: + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + - xorg-libxrandr >=1.5.5,<2.0a0 + constrains: + - libvulkan-headers 1.4.357.0.* + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libvulkan-loader >=1.4.357.0,<2.0a0 + size: 203456 + timestamp: 1785311377294 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libwebp-base-1.6.0-hd42ef1d_1.conda + sha256: 8415001414f488c85b72b9d8cc2071dfb3981a47bc3c8eb56ef91a57d12eae7f + md5: 9332b53d0ea93c5d39e33be03a0c611a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - libwebp 1.6.0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libwebp-base >=1.6.0,<2.0a0 + size: 428430 + timestamp: 1785954557217 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-hb83e432_1.conda + sha256: ce25a1efa85a78a3ce3b16721d9c36153814adbf2fb004a15f72ec69894b4cb1 + md5: 64e856c420205b009da26471d3ac161d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - pthread-stubs + - xorg-libxau >=1.0.12,<2.0a0 + - xorg-libxdmcp >=1.1.5,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libxcb >=1.17.0,<2.0a0 + size: 397355 + timestamp: 1787077466600 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.38-h280c20c_0.conda + sha256: f7e9292dd219a6435bbb1223da9586c3e70d66d169c5a92f08db3f2127df04e9 + md5: f7a7ff5a6ab331e037abd34f379a631d + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libxcrypt >=4.4.38 + size: 101957 + timestamp: 1785887123445 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxkbcommon-1.13.2-h51789e4_1.conda + sha256: d44878d396713ccf3b355df617f61c40a1442fffcf134392bc6ce0e6c2219369 + md5: f888787e0eab7a8076a67d197e155ffc + depends: + - xkeyboard-config + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libxcb >=1.17.0,<2.0a0 + - xorg-libxau >=1.0.12,<2.0a0 + - libxml2 + - libxml2-16 >=2.14.6 + license: MIT AND MIT-open-group AND HPND AND HPND-sell-variant AND ISC + purls: [] + run_exports: + weak: + - libxkbcommon >=1.13.2,<2.0a0 + size: 942571 + timestamp: 1787178780572 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-16-2.15.3-hca6bf5a_0.conda + sha256: 3d44f737c5ae52d5af32682cc1530df433f401f8e58a7533926536244127572a + md5: e79d2c2f24b027aa8d5ab1b1ba3061e7 + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=78.3,<79.0a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - libxml2 2.15.3 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 559775 + timestamp: 1776376739004 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxml2-2.15.3-h49c6c72_0.conda + sha256: 3bc5551720c58591f6ea1146f7d1539c734ed1c40e7b9f5cb8cb7e900c509aba + md5: 995d8c8bad2a3cc8db14675a153dec2b + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=78.3,<79.0a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libxml2-16 2.15.3 hca6bf5a_0 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libxml2 + - libxml2-16 >=2.15.3 + size: 46810 + timestamp: 1776376751152 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + sha256: eb8a0db0aa570124f7d2a93d7c7f596e3390df5e047818d873baad32985fc736 + md5: 0de0122d9570a8ab637c6b73db268389 + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - zlib 1.3.2 *_3 + license: Zlib + license_family: Other + purls: [] + run_exports: + weak: + - libzlib >=1.3.2,<2.0a0 + size: 63713 + timestamp: 1785362952714 +- conda: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb03c661_3.conda + sha256: 4c65d2769847778a6d84db6984ac81bcec6f8958d349f1fe57ae040ccc56a801 + md5: b4a198dc40024de2a59c1343e4ae4144 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + run_exports: {} + size: 510695 + timestamp: 1785879853297 +- 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=hash-mapping + run_exports: {} + size: 26057 + timestamp: 1772445297924 +- conda: https://conda.anaconda.org/conda-forge/linux-64/mpg123-1.33.7-h8142553_0.conda + sha256: 065c3cbc1d2de67bf3ffeb66a8e05cd89c12289b0bd0d877db52e472e45c231c + md5: 1d90b387cb397d0a75fd2a70be28cad1 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: LGPL-2.1-only + license_family: LGPL + purls: [] + run_exports: + weak: + - mpg123 >=1.33.7,<1.34.0a0 + size: 491740 + timestamp: 1786232222548 +- conda: https://conda.anaconda.org/conda-forge/linux-64/msgpack-python-1.2.1-py312h0a2e395_1.conda + sha256: c9764c77dd7f9c581c1d8a24c3024edf777cacfb5a4180de5badc6638dc8590f + md5: a142257c1b69e37cfefc66dc228a4d93 + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/msgpack?source=hash-mapping + run_exports: {} + size: 112800 + timestamp: 1782460774570 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + sha256: 5d46557214ed184381dafe835b7c94a474a1c3b307a08a250b1ea4779b44ffb3 + md5: ee6c0cd80a60961a1f48aa3e0b91f986 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: X11 AND BSD-3-Clause + purls: [] + run_exports: + weak: + - ncurses >=6.6,<7.0a0 + size: 911196 + timestamp: 1786355078102 +- conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.5.2-py312h33ff503_0.conda + sha256: 1235aaa0e265d7b0247fe6fb456a55f10f5fddf5349b652727fcdcdff4a26eb4 + md5: 3e15aca2584b6c69dc09ba2aa5ae1503 + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + - 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=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 8950985 + timestamp: 1786330619159 +- conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.5.2-py314h2b28147_0.conda + sha256: 124b753583ea9c157301fe78de3e88aa5fa8806bd2da8abaa8808065d1b93d51 + md5: d77631addad93399a90157d2c597e7f3 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.14.* *_cp314 + - libblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpy?source=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 9119694 + timestamp: 1786330625923 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ocl-icd-2.3.4-hb03c661_1.conda + sha256: 75f3bf733523a338f73d6c276c4a26634877cd970edb558f2769d9fa52b100a9 + md5: c2871ba95727fd1382c05db66048b64c + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - opencl-headers >=2025.6.13 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - ocl-icd >=2.3.4,<3.0a0 + size: 109598 + timestamp: 1780362789611 +- conda: https://conda.anaconda.org/conda-forge/linux-64/opencl-headers-2025.06.13-hecca717_0.conda + sha256: 8de2f0cd8a659b01abf86e7fbb8cea4f28ada62fd288429a2bbc040db1b98dd0 + md5: c930c8052d780caa41216af7de472226 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 55754 + timestamp: 1773844383536 +- conda: https://conda.anaconda.org/conda-forge/linux-64/openh264-2.6.0-h65dd3cf_1.conda + sha256: 5317c5c23762f3fe1c8510565a2bb94c645e1470ff73b386315656404f7eb58a + md5: 69894a95220a17a66272daa701c387bc + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - openh264 >=2.6.0,<2.6.1.0a0 + size: 726478 + timestamp: 1782685945856 +- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + sha256: 012096056b97abf1f68c46b7146bd2cbd68c1be762340b4f5dad4fbbe99177bc + md5: c5955c27917ff2234def47f075e71e02 + depends: + - __glibc >=2.17,<3.0.a0 + - ca-certificates + - libgcc >=14 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - openssl >=3.6.3,<4.0a0 + size: 3182423 + timestamp: 1785913583650 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pango-1.58.2-hda50119_0.conda + sha256: 48f27a6c3e4062bc09dafe9c7f6b288c5de5655e81095ab7f1aad920b2163b7b + md5: 6a2822aaf9a34ac3708904a47ff3dd7e + depends: + - __glibc >=2.17,<3.0.a0 + - cairo >=1.18.4,<2.0a0 + - fontconfig >=2.18.2,<3.0a0 + - fonts-conda-ecosystem + - fribidi >=1.0.16,<2.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=14 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz >=14.3.0 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - pango >=1.58.2,<2.0a0 + size: 469916 + timestamp: 1786107384537 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda + sha256: 5e6f7d161356fefd981948bea5139c5aa0436767751a6930cb1ca801ebb113ff + md5: 7a3bff861a6583f1889021facefc08b1 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - libgcc >=14 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - pcre2 >=10.47,<10.48.0a0 + size: 1222481 + timestamp: 1763655398280 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_3.conda + sha256: 829d8288764282de5a9f7b9169acb75cc7dc0b6c3fe2535cfe87dea3436bbc5d + md5: 0ee5bb30034b081a1386c1e2c98ab0a7 + depends: + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - pixman >=0.46.4,<1.0a0 + size: 376704 + timestamp: 1786106621354 +- 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=hash-mapping + run_exports: {} + size: 225545 + timestamp: 1769678155334 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb03c661_1003.conda + sha256: afc3b27b2cbb0487c1d0e963f96e71181ecfb623a24fb393bb19ff974a6382a1 + md5: df2c27f36bdb0dde779f55b5df76a352 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 9115 + timestamp: 1786067714761 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pugixml-1.15-h3f63f65_0.conda + sha256: 23c98a5000356e173568dc5c5770b53393879f946f3ace716bbdefac2a8b23d2 + md5: b11a4c6bf6f6f44e5e143f759ffa2087 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libstdcxx >=13 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - pugixml >=1.15,<1.16.0a0 + size: 118488 + timestamp: 1736601364156 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pulseaudio-client-17.0-h9a6aba3_3.conda + sha256: 0a0858c59805d627d02bdceee965dd84fde0aceab03a2f984325eec08d822096 + md5: b8ea447fdf62e3597cb8d2fae4eb1a90 + depends: + - __glibc >=2.17,<3.0.a0 + - dbus >=1.16.2,<2.0a0 + - libgcc >=14 + - libglib >=2.86.1,<3.0a0 + - libiconv >=1.18,<2.0a0 + - libsndfile >=1.2.2,<1.3.0a0 + - libsystemd0 >=257.10 + - libxcb >=1.17.0,<2.0a0 + constrains: + - pulseaudio 17.0 *_3 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - pulseaudio-client >=17.0,<17.1.0a0 + size: 750785 + timestamp: 1763148198088 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.13-h8ab3286_1_cpython.conda + build_number: 1 + sha256: df3d1e5f972e79e78b61730c09135c795f6e7aa45b7777835c95f451e85eff0d + md5: c6e02a78e3b6427c633328fea9399534 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=14 + - liblzma >=5.8.3,<6.0a0 + - libnsl >=2.0.1,<2.1.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libuuid >=2.42.2,<3.0a0 + - libxcrypt >=4.4.38 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.6,<7.0a0 + - openssl >=3.5.7,<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: [] + run_exports: + weak: + - python_abi 3.12.* *_cp312 + noarch: + - python + size: 31527849 + timestamp: 1786445051525 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.7-h399a421_100_cp314.conda + build_number: 100 + sha256: ee59fa05898243b9a068476f4bed9461abef4487ebcdc094f569c4c47dc4a732 + md5: a9d6f626c591a56d7b7b36d2465f646d + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=15 + - liblzma >=5.8.3,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libuuid >=2.42.2,<3.0a0 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.6,<7.0a0 + - openssl >=3.5.7,<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 + purls: [] + run_exports: + weak: + - python_abi 3.14.* *_cp314 + noarch: + - python + size: 37028007 + timestamp: 1787154417160 + python_site_packages_path: lib/python3.14/site-packages +- 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 + run_exports: {} + size: 198293 + timestamp: 1770223620706 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyzmq-27.1.0-py312hda471dd_3.conda + noarch: python + sha256: 970b2a1d12983d8d1cc05d914ad88a0b6ef1fa14038c9649aa834dd6ebee65d7 + md5: acd216255e1370e9aeab5351b831f07c + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - __glibc >=2.17,<3.0.a0 + - _python_abi3_support 1.* + - cpython >=3.12 + - zeromq >=4.3.5,<4.4.0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyzmq?source=hash-mapping + run_exports: {} + size: 210896 + timestamp: 1779483879367 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-63.0-h192683f_1.conda + sha256: f0931894c751b22be09d7c976343a2957a14a59cfe0db04d916d1b93bd66ffcf + md5: da47d3251c0f0d16b2801afe5a77b532 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.13 + - libudev1 >=257.13 + license: Linux-OpenIB + license_family: BSD + purls: [] + run_exports: + weak: + - rdma-core >=63.0 + size: 1281605 + timestamp: 1778528449130 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + sha256: 01b3fe073a66e321970d09e04b388708f8cbdca5cdfbfcb7c9eeb470ad10383d + md5: 69c01c781e7c8190bbdaf79e3848c5ca + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - ncurses >=6.6,<7.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: + weak: + - readline >=8.3,<9.0a0 + size: 348899 + timestamp: 1787033801506 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rpds-py-2026.6.3-py312h192e038_0.conda + sha256: 4a190c74b5f3b441820a3142b03a489987c724b65237882ebe87d75892345d17 + md5: 40984fba15f43a366ea4c6dea2b4c8bd + depends: + - python + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + purls: + - pkg:pypi/rpds-py?source=hash-mapping + run_exports: {} + size: 300259 + timestamp: 1782831325201 +- 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 + run_exports: {} + size: 148221 + timestamp: 1766159515069 +- conda: https://conda.anaconda.org/conda-forge/linux-64/scipy-1.18.0-py312h54fa4ab_0.conda + sha256: c304dfb0bbf0d824d3706623f6437237d7bfc83941bb7b18f80e05abb10ec79e + md5: f8d242c552b0f7f682451ce95879af5e + 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 + - numpy <2.7 + - numpy >=1.23,<3 + - numpy >=2.0.0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/scipy?source=hash-mapping + run_exports: {} + size: 17104066 + timestamp: 1781912972195 +- conda: https://conda.anaconda.org/conda-forge/linux-64/sdl2-2.32.56-h54a6638_0.conda + sha256: 987ad072939fdd51c92ea8d3544b286bb240aefda329f9b03a51d9b7e777f9de + md5: cdd138897d94dc07d99afe7113a07bec + depends: + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libgl >=1.7.0,<2.0a0 + - sdl3 >=3.2.22,<4.0a0 + - libegl >=1.7.0,<2.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl2 >=2.32.56,<3.0a0 + size: 589145 + timestamp: 1757842881000 +- conda: https://conda.anaconda.org/conda-forge/linux-64/sdl3-3.4.14-hdeec2a5_0.conda + sha256: b7f4a338074d0daa5086d6d7f319dd79b277c47a761abd8ebac72c0253f4c6ad + md5: 1ef39a7b42a06e262723fa7937210639 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - liburing >=2.14,<2.15.0a0 + - libudev1 >=257.13 + - xorg-libxcursor >=1.2.3,<2.0a0 + - xorg-libxtst >=1.2.5,<2.0a0 + - dbus >=1.16.2,<2.0a0 + - libunwind >=1.8.3,<1.9.0a0 + - libusb >=1.0.29,<2.0a0 + - libegl >=1.7.0,<2.0a0 + - pulseaudio-client >=17.0,<17.1.0a0 + - libgl >=1.7.0,<2.0a0 + - xorg-libxext >=1.3.7,<2.0a0 + - xorg-libxfixes >=6.0.2,<7.0a0 + - libdrm >=2.4.127,<2.5.0a0 + - xorg-libxi >=1.8.3,<2.0a0 + - wayland >=1.26.0,<2.0a0 + - xorg-libxscrnsaver >=1.2.4,<2.0a0 + - libxkbcommon >=1.13.2,<2.0a0 + - xorg-libx11 >=1.8.13,<2.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl3 >=3.4.14,<4.0a0 + size: 2158268 + timestamp: 1785816103164 +- conda: https://conda.anaconda.org/conda-forge/linux-64/shaderc-2026.3-h1b60276_0.conda + sha256: 1325456e9cff1ec8a5e826f64b8eef5806162bfcceeed2e32817a3c280f0dfc9 + md5: ee5e719bbf258faa3b6533a1a621092b + depends: + - __glibc >=2.17,<3.0.a0 + - glslang >=16,<17.0a0 + - libgcc >=14 + - libstdcxx >=14 + - spirv-tools >=2026,<2027.0a0 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - shaderc >=2026.3,<2026.4.0a0 + size: 114267 + timestamp: 1784251192959 +- conda: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.2-h03e3b7b_1.conda + sha256: 48f3f6a76c34b2cfe80de9ce7f2283ecb55d5ed47367ba91e8bb8104e12b8f11 + md5: 98b6c9dc80eb87b2519b97bcf7e578dd + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - snappy >=1.2.2,<1.3.0a0 + size: 45829 + timestamp: 1762948049098 +- conda: https://conda.anaconda.org/conda-forge/linux-64/spirv-tools-2026.3-hb700be7_0.conda + sha256: 863058fea246a08b348e010462dd5637cac9a15964012ae6c174f0f89978705f + md5: 471eb0afe44e7546d26209ed45b58ec9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - spirv-headers >=1.4.357.0,<1.4.357.1.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - spirv-tools >=2026,<2027.0a0 + size: 2753273 + timestamp: 1786908115068 +- conda: https://conda.anaconda.org/conda-forge/linux-64/sqlalchemy-2.0.52-py312h5253ce2_0.conda + sha256: c6677580087354e02e98fe3d356ca3de3d6f0521da831ea949b7a42e52bfd60d + md5: 3d301c6754633aacf499ac6ee63bd2b8 + depends: + - python + - greenlet !=0.4.17 + - typing-extensions >=4.6.0 + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sqlalchemy?source=compressed-mapping + run_exports: {} + size: 3721699 + timestamp: 1786535232010 +- conda: https://conda.anaconda.org/conda-forge/linux-64/svt-av1-4.2.0-hecca717_0.conda + sha256: c79f983a6bb4218bdef9064aec5821d59d744f9a98f8cf8437c7bd0351df0d95 + md5: 683f1b6d013bb1eb0d5c8025d2eb21a3 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - svt-av1 >=4.2.0,<4.2.1.0a0 + size: 2666786 + timestamp: 1784069888521 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-2023.0.0-hab88423_2.conda + sha256: 30cb9355c2fefc20ff1a3d6566b9714d5614086a2524c07721fc344eb20515ae + md5: 7073b15f9364ebc118998601ac6ca6a6 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libhwloc >=2.13.0,<2.13.1.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 182331 + timestamp: 1778673758649 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + build_number: 103 + sha256: 43624eab22f5f29df7d6ffe914cf442f28fd559b55b290906255492826e636e8 + md5: 48a1049e710857572fc2a832aa394d9f + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libzlib >=1.3.2,<2.0a0 + constrains: + - xorg-libx11 >=1.8.13,<2.0a0 + license: TCL + purls: [] + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + size: 3550916 + timestamp: 1784229071544 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.8-py312h4c3975b_0.conda + sha256: 2ea8f8b10e869b675d2fba157b387eaf4eed1696bfc924bb7b28e67d7aa0a947 + md5: 5423c2b8f82d60320e65b9ff30babbdf + 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 + run_exports: {} + size: 869730 + timestamp: 1786226754702 +- conda: https://conda.anaconda.org/conda-forge/linux-64/uv-0.12.5-hec9e821_1.conda + sha256: 19e200bf2b34ea9fd3f88e8f20603541c58b741f9ac0f0f71804859fc2b5f97e + md5: d1d3d016ae5371aafd0967dba5151afe + depends: + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=15 + - libgcc >=15 + constrains: + - __glibc >=2.17 + license: Apache-2.0 OR MIT + run_exports: {} + size: 17769047 + timestamp: 1787146933655 +- conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.26.0-h1964d1d_1.conda + sha256: a8f1333274382d23721d6f72483ece364631231f8ac3f74389951b1ff2820148 + md5: 47e3c5d0b1e968ee49efc7c3fa8ebc0c + depends: + - __glibc >=2.17,<3.0.a0 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - wayland >=1.26.0,<2.0a0 + size: 339462 + timestamp: 1786151675802 +- conda: https://conda.anaconda.org/conda-forge/linux-64/x264-1!164.3095-h166bdaf_2.tar.bz2 + sha256: 175315eb3d6ea1f64a6ce470be00fa2ee59980108f246d3072ab8b977cb048a5 + md5: 6c99772d483f566d59e25037fea2c4b1 + depends: + - libgcc-ng >=12 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x264 >=1!164.3095,<1!165 + size: 897548 + timestamp: 1660323080555 +- conda: https://conda.anaconda.org/conda-forge/linux-64/x265-3.5-h924138e_3.tar.bz2 + sha256: 76c7405bcf2af639971150f342550484efac18219c0203c5ee2e38b8956fe2a0 + md5: e7f6ed84d4623d52ee581325c1587a6b + depends: + - libgcc-ng >=10.3.0 + - libstdcxx-ng >=10.3.0 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x265 >=3.5,<3.6.0a0 + size: 3357188 + timestamp: 1646609687141 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xkeyboard-config-2.48-h280c20c_0.conda + sha256: 3b04afd5d1a65d2d27ac2d49a63b01ab8bcd875776779ec63e337370ed38afdc + md5: b233b41be0bf210989d57160ed39b394 + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 441670 + timestamp: 1782027360439 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libice-1.1.2-h280c20c_0.conda + sha256: 49b532d1df875c6749d9078b56a76f3f5db49a5abe0ca620b593ed474ef0ebf1 + md5: 85c9442aec283b4e464fa9ecc484a2f3 + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libice >=1.1.2,<2.0a0 + size: 62517 + timestamp: 1786474410404 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.6-h0d788c3_1.conda + sha256: ef907caee0665cf3b0f775602cc50e388e3bade8ce22ecade0873ff26604b2fd + md5: aa7459ed9ad086ba11dda843d764b33d + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - xorg-libice >=1.1.2,<2.0a0 + - libuuid >=2.42.2,<3.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libsm >=1.2.6,<2.0a0 + size: 30739 + timestamp: 1786545374265 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libx11-1.8.13-he1eb515_1.conda + sha256: 68053eebfa9f0d91666786c8fb5839d989aa9b869add92cb8815228bb2d7302c + md5: 8c282bbe4808a3cc80a5c98e9aec1cfc + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libxcb >=1.17.0,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libx11 >=1.8.13,<2.0a0 + size: 839578 + timestamp: 1787087012372 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxau-1.0.12-hb03c661_2.conda + sha256: cbf891f6cc1a859347680af1c8562bc6b033bf182a2a3bb536016932be3206de + md5: f06ef439c280a5f90b8bf62355008dbc + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxau >=1.0.12,<2.0a0 + size: 16419 + timestamp: 1786381001122 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxcursor-1.2.3-hb9d3cd8_0.conda + sha256: 832f538ade441b1eee863c8c91af9e69b356cd3e9e1350fff4fe36cc573fc91a + md5: 2ccd714aa2242315acaf0a67faea780b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - xorg-libx11 >=1.8.10,<2.0a0 + - xorg-libxfixes >=6.0.1,<7.0a0 + - xorg-libxrender >=0.9.11,<0.10.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxcursor >=1.2.3,<2.0a0 + size: 32533 + timestamp: 1730908305254 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxdmcp-1.1.5-hb03c661_2.conda + sha256: c50a16c05ccd7fe7dd6d6cfb539f4e9a491d50f9ed7a5c902fec638f7d0d27be + md5: 2e66c929f3d879708335b6ea4557c838 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxdmcp >=1.1.5,<2.0a0 + size: 21120 + timestamp: 1786381006369 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxext-1.3.7-h7cc23a3_1.conda + sha256: aa9bbe8b278aacc194e280ff5037f9f9a1f2c5b33ed97de8e7f01cfbe90dda43 + md5: e5b6b28536b81b3f4cb20db4668a4642 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxext >=1.3.7,<2.0a0 + size: 53124 + timestamp: 1787100841900 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxfixes-6.0.2-hb03c661_0.conda + sha256: 83c4c99d60b8784a611351220452a0a85b080668188dce5dfa394b723d7b64f4 + md5: ba231da7fccf9ea1e768caf5c7099b84 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - xorg-libx11 >=1.8.12,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxfixes >=6.0.2,<7.0a0 + size: 20071 + timestamp: 1759282564045 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxi-1.8.3-hb03c661_0.conda + sha256: 495f99c8eacfa4ae2d8fed2a7f2105777af89acdc204df145d2bbbc380ac631b + md5: adba2e334082bb218db806d4c12277c9 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + - xorg-libxext >=1.3.7,<2.0a0 + - xorg-libxfixes >=6.0.2,<7.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxi >=1.8.3,<2.0a0 + size: 47717 + timestamp: 1779111857071 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrandr-1.5.5-hb03c661_0.conda + sha256: 80ed047a5cb30632c3dc5804c7716131d767089f65877813d4ae855ee5c9d343 + md5: e192019153591938acf7322b6459d36e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - xorg-libx11 >=1.8.12,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxrender >=0.9.12,<0.10.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxrandr >=1.5.5,<2.0a0 + size: 30456 + timestamp: 1769445263457 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxrender-0.9.12-hb03c661_1.conda + sha256: 6901f91d398811e4ec89d7e20a69abac02a7bfebfaf073338b7ea3d1a99685b7 + md5: e470d224a7a5be1b1d021bded7abb536 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxrender >=0.9.12,<0.10.0a0 + size: 34645 + timestamp: 1787100191192 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxscrnsaver-1.2.4-hb9d3cd8_0.conda + sha256: 58e8fc1687534124832d22e102f098b5401173212ac69eb9fd96b16a3e2c8cb2 + md5: 303f7a0e9e0cd7d250bb6b952cecda90 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - xorg-libx11 >=1.8.10,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxscrnsaver >=1.2.4,<2.0a0 + size: 14412 + timestamp: 1727899730073 +- conda: https://conda.anaconda.org/conda-forge/linux-64/xorg-libxtst-1.2.5-hb9d3cd8_3.conda + sha256: 752fdaac5d58ed863bbf685bb6f98092fe1a488ea8ebb7ed7b606ccfce08637a + md5: 7bbe9a0cc0df0ac5f5a8ad6d6a11af2f + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - xorg-libx11 >=1.8.10,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxi >=1.7.10,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxtst >=1.2.5,<2.0a0 + size: 32808 + timestamp: 1727964811275 +- 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: [] + run_exports: + weak: + - yaml >=0.2.5,<0.3.0a0 + size: 85189 + timestamp: 1753484064210 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zeromq-4.3.5-h09e67af_11.conda + sha256: dc9f28dedcb5f35a127fad2d847674d2833369dd616d294e423b8997df31d8a8 + md5: 96b08867e21d4694fa5c2c226e6581b0 + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - krb5 >=1.22.2,<1.23.0a0 + - libsodium >=1.0.22,<1.0.23.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + run_exports: + weak: + - zeromq >=4.3.5,<4.4.0a0 + size: 311184 + timestamp: 1779123989774 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + sha256: 47d682b9f6d6ec9eb1a6e6c3e75ea6273e899e78fb7fc59f81d39745009fbc60 + md5: aa459086047c0e5e27023ab19f8cb86a + depends: + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + size: 601301 + timestamp: 1786599621503 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda + build_number: 20 + sha256: a2527b1d81792a0ccd2c05850960df119c2b6d8f5fdec97f2db7d25dc23b1068 + md5: 468fd3bb9e1f671d36c2cbc677e56f1d + depends: + - libgomp >=7.5.0 + constrains: + - openmp_impl <0.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 28926 + timestamp: 1770939656741 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/alsa-lib-1.2.16.1-he30d5cf_0.conda + sha256: 105e4c19cfa770affcb9a64b9d2451f406914cd09a67664009910869fa01a639 + md5: 5427b5dcb268bddf1a69c16d1cb77a47 + depends: + - libgcc >=14 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - alsa-lib >=1.2.16.1,<1.3.0a0 + size: 621865 + timestamp: 1781522013595 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/aom-3.14.1-pl5321h8fffa31_1.conda + sha256: a228f46f68fa3e2e50a09b5a4cefd1ee2c1ce868bfa2a288867b3d44b6e77427 + md5: a3c86229b531656c2bce99e8a6c6de4a + depends: + - libstdcxx >=14 + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - aom >=3.14.1,<3.15.0a0 + size: 4091040 + timestamp: 1780752489693 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/backports.zstd-1.7.0-py312h22d1088_0.conda + sha256: ca437dff643bdb17dcc433661650d83e6102b34ad52303af4fa2d5126af0144f + md5: cf9331987e4b79231565507322651487 + depends: + - python + - libgcc >=15 + - 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 + run_exports: {} + size: 241995 + timestamp: 1786861408180 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_impl_linux-aarch64-2.46.1-default_h5f4c503_102.conda + sha256: eebe159bf600943552e4319ff4ce27b6a2dadf0dcc5443e76dcee9259a408e11 + md5: 58f37d76b8234c69dbf2939d511bea0b + depends: + - ld_impl_linux-aarch64 2.46.1 default_h1979696_102 + - sysroot_linux-aarch64 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 4677171 + timestamp: 1784214549910 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_linux-aarch64-2.46.1-default_hf1166c9_102.conda + sha256: d41099a3fe2809a3ab3e4c718ecff4d5f8879e7949f3c8e8efa97fa06a90248c + md5: 9a340123cb7217eae51c5cae24484631 + depends: + - binutils_impl_linux-aarch64 2.46.1 default_h5f4c503_102 + license: GPL-3.0-only + license_family: GPL + run_exports: {} + size: 36196 + timestamp: 1784214578949 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/brotli-python-1.2.0-py312h41c1d46_3.conda + sha256: 478ecfe797fc37e2e95093774810ce76d34c0738b2d08ac3e88cb342c88f1b75 + md5: 001b8b88d982096da52039fee68f47f1 + depends: + - libgcc >=15 + - libstdcxx >=15 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - libbrotlicommon 1.2.0 h384ecca_3 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=compressed-mapping + run_exports: {} + size: 367476 + timestamp: 1786622919850 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + sha256: 24eacc8a20fd7c4616566178562bef7f9344eb4a8700cfc3180fa75a6ff9d39f + md5: fd544ef1c672d645bf78e5819cbb8f91 + depends: + - libgcc >=14 + license: bzip2-1.0.6 + license_family: BSD + purls: [] + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + size: 194694 + timestamp: 1785906301397 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cairo-1.18.4-h0b6afd8_1.conda + sha256: 675db823f3d6fb6bf747fab3b0170ba99b269a07cf6df1e49fff2f9972be9cd1 + md5: 043c13ed3a18396994be9b4fab6572ad + depends: + - fontconfig >=2.15.0,<3.0a0 + - fonts-conda-ecosystem + - icu >=78.1,<79.0a0 + - libexpat >=2.7.3,<3.0a0 + - libfreetype >=2.14.1 + - libfreetype6 >=2.14.1 + - libgcc >=14 + - libglib >=2.86.3,<3.0a0 + - libpng >=1.6.53,<1.7.0a0 + - libstdcxx >=14 + - libxcb >=1.17.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - pixman >=0.46.4,<1.0a0 + - xorg-libice >=1.1.2,<2.0a0 + - xorg-libsm >=1.2.6,<2.0a0 + - xorg-libx11 >=1.8.12,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxrender >=0.9.12,<0.10.0a0 + license: LGPL-2.1-only or MPL-1.1 + purls: [] + run_exports: + weak: + - cairo >=1.18.4,<2.0a0 + size: 927045 + timestamp: 1766416003626 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/conda-gcc-specs-16.1.0-h4acae54_2.conda + sha256: f2d7a32a681b9d76fa2d2195d1b83f54c8b62fee97bb4271420f180e6537d912 + md5: a05a8cdb0ef05a80c1dc98f6cdcd55a0 + depends: + - gcc_impl_linux-aarch64 >=16.1.0,<16.1.1.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 32280 + timestamp: 1787164611341 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-bindings-12.9.7-py312hdebd348_1.conda + sha256: 9f4878be4f23dda46fb4f0c6d93c9d23fae4771e973a567beac55ea637a1909b + md5: d328b89bcb5eb29857c00fddf4a25e52 + depends: + - python + - cuda-pathfinder >=1.5.5,<2 + - cuda-version >=12.2,<13.0a0 + - cuda-nvrtc >=12,<13.0a0 + - cuda-nvcc-impl >=12,<13.0a0 + - libcufile >=1,<2.0a0 + - libnvjitlink >=12.3,<13 + - libgcc >=14 + - python 3.12.* *_cpython + - libstdcxx >=14 + - python_abi 3.12.* *_cp312 + constrains: + - cuda-cudart >=12,<13.0a0 + - libnvfatbin >=12,<13.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + run_exports: {} + size: 4646579 + timestamp: 1782355019087 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-crt-tools-12.9.86-h579c4fd_2.conda + sha256: dad493fdcef9a5b84269bdd22b5dfbe73300d99057f2fc1a1ad1114a944167c7 + md5: 6f66ef2abe496ac82066ea6b9f33ab90 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 29186 + timestamp: 1753975202369 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda + sha256: 3d6699fc27ffabf28a9d359b48e7b88437e4d945844718a58608627998db5d1b + md5: df78e19e5fe656631d1470aa0fcf6ced + depends: + - arm-variant * sbsa + - cuda-cudart_linux-aarch64 12.9.79 h3ae8b8a_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23466 + timestamp: 1749218349235 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda + sha256: d70f85411992e03494f2fe94a9852d79f366a92f40ba791611eda5551044afe9 + md5: d58cc487273764a11637456c06399ff0 + depends: + - arm-variant * sbsa + - cuda-cudart 12.9.79 h3ae8b8a_0 + - cuda-cudart-dev_linux-aarch64 12.9.79 h3ae8b8a_0 + - cuda-cudart-static 12.9.79 h3ae8b8a_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 23911 + timestamp: 1749218369632 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda + sha256: dac33edcebbf557563a41521f67961039186efbc276903d937b32243ef3be937 + md5: 365adcddf99b81eb323698fda31d507c + depends: + - arm-variant * sbsa + - cuda-cudart-static_linux-aarch64 12.9.79 h3ae8b8a_0 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=13 + - libstdcxx >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23507 + timestamp: 1749218358755 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvcc-impl-12.9.86-h614329b_2.conda + sha256: 60ca00b86a28f3f1abd080df6685c415a51f9a0267e65b3a56783b9b97265486 + md5: 7ad15773a6b7617fb36cc3d92034f3e9 + depends: + - arm-variant * sbsa + - cuda-cudart >=12.9.79,<13.0a0 + - cuda-cudart-dev + - cuda-nvcc-dev_linux-aarch64 12.9.86 h4310d6a_2 + - cuda-nvcc-tools 12.9.86 h614329b_2 + - cuda-nvvm-impl 12.9.86 h7b14b0b_2 + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev 12.9.86 h579c4fd_2 + constrains: + - gcc_impl_linux-aarch64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27322 + timestamp: 1753975427660 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvcc-tools-12.9.86-h614329b_2.conda + sha256: 1cc064e076c417bca2de7fb6ee28df0964cbad25eada2131a48b43ab36cdea33 + md5: ab332ca8da729b13bf7e5b0022c2702c + depends: + - arm-variant * sbsa + - cuda-crt-tools 12.9.86 h579c4fd_2 + - cuda-nvvm-tools 12.9.86 h7b14b0b_2 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + - libstdcxx >=12 + constrains: + - gcc_impl_linux-aarch64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23974390 + timestamp: 1753975366926 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda + sha256: e7f8d835d7bf993dcad9fba6db5af89c35b2b4f0282799b729bf6ad2c3bd896d + md5: 48187c09673a42f9930764e8170b8787 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 33382016 + timestamp: 1760723722396 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-dev-12.9.86-h8f3c8d4_1.conda + sha256: b1d1a74cbbdcf46c4ee737279df3220eb7a29393999bc96b3c1398f7de78c912 + md5: 2346ee558cbfb7b857c8353ffc2553fa + depends: + - arm-variant * sbsa + - cuda-nvrtc 12.9.86 h8f3c8d4_1 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - cuda-nvrtc-static >=12.9.86 + - arm-variant * sbsa + license: LicenseRef-NVIDIA-End-User-License-Agreement + run_exports: + weak: + - cuda-nvrtc >=12.9.86,<13.0a0 + size: 36250 + timestamp: 1760723865518 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-12.9.86-he9431aa_106.conda + sha256: 97bf1688e3847090d1c4193c39ca575a67e2183d0c20ddf8bcedc0f9d9528bbc + md5: 8ace2a8121a5f733a902822290aae11c + depends: + - cuda-nvvm-dev_linux-aarch64 12.9.86.* + - cuda-nvvm-impl 12.9.86.* + - cuda-nvvm-tools 12.9.86.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 25585 + timestamp: 1771619514901 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda + sha256: 100accfc6f608004ddef4b9004ee5179eddbac19e7d5c4c7bd5e6e8b71bd7c5d + md5: 8e9fceb7b677be7107cc9c20f8d71d86 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 21601172 + timestamp: 1753975236344 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda + sha256: f5cf91e491e150e37cd224fa648c07f6b1cd2cbfee5affba10625df7ba0b0425 + md5: 9a35dcda5573a713183f5159ec282364 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 24411824 + timestamp: 1753975273689 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-12.9.79-h16bee8c_1.conda + sha256: 6fa8a4d4548b114acd3c9849b65b5d9fcf1ca8f39cd2b792ce5167a51955100c + md5: 875bfddc9855f12e9f518ef8e44c2d85 + depends: + - arm-variant * sbsa + - cuda-cudart-dev + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23784 + timestamp: 1761098779882 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py312hbda70bc_0.conda + sha256: 9c3df78ef64fc05aaf01b4d16ccefe25656b7aac677a3a9d5e89e0c462c65a2c + md5: 30984003a6a35ea7b9eedc979cf52c7e + depends: + - 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 + run_exports: {} + size: 3649707 + timestamp: 1785016066705 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py314hc6b4731_0.conda + sha256: 84aebc300e4a0f4ea697d95ec97277301e83f0a457e61efb48b27a14cfb37bda + md5: 4a44c5167b358f22ae2cd89b07728797 + depends: + - libgcc >=14 + - libstdcxx >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cython?source=hash-mapping + run_exports: {} + size: 3741802 + timestamp: 1785016071504 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dav1d-1.2.1-h31becfc_0.conda + sha256: 33fe66d025cf5bac7745196d1a3dd7a437abcf2dbce66043e9745218169f7e17 + md5: 6e5a87182d66b2d1328a96b61ca43a62 + depends: + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - dav1d >=1.2.1,<1.2.2.0a0 + size: 347363 + timestamp: 1685696690003 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dbus-1.16.2-h70963c4_1.conda + sha256: 3af801577431af47c0b72a82bb93c654f03072dece0a2a6f92df8a6802f52a22 + md5: a4b6b82427d15f0489cef0df2d82f926 + depends: + - libstdcxx >=14 + - libgcc >=14 + - libglib >=2.86.2,<3.0a0 + - libzlib >=1.3.1,<2.0a0 + - libexpat >=2.7.3,<3.0a0 + license: AFL-2.1 OR GPL-2.0-or-later + purls: [] + run_exports: + weak: + - dbus >=1.16.2,<2.0a0 + size: 480416 + timestamp: 1764536098891 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/debugpy-1.8.21-py312hf55c4e8_0.conda + sha256: 9d8a3442fae659629980c972b5f7ba8c2d339d233bd1de38ae72faf244cdc3a9 + md5: 228761e2c5f069dc8445337bd4abe097 + depends: + - python + - libgcc >=14 + - python 3.12.* *_cpython + - libstdcxx >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/debugpy?source=hash-mapping + run_exports: {} + size: 2791691 + timestamp: 1780390168122 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ffmpeg-9.0.1-gpl_hcd1c4d7_900.conda + sha256: 2835138469d3bc5f06abe683f5f3df342fa4cefc8e1b7e4325b6d726d69d41ae + md5: 16df5bfde5557da591ed445804bc8f46 + depends: + - alsa-lib >=1.2.16.1,<1.3.0a0 + - aom >=3.14.1,<3.15.0a0 + - bzip2 >=1.0.8,<2.0a0 + - dav1d >=1.2.1,<1.2.2.0a0 + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + - gmp >=6.3.0,<7.0a0 + - lame >=4.0,<4.1.0a0 + - libass >=0.17.5,<0.17.6.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libharfbuzz >=14.3.0 + - libiconv >=1.18,<2.0a0 + - libjxl >=0.12.0,<0.13.0a0 + - liblzma >=5.8.3,<6.0a0 + - libopenvino >=2026.3.0,<2026.3.1.0a0 + - libopenvino-arm-cpu-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-auto-batch-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-auto-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-hetero-plugin >=2026.3.0,<2026.3.1.0a0 + - libopenvino-ir-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-onnx-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-paddle-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-pytorch-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-tensorflow-frontend >=2026.3.0,<2026.3.1.0a0 + - libopenvino-tensorflow-lite-frontend >=2026.3.0,<2026.3.1.0a0 + - libopus >=1.6.1,<2.0a0 + - libplacebo >=7.360.1,<7.361.0a0 + - librsvg >=2.62.3,<3.0a0 + - libstdcxx >=15 + - libvorbis >=1.3.7,<1.4.0a0 + - libvpx >=1.15.2,<1.16.0a0 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - libwebp-base >=1.6.0,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - libxml2 + - libxml2-16 >=2.14.6 + - libzlib >=1.3.2,<2.0a0 + - openh264 >=2.6.0,<2.6.1.0a0 + - openssl >=3.5.7,<4.0a0 + - pulseaudio-client >=17.0,<17.1.0a0 + - sdl2 >=2.32.56,<3.0a0 + - svt-av1 >=4.2.0,<4.2.1.0a0 + - x264 >=1!164.3095,<1!165 + - x265 >=3.5,<3.6.0a0 + - xorg-libx11 >=1.8.13,<2.0a0 + constrains: + - __cuda >=12.8 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - ffmpeg >=9.0.1,<10.0a0 + size: 13191134 + timestamp: 1786704937927 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fontconfig-2.18.3-ha4b22b4_1.conda + sha256: 5f7801b6044ff233943e68f5156d4987fe8447d1be9378fb5c67f7aa009a33e7 + md5: bb629904b3e9326efaa5c39c956f2b63 + depends: + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libuuid >=2.42.2,<3.0a0 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + size: 304159 + timestamp: 1786667327378 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/freetype-2.14.3-h8af1aa0_2.conda + sha256: 7af9e368efdaf59e0709ae89c2e7f0ce0e1067a857958f367318ff3c27209a64 + md5: f5d76071be867597bab18a0e45d588e1 + depends: + - libfreetype 2.14.3 h8af1aa0_2 + - libfreetype6 2.14.3 h9cc7050_2 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: + weak: + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + size: 174712 + timestamp: 1786640946309 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/fribidi-1.0.16-he30d5cf_1.conda + sha256: 0b11eca89f8143a1eed1cb64876c2015aaccc1e794394706dae2978dfdee148e + md5: a53fb4bfd0bc371eab779e79152fea74 + depends: + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - fribidi >=1.0.16,<2.0a0 + size: 63507 + timestamp: 1785912512987 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc-16.1.0-hfdd745d_2.conda + sha256: 7444174af15de9f6ab1cdcbb601a5c2d64529b1f2335b4f5d7033c3b93efd928 + md5: 6aff25b657edcba83b47e1f3df6de1d0 + depends: + - conda-gcc-specs + - gcc_impl_linux-aarch64 16.1.0 h998876f_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 29189 + timestamp: 1787164706844 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_impl_linux-aarch64-16.1.0-h998876f_2.conda + sha256: 876c65381cfe670190d006e131c0d94d7afc56850ea77e4ca430cd9a42d97901 + md5: 9ae9626b6f170c73b7ad0b6d46962784 + depends: + - binutils_impl_linux-aarch64 >=2.46.1 + - libgcc >=16.1.0 + - libgcc-devel_linux-aarch64 16.1.0 hd673532_102 + - libgomp >=16.1.0 + - libsanitizer 16.1.0 h2510bd8_2 + - libstdcxx >=16.1.0 + - libstdcxx-devel_linux-aarch64 16.1.0 h2445e1f_102 + - sysroot_linux-aarch64 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 76690199 + timestamp: 1787164502217 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_linux-aarch64-16.1.0-hed00b63_1.conda + sha256: 25616cffe3cf0d939909e9b53da7ffebcea9dda61e67e138e9b9a905f25a7eb5 + md5: 6975e69904faf9e23ffcbe59fa0d8861 + depends: + - gcc_impl_linux-aarch64 16.1.0.* + - binutils_linux-aarch64 + - sysroot_linux-aarch64 + license: BSD-3-Clause + license_family: BSD + run_exports: + strong: + - libgcc >=16 + size: 29527 + timestamp: 1787166199966 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gdk-pixbuf-2.44.8-hb26ce08_0.conda + sha256: 2b2e4c60a7699dca619cab6123486c058e75931d61cfa272b42be8d09b5fbfc1 + md5: 1290c220c77ac0d9ad15db64870023a7 + depends: + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libjpeg-turbo >=3.2.0,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libtiff >=4.7.2,<4.8.0a0 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - gdk-pixbuf >=2.44.8,<3.0a0 + size: 581638 + timestamp: 1786717909641 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/glslang-16.5.0-hfeb5c2c_1.conda + sha256: ffddee19cabdba3835974f42def5339aa9edcdb36c7e178c42dceb3514769011 + md5: 3cf455cc596845f04200a6f2d67f4366 + depends: + - libgcc >=14 + - libstdcxx >=14 + - spirv-tools >=2026,<2027.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - glslang >=16,<17.0a0 + size: 1398415 + timestamp: 1785879950902 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gmp-6.3.0-h4d6b352_3.conda + sha256: ab165962a7316f269a7bde936aa442bf69f0fed97a497e63ec28f366b4999037 + md5: ce2326e31df1913341036653e1c07baa + depends: + - libstdcxx >=14 + - libgcc >=14 + license: GPL-2.0-or-later OR LGPL-3.0-or-later + purls: [] + run_exports: + weak: + - gmp >=6.3.0,<7.0a0 + size: 457444 + timestamp: 1786629160018 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/graphite2-1.3.15-h7ac5ae9_1.conda + sha256: 5be01914b445dfbde85a4751b1d12b331740e7af68a86e4ef6313ab38a870fdd + md5: c5835ff5788e0d772d67a97bd5fe001b + depends: + - libstdcxx >=14 + - libgcc >=14 + license: LGPL-2.0-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - graphite2 >=1.3.15,<2.0a0 + size: 119414 + timestamp: 1786118514013 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/greenlet-3.5.5-py312hf55c4e8_0.conda + sha256: bb028656fcaf6b29afc51d51488c89948fe14142250d2531d1a239dcc951bf8d + md5: 9a2e24d7c7f65dd81e11ee404b2e5cef + depends: + - python + - python 3.12.* *_cpython + - libgcc >=14 + - libstdcxx >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/greenlet?source=compressed-mapping + run_exports: {} + size: 279798 + timestamp: 1786384055329 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx-16.1.0-hfdd745d_2.conda + sha256: ac8e591114228e96d55c6d0bfc30a2510ba94a0d9cbb86e60baf311e75b8382d + md5: 5c100a1b94ae399af55fa3d208468be1 + depends: + - conda-gcc-specs + - gcc 16.1.0 hfdd745d_2 + - gxx_impl_linux-aarch64 16.1.0 hd5c6868_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 28614 + timestamp: 1787164736946 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_impl_linux-aarch64-16.1.0-hd5c6868_2.conda + sha256: 149b32c85faea366f09df9e20bba194a6455d0ad801a568b7857d1090dcf3bd5 + md5: 602150d91feb5a9ea227ad0722d7e982 + depends: + - gcc_impl_linux-aarch64 16.1.0 h998876f_2 + - libstdcxx-devel_linux-aarch64 16.1.0 h2445e1f_102 + - sysroot_linux-aarch64 + - tzdata + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 15360140 + timestamp: 1787164680765 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_linux-aarch64-16.1.0-hdc5d2df_1.conda + sha256: b4437b50af3a08a90fed435769a37dc892dba8aafa11f2918a215c2aee17a0b3 + md5: 77bfa23b3b135380a0bed9d7a9d024fd + depends: + - gxx_impl_linux-aarch64 16.1.0.* + - gcc_linux-aarch64 ==16.1.0 hed00b63_1 + - binutils_linux-aarch64 + - sysroot_linux-aarch64 + license: BSD-3-Clause + license_family: BSD + run_exports: + strong: + - libstdcxx >=16 + - libgcc >=16 + size: 27954 + timestamp: 1787166199966 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/harfbuzz-14.3.1-h8af1aa0_0.conda + sha256: 91d714113121591adff3193d4de9aa57bc4c9fe3644514b344151f8f6576c1b7 + md5: 637aed5a74074c59107b6d0bb97d9266 + depends: + - libharfbuzz-devel 14.3.1 h8f7ccb3_0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 11103 + timestamp: 1786970826414 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + sha256: 54d921defd947adb58a90e10203d3bfe6c1f209f5f1a1ad2c6a9f7617f2fb59e + md5: b35bbb1b957440ed742f35fb96eb7f1c + depends: + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - icu >=78.3,<79.0a0 + size: 14688525 + timestamp: 1786545779464 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/keyutils-1.6.3-h5bc82ec_1.conda + sha256: 3999b1472f1e549a0b766428e2823abf20626aac5314b474c9b76bf6eb679def + md5: 6d9be306ecb8dfc9ff46f02cb367d5c2 + depends: + - libgcc >=15 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - keyutils >=1.6.3,<2.0a0 + size: 129546 + timestamp: 1786739205968 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/krb5-1.22.2-h095d8e5_2.conda + sha256: 601d79af94d9562ba70e2d4947034ba159aae293a3c860855335a7c76c14400e + md5: a4d0da122ba952abf76981e76d0d283c + depends: + - keyutils >=1.6.3,<2.0a0 + - libedit >=3.1.20250104,<3.2.0a0 + - libedit >=3.1.20250104,<4.0a0 + - libgcc >=15 + - libstdcxx >=15 + - openssl >=3.5.7,<4.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - krb5 >=1.22.2,<1.23.0a0 + size: 1538590 + timestamp: 1786762058856 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lame-4.0-h7ce06ba_1.conda + sha256: ba9cc2ae7c2b60259fb94a607e59a2b3a04b3e186d333e2dbdc619f59a891464 + md5: 1ad30e9af2941ff12351f17d33ec1acb + depends: + - libgcc >=14 + - mpg123 >=1.33.7,<1.34.0a0 + license: LGPL-2.0-only + license_family: LGPL + purls: [] + run_exports: + weak: + - lame >=4.0,<4.1.0a0 + size: 335199 + timestamp: 1786292484241 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lcms2-2.19.1-h9d5b58d_1.conda + sha256: ed213207bbf11663181941e0931caa9ce748f0544688e8e0fbcf330bca279389 + md5: 9183fda4be2b4ee5760cdb8e540439c8 + depends: + - libgcc >=14 + - libjpeg-turbo >=3.1.4.1,<4.0a0 + - libtiff >=4.7.1,<4.8.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - lcms2 >=2.19.1,<3.0a0 + size: 296564 + timestamp: 1780211834883 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + sha256: 2c4901f4227b0850328ed0c69f958b30ad2cd18982f7a31c7c1f911827004d08 + md5: 489444d0acb2a579d2a002d85a08c059 + depends: + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-aarch64 2.46.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 905305 + timestamp: 1784214534868 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lerc-4.2.0-h52b7260_0.conda + sha256: 0176a71d64fcb5aec43c9e8ab4ae72faa6c6b0b1cda8f40b65e19429ce13c84d + md5: 9fcfe6be4f752b72be7abc69842ca396 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - lerc >=4.2.0,<5.0a0 + size: 244850 + timestamp: 1785038308130 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libabseil-20260526.0-cxx17_h6983b43_1.conda + sha256: 51f53ae6266889f0972a10c2773465da5554fdf55ac15b9dea3e7f77520022d9 + md5: d8637f7cc7143fe4ad2eceac8e8cf033 + depends: + - libgcc >=14 + - libstdcxx >=14 + constrains: + - abseil-cpp =20260526.0 + - libabseil-static =20260526.0=cxx17* + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - libabseil >=20260526.0,<20260527.0a0 + - libabseil =*=cxx17* + size: 1457025 + timestamp: 1780524543286 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libass-0.17.5-hac26362_0.conda + sha256: e6029ed8232ea197f54ffffb7701b85ae1ee2850d44699d9554fadb95c578bd7 + md5: 00b2bb0ddef69e0fe6d42aff08abeaec + depends: + - libgcc >=14 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - fontconfig >=2.18.1,<3.0a0 + - fonts-conda-ecosystem + - fribidi >=1.0.16,<2.0a0 + - libiconv >=1.18,<2.0a0 + - harfbuzz >=14.2.1 + - libzlib >=1.3.2,<2.0a0 + license: ISC + purls: [] + run_exports: + weak: + - libass >=0.17.5,<0.17.6.0a0 + size: 178938 + timestamp: 1782298717792 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-9_haddc8a3_openblas.conda + build_number: 9 + sha256: 5ad8fda537086a842379b7eb8d67770674e3c3afa66b09690ed62b54439fc227 + md5: c2d360534e0377666eaf8f86e605511c + depends: + - libopenblas >=0.3.34,<0.3.35.0a0 + - libopenblas >=0.3.34,<1.0a0 + constrains: + - blas 2.309 openblas + - libcblas 3.11.0 9*_openblas + - liblapack 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + - mkl <2027 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libblas >=3.11.0,<4.0a0 + size: 18024 + timestamp: 1786058936290 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlicommon-1.2.0-h384ecca_3.conda + sha256: e81f38af3387620c4afb3769e668ecfb5bf9426bd9fd9db8a70d071ca4477b1f + md5: d0d4029ed32776dce412334e0f1c6160 + depends: + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlicommon >=1.2.0,<1.3.0a0 + size: 80692 + timestamp: 1786622718545 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlidec-1.2.0-h011f0d3_3.conda + sha256: a2e41f51d4f05bd96b1148c35882a880e85f2b316f238a32d657d908b928aae6 + md5: 8c25aeafcbf1629c1e39ee7c03e77c93 + depends: + - libbrotlicommon 1.2.0 h384ecca_3 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlidec >=1.2.0,<1.3.0a0 + size: 33949 + timestamp: 1786622726640 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libbrotlienc-1.2.0-hb247b97_3.conda + sha256: 4173e5c4d42bf08a9fc751914122acb87f6a565563cc11e8e896f2fa0dcd2ce9 + md5: 35f63f9c1202a85c121dbe40657612af + depends: + - libbrotlicommon 1.2.0 h384ecca_3 + - libgcc >=15 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlienc >=1.2.0,<1.3.0a0 + size: 348164 + timestamp: 1786622734798 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.78-hfcc8634_1.conda + sha256: 6487e7644d062e18d389c11a9a3183e5a71c2652d05fdd88dbd063ad09f7ad4b + md5: 5e347c665a310b4c148bbb02596ae0c3 + depends: + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libcap >=2.78,<2.79.0a0 + size: 108530 + timestamp: 1786025925536 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-9_hd72aa62_openblas.conda + build_number: 9 + sha256: 9e83c59429296818e7111a9f80f29c2c8a1e5ab9ae2d59aec8e67af9b87ac923 + md5: 1ff91e2252ca15db87a27b7b3ff280ae + depends: + - libblas 3.11.0 9_haddc8a3_openblas + constrains: + - blas 2.309 openblas + - liblapack 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libcblas >=3.11.0,<4.0a0 + size: 17977 + timestamp: 1786058941306 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda + sha256: fbc1fa6b3ddf946b2999c9820310682739505df71e1e2ac513a72efb951fa3e5 + md5: ee136db5a5409dddc78eaf7658fccffe + depends: + - __glibc >=2.28,<3.0.a0 + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=59.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 909365 + timestamp: 1761098964619 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-dev-1.14.1.1-he38c790_1.conda + sha256: 1d20ed52cd0a08fae11bdfba5762c50864651860f0d9f02ecf0eaed37a573a83 + md5: 7c4d86e9dd8643ed77ba3c918637bb3e + depends: + - __glibc >=2.28,<3.0.a0 + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libcufile 1.14.1.1 had8bf56_1 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - libcufile-static >=1.14.1.1 + license: LicenseRef-NVIDIA-End-User-License-Agreement + run_exports: + weak: + - libcufile >=1.14.1.1,<2.0a0 + size: 36798 + timestamp: 1761098993768 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdeflate-1.25-hfa851ae_1.conda + sha256: 4cb3da1d4ce7540604219d2a016253777da66c1a710c41557bc708aae7f54a75 + md5: 8cdf7f7e4908c9b2cf50c58966f2ff64 + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdeflate >=1.25,<1.26.0a0 + size: 71628 + timestamp: 1785908730449 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdovi-3.4.0-hf71c8f5_0.conda + sha256: d12c0db93410085c827587352f05b24ba56ac786285752a4b2aba59309b09832 + md5: 318831d864fbd3a513d71bb0db5ff9e6 + depends: + - libgcc >=14 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdovi >=3.4.0,<4.0a0 + size: 408693 + timestamp: 1784281571706 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdrm-2.4.129-h5bc82ec_0.conda + sha256: 2a0ee6c7648de5a5b7de2b861aa1aba01c860218f8b97af63ac6c81b0175b960 + md5: 3f34f401fa04c0ad38ff15b046c20596 + depends: + - libgcc >=15 + - libpciaccess >=0.19,<0.20.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdrm >=2.4.129,<2.5.0a0 + size: 346564 + timestamp: 1786684730263 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libedit-3.1.20250104-pl5321hc48eb74_1.conda + sha256: 2d7218da06f1121619335bff25a2669df810dee90d2eb65b17f8b2e6b1c0d372 + md5: 6e06eb2c9fda76721699bcdd759b9c60 + depends: + - ncurses + - libgcc >=14 + - ncurses >=6.6,<7.0a0 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libedit >=3.1.20250104,<3.2.0a0 + size: 149007 + timestamp: 1786616643904 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libegl-1.7.0-hd24410f_3.conda + sha256: b987d3874edfcd9c7ddca86c003cb04ae51160a72c173a24cd46ab9eeb8886ab + md5: ec017f25e5d01ef9dd81e95ff73ff051 + depends: + - libglvnd 1.7.0 hd24410f_3 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 54600 + timestamp: 1779728234591 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + sha256: 20a5726bc8705d91437c9e6ef83b30da64a1719b869656d20a1ee818333ea5ac + md5: fac3b65a605cd253037fdf3daf2de8d9 + depends: + - libgcc >=14 + constrains: + - expat 2.8.1.* + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 77649 + timestamp: 1781203572523 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + sha256: c95b5b5fc13c8d7af2a9908e6c64844f48787a7631f8abcde1813dc21b3b079e + md5: 81aedbde3ea118c602e8b289bf565ac5 + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libffi >=3.7.0,<3.8.0a0 + size: 63746 + timestamp: 1783520889209 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libflac-1.5.0-he9c94f4_1.conda + sha256: 175cdc1865c3d6becc87e96bf44010a8e14f3021600ddad59417ed36e677b1ea + md5: cbe37f1d15f60b5e5272955b55b65325 + depends: + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - libogg >=1.3.5,<1.4.0a0 + - libstdcxx >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libflac >=1.5.0,<1.6.0a0 + size: 397272 + timestamp: 1764526699497 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype-2.14.3-h8af1aa0_2.conda + sha256: 1e6ba895a397ee4fc1646f21000903ad13d93e9e6d9a7fb4dcef1baa837970bf + md5: 9d7e520ae06d08185ef2d500ff116d30 + depends: + - libfreetype6 >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 8409 + timestamp: 1786640943558 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libfreetype6-2.14.3-h9cc7050_2.conda + sha256: d29eac57042f2362d4e45c63a4a78d64a30e5284b1da29b99e0c1526671dd4c3 + md5: f7ee9de31f98281a3e451e496fbee3b5 + depends: + - libgcc >=15 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - freetype >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 445035 + timestamp: 1786640942903 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + sha256: 8f67a9b2ca7814b9480907bc9875f9643e0880e1a190bede54db88a02eeac76c + md5: 73685f300c39141946aa83a3b283c238 + depends: + - _openmp_mutex >=4.5 + constrains: + - libgcc-ng ==16.1.0=*_2 + - libgomp 16.1.0 h8acb6b2_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 627721 + timestamp: 1787164430390 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-ng-16.1.0-he9431aa_2.conda + sha256: b02d2865d2021e9bf1e945e9e7f3159c6c6e435e2f931e0834c18107941d7e7a + md5: dbfad493f04404a02f6e67370483d17e + depends: + - libgcc 16.1.0 h205dda4_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - libgcc + size: 28219 + timestamp: 1787164434239 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-16.1.0-he9431aa_2.conda + sha256: 82e0e0a77afb7c2fe1eef9128e2b2fc9ce1d23f6ce3340685610d468f222cae8 + md5: 3b93b41efc143168edf2946f146ce11d + depends: + - libgfortran5 16.1.0 h47adacf_2 + constrains: + - libgfortran-ng ==16.1.0=*_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 28172 + timestamp: 1787164456115 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-16.1.0-h47adacf_2.conda + sha256: 34b76bdabf1e75032802ab28b222226c630b5bb33cbcf37f019e89d805837e78 + md5: 10bf62128b3a5bd7388fa2b0749de565 + depends: + - libgcc >=16.1.0 + constrains: + - libgfortran 16.1.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 1495125 + timestamp: 1787164440512 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgl-1.7.0-hd24410f_3.conda + sha256: 05c75a2034bdbca29bab467d02ad770ed5e524e4f0670432258f2d8487c95348 + md5: 6e893c36f31502dd195d3d58f455fdbd + depends: + - libglvnd 1.7.0 hd24410f_3 + - libglx 1.7.0 hd24410f_3 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 148112 + timestamp: 1779728248678 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglib-2.88.3-had1c41b_1.conda + sha256: 0f8a6e2346540a7cbbd3bfb41395385190821247b9f8003859089ea3c2b623c2 + md5: 11f141ce3aca0b2a07cd5bc07e6072f6 + depends: + - libgcc >=14 + - libffi >=3.7.0,<3.8.0a0 + - libiconv >=1.18,<2.0a0 + - libzlib >=1.3.2,<2.0a0 + - pcre2 >=10.47,<10.48.0a0 + constrains: + - glib >2.66 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libglib >=2.88.3,<3.0a0 + size: 4945329 + timestamp: 1786457675064 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglvnd-1.7.0-hd24410f_3.conda + sha256: ca124e53765a2b123e0ca6ce809c7caf188bb26e5fe125b69099378276d5e66f + md5: a2ad848c0aab2e326c6af08ea20502f4 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 146645 + timestamp: 1779728228274 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libglx-1.7.0-hd24410f_3.conda + sha256: 2698b415b9f7b692cd64e34db623e1a6e54ed54e78b0b4e5d4ea6762791e9118 + md5: 338faf34b78d053841098c0528699e34 + depends: + - libglvnd 1.7.0 hd24410f_3 + - xorg-libx11 >=1.8.13,<2.0a0 + license: LicenseRef-libglvnd + purls: [] + run_exports: {} + size: 76704 + timestamp: 1779728242753 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + sha256: c47d48956ab7b399744ae363509dc644ac614b0ad9c000beaeeea8b1c6e258e3 + md5: 8d427a4d1a086922e2e1cd536b9c63cf + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 617395 + timestamp: 1787164364894 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-14.3.1-h8f7ccb3_0.conda + sha256: 7bd39d90363ac1b1f51a48510eb624bd053520ba0fefa656e717388bae3c6a7c + md5: ea9294a2b068d982e9e8ef4e7c48f7ac + depends: + - cairo >=1.18.4,<2.0a0 + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libstdcxx >=15 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 1407242 + timestamp: 1786970801231 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libharfbuzz-devel-14.3.1-h8f7ccb3_0.conda + sha256: f750ba44b7e2519dcd72450ca78d804d37f027f0b7930400003096bcda68be04 + md5: e432909c0984c98b6ce080657c6928ca + depends: + - cairo >=1.18.4,<2.0a0 + - freetype + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=15 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz 14.3.1 h8f7ccb3_0 + - libpng >=1.6.58,<1.7.0a0 + - libstdcxx >=15 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 2162092 + timestamp: 1786970819598 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwloc-2.13.0-default_ha95e27d_1000.conda + sha256: 88888d99e81c93e7331f2eb0fec08b3c4a47a1bfa1c88b3e641f6568569b6261 + md5: 974183f6420938051e2f3208922d057f + depends: + - libgcc >=14 + - libstdcxx >=14 + - libxml2 + - libxml2-16 >=2.14.6 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libhwloc >=2.13.0,<2.13.1.0a0 + size: 2453519 + timestamp: 1770953713701 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libhwy-1.4.0-h9b45113_0.conda + sha256: 6583ca6181e2c70367a62951fb7e82fd63048ab667af3c254ca3ba35a8ea2a0c + md5: 321d06ae401d0f7face5326d78f84fc8 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: Apache-2.0 OR BSD-3-Clause + purls: [] + run_exports: + weak: + - libhwy >=1.4.0,<1.5.0a0 + size: 947179 + timestamp: 1784325595902 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libiconv-1.18-h1ea5142_3.conda + sha256: d22c666eb887afd2119aac2110e23a0e817e9391bda99293421f7c46dab1564c + md5: 951b54a36388613a99820b33b997f690 + depends: + - libgcc >=15 + license: LGPL-2.1-only + purls: [] + run_exports: + weak: + - libiconv >=1.18,<2.0a0 + size: 785924 + timestamp: 1787033793216 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjpeg-turbo-3.2.0-he30d5cf_1.conda + sha256: c5626ea672be2e59784f9be20dc8ceb7961b8ab0053651ded2dffec64e4b8245 + md5: 8730e25aa7eab80ca86dfb9a6bedf1ba + depends: + - libgcc >=14 + constrains: + - jpeg <0.0.0a + license: IJG AND BSD-3-Clause AND Zlib + purls: [] + run_exports: + weak: + - libjpeg-turbo >=3.2.0,<4.0a0 + size: 716519 + timestamp: 1785896318334 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libjxl-0.12.0-h7a31cfc_2.conda + sha256: 9769e5deda696c88c5d3a2e137af13db7934e4f7231dfd92527e683f76d874bf + md5: 6053b222ea74b7f6d04d770d85d62948 + depends: + - libgcc >=15 + - libstdcxx >=15 + - libbrotlienc >=1.2.0,<1.3.0a0 + - libbrotlidec >=1.2.0,<1.3.0a0 + - libhwy >=1.4.0,<1.5.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libjxl >=0.12.0,<0.13.0a0 + size: 2171868 + timestamp: 1786691386840 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-9_h88aeb00_openblas.conda + build_number: 9 + sha256: 562077bf38f962f6b80ec4e021bd2328f603ce0b112d3045b3f3b37f1a110f73 + md5: c560d88ddee90ba4120ac63eda69fbee + depends: + - libblas 3.11.0 9_haddc8a3_openblas + constrains: + - blas 2.309 openblas + - libcblas 3.11.0 9*_openblas + - liblapacke 3.11.0 9*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - liblapack >=3.11.0,<3.12.0a0 + size: 18007 + timestamp: 1786058945578 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + sha256: f760669fd1cea27f689f411c0d5488e26ce50e382c9b63e4ad348f959850124a + md5: e0e6411a60d00186eec7c73f4118ab67 + depends: + - libgcc >=14 + constrains: + - xz 5.8.3.* + license: 0BSD + purls: [] + run_exports: + weak: + - liblzma >=5.8.3,<6.0a0 + size: 125578 + timestamp: 1786348561649 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-he30d5cf_2.conda + sha256: 5d6621a2229777824386164b40c67ff804fe98dd4165354cf73ee73e282a2adf + md5: eaaaec4776cd8a7b987c4b1782220141 + depends: + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 113885 + timestamp: 1786650485380 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-he30d5cf_1.conda + sha256: d5a50ee7a82e8fb98069b51af2e28a2360cd9f67c3fb4376ecea75598f0c3ef6 + md5: 649b8ed2e7639550c891f875dfb01e88 + depends: + - libgcc >=14 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - libnl >=3.11.0,<4.0a0 + size: 743370 + timestamp: 1787038306943 +- 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: [] + run_exports: + weak: + - libnsl >=2.0.1,<2.1.0a0 + size: 34831 + timestamp: 1750274211000 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-12.9.82-h8f3c8d4_2.conda + sha256: 11a041920935c01fce0cc351f5db4157a3154e9a1aa3cfec29a707fb44c9a112 + md5: 230f26daf9cfcf4a4185c0c6f9cbdcb2 + depends: + - arm-variant * sbsa + - cuda-version >=12,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 771344 + timestamp: 1782920321153 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-12.9.86-h8f3c8d4_2.conda + sha256: d5ff36f46250069a23b18d557052c6656f40a002333885e8c5332071e873b48e + md5: e318a6573fea150226d5f417d1c0807a + depends: + - arm-variant * sbsa + - cuda-version >=12,<12.10.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 30323952 + timestamp: 1760723774770 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvptxcompiler-dev-12.9.86-h579c4fd_2.conda + sha256: 20cc92d163571b6d67efcfcb05dec042916219f29846152fdb696d499fa9fade + md5: 096a5f4ddc263418d1b8160413a16c61 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev_linux-aarch64 12.9.86 h579c4fd_2 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27138 + timestamp: 1753975408006 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libogg-1.3.5-h86ecc28_1.conda + sha256: 2c1b7c59badc2fd6c19b6926eabfce906c996068d38c2972bd1cfbe943c07420 + md5: 319df383ae401c40970ee4e9bc836c7a + depends: + - libgcc >=13 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libogg >=1.3.5,<1.4.0a0 + size: 220653 + timestamp: 1745826021156 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.34-pthreads_h9d3fd7e_0.conda + sha256: 0905b8acaff83558e5007351b2de329ce212ef5acbd595fcc22bb7fa1592f277 + md5: c37ba01d9ab7bfaf5f5dddc5d8807454 + depends: + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.34,<0.3.35.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libopenblas >=0.3.34,<1.0a0 + size: 5332045 + timestamp: 1784287139395 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-2026.3.0-h18f7da6_0.conda + sha256: 5f32dae84af50d6c827e86a9ff69347b6c729fb48bf34eec45a2f75991c28599 + md5: 7f5cb1ec2d79862c25b3655c4a4be134 + depends: + - libgcc >=14 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino >=2026.3.0,<2026.3.1.0a0 + size: 6104414 + timestamp: 1786125970101 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-arm-cpu-plugin-2026.3.0-h18f7da6_0.conda + sha256: b91dcebd6ea2236d413d3f026e738b1d35f57099351e9137b8d0242739f836ba + md5: 42e7705ae0c0a42fd37a15685a88e94b + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 10459044 + timestamp: 1786125988568 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-batch-plugin-2026.3.0-ha92a2b9_0.conda + sha256: eb1723d1a4ca78d34470856e3b95ad30a534085a219e85149ef2c679d7fdfbdf + md5: f08c3480f8a916cbd483d0d11217b230 + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 111414 + timestamp: 1786126017105 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-auto-plugin-2026.3.0-ha92a2b9_0.conda + sha256: 7476b8c0b95c965b3544504b647e0528df00816286cdef53befbd5ca161cfa0a + md5: 6825f08ddc3d38d95f878ef6780e73c3 + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + - tbb >=2023.0.0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 238304 + timestamp: 1786126025324 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-hetero-plugin-2026.3.0-h243f116_0.conda + sha256: e4320c205324a4801ec98f95f73a1efa8d264a30e4e4f005e2926bba1f0b2819 + md5: 357a4baccc99198573cb355aeeac4038 + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 215728 + timestamp: 1786126033594 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-ir-frontend-2026.3.0-h243f116_0.conda + sha256: 8e1dc24d203f08f0143be45ed9852bc3a5897025d2608b856852ad4e8ea8ec79 + md5: 0de93b8b53792b7213e5c3591cccad16 + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + - pugixml >=1.15,<1.16.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-ir-frontend >=2026.3.0,<2026.3.1.0a0 + size: 198176 + timestamp: 1786126041827 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-onnx-frontend-2026.3.0-hfb90a0c_0.conda + sha256: 9fcaec775c835ef474af83bc9749789794b2d3c2e17643a067f18969c8c2fb44 + md5: c88bee2c416f893f97892da5ca3a71c1 + depends: + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-onnx-frontend >=2026.3.0,<2026.3.1.0a0 + size: 1917529 + timestamp: 1786126051250 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-paddle-frontend-2026.3.0-hfb90a0c_0.conda + sha256: f07338ccb931d31b9965ff9af9b33f3403a9c2c76e40d400117f8a489286eba7 + md5: 4ac0a8ea5ddc667bd982f80afb2a9b26 + depends: + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-paddle-frontend >=2026.3.0,<2026.3.1.0a0 + size: 646503 + timestamp: 1786126061713 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-pytorch-frontend-2026.3.0-ha85bb2c_0.conda + sha256: a3934264c40091bfa0f4714bb05fd15e1f41000cd4d99cf45c3632bc6f25e682 + md5: fabb410e39ca81c5885ebb9cca146310 + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-pytorch-frontend >=2026.3.0,<2026.3.1.0a0 + size: 1136280 + timestamp: 1786126070349 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-frontend-2026.3.0-hba97658_0.conda + sha256: 41e9c88bc1dfcce23c6ac5cf71f54775adb64fe0717bda194b674ebc478d557d + md5: 02b09a9bbd116e7d83849eda44b116a4 + depends: + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libprotobuf >=7.35.1,<7.35.2.0a0 + - libstdcxx >=14 + - snappy >=1.2.2,<1.3.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-tensorflow-frontend >=2026.3.0,<2026.3.1.0a0 + size: 1219157 + timestamp: 1786126079947 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-tensorflow-lite-frontend-2026.3.0-ha85bb2c_0.conda + sha256: a52f9d03eee040b433f61661d6acec7209e4a0be050507aa33e3c039f09e51e8 + md5: e1464d38eae6013a29881c21b5731ddd + depends: + - libgcc >=14 + - libopenvino 2026.3.0 h18f7da6_0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libopenvino-tensorflow-lite-frontend >=2026.3.0,<2026.3.1.0a0 + size: 477952 + timestamp: 1786126089139 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopus-1.6.1-h80f16a2_0.conda + sha256: 059214f037fa5e51080f5aced39466993b2311a01d871086bd6d2a59bfbf59b5 + md5: c781f98ca7b987f968369bc768b2cd55 + depends: + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libopus >=1.6.1,<2.0a0 + size: 383586 + timestamp: 1768497303687 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpciaccess-0.19-he30d5cf_1.conda + sha256: 2161dacebeb075187f20ba35529297e7d4f6d456a89c4474062782436dbe3735 + md5: b1cb4a94819281ecb0391438e0be505c + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libpciaccess >=0.19,<0.20.0a0 + size: 31035 + timestamp: 1785971703914 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libplacebo-7.360.1-ha018e38_1.conda + sha256: 22fe6a6f34b6910c23cdaac21166cddd70ff385ced7aa45322b70c736fcae4c3 + md5: 6a8214555c597ce831d41d63f3fd3f71 + depends: + - libstdcxx >=14 + - libgcc >=14 + - shaderc >=2026.3,<2026.4.0a0 + - libdovi >=3.4.0,<4.0a0 + - libvulkan-loader >=1.4.341.0,<2.0a0 + - lcms2 >=2.19.1,<3.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libplacebo >=7.360.1,<7.361.0a0 + size: 565641 + timestamp: 1784287829183 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libpng-1.6.58-hf9b7768_1.conda + sha256: bd6e423b08342969689d8893c965aad78244b29724da2168aef3634fa0e1ebd7 + md5: 308ecb7ad60637dc5e95558ab583c5ba + depends: + - libgcc >=15 + - libzlib >=1.3.2,<2.0a0 + license: zlib-acknowledgement + purls: [] + run_exports: + weak: + - libpng >=1.6.58,<1.7.0a0 + size: 333238 + timestamp: 1786616546810 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libprotobuf-7.35.1-h30ec8a2_2.conda + sha256: df3cd7057c4a1d229bff2c9060c03425a42fb12d7d7e7fe985f63907c9e88922 + md5: b9c3b50124bf5fd1ff3ed97ee55f6266 + depends: + - libabseil * cxx17* + - libabseil >=20260526.0,<20260527.0a0 + - libgcc >=14 + - libstdcxx >=14 + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libprotobuf >=7.35.1,<7.35.2.0a0 + size: 3597785 + timestamp: 1783168080031 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/librsvg-2.62.3-hf685517_0.conda + sha256: c95ac70755863d8522c1115b54afca86148ea25366b616aa84c993c2ca54b9ce + md5: 38209cc04b3e3e5624c534bc703e6939 + depends: + - cairo >=1.18.4,<2.0a0 + - fontconfig >=2.18.0,<3.0a0 + - fonts-conda-ecosystem + - gdk-pixbuf >=2.44.6,<3.0a0 + - harfbuzz >=14.2.0 + - libgcc >=14 + - libglib >=2.88.1,<3.0a0 + - libxml2-16 >=2.14.6 + - pango >=1.56.4,<2.0a0 + constrains: + - __glibc >=2.17 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - librsvg >=2.62.3,<3.0a0 + size: 3052373 + timestamp: 1780456154830 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsanitizer-16.1.0-h2510bd8_2.conda + sha256: bb46fd60e0bed6e6b34eaa037daa4aa3c8b570e6d61dc925eaee4e82ddf1d79b + md5: e904e995159a71fc9b8f1d2fcca7366e + depends: + - libgcc >=16.1.0 + - libstdcxx >=16.1.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + weak: + - libsanitizer 16.1.0 + size: 7659334 + timestamp: 1787164462584 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsndfile-1.2.2-h7354dbf_3.conda + sha256: d92e859d8eef147faa00d4d494d7f2d2805327dbfcfa05f71b239907f5706149 + md5: 721cd8fba5d2a457f5f18f86eff9b841 + depends: + - libgcc >=14 + - libstdcxx >=14 + - libogg >=1.3.5,<1.4.0a0 + - libopus >=1.6.1,<2.0a0 + - libflac >=1.5.0,<1.6.0a0 + - libvorbis >=1.3.7,<1.4.0a0 + - mpg123 >=1.33.7,<1.34.0a0 + - lame >=4.0,<4.1.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libsndfile >=1.2.2,<1.3.0a0 + size: 456116 + timestamp: 1786538532217 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsodium-1.0.22-h80f16a2_1.conda + sha256: 36fb7afb28fecb8d678611e05a96b1e135510369b7fe5e353e407308ef1f6796 + md5: 5cb9cebc948d70e6e7c81670f911dab3 + depends: + - libgcc >=14 + license: ISC + purls: [] + run_exports: + weak: + - libsodium >=1.0.22,<1.0.23.0a0 + size: 283426 + timestamp: 1779163468728 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + sha256: fae75e68e9dbc3c90dcf93d4bae6315f1330c95aaf1404a721e8468266c23475 + md5: 27e16aa1f45c787aa181549be6f209f4 + depends: + - icu >=78.3,<79.0a0 + - libgcc >=15 + - libzlib >=1.3.2,<2.0a0 + license: blessing + purls: [] + run_exports: + weak: + - libsqlite >=3.53.4,<4.0a0 + size: 972932 + timestamp: 1787051100646 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + sha256: ebe8a5794162ec1603c43eadc23f0feaaf4894bcc52e9061c4d452237a6b3c99 + md5: b1ff3987d440eed553b5015ee18e0d58 + depends: + - libgcc 16.1.0 h205dda4_2 + constrains: + - libstdcxx-ng ==16.1.0=*_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 6260013 + timestamp: 1787164448776 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-ng-16.1.0-hdbbeba8_2.conda + sha256: cd0919277f81f783ecd113692a6e0a13000d847c2e4591b316a942a5d8a4b98b + md5: 2f75cf9611149a0a1b33c619d5555411 + depends: + - libstdcxx 16.1.0 hef695bb_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - libstdcxx + size: 28262 + timestamp: 1787164477642 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hfcc8634_1.conda + sha256: 7938befc6a09d9f829663ea134b01bea78dabe08d928e9a7caa68e2d726e03c5 + md5: d8981d39a52ab992a033a68927da47e0 + depends: + - libcap >=2.78,<2.79.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 515284 + timestamp: 1780084773602 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libtiff-4.7.2-hdb009f0_0.conda + sha256: ef1006578ef7e3f7c420e89d87846213ceb3fdcef2626af2558cbede53d36839 + md5: 20166e2297c1cac346b544d5f6197440 + depends: + - lerc >=4.1.0,<5.0a0 + - libdeflate >=1.25,<1.26.0a0 + - libgcc >=14 + - libjpeg-turbo >=3.1.4.1,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libstdcxx >=14 + - libwebp-base >=1.6.0,<2.0a0 + - libzlib >=1.3.2,<2.0a0 + - zstd >=1.5.7,<1.6.0a0 + license: HPND + purls: [] + run_exports: + weak: + - libtiff >=4.7.2,<4.8.0a0 + size: 508982 + timestamp: 1783084925965 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hfcc8634_1.conda + sha256: 1963dbd5a5c08390db2321dd2fa5c9df45c0fe68701fce4f9c36141155b4de13 + md5: 67728797901490baae52b3ce8d738d34 + depends: + - libcap >=2.78,<2.79.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 156922 + timestamp: 1780084778404 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libunwind-1.8.3-h6470e1d_0.conda + sha256: 86c013d522975b76e16a74341bfcb22f6ec2e9b8b87ec3e15380f46c435eaa7b + md5: 5d8191a950e492a06dc29b491dd5f7c5 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libunwind >=1.8.3,<1.9.0a0 + size: 94555 + timestamp: 1757032278900 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liburing-2.14-hfefdfc9_0.conda + sha256: 7584dc478a34e50c5dc0e0ceac4cb9819ff352bc3a5d0cbb001b974dab9a0967 + md5: 9d32167817a5a85724e8524436559229 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - liburing >=2.14,<2.15.0a0 + size: 155011 + timestamp: 1770567701524 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libusb-1.0.29-h06eaf92_0.conda + sha256: a60aae6b529cd7caa7842f9781ef95b93014e618f71fb005e404af434d76a33f + md5: 9a86e7473e16fe25c5c47f6c1376ac82 + depends: + - libgcc >=13 + - libudev1 >=257.4 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libusb >=1.0.29,<2.0a0 + size: 93129 + timestamp: 1748856228398 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + sha256: 7663489f97c104ae3814db10f384932c74b439f3c1fd4247e4fe3599830c090a + md5: 58fa42bc4bc71fc329889497ec15effb + depends: + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libuuid >=2.42.2,<3.0a0 + size: 43248 + timestamp: 1781625528371 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvorbis-1.3.7-h7ac5ae9_2.conda + sha256: 066708ca7179a1c6e5639d015de7ed6e432b93ad50525843db67d57eb1ba1faf + md5: 9d099329070afe52d797462ca7bf35f3 + depends: + - libogg + - libstdcxx >=14 + - libgcc >=14 + - libogg >=1.3.5,<1.4.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libvorbis >=1.3.7,<1.4.0a0 + size: 289391 + timestamp: 1753879417231 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvpx-1.15.2-hfae3067_0.conda + sha256: 4b60838eee9bda276f4b75906745d8f98f74c4b40d741050e07b2a96fcaf753f + md5: dd61430bfc5499c75422afdd0fe0a1bb + depends: + - libgcc >=14 + - libstdcxx >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libvpx >=1.15.2,<1.16.0a0 + size: 1296382 + timestamp: 1762012332100 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libvulkan-loader-1.4.357.0-h8b8848b_0.conda + sha256: 0c3d264d8dae9f6bc57a9143934d1914f60b206fe6b110ccc3cf2fd2a5b90508 + md5: 34b3f91180116e005605e174b626e2ff + depends: + - libstdcxx >=14 + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + - xorg-libxrandr >=1.5.5,<2.0a0 + constrains: + - libvulkan-headers 1.4.357.0.* + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libvulkan-loader >=1.4.357.0,<2.0a0 + size: 227452 + timestamp: 1785311395466 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libwebp-base-1.6.0-ha2e29f5_1.conda + sha256: 4c64e6843d64876d054a28ecbab70abdf145da3c2cbdaa4a43db26cdf0fd760b + md5: 548943c39851543734ce0d20eeb469b0 + depends: + - libgcc >=14 + constrains: + - libwebp 1.6.0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libwebp-base >=1.6.0,<2.0a0 + size: 357551 + timestamp: 1785956962809 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcb-1.17.0-h3f04742_1.conda + sha256: 5e804b6221d22732826091c9da062acaaae6cd45a2458be29fe4e55c47510212 + md5: caa24d7637c6df83b4c8203f5680266e + depends: + - libgcc >=15 + - pthread-stubs + - xorg-libxau >=1.0.12,<2.0a0 + - xorg-libxdmcp >=1.1.5,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libxcb >=1.17.0,<2.0a0 + size: 401513 + timestamp: 1787077419191 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcrypt-4.4.38-h80f16a2_0.conda + sha256: d3514900e2121972e435f7803763c1843dad6709e48aa02a2b47c4d481f83be7 + md5: b1a5cb7ff2d8f5911ba1fb6897176098 + depends: + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libxcrypt >=4.4.38 + size: 133882 + timestamp: 1785887114864 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxkbcommon-1.13.2-he51e330_1.conda + sha256: b196478988b576d324b3343fdcf4972a42647ea0a5c1b02dc77b926a64b8ceb8 + md5: a9abdfd661d3bf523244a5488ca0f6a5 + depends: + - xkeyboard-config + - libstdcxx >=14 + - libgcc >=14 + - xorg-libxau >=1.0.12,<2.0a0 + - libxcb >=1.17.0,<2.0a0 + - libxml2 + - libxml2-16 >=2.14.6 + license: MIT AND MIT-open-group AND HPND AND HPND-sell-variant AND ISC + purls: [] + run_exports: + weak: + - libxkbcommon >=1.13.2,<2.0a0 + size: 984153 + timestamp: 1787178819842 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-16-2.15.3-h79dcc73_0.conda + sha256: ad048a9ca1bf2cdfedb2b0c231050da416c44ee1436a3d1a83b51d2e2deaa842 + md5: 68866231cfe8789e780347f2482df96d + depends: + - icu >=78.3,<79.0a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - libxml2 2.15.3 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 601948 + timestamp: 1776376758674 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxml2-2.15.3-h869d058_0.conda + sha256: e3af6af9df73bd3c7a8e4e6c8cc38df3699e7f588b0705c257a8601e40acfbdf + md5: 2cffef27cb2eb9ed1e315a1e269d4335 + depends: + - icu >=78.3,<79.0a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libxml2-16 2.15.3 h79dcc73_0 + - libzlib >=1.3.2,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libxml2 + - libxml2-16 >=2.15.3 + size: 48101 + timestamp: 1776376766341 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + sha256: 76efa6cc9d7e6f5ee3bbca0939f64054af2bdfb3c3632531f8e633cf6c2ea41e + md5: bd534c2fbe56d8c2ea3b2d8f5e12bca8 + constrains: + - zlib 1.3.2 *_3 + license: Zlib + license_family: Other + purls: [] + run_exports: + weak: + - libzlib >=1.3.2,<2.0a0 + size: 70108 + timestamp: 1785276540870 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/make-4.4.1-he30d5cf_3.conda + sha256: b008fb8ba5c93478dacf36d60eed1b2de341d69773c3f73621d2a9e56f834d9d + md5: 9d82bf3d9bf57d56906354e2ad58204a + depends: + - libgcc >=14 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + run_exports: {} + size: 531874 + timestamp: 1785879822550 +- 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 + run_exports: {} + size: 26305 + timestamp: 1772446326927 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/mpg123-1.33.7-h2b27223_0.conda + sha256: 6506406e322bd3b5094579454a612fd5f1a349239530bc303d96782b9c0e710d + md5: d45db08f3b813b3b8b9c992e3583ac58 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: LGPL-2.1-only + license_family: LGPL + purls: [] + run_exports: + weak: + - mpg123 >=1.33.7,<1.34.0a0 + size: 575523 + timestamp: 1786232162349 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/msgpack-python-1.2.1-py312h1683e8e_1.conda + sha256: 2d760955dd3ef02428291efc1590067a7d045cf716bd2cdd30dc6924d1ca480e + md5: 0909f1715c44d390a8ba18be4e5a0fd1 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/msgpack?source=hash-mapping + run_exports: {} + size: 109581 + timestamp: 1786217402304 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + sha256: d69a04914139627f0a6bfd19412d6c7f1e37edc896af84a6011e07e8bc1e69fa + md5: c3b4349171ca987ff33a1de61f7b3f96 + depends: + - libgcc >=14 + license: X11 AND BSD-3-Clause + purls: [] + run_exports: + weak: + - ncurses >=6.6,<7.0a0 + size: 955422 + timestamp: 1786355019431 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.5.2-py312hce9e0af_0.conda + sha256: 29205d0c829c594e457289fae07fd7942d612afc15a947570c4686275c6a35f6 + md5: f1b530dcaa95a1e5ee7a992c4217cfef + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - 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=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 8029479 + timestamp: 1786330610947 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.5.2-py314he1698a1_0.conda + sha256: 094fb3f85c0af562d46dc96277d0d2297f651ca35ae99009313dcfb28da7c73d + md5: a1b6c6047ad7dc032db6380ffb72b1ca + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - 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 + purls: + - pkg:pypi/numpy?source=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 8192594 + timestamp: 1786330616684 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openh264-2.6.0-h663e864_1.conda + sha256: c90d20ddcf28537ea6c1bd1c26a7abcba6baf9d7cdec493daa04bf0a968d1264 + md5: 0d86d4becd3cd1ce48011f71099211be + depends: + - libgcc >=14 + - libstdcxx >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - openh264 >=2.6.0,<2.6.1.0a0 + size: 795565 + timestamp: 1782685979198 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + sha256: c89e748e8a008e8ca6f25e102362f33319db0c98cc29d98ddada92842f636327 + md5: 1600dfde78c5adba306f8571af62a323 + depends: + - ca-certificates + - libgcc >=14 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - openssl >=3.6.3,<4.0a0 + size: 3719270 + timestamp: 1785913554920 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pango-1.58.2-h8547ced_0.conda + sha256: 7337c11d536da3c920a7bc67fc4a5a927c3366cb08d95c66056319145a847535 + md5: de1fcba6c7fe5efc236b58e38516bd39 + depends: + - cairo >=1.18.4,<2.0a0 + - fontconfig >=2.18.2,<3.0a0 + - fonts-conda-ecosystem + - fribidi >=1.0.16,<2.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libgcc >=14 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz >=14.3.0 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - pango >=1.58.2,<2.0a0 + size: 482634 + timestamp: 1786110288624 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pcre2-10.47-hf841c20_0.conda + sha256: 04df2cee95feba440387f33f878e9f655521e69f4be33a0cd637f07d3d81f0f9 + md5: 1a30c42e32ca0ea216bd0bfe6f842f0b + depends: + - bzip2 >=1.0.8,<2.0a0 + - libgcc >=14 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - pcre2 >=10.47,<10.48.0a0 + size: 1166552 + timestamp: 1763655534263 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pixman-0.46.4-h7ac5ae9_3.conda + sha256: ed718d35c744ceef33063b5686f27b4b8d30d4065485e24efafb248658ee83b5 + md5: c5f34596fc05afb9ccc2782c42bcfcc5 + depends: + - libstdcxx >=14 + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - pixman >=0.46.4,<1.0a0 + size: 304657 + timestamp: 1786106625126 +- 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 + run_exports: {} + size: 230283 + timestamp: 1769678159757 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pthread-stubs-0.4-he30d5cf_1003.conda + sha256: 6138ca8729e6af8658c7e184c38370bec9b0b7840272deff79a3d0c1090f07e4 + md5: 75ad6624c7f795b828227672ca4b5f0b + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 9235 + timestamp: 1786069420166 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pugixml-1.15-h6ef32b0_0.conda + sha256: adc17205a87e064508d809fe5542b7cf49f9b9a458418f8448e2fc895fcd04f3 + md5: 53e14f45d38558aa2b9a15b07416e472 + depends: + - libgcc >=13 + - libstdcxx >=13 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - pugixml >=1.15,<1.16.0a0 + size: 113424 + timestamp: 1737355438448 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pulseaudio-client-17.0-hcf98165_3.conda + sha256: bb55db0dfe120f6063ad3ac74524b37c0bf92c6002cc059c31a5506f96a67f22 + md5: 8d73cfc699cd0a5ed2ea04bfb73eee0a + depends: + - dbus >=1.16.2,<2.0a0 + - libgcc >=14 + - libglib >=2.86.1,<3.0a0 + - libiconv >=1.18,<2.0a0 + - libsndfile >=1.2.2,<1.3.0a0 + - libsystemd0 >=257.10 + - libxcb >=1.17.0,<2.0a0 + constrains: + - pulseaudio 17.0 *_3 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - pulseaudio-client >=17.0,<17.1.0a0 + size: 760306 + timestamp: 1763148231117 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.12.13-ha505bbe_1_cpython.conda + build_number: 1 + sha256: d06c06da903b39bffc460c1626ab4fdd932bea5a2444ffac3132a3758b0d549c + md5: 93e063173a66ab5e0f89455cef04ffb0 + depends: + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-aarch64 >=2.36.1 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=14 + - liblzma >=5.8.3,<6.0a0 + - libnsl >=2.0.1,<2.1.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libuuid >=2.42.2,<3.0a0 + - libxcrypt >=4.4.38 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.6,<7.0a0 + - openssl >=3.5.7,<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: [] + run_exports: + weak: + - python_abi 3.12.* *_cp312 + noarch: + - python + size: 13798396 + timestamp: 1786443483173 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.7-h6bfacdd_100_cp314.conda + build_number: 100 + sha256: f06bf28284339913931caf4004e3d81269bfb08e57fe3487cf87008c02480194 + md5: 0be19acb61fbaa0f3c7bd3c58755ae39 + depends: + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-aarch64 >=2.36.1 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=15 + - liblzma >=5.8.3,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libuuid >=2.42.2,<3.0a0 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.6,<7.0a0 + - openssl >=3.5.7,<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 + purls: [] + run_exports: + weak: + - python_abi 3.14.* *_cp314 + noarch: + - python + size: 35165847 + timestamp: 1787154077054 + python_site_packages_path: lib/python3.14/site-packages +- 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 + run_exports: {} + size: 192182 + timestamp: 1770223431156 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pyzmq-27.1.0-py312hdf0a211_3.conda + noarch: python + sha256: 0bf98beaccc17a101d8e8496b88708f938e098a2606f6cc802379dc716572614 + md5: acc7f0e3fc38e949267bc9a4f09ded15 + depends: + - python + - libgcc >=14 + - libstdcxx >=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 + run_exports: {} + size: 212016 + timestamp: 1779483886884 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-63.0-h1f0f388_1.conda + sha256: 89dc4066bf0a2ee8e0cdeb6b6e8884c2c36c9a82855a438a0720ee59297fae3e + md5: 94e99208cc8828d5953fac098814a0e9 + depends: + - libgcc >=14 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.13 + - libudev1 >=257.13 + license: Linux-OpenIB + license_family: BSD + purls: [] + run_exports: + weak: + - rdma-core >=63.0 + size: 1351719 + timestamp: 1778528506759 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + sha256: 80167dcf73a96b6d0c1bb2298d7b8b9bc21b27cc5bf56979f9c548b49a4d1722 + md5: 5b399a7afa10098f2a6b02263181426e + depends: + - libgcc >=15 + - ncurses >=6.6,<7.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: + weak: + - readline >=8.3,<9.0a0 + size: 364344 + timestamp: 1787033761576 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rpds-py-2026.6.3-py312h00f41f5_0.conda + sha256: 0f80e0149ea885b378cbcbc5c01b7b3b32fb0918775d3898e97b69999fe3b78b + md5: 9d4967f1582f83435b649a7998e7f942 + 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 + run_exports: {} + size: 295235 + timestamp: 1782831257757 +- 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 + run_exports: {} + size: 147242 + timestamp: 1766159546485 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/scipy-1.18.0-py312ha7f05e0_0.conda + sha256: 79343875bcc5cce28a54001844b221395b883a3d28fd8d9125dd38a4afab825b + md5: c957cde07f79a2cf5c7e9cdab39fa90b + depends: + - 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 + - numpy <2.7 + - numpy >=1.23,<3 + - numpy >=2.0.0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/scipy?source=hash-mapping + run_exports: {} + size: 17170333 + timestamp: 1781912658149 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl2-2.32.56-h7ac5ae9_0.conda + sha256: 47f4ef4cd2313906840f146b18fee95c2a3a4fa9bd0afdb2d519e6c0aa8ca2ed + md5: 54747a3f3c468c5f446c78974c8c1234 + depends: + - libstdcxx >=14 + - libgcc >=14 + - sdl3 >=3.2.22,<4.0a0 + - libgl >=1.7.0,<2.0a0 + - libegl >=1.7.0,<2.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl2 >=2.32.56,<3.0a0 + size: 597756 + timestamp: 1757842928996 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sdl3-3.4.14-had2c13b_0.conda + sha256: 9ca267af883667fa20b0ec9e6d4a7ad6a54e9ef65c130880cce1bce539bde49d + md5: 6afcf0629c8cdc96f1f6e9bc06ac25de + depends: + - libstdcxx >=14 + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + - wayland >=1.26.0,<2.0a0 + - xorg-libxi >=1.8.3,<2.0a0 + - libegl >=1.7.0,<2.0a0 + - xorg-libxtst >=1.2.5,<2.0a0 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - xorg-libxext >=1.3.7,<2.0a0 + - libudev1 >=257.13 + - dbus >=1.16.2,<2.0a0 + - xorg-libxfixes >=6.0.2,<7.0a0 + - libxkbcommon >=1.13.2,<2.0a0 + - pulseaudio-client >=17.0,<17.1.0a0 + - xorg-libxscrnsaver >=1.2.4,<2.0a0 + - liburing >=2.14,<2.15.0a0 + - xorg-libxcursor >=1.2.3,<2.0a0 + - libunwind >=1.8.3,<1.9.0a0 + - libdrm >=2.4.127,<2.5.0a0 + - libgl >=1.7.0,<2.0a0 + - libusb >=1.0.29,<2.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl3 >=3.4.14,<4.0a0 + size: 2157224 + timestamp: 1785816119163 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/shaderc-2026.3-h9a39c52_0.conda + sha256: f3c16aeeae7dee968ff429e07a9100abe7a7a59ba0a262bc628dda04d0a96348 + md5: 3f4eeb1a29600a3e184835cade2b1621 + depends: + - glslang >=16,<17.0a0 + - libgcc >=14 + - libstdcxx >=14 + - spirv-tools >=2026,<2027.0a0 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - shaderc >=2026.3,<2026.4.0a0 + size: 117255 + timestamp: 1784251230054 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/snappy-1.2.2-he774c54_1.conda + sha256: a8a79c53852fb07286407907402caa5a96b6e22b518c4f010be40647f9ee3726 + md5: 3dec912091fb88614afa0af2712c1362 + depends: + - libgcc >=14 + - libstdcxx >=14 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - snappy >=1.2.2,<1.3.0a0 + size: 47096 + timestamp: 1762948094646 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/spirv-tools-2026.3-hfefdfc9_0.conda + sha256: 7befe58fcf61d93790570ca54620c10dd30668af0f6a0adffc4cdf16bd795037 + md5: 0f015ecd08599eaaa0e9387597108695 + depends: + - libgcc >=14 + - libstdcxx >=14 + constrains: + - spirv-headers >=1.4.357.0,<1.4.357.1.0a0 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - spirv-tools >=2026,<2027.0a0 + size: 2361152 + timestamp: 1786908177381 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sqlalchemy-2.0.52-py312h2fc9c67_0.conda + sha256: 6006ff829117b0e1efa70f83c631f7d522c9979de5286ca69b804e6177b24a7d + md5: 1c79fab0b42577004a89aaec3b4adbc6 + 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 + run_exports: {} + size: 3729200 + timestamp: 1786535217317 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/svt-av1-4.2.0-hfae3067_0.conda + sha256: 5f4c820fbf924145755c394df3d6ab98c96d6f5630ba486ce6f568de25d5845d + md5: 54ccc3ac256db941ff50f0fada595fa0 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - svt-av1 >=4.2.0,<4.2.1.0a0 + size: 2083840 + timestamp: 1784069822348 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tbb-2023.0.0-h57272ed_2.conda + sha256: 7ed4e93fad3707aa1686c5be286604c63aad33c9765a0d53fab7adbd179510b3 + md5: 0bc302bd45e5f744a672eb4f4a930398 + depends: + - libgcc >=14 + - libhwloc >=2.13.0,<2.13.1.0a0 + - libstdcxx >=14 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 145425 + timestamp: 1778675412470 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + build_number: 103 + sha256: cd51fbda051a9f3679d10ef4a94cd1ff38c10533b82845dadce8ba87245ba4ce + md5: 89e78452e06563964e419059ee45584a + depends: + - libgcc >=14 + - libzlib >=1.3.2,<2.0a0 + constrains: + - xorg-libx11 >=1.8.13,<2.0a0 + license: TCL + purls: [] + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + size: 3683040 + timestamp: 1784229053797 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tornado-6.5.8-py312hefbd42c_0.conda + sha256: d6e1b5017ba755c8b32f81b8a3f620ccbe1254bb63a2a5cb36e2779c2ec64b99 + md5: a6227a242f0f34c7bfd132ae5612b775 + 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 + run_exports: {} + size: 870861 + timestamp: 1786228525800 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/uv-0.12.5-h9b5564c_1.conda + sha256: 8905a0fc7350d0198bc6b72b7d3245db9d258e3ee38acf994237bf0993ef73e7 + md5: 1d23354045384cdd39eabc0252094a3e + depends: + - libstdcxx >=15 + - libgcc >=15 + constrains: + - __glibc >=2.17 + license: Apache-2.0 OR MIT + run_exports: {} + size: 17683943 + timestamp: 1787146849818 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/wayland-1.26.0-hb3e8f30_1.conda + sha256: 0cea81af0776eb1f472504c30590aa42fcef6c85b3982a2886e43d2b0bb800da + md5: 980e4d3720dac935b7bfa58dec351244 + depends: + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - wayland >=1.26.0,<2.0a0 + size: 342074 + timestamp: 1786151707553 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x264-1!164.3095-h4e544f5_2.tar.bz2 + sha256: b48f150db8c052c197691c9d76f59e252d3a7f01de123753d51ebf2eed1cf057 + md5: 0efaf807a0b5844ce5f605bd9b668281 + depends: + - libgcc-ng >=12 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x264 >=1!164.3095,<1!165 + size: 1000661 + timestamp: 1660324722559 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/x265-3.5-hdd96247_3.tar.bz2 + sha256: cb2227f2441499900bdc0168eb423d7b2056c8fd5a3541df4e2d05509a88c668 + md5: 786853760099c74a1d4f0da98dd67aea + depends: + - libgcc-ng >=10.3.0 + - libstdcxx-ng >=10.3.0 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x265 >=3.5,<3.6.0a0 + size: 1018181 + timestamp: 1646610147365 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xkeyboard-config-2.48-h80f16a2_0.conda + sha256: 96078068df25ddccc60958be740e6fa99efb1e0fa2dae2f84e775201bf84d70c + md5: 3dbc6d9e1f8a8768e7ef9f57585a43ca + depends: + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 442725 + timestamp: 1782027381059 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libice-1.1.2-h80f16a2_0.conda + sha256: e56bb636aefe3503a53520a0b7f3737f3a26fe0accf0befffc24d1c0ddd27008 + md5: 0566e37830f85911b141524635939941 + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libice >=1.1.2,<2.0a0 + size: 63847 + timestamp: 1786474771090 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libsm-1.2.6-hf23e593_1.conda + sha256: 4978f89a764b54dc8be7a115b2d57f570f793243f3227653232742ce0946101b + md5: f5f4a1233da463827499fb4e5e1f0172 + depends: + - libgcc >=14 + - xorg-libice >=1.1.2,<2.0a0 + - libuuid >=2.42.2,<3.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libsm >=1.2.6,<2.0a0 + size: 31476 + timestamp: 1786546266048 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libx11-1.8.13-h63a1b12_1.conda + sha256: 9ff59d55cbf85561833be3604a8c0a5497b0f13cdf122e8bb490e9cf3138d116 + md5: 8e873e9efc395329b914ee44e305b624 + depends: + - libgcc >=14 + - libxcb >=1.17.0,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libx11 >=1.8.13,<2.0a0 + size: 875768 + timestamp: 1787087025456 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxau-1.0.12-he30d5cf_2.conda + sha256: 0822f3a8eb2a54bb41e1133f010e09d4a3242f8f12a372dfff7ad7248c5dbd29 + md5: b03af9d9dfe7aec9e27db74fc41a4ba9 + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxau >=1.0.12,<2.0a0 + size: 17413 + timestamp: 1786382929588 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxcursor-1.2.3-h86ecc28_0.conda + sha256: c5d3692520762322a9598e7448492309f5ee9d8f3aff72d787cf06e77c42507f + md5: f2054759c2203d12d0007005e1f1296d + depends: + - libgcc >=13 + - xorg-libx11 >=1.8.9,<2.0a0 + - xorg-libxfixes >=6.0.1,<7.0a0 + - xorg-libxrender >=0.9.11,<0.10.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxcursor >=1.2.3,<2.0a0 + size: 34596 + timestamp: 1730908388714 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxdmcp-1.1.5-he30d5cf_2.conda + sha256: 681465a02be4ac256c05cd5b32ce9812da1563b75be1bfc8884d991454194df3 + md5: 044c398bf4b3b9c01741d8afe4ce1c3e + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxdmcp >=1.1.5,<2.0a0 + size: 21558 + timestamp: 1786383120543 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxext-1.3.7-h5bc82ec_1.conda + sha256: e2cc4ba2b5291710f9ae3e88d917d778ce7911262450e673ba8a597a5d43490a + md5: 32734d534d08a853f22bdef1d43223b7 + depends: + - libgcc >=15 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxext >=1.3.7,<2.0a0 + size: 53801 + timestamp: 1787103097310 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxfixes-6.0.2-he30d5cf_0.conda + sha256: 8cb9c88e25c57e47419e98f04f9ef3154ad96b9f858c88c570c7b91216a64d0e + md5: e8b4056544341daf1d415eaeae7a040c + depends: + - libgcc >=14 + - xorg-libx11 >=1.8.12,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxfixes >=6.0.2,<7.0a0 + size: 20704 + timestamp: 1759284028146 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxi-1.8.3-he30d5cf_0.conda + sha256: 0c1c7b39763469cfe0e9c6d0f9a39415321f477710719f4c5d63c61ea270271c + md5: f8ad5777ecc217d383a722598dbeb1ac + depends: + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + - xorg-libxext >=1.3.7,<2.0a0 + - xorg-libxfixes >=6.0.2,<7.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxi >=1.8.3,<2.0a0 + size: 49292 + timestamp: 1779113229775 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrandr-1.5.5-he30d5cf_0.conda + sha256: 9f5196665a8d72f4f119c40dcc4bafeb0b540b102cc7b8b299c2abf599e7919f + md5: 1f64c613f0b8d67e9fb0e165d898fb6b + depends: + - libgcc >=14 + - xorg-libx11 >=1.8.12,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxrender >=0.9.12,<0.10.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxrandr >=1.5.5,<2.0a0 + size: 31122 + timestamp: 1769445286951 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxrender-0.9.12-he30d5cf_1.conda + sha256: 3cbac6f69e4a8634ba6b60cf283cba92606c8c74caa1369b799325f96b2f0cbf + md5: 1bcdaa1fc263291e6f42ff061666f3ae + depends: + - libgcc >=14 + - xorg-libx11 >=1.8.13,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxrender >=0.9.12,<0.10.0a0 + size: 35814 + timestamp: 1787100239228 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxscrnsaver-1.2.4-h86ecc28_0.conda + sha256: ab88b1533e7498baeb00cbda50c899a6fe73eaee14df32c57b8ad3f2a0b3cc26 + md5: 7a0a04defd4399a93936f06fcfac5531 + depends: + - libgcc >=13 + - xorg-libx11 >=1.8.12,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxscrnsaver >=1.2.4,<2.0a0 + size: 15720 + timestamp: 1750007336692 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/xorg-libxtst-1.2.5-h57736b2_3.conda + sha256: 6eaffce5a34fc0a16a21ddeaefb597e792a263b1b0c387c1ce46b0a967d558e1 + md5: c05698071b5c8e0da82a282085845860 + depends: + - libgcc >=13 + - xorg-libx11 >=1.8.9,<2.0a0 + - xorg-libxext >=1.3.6,<2.0a0 + - xorg-libxi >=1.7.10,<2.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - xorg-libxtst >=1.2.5,<2.0a0 + size: 33786 + timestamp: 1727964907993 +- 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: [] + run_exports: + weak: + - yaml >=0.2.5,<0.3.0a0 + size: 88088 + timestamp: 1753484092643 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zeromq-4.3.5-hec9560f_11.conda + sha256: 134bceda31df1ad0dbadb61dd30e7254f5eab398288fcdd8b070946130533b5a + md5: 1ae4f546793d83754d79a43a38154746 + depends: + - libstdcxx >=14 + - libgcc >=14 + - krb5 >=1.22.2,<1.23.0a0 + - libsodium >=1.0.22,<1.0.23.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + run_exports: + weak: + - zeromq >=4.3.5,<4.4.0a0 + size: 355573 + timestamp: 1779123980042 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + sha256: 427fd14bcb3b8659796fecc682716617409350fb5a98e5b7b47558a10d1a2fc7 + md5: d942e34ac3920ba83f8b2d0169570187 + depends: + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + size: 615477 + timestamp: 1786599613561 +- conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.conda + sha256: 2a7204314663eeda5dec482a956f0e2eaf289bd5b9953eaaaad0e81aa64638f2 + md5: 3845f3d75991bae0fb90884662f4327c + depends: + - cpython + - python-gil + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 8144 + timestamp: 1784221492234 +- 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 + run_exports: {} + 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 + run_exports: {} + size: 18684 + timestamp: 1733750512696 +- 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 + run_exports: {} + 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 + run_exports: {} + 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: [] + run_exports: + strong: + - arm-variant * sbsa + size: 7126 + timestamp: 1742928603302 +- conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-3.0.2-pyhd8ed1ab_0.conda + sha256: fbbd8ce60cbd5c16f3fe559eb644551f94285caff30985ea961ff851c1cf25ac + md5: 89d495168582cb00428dad699d149624 + depends: + - python >=3.10 + constrains: + - astroid >=2,<5 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/asttokens?source=hash-mapping + run_exports: {} + size: 34639 + timestamp: 1783975742052 +- 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 + run_exports: {} + 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 + run_exports: {} + 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=hash-mapping + run_exports: {} + size: 7684321 + timestamp: 1772555330347 +- conda: https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.15.0-pyha770c72_0.conda + sha256: aed4b9dcf68ec2a75e5645fed14d77fd884d38d2e52bfa6ef4b278d90cd88781 + md5: 3b261da3fe9b4168738712832410b022 + depends: + - python >=3.10 + - soupsieve >=1.2 + - typing-extensions + license: MIT + license_family: MIT + purls: + - pkg:pypi/beautifulsoup4?source=hash-mapping + run_exports: {} + size: 92704 + timestamp: 1780853175566 +- conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.conda + sha256: 95e8e74062a5fe5f870ac8c90302b6e89945165fdaed7810606e84ddee6aac12 + md5: e27d2ac27b096dc51fedfcf775a53f9b + depends: + - __win + license: ISC + purls: [] + run_exports: {} + size: 132136 + timestamp: 1784754918886 +- conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + sha256: 0a0544cf95f64394fe4959286f5c71f5444ad58feb0602e53becb27448d24da6 + md5: 0f51e2391ade309db462a55611263e9c + depends: + - __unix + license: ISC + purls: [] + run_exports: {} + size: 131780 + timestamp: 1784754889428 +- conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.4-pyha770c72_0.conda + sha256: cca3a26282a5bc37a10afb1aa2006a21c45033cbc4ff012f9501f56f2a115c12 + md5: 13bdbb9b693b29134c56a9a00c23de41 + depends: + - msgpack-python >=0.5.2,<2.0.0 + - python >=3.10 + - requests >=2.16.0 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/cachecontrol?source=hash-mapping + run_exports: {} + size: 24906 + timestamp: 1782470439060 +- conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.7.22-pyhd8ed1ab_0.conda + sha256: fb167de4388e64e52aa3907ed099afab944c1fa6e5f74b281a312dae1bcf7f3b + md5: 37e13edbe3b48f1095a9d085ef9cd83b + depends: + - python >=3.10 + license: ISC + purls: + - pkg:pypi/certifi?source=hash-mapping + run_exports: {} + size: 137015 + timestamp: 1784717699092 +- conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.5.1-pyhd8ed1ab_0.conda + sha256: cb60ef3e0631c8bacb4f7057196dee4496091a22baa3bb4b9bccb12c7e1c921b + md5: e0ac3accc64e23e40969d660e5f58ac8 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/charset-normalizer?source=compressed-mapping + run_exports: {} + size: 64487 + timestamp: 1786835648298 +- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.4.2-pyh6dadd2b_0.conda + sha256: 5b5c96afdd801dd9c3b78ebc2cd9a9f3ce34186257415d394dde1aa8468aa3c0 + md5: 8a0d65027e25e367f9f1754f0604e8de + depends: + - __win + - colorama + - python >=3.10 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/click?source=hash-mapping + run_exports: {} + size: 106227 + timestamp: 1783085395110 +- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.4.2-pyhc90fa1f_0.conda + sha256: ccc4787f511964f9a1f2d2d2859c91c5d571fb60f7f09d4c4e092c9b7a94e671 + md5: 2c4bd6aeb90bb157456841c3270a0d92 + depends: + - __unix + - python + - python >=3.10 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/click?source=hash-mapping + run_exports: {} + size: 107155 + timestamp: 1783085363526 +- 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 + purls: + - pkg:pypi/colorama?source=hash-mapping + run_exports: {} + 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 + run_exports: {} + size: 14690 + timestamp: 1753453984907 +- conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.12.13-py312hd8ed1ab_1.conda + noarch: generic + sha256: b7ea8ebc1b2059159cbd49e0c9d1815713c73c4a55156b060c28dd61cfbdf9c2 + md5: 171d0cc7f621a0371ea273a05abdb46c + depends: + - python >=3.12,<3.13.0a0 + - python_abi * *_cp312 + license: Python-2.0 + purls: [] + run_exports: {} + size: 45930 + timestamp: 1786443506006 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-12.9.27-ha770c72_0.conda + sha256: 2ee3b9564ca326226e5cda41d11b251482df8e7c757e333d28ec75213c75d126 + md5: 87ff6381e33b76e5b9b179a2cdd005ec + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 1150650 + timestamp: 1746189825236 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-12.9.27-h579c4fd_0.conda + sha256: b4efaee8fa95b9ec97a462dc343914a138ece704895e33caa52ac55968f7adfa + md5: 71e4d87a72bf003bd05f05a502288b2a + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 1149299 + timestamp: 1746189919921 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-12.9.27-h57928b3_0.conda + sha256: 681eb1d9afd596e04329a82b04734c0e37c6ecb94b3380f3a378d61983e2a8cc + md5: 8f897dca7111f3bb4ded97ba6947b186 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 1139649 + timestamp: 1746189858434 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-12.9.86-ha770c72_2.conda + sha256: e6257534c4b4b6b8a1192f84191c34906ab9968c92680fa09f639e7846a87304 + md5: 79d280de61e18010df5997daea4743df + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 94239 + timestamp: 1753975242354 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + sha256: 1db1f3ff4b0f445ce4064eb323733f7612ce28bc879dd6849e162b1504b7474a + md5: 86be43a4154301b74f823bc6fe476629 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 94794 + timestamp: 1753975199249 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-12.9.86-h57928b3_2.conda + sha256: 2fccde18cafec3cdb6697f37c576567ac623dc69531e2a81bbc83d8a86a82d1f + md5: 569c55bd368307e48191a2ed54c64428 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 95452 + timestamp: 1753975640812 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_0.conda + sha256: ffe86ed0144315b276f18020d836c8ef05bf971054cf7c3eb167af92494080d5 + md5: 86e40eb67d83f1a58bdafdd44e5a77c6 + depends: + - cuda-cccl_linux-64 + - cuda-cudart-static_linux-64 + - cuda-cudart_linux-64 + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 389140 + timestamp: 1749218427266 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda + sha256: ad64a1ecfc933172dbc6407d71b1abb78dc7ffcd5cc871baee238350307a7c0c + md5: 60e07c05a51d5549bec1e7ee38849feb + depends: + - arm-variant * sbsa + - cuda-cccl_linux-aarch64 + - cuda-cudart-static_linux-aarch64 + - cuda-cudart_linux-aarch64 + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 388797 + timestamp: 1749218354725 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-12.9.79-he0c23c2_0.conda + sha256: e022d36a333420130faf6473c49f8dab54bf976cf320577ffb06db0a0797b734 + md5: 3c3e2f6b5455783fd332a072d632ea78 + depends: + - cuda-cccl_win-64 + - cuda-cudart-static_win-64 + - cuda-cudart_win-64 + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 1190184 + timestamp: 1749218971019 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-12.9.79-h3f2d84a_0.conda + sha256: d435f8a19b59b52ce460ee3a6bfd877288a0d1d645119a6ba60f1c3627dc5032 + md5: b87bf315d81218dd63eb46cc1eaef775 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 1148889 + timestamp: 1749218381225 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda + sha256: d4be038bad9abf0eac1e88dc57c8db6a469db8eb5d7c281085dfbb018ef84212 + md5: 52498fedeb43bbd4c45f84a0fb722d21 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 1152498 + timestamp: 1749218333554 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-12.9.79-he0c23c2_0.conda + sha256: 6a3410cd7ce07955cb705801055ef129ebee1cd6390c6fe9e5f607b67c3dba36 + md5: 0dd152a1493d90356037604a865f050f + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 354611 + timestamp: 1749218544740 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-12.9.79-h3f2d84a_0.conda + sha256: 6cde0ace2b995b49d0db2eefb7bc30bf00ffc06bb98ef7113632dec8f8907475 + md5: 64508631775fbbf9eca83c84b1df0cae + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 197249 + timestamp: 1749218394213 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda + sha256: 4900ff2f000a4f8a70a7bc8576469640aa6590618fa9e73c84e066e025dcb760 + md5: cc2459ad427431e089d78d760cf24437 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 212993 + timestamp: 1749218341193 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-12.9.79-he0c23c2_0.conda + sha256: 6a89a53cdbcfafa0bb55abee1b58492c6a9a28e688abe04f48f0d01649c5f3e4 + md5: 71c9c2ab52226f990f268164381d8494 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23260 + timestamp: 1749218569458 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvcc-dev_linux-64-12.9.86-he91c749_2.conda + sha256: a1672a34439a72869de9e011e935d41b62fc8dfb1a2700e85ed8a7a129b79981 + md5: 19d4e090217f0ea89d30bedb7461c048 + depends: + - cuda-crt-dev_linux-64 12.9.86 ha770c72_2 + - cuda-nvvm-dev_linux-64 12.9.86 ha770c72_2 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=6 + - libnvptxcompiler-dev_linux-64 12.9.86 ha770c72_2 + constrains: + - gcc_impl_linux-64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 28121 + timestamp: 1753975535813 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvcc-dev_linux-aarch64-12.9.86-h4310d6a_2.conda + sha256: f4b2917f38867dd1ad9cfb029c790cfdbee89f79919cd43b7ce0142cc77bfd35 + md5: e508550bd3d76ef97eaf5aab9ca757cd + depends: + - arm-variant * sbsa + - cuda-crt-dev_linux-aarch64 12.9.86 h579c4fd_2 + - cuda-nvvm-dev_linux-aarch64 12.9.86 h579c4fd_2 + - cuda-version >=12.9,<12.10.0a0 + - libgcc >=6 + - libnvptxcompiler-dev_linux-aarch64 12.9.86 h579c4fd_2 + constrains: + - gcc_impl_linux-aarch64 >=6,<15.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 28252 + timestamp: 1753975422031 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvcc-dev_win-64-12.9.86-h36c15f3_2.conda + sha256: e50255fe30f60135414e8b657c4ffdb12938af06463c959280eceb7166f69eb5 + md5: 20c8a059c5175ab804e7fc94213eb464 + depends: + - cuda-crt-dev_win-64 12.9.86 h57928b3_2 + - cuda-nvvm-dev_win-64 12.9.86 h57928b3_2 + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev_win-64 12.9.86 h57928b3_2 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23452957 + timestamp: 1753976361068 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda + sha256: 522722dcaffd133e0c7500c69dc70e21ac34d6762dcbaabfe847439f944028f0 + md5: 7b386291414c7eea113d25ac28a33772 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27096 + timestamp: 1753975261562 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + sha256: 5f27299818ecef44d6cf46a99465671744f6074c14618b5f8491a03a62942a7f + md5: c59b036058d7bf78ac0a99618c321e85 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27218 + timestamp: 1753975206503 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda + sha256: 455dbf0ec81efdbd40c0387d82c77689721f6d34b6e7694ca0d51bad9392eddc + md5: 23f7e70c03eabd2139b5e659c8e188b4 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27284 + timestamp: 1753975714790 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.6.1-pyhc364b38_0.conda + sha256: 13ac7a16860bc817a2b5461731ec4bbb22ebf7e4e38183441b1f9fdde9ce4191 + md5: 43b0f44f0bfbfcda7cb25cfde0fd747b + depends: + - python >=3.10 + - cuda-version >=12.0,<14 + - python + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cuda-pathfinder?source=compressed-mapping + run_exports: {} + size: 51858 + timestamp: 1787073465607 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + sha256: 5f5f428031933f117ff9f7fcc650e6ea1b3fef5936cf84aa24af79167513b656 + md5: b6d5d7f1c171cbd228ea06b556cfa859 + constrains: + - cudatoolkit 12.9|12.9.* + - __cuda >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 21578 + timestamp: 1746134436166 +- conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.6.0-pyhd8ed1ab_0.conda + sha256: 446d5d68b2e76ed4afbd23fdde580b242e4fd309006fc246181437942ef1fac7 + md5: 788c6a27890b964b6980d062d593c5da + depends: + - domdf-python-tools >=2.2.0 + - python >=3.10 + - tinycss2 >=1.2.1 + license: MIT + license_family: MIT + purls: + - pkg:pypi/dict2css?source=hash-mapping + run_exports: {} + size: 16157 + timestamp: 1779358557191 +- 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 + run_exports: {} + 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 + run_exports: {} + size: 96253 + timestamp: 1739444562482 +- conda: https://conda.anaconda.org/conda-forge/noarch/enum_tools-0.13.0-pyhcf101f3_1.conda + sha256: 6a9ca88e9cb9410fbc2a3ec8ef8fa691bfd69541b652cd9e6ec1accf02f07cb1 + md5: 2c4a76362cf961db49bc9dbd8707dcef + depends: + - pygments >=2.6.1 + - python >=3.10 + - typing-extensions >=3.7.4.3 + - python + 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 + run_exports: {} + size: 31183 + timestamp: 1777266899521 +- 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 + purls: + - pkg:pypi/exceptiongroup?source=hash-mapping + run_exports: {} + 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 + run_exports: {} + size: 30753 + timestamp: 1756729456476 +- conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.32.3-pyhd8ed1ab_0.conda + sha256: 43832e6442c59af5d65c6a5afa5a4a5160f6a45c8cc25f5275a9454161c40bfd + md5: 1ef717bcf73da3edcaaf7bf12a1e846c + depends: + - python >=3.10 + license: Unlicense + purls: + - pkg:pypi/filelock?source=compressed-mapping + run_exports: {} + size: 78106 + timestamp: 1786669915951 +- conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 + sha256: 58d7f40d2940dd0a8aa28651239adbf5613254df0f75789919c4e6762054403b + md5: 0c96522c6bdaed4b1566d11387caaf45 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 397370 + timestamp: 1566932522327 +- conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2 + sha256: c52a29fdac682c20d252facc50f01e7c2e7ceac52aa9817aaf0bb83f7559ec5c + md5: 34893075a5c9e55cdafac56607368fc6 + license: OFL-1.1 + license_family: Other + purls: [] + run_exports: {} + size: 96530 + timestamp: 1620479909603 +- conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2 + sha256: 00925c8c055a2275614b4d983e1df637245e19058d79fc7dd1a93b8d9fb4b139 + md5: 4d59c254e01d9cde7957100457e2d5fb + license: OFL-1.1 + license_family: Other + purls: [] + run_exports: {} + size: 700814 + timestamp: 1620479612257 +- conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-ubuntu-0.83-h77eed37_3.conda + sha256: 2821ec1dc454bd8b9a31d0ed22a7ce22422c0aef163c59f49dfdf915d0f0ca14 + md5: 49023d73832ef61042f6a237cb2687e7 + license: LicenseRef-Ubuntu-Font-Licence-Version-1.0 + license_family: Other + purls: [] + run_exports: {} + size: 1620504 + timestamp: 1727511233259 +- conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-ecosystem-1-0.tar.bz2 + sha256: a997f2f1921bb9c9d76e6fa2f6b408b7fa549edd349a77639c9fe7a23ea93e61 + md5: fee5683a3f04bd15cbd8318b096a27ab + depends: + - fonts-conda-forge + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 3667 + timestamp: 1566974674465 +- conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-hc364b38_1.conda + sha256: 54eea8469786bc2291cc40bca5f46438d3e062a399e8f53f013b6a9f50e98333 + md5: a7970cd949a077b7cb9696379d338681 + depends: + - font-ttf-ubuntu + - font-ttf-inconsolata + - font-ttf-dejavu-sans-mono + - font-ttf-source-code-pro + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 4059 + timestamp: 1762351264405 +- conda: https://conda.anaconda.org/conda-forge/noarch/furo-2025.12.19-pyhd8ed1ab_1.conda + sha256: 0b6c349fb314515b6d0bda4973edeab83366e4ebe6d57a435c028193ebe1e6f6 + md5: a119df8b5f08fe7b185f5923ab8c4c0e + depends: + - accessible-pygments >=0.0.5 + - beautifulsoup4 + - pygments >=2.7 + - python >=3.10 + - sphinx >=7.0,<10.0 + - sphinx-basic-ng + license: MIT + license_family: MIT + purls: + - pkg:pypi/furo?source=hash-mapping + run_exports: {} + size: 83092 + timestamp: 1772974091117 +- conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.4.1-pyhcf101f3_0.conda + sha256: 307dd6ec90140c3cf4171071b0e5e870abec314f4565c1edd5bc433e942cdcc0 + md5: e652ac7756069c456d0da2a922cd7df5 + depends: + - python >=3.10 + - hyperframe >=6.1,<7 + - hpack >=4.2,<5 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/h2?source=hash-mapping + run_exports: {} + size: 100789 + timestamp: 1785796355216 +- conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.2.0-pyhd8ed1ab_0.conda + sha256: fdcea5d7cb314485d3907192ef024c704311548c5b0cbeb390cd1951051e29d2 + md5: b395909221b9bd1df066e5930e18855b + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/hpack?source=hash-mapping + run_exports: {} + size: 32884 + timestamp: 1782283986153 +- 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 + run_exports: {} + 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 + run_exports: {} + size: 17397 + timestamp: 1737618427549 +- conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.19-pyhcf101f3_0.conda + sha256: 1c35a59c1545ad0fdaddf1fbde7bcfa6ef41a8d68c3a2b0b4a291be00676163e + md5: a39ae05027e9b707742e41b30d296b75 + depends: + - python >=3.10 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/idna?source=compressed-mapping + run_exports: {} + size: 177433 + timestamp: 1787059857580 +- 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 + run_exports: {} + size: 15729 + timestamp: 1773752188889 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-9.0.0-pyhcf101f3_0.conda + sha256: 43e2a5497cad1598ff88a3e69f69bc88b7b8f141fa63c60eab5db296317318b8 + md5: ffc17e785d64e12fc311af9184221839 + depends: + - python >=3.10 + - zipp >=3.20 + - python + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/importlib-metadata?source=hash-mapping + run_exports: {} + size: 34766 + timestamp: 1779714582554 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-7.1.0-pyhd8ed1ab_0.conda + sha256: 6a2f86ef0965605d742b5b94229bf8b829258d0a9f640e3651901cc72ef9a0a5 + md5: e3bffa82b874f8b9a2631bddb3869529 + depends: + - importlib_resources >=7.1.0,<7.1.1.0a0 + - python >=3.10 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 10354 + timestamp: 1776068852701 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-7.1.0-pyhd8ed1ab_0.conda + sha256: a563a51aa522998172838e867e6dedcf630bc45796e8612f5a1f6d73e9c8125a + md5: 0ba6225c279baf7ea9473a62ea0ec9ae + depends: + - python >=3.10 + - zipp >=3.1.0 + constrains: + - importlib-resources >=7.1.0,<7.1.1.0a0 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/importlib-resources?source=hash-mapping + run_exports: {} + size: 34809 + timestamp: 1776068839274 +- 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 + purls: + - pkg:pypi/iniconfig?source=hash-mapping + run_exports: {} + size: 13387 + timestamp: 1760831448842 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.3.0-pyh6dadd2b_0.conda + sha256: e3ff0b3d5db5c31830030406f50ac2c9a5c31b86f1c2cef87a6042f0a4c77eb7 + md5: dd5c51d5c42381ba4a2e0ce32e02ba17 + depends: + - __win + - comm >=0.1.1 + - debugpy >=1.6.5 + - ipython >=7.23.1 + - jupyter_client >=8.9.0 + - jupyter_core >=5.1,!=6.0.* + - matplotlib-inline >=0.1 + - nest-asyncio2 >=1.7.0 + - packaging >=22 + - psutil >=5.7 + - python >=3.10 + - pyzmq >=25 + - tornado >=6.4.1 + - traitlets >=5.4.0 + - python + constrains: + - appnope >=0.1.2 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipykernel?source=hash-mapping + run_exports: {} + size: 138046 + timestamp: 1781101760172 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.3.0-pyha191276_0.conda + sha256: 305ad9226363ff5f259c404dd9a7508183a2e150739b2adc43db7d817234da66 + md5: 2b47a10e4d98334f8171ff60aea05ff3 + depends: + - __linux + - comm >=0.1.1 + - debugpy >=1.6.5 + - ipython >=7.23.1 + - jupyter_client >=8.9.0 + - jupyter_core >=5.1,!=6.0.* + - matplotlib-inline >=0.1 + - nest-asyncio2 >=1.7.0 + - packaging >=22 + - psutil >=5.7 + - python >=3.10 + - pyzmq >=25 + - tornado >=6.4.1 + - traitlets >=5.4.0 + - python + constrains: + - appnope >=0.1.2 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipykernel?source=hash-mapping + run_exports: {} + size: 138635 + timestamp: 1781101665847 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.16.1-pyh53cf698_0.conda + sha256: 8470648b5e790d1881c09c02068d53e1bf0126f020db02a6dc2e73400cf1eeeb + md5: 23564ed27c9c7714905be96ac5786500 + depends: + - __unix + - ipython_pygments_lexers >=1.0.0 + - jedi >=0.18.2 + - matplotlib-inline >=0.1.6 + - prompt-toolkit >=3.0.41,<3.1.0 + - psutil >=7 + - pygments >=2.14.0 + - python >=3.11 + - stack_data >=0.6.0 + - traitlets >=5.13.0 + - typing_extensions >=4.6 + - pexpect >4.6 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython?source=hash-mapping + run_exports: {} + size: 716078 + timestamp: 1785754203352 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.16.1-pyhe2676ad_0.conda + sha256: 2a0cd24e5c0e1eb8b7baf06346906673f6b8abea151ce302d7d978a3c416aeec + md5: d7c95d926befcfa22bee69bb1980e2ce + depends: + - __win + - ipython_pygments_lexers >=1.0.0 + - jedi >=0.18.2 + - matplotlib-inline >=0.1.6 + - prompt-toolkit >=3.0.41,<3.1.0 + - psutil >=7 + - pygments >=2.14.0 + - python >=3.11 + - stack_data >=0.6.0 + - traitlets >=5.13.0 + - typing_extensions >=4.6 + - colorama >=0.4.4 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython?source=hash-mapping + run_exports: {} + size: 715162 + timestamp: 1785754256301 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython_pygments_lexers-1.1.1-pyhd8ed1ab_0.conda + sha256: 894682a42a7d659ae12878dbcb274516a7031bbea9104e92f8e88c1f2765a104 + md5: bd80ba060603cc228d9d81c257093119 + depends: + - pygments + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython-pygments-lexers?source=hash-mapping + run_exports: {} + size: 13993 + timestamp: 1737123723464 +- conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.20.0-pyhcf101f3_0.conda + sha256: 744143551c1c7b528b82533fb641b9d7db20b2203abc4c2635c387fa6c089fc3 + md5: c2b3d37aa1411031126036ee76a8a861 + depends: + - python >=3.10 + - parso >=0.8.6,<0.9.0 + - python + license: Apache-2.0 AND MIT + purls: + - pkg:pypi/jedi?source=hash-mapping + run_exports: {} + size: 2715215 + timestamp: 1782251948616 +- 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=hash-mapping + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + size: 31236 + timestamp: 1731777189586 +- conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.9.1-pyhcf101f3_0.conda + sha256: 48b18974cc93b2c0d2681563237034e521f51d1878f0bbc6a5a67ca31b1608a6 + md5: 49440e66df843bee2273937e8032ec43 + depends: + - jupyter_core >=5.1 + - python >=3.10 + - python-dateutil >=2.8.2 + - pyzmq >=25.0 + - tornado >=6.4.1 + - traitlets >=5.3 + - typing_extensions >=4.13.0 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/jupyter-client?source=hash-mapping + run_exports: {} + size: 117954 + timestamp: 1781019994076 +- 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 + run_exports: {} + 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 + run_exports: {} + 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 + purls: [] + run_exports: {} + 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 + purls: [] + run_exports: {} + size: 1248134 + timestamp: 1765578613607 +- conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-16.1.0-h59071f9_102.conda + sha256: 6bc83b1cbb82292da5e2307baa6ca35c70b94713a6c8bb7571c3b84dc7c13a2e + md5: 88543bc2f8ecafd2b207424a63a26f49 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 3103886 + timestamp: 1787165271697 +- conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-aarch64-16.1.0-hd673532_102.conda + sha256: b501040edd7760c8fd0690797abefae412527f091e302ef7754e3fdd2026c42b + md5: 815f9cdd357b1b3563556dd9adad5597 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 2357208 + timestamp: 1787164356336 +- conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_win-64-16.1.0-hecf7705_102.conda + sha256: c4109f73927eac3b635139137b1f30d331fde59c7b15f2b585cd7cdcc1204a55 + md5: 5f1ff5c8ea174345c5e45ae104a0a66d + depends: + - m2-conda-epoch + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 2419197 + timestamp: 1787166432786 +- conda: https://conda.anaconda.org/conda-forge/noarch/libnvptxcompiler-dev_linux-64-12.9.86-ha770c72_2.conda + sha256: 17952c32eac197a59c119fdf3fb6f08c6a29c225a80bae141ac904ad212b87dd + md5: a66a909acf08924aced622903832a937 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 14422867 + timestamp: 1753975387297 +- conda: https://conda.anaconda.org/conda-forge/noarch/libnvptxcompiler-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + sha256: 0b0b96f4bb99d9f9fccfcd34fcb5b0f465c05373c9628ffa32951ed5fc7ab379 + md5: 3f6edd278c0a724f427d2655111c1c72 + depends: + - arm-variant * sbsa + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 13939480 + timestamp: 1753975314178 +- conda: https://conda.anaconda.org/conda-forge/noarch/libnvptxcompiler-dev_win-64-12.9.86-h57928b3_2.conda + sha256: 9858bc91d01ab6d3a21039f37c8e22e3cb59542b7d308098b10bbe2b12be0aaa + md5: 77baf6d1c6916a86ab99ce4e83282e4f + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 31818844 + timestamp: 1753976049670 +- conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-16.1.0-h41cdd0d_102.conda + sha256: fa3399192aa567a85c7fa698990c5a8412d0c5d06d0a787dce900725d2fa1760 + md5: a64e9877b568575ac1d8ef73a208ee92 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 23474177 + timestamp: 1787165294351 +- conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-aarch64-16.1.0-h2445e1f_102.conda + sha256: 3bc11bc5763bbd3155f07146314440ab3a074483b06b0f9b6b4120dce41e163e + md5: c120d97c22af34a1bd3170a4cf8ada52 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 19145587 + timestamp: 1787164374800 +- conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_win-64-16.1.0-hc76ffd0_102.conda + sha256: 80b864a82655aa7a1caf7dae067fbdb85428c397f6193da65da25f97c6dba158 + md5: 7e2976df6bc9f80d13d79e85101dfb64 + depends: + - m2-conda-epoch + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 13783582 + timestamp: 1787166451739 +- conda: https://conda.anaconda.org/conda-forge/noarch/m2w64-sysroot_win-64-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + sha256: fb0ffe6b3c25189038c29abbd1fac2522d87fe2775a09e5f5088e5542dc3309b + md5: 9676d2a30fa3ffa4e5350041d0993758 + depends: + - m2-conda-epoch + - mingw-w64-ucrt-x86_64-crt-git 12.0.0.r4.gg4f2fc60ca hd8ed1ab_10 + - mingw-w64-ucrt-x86_64-headers-git 12.0.0.r4.gg4f2fc60ca hd8ed1ab_10 + - mingw-w64-ucrt-x86_64-windows-default-manifest + - mingw-w64-ucrt-x86_64-winpthreads-git 12.0.0.r4.gg4f2fc60ca hd8ed1ab_10 + - ucrt + purls: [] + run_exports: + strong: + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + size: 8421 + timestamp: 1759768559974 +- conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.2.0-pyhd8ed1ab_0.conda + sha256: 0c4c35376fe920714390d46e4b8d31c876d65f18e1655899e0763ec25f2a902f + md5: 6d03368f2b2b0a5fb6839df53b2eb5e0 + depends: + - mdurl >=0.1,<1 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/markdown-it-py?source=hash-mapping + run_exports: {} + size: 69017 + timestamp: 1778169663339 +- conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.2-pyhd8ed1ab_0.conda + sha256: 35b43d7343f74452307fd018a1cca92b8f68961ff8e2ab6a81ce0a703c9a3764 + md5: 9acc1c385be401d533ff70ef5b50dae6 + depends: + - python >=3.10 + - traitlets + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/matplotlib-inline?source=hash-mapping + run_exports: {} + size: 15725 + timestamp: 1778264403247 +- conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.6.1-pyhd8ed1ab_0.conda + sha256: 49db23cbfb1c1d414a14d7540195208b994ebd747beba0f15c903f3a0a2dc446 + md5: ad6821df7a98510117db06e9a833281f + 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 + run_exports: {} + size: 50460 + timestamp: 1778692223625 +- 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 + run_exports: {} + 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 + depends: + - m2-conda-epoch + - mingw-w64-ucrt-x86_64-headers-git 12.0.0.r4.gg4f2fc60ca hd8ed1ab_10 + constrains: + - mingw-w64-ucrt-x86_64-winpthreads-git 12.0.0.r4.gg4f2fc60ca.* + license: ZPL-2.1 + purls: [] + run_exports: {} + size: 5663635 + timestamp: 1759768458961 +- conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-headers-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + sha256: 1add86481f35163215e7076e6f06f22aa9f1f9345a5fff5cb07bc846c13fbec7 + md5: cab7b807024204893ef5bb1860d91408 + depends: + - m2-conda-epoch + constrains: + - mingw-w64-ucrt-x86_64-crt-git 12.0.0.r4.gg4f2fc60ca.* + - mingw-w64-ucrt-x86_64-winpthreads-git 12.0.0.r4.gg4f2fc60ca.* + license: ZPL-2.1 AND LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 7089846 + timestamp: 1759768412123 +- conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-he206cdd_7.conda + sha256: 5b0df4e0ba8487ffd59f60c34c5dbb9e001ecd2c5d2c66ba88eada40bfa3ecb8 + md5: 1d6b5c96d7e3cce773519d7d1a4482f0 + depends: + - __win + constrains: + - m2w64-sysroot_win-64 >=12.0.0.r0 + license: FSFAP + purls: [] + run_exports: {} + size: 7412 + timestamp: 1717486007140 +- conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-winpthreads-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda + sha256: 828abb111286940473c4c665fc8ab300d28920f5af83b32295e8bf2256a8f342 + md5: ba0eeff6a5c62b83c771bb392e22dbb4 + depends: + - m2-conda-epoch + - mingw-w64-ucrt-x86_64-headers-git 12.0.0.r4.gg4f2fc60ca hd8ed1ab_10 + constrains: + - mingw-w64-ucrt-x86_64-crt-git 12.0.0.r4.gg4f2fc60ca.* + license: MIT AND BSD-3-Clause-Clear + purls: [] + run_exports: {} + size: 123916 + timestamp: 1759768539535 +- 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 + run_exports: {} + 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 + run_exports: {} + size: 68766 + timestamp: 1772587444587 +- conda: https://conda.anaconda.org/conda-forge/noarch/myst-parser-5.1.0-pyhd8ed1ab_0.conda + sha256: 94235bc1f769cf35029942ecb2ca796f18e730c1bf5aeef95e72680ebcfacfef + md5: 580615e59fc7c07741e4d2ab052cfc8b + depends: + - docutils >=0.20,<0.23 + - jinja2 + - markdown-it-py >=4.2.0,<4.3.0 + - mdit-py-plugins >=0.6.1,<0.7 + - python >=3.11 + - pyyaml + - sphinx >=8,<10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/myst-parser?source=hash-mapping + run_exports: {} + size: 74888 + timestamp: 1778696564508 +- 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 + run_exports: {} + size: 39262 + timestamp: 1770905275632 +- conda: https://conda.anaconda.org/conda-forge/noarch/nbclient-0.11.0-pyhd8ed1ab_0.conda + sha256: eceb424236fbbb9b337a857fe5448307b57a2a3fb2db389ae37e7a8b8cdca2ab + md5: cf01a81d7960ad9c829bf2e794fcee9a + depends: + - jupyter_client >=7.0.0 + - jupyter_core >=5.4 + - nbformat >=5.2.0 + - python >=3.10 + - traitlets >=5.13 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/nbclient?source=hash-mapping + run_exports: {} + size: 29138 + timestamp: 1780661039538 +- conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.11.1-pyhcf101f3_0.conda + sha256: d85d76827ff732e1639f50f45e4d7d3387a27abd857b194dcbb5bb4166c2a7c2 + md5: 2fbbf92e1173ae024f0b12759c1e64a1 + depends: + - jsonschema >=2.6 + - jupyter_core >=4.12,!=5.0.* + - python >=3.10 + - python-fastjsonschema >=2.15 + - traitlets >=5.1 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/nbformat?source=compressed-mapping + run_exports: {} + size: 107750 + timestamp: 1787133512599 +- conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio2-1.7.2-pyhcf101f3_0.conda + sha256: e6768ceef038f4d7e083de7e393f5dd7d672b937e2bda570b740f6399b686689 + md5: fcd832bfd4749e9b246112b6894f97fc + depends: + - python >=3.10 + - python + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/nest-asyncio2?source=hash-mapping + run_exports: {} + size: 15903 + timestamp: 1770973502283 +- 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 + run_exports: {} + size: 65801 + timestamp: 1764715638266 +- conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + sha256: c432626b16768b8dab228bfb706f7060c2d462a21c516d240f68f2f902b5a044 + md5: 936687ed80f295a1f5dbcf8bd34c252c + depends: + - python >=3.9 + - python + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/packaging?source=hash-mapping + run_exports: {} + size: 116363 + timestamp: 1785888127370 +- conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.7-pyhcf101f3_0.conda + sha256: 611882f7944b467281c46644ffde6c5145d1a7730388bcde26e7e86819b0998e + md5: 39894c952938276405a1bd30e4ce2caf + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/parso?source=hash-mapping + run_exports: {} + size: 82472 + timestamp: 1777722955579 +- 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 + run_exports: {} + size: 53561 + timestamp: 1733302019362 +- conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.2.1-pyh8b19718_0.conda + sha256: c205bae42eb11b364fe3663a817cbcbc20a8ef544c6b2ff6f391013487117259 + md5: 77b6cf3b0689d9fc68561df0db9b856d + depends: + - python >=3.10,<3.13.0a0 + - setuptools + - wheel + license: MIT + license_family: MIT + purls: + - pkg:pypi/pip?source=hash-mapping + run_exports: {} + size: 1199593 + timestamp: 1785914492234 +- conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.11.3-pyhcf101f3_0.conda + sha256: 810511c90649ca59fa0174958a210fd5051c0a7848cfbd42c87054a6836726b5 + md5: 31474b00d0ca5accac14eda09ba11216 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/platformdirs?source=compressed-mapping + run_exports: {} + size: 26956 + timestamp: 1786708411066 +- 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 + purls: + - pkg:pypi/pluggy?source=hash-mapping + run_exports: {} + size: 25877 + timestamp: 1764896838868 +- conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.53-pyha770c72_0.conda + sha256: efe8def2c93aa34cd8d3c9af1dc4c7d312791cf769d8b2b615e32733e6df6051 + md5: 39c92a39517316e5001d645ae63d9ab9 + depends: + - python >=3.10 + - wcwidth + constrains: + - prompt_toolkit 3.0.53 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/prompt-toolkit?source=hash-mapping + run_exports: {} + size: 276081 + timestamp: 1785160613307 +- 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 + run_exports: {} + size: 19457 + timestamp: 1733302371990 +- 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 + run_exports: {} + size: 16668 + timestamp: 1733569518868 +- 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 + purls: + - pkg:pypi/py-cpuinfo?source=hash-mapping + run_exports: {} + 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 + run_exports: {} + size: 437505 + timestamp: 1734953615203 +- conda: https://conda.anaconda.org/conda-forge/noarch/pydata-sphinx-theme-0.19.0-pyhcf101f3_0.conda + sha256: 6deac8ece8b8e243634c13837967b253b8c9b09ef39beaaff494584ee05465c7 + md5: 87921f66a4dc56ce92e4ff13be5f63dc + depends: + - accessible-pygments + - babel + - beautifulsoup4 + - docutils !=0.17.0 + - pygments >=2.7 + - python >=3.10 + - sphinx >=8.0 + - typing_extensions + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pydata-sphinx-theme?source=hash-mapping + run_exports: {} + size: 1312203 + timestamp: 1781528227244 +- conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.15-pyhd8ed1ab_0.conda + sha256: 8ca25ae8d49e85e76b0f86e265cb0298874cb7c2e65b2620defaa80ad49560dd + md5: d46ece489f2dcce81d7af736025a9e42 + depends: + - ffmpeg >=4.0.0 + - freetype + - python >=3.10 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyglet?source=hash-mapping + run_exports: {} + size: 729762 + timestamp: 1782670710304 +- conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + sha256: f5f015ff1bc3e1b7fc08eee096b1865234189ae0b82bebdb86a5369116e42fa0 + md5: 2882dee445dfa45b0c5afce3ffb7730a + depends: + - python >=3.10 + - python + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/pygments?source=compressed-mapping + run_exports: {} + size: 959376 + timestamp: 1786995678795 +- 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + size: 21085 + timestamp: 1733217331982 +- conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.1.1-pyhc364b38_2.conda + sha256: 430051d80765207a7d782b2b188230ba1489d35c6e75fd9903f76cb9fda4af16 + md5: 64c98a12c4e23eb238bf66bbecafdf3c + depends: + - colorama + - pygments >=2.7.2 + - python >=3.10 + - iniconfig >=1.0.1 + - packaging >=22 + - pluggy >=1.5,<2 + - tomli >=1 + - exceptiongroup >=1 + - python + constrains: + - pytest-faulthandler >=2 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pytest?source=hash-mapping + run_exports: {} + size: 306724 + timestamp: 1782127176429 +- 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 + purls: + - pkg:pypi/pytest-benchmark?source=hash-mapping + run_exports: {} + size: 43976 + timestamp: 1762716480208 +- conda: https://conda.anaconda.org/conda-forge/noarch/pytest-randomly-4.1.0-pyhd8ed1ab_0.conda + sha256: c292d7060f043577569b9c257cbef99446a356e1b1f90482e1058c111d5e374b + md5: b869f743e0e40024d14b22e3f6268fe4 + depends: + - pytest + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pytest-randomly?source=hash-mapping + run_exports: {} + size: 15440 + timestamp: 1785269179302 +- conda: https://conda.anaconda.org/conda-forge/noarch/pytest-repeat-0.9.4-pyhd8ed1ab_0.conda + sha256: cea7b0555c22a734d732f98a3b256646f3d82d926a35fa2bfd16f11395abd83b + md5: 9e8871313f26d8b6f0232522b3bc47a5 + depends: + - pytest >=5 + - python >=3.9 + license: MPL-2.0 + license_family: MOZILLA + purls: + - pkg:pypi/pytest-repeat?source=hash-mapping + run_exports: {} + size: 10537 + timestamp: 1744061283541 +- 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 + run_exports: {} + size: 233310 + timestamp: 1751104122689 +- conda: https://conda.anaconda.org/conda-forge/noarch/python-fastjsonschema-2.22.2-pyhcf101f3_0.conda + sha256: fc4a704822df22defce49d0fb811fdc036a1fd3b579aeaa601228e9cfd198b3d + md5: aa75b7f096d17621bc307b3025b29461 + depends: + - python >=3.10 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/fastjsonschema?source=compressed-mapping + run_exports: {} + size: 254446 + timestamp: 1786892280524 +- conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_1.conda + sha256: cf0972372c4469881e13e9342ab51aed8b25d0d5dff45fcd0fe847b3dd11f97c + md5: 87225cc6af32ec67528efa39c4945aaf + depends: + - cpython 3.12.13.* + - python_abi * *_cp312 + license: Python-2.0 + purls: [] + run_exports: {} + size: 45874 + timestamp: 1786443525835 +- 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: [] + run_exports: {} + size: 6958 + timestamp: 1752805918820 +- 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 + purls: [] + run_exports: {} + size: 6989 + timestamp: 1752805904792 +- 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 + run_exports: {} + size: 51788 + timestamp: 1760379115194 +- conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.34.2-pyhcf101f3_0.conda + sha256: 1715246b19c9f85ee022933b4845f2fc14ac9184981b7b7d9b728bec8e9588da + md5: 4a85203c1d80c1059086ae860836ffb9 + 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,<8 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/requests?source=hash-mapping + run_exports: {} + size: 68709 + timestamp: 1778851103479 +- conda: https://conda.anaconda.org/conda-forge/noarch/roman-5.2-pyhcf101f3_0.conda + sha256: 1e8721aa6bbae93c2f27778afac35edc1178cc7284e067fa7b531a859655a866 + md5: d4decf19981d32d102bf007b7e287b9a + depends: + - python >=3.10 + - python + license: ZPL-2.1 + purls: + - pkg:pypi/roman?source=hash-mapping + run_exports: {} + size: 13894 + timestamp: 1763405456774 +- 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 + run_exports: {} + size: 98448 + timestamp: 1767538149184 +- conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + sha256: 9e200ee5f9ff19a4d94e4b51c4856d53dec849f91032f345cf0c6bc3d51a7183 + md5: 62ac906f1cd582c6c264c95625cb9d6f + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/setuptools?source=compressed-mapping + run_exports: {} + size: 524488 + timestamp: 1786282924579 +- conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + sha256: 8eb9daf6fc70111abf73f848c6d32d2769aa1fba550f793b865076fd4e33fb3a + md5: eefa3bc61c9224107d3a9afeb37552a9 + depends: + - python >=3.10 + - vcs_versioning >=2.0.0.dev0 + - packaging >=20 + - setuptools + - tomli >=1 + - typing_extensions + - python + license: MIT + license_family: MIT + run_exports: {} + size: 29407 + timestamp: 1784653562396 +- 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 + run_exports: {} + size: 18455 + timestamp: 1753199211006 +- conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-3.1.1-pyhd8ed1ab_0.conda + sha256: ad89284ea94821c20ff87e64b948e4afc690cf5202d14c009355b0594cf23aea + md5: 46b6abe31482f6bca064b965696ae807 + depends: + - python >=3.10 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/snowballstemmer?source=hash-mapping + run_exports: {} + size: 74456 + timestamp: 1780468201547 +- conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.9.2-pyhd8ed1ab_0.conda + sha256: 056d7a2e91e303a9ee37e580f6dde0511fc3fb72476581cc337aacf2cc747613 + md5: ba33e6c8a46ee373fdf6dd8665212778 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/soupsieve?source=compressed-mapping + run_exports: {} + size: 39439 + timestamp: 1786202135509 +- 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 + run_exports: {} + 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 + run_exports: {} + size: 24055 + timestamp: 1737099757820 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-basic-ng-1.0.0b2-pyhd8ed1ab_3.conda + sha256: 90d900d31afe0bd6f42cf1e529e23e6eac4284b48bc64e5e942f19f5bf8ef0f2 + md5: a090580065b21d9c56662ebe68f6e7a6 + depends: + - python >=3.9 + - sphinx >=4.0 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-basic-ng?source=hash-mapping + run_exports: {} + size: 20495 + timestamp: 1737748706101 +- 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + size: 12214 + timestamp: 1758128174284 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-tabs-3.5.0-pyhd8ed1ab_0.conda + sha256: 9070e6f3185e8a5fa12c91ac1fcd3b288c6d724be0b589c8b8215ad5cca1e0f5 + md5: 954d1340349f0d9aa7e9a7efb79c42dc + depends: + - docutils >=0.18.0 + - pygments + - python >=3.10 + - sphinx >=7 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-tabs?source=hash-mapping + run_exports: {} + size: 16463 + timestamp: 1780932961443 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.3.0-pyhd8ed1ab_0.conda + sha256: b5d36034b8d247c0198d78708631dc93240ec8c48a02aa0c56401bc8c3428dce + md5: 9f2d71c1524e4f439e6d0028b6f86be2 + 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 + - roman >4.0 + - ruamel.yaml >=0.16.12 + - sphinx >=3.2.0 + - sphinx-autodoc-typehints <3.6.0,>=1.11.1 + - sphinx-jinja2-compat >=0.1.0 + - sphinx-prompt >=1.1.0 + - sphinx-tabs <3.6.0,>=3.4.7 + - 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 + run_exports: {} + size: 101346 + timestamp: 1785317197648 +- 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + 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 + run_exports: {} + size: 26959 + timestamp: 1733753505008 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-2.0.0-pyhd8ed1ab_0.conda + sha256: 20b49741065fd7d3fabf98caf6d19b6436badb06b6d41f66b58f1fc2b52f37a1 + md5: f77df1fcf9af03b7287342638befca77 + depends: + - python >=3.10 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-serializinghtml?source=hash-mapping + run_exports: {} + size: 30640 + timestamp: 1781260357443 +- 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 + run_exports: {} + size: 26988 + timestamp: 1733569565672 +- 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 + purls: [] + run_exports: + strong: + - __glibc >=2.28,<3.0.a0 + size: 24008591 + timestamp: 1765578833462 +- conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-aarch64-2.28-h585391f_9.conda + sha256: 1bd2db6b2e451247bab103e4a0128cf6c7595dd72cb26d70f7fadd9edd1d1bc3 + md5: fdf07ab944a222ff28c754914fdb0740 + depends: + - __glibc >=2.28 + - kernel-headers_linux-aarch64 4.18.0 h05a177a_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 + purls: [] + run_exports: + strong: + - __glibc >=2.28,<3.0.a0 + 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=hash-mapping + run_exports: {} + size: 43964 + timestamp: 1772732795746 +- conda: https://conda.anaconda.org/conda-forge/noarch/tinycss2-1.5.1-pyhcf101f3_0.conda + sha256: 7c803480dbfb8b536b9bf6287fa2aa0a4f970f8c09075694174eb4550a4524cd + md5: c0d0b883e97906f7524e2aac94be0e0d + depends: + - python >=3.10 + - webencodings >=0.4 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/tinycss2?source=hash-mapping + run_exports: {} + size: 30571 + timestamp: 1764621508086 +- 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=hash-mapping + run_exports: {} + size: 21561 + timestamp: 1774492402955 +- conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.16.1-pyhcf101f3_0.conda + sha256: 03dba5917f944c6684ab44c81daacac1624cd148e4b2cae215dcec594a210c48 + md5: a79bf97561232a31447b6246c2153ab5 + depends: + - python >=3.10 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/traitlets?source=hash-mapping + run_exports: {} + size: 116935 + timestamp: 1785761789772 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.16.0-h69aa097_0.conda + sha256: b141933ece3518f6d7b75dfb59451e2f26b405a44c18e2518a83e9a02e09315c + md5: c680b5747e8c4c8f23dca0bb7042a8fc + depends: + - typing_extensions ==4.16.0 pyhcf101f3_0 + license: PSF-2.0 + license_family: PSF + purls: [] + run_exports: {} + size: 94080 + timestamp: 1783002732887 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + sha256: 2d888f90af0686044882c74193ec80a90ec1943145d94a7b1b048958acda1848 + md5: c70ad746c22219b9700931707482992c + depends: + - python >=3.10 + - python + license: PSF-2.0 + license_family: PSF + purls: + - pkg:pypi/typing-extensions?source=hash-mapping + run_exports: {} + size: 52631 + timestamp: 1783002732887 +- 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 + run_exports: {} + size: 14919 + timestamp: 1733845966415 +- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + sha256: b928c30ddcb0e3f544c6eade8352737e6e610e263276b90232db6a578ef899d8 + md5: fcb489df604d100968b737f2cb6076c6 + license: LicenseRef-Public-Domain + purls: [] + run_exports: {} + size: 118849 + timestamp: 1784250406640 +- conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda + sha256: feff959a816f7988a0893201aa9727bbb7ee1e9cec2c4f0428269b489eb93fb4 + md5: cbb88288f74dbe6ada1c6c7d0a97223e + 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 + run_exports: {} + size: 103560 + timestamp: 1778188657149 +- conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda + sha256: cec2b683070a2413796552011751483299b804f7410f99cc739e2bc4f083ba3f + md5: 6043a03a3733302373b30e16ecc408b7 + depends: + - python >=3.10 + - packaging >=26.2 + - tomli >=1 + - typing_extensions >=4.1 + - python + license: MIT + license_family: MIT + run_exports: {} + size: 88449 + timestamp: 1787149152008 +- conda: https://conda.anaconda.org/conda-forge/noarch/vswhere-3.1.7-h40126e0_1.conda + sha256: b72270395326dc56de9bd6ca82f63791b3c8c9e2b98e25242a9869a4ca821895 + md5: f622897afff347b715d046178ad745a5 + depends: + - __win + license: MIT + license_family: MIT + run_exports: {} + size: 238764 + timestamp: 1745560912727 +- conda: https://conda.anaconda.org/conda-forge/noarch/wayland-protocols-1.49-hd8ed1ab_0.conda + sha256: 04ce686cd187d379344f9b2be7b4da5f431b265dc0944a6b764fab9da9171948 + md5: 0839a3421140d4a9ba93fb988698fc00 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 147954 + timestamp: 1780946721169 +- conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.8.2-pyhd8ed1ab_0.conda + sha256: 4acf845da404e84cef1acccc66cc0156af1b83a5b5d7077b2ca19b705c561e57 + md5: 99f7755ec8648a042b0dbe906234f888 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/wcwidth?source=hash-mapping + run_exports: {} + size: 132415 + timestamp: 1782771807703 +- 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 + run_exports: {} + size: 15496 + timestamp: 1733236131358 +- conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.48.0-pyhd8ed1ab_0.conda + sha256: ba64b29b6d418024cb565081a1799262cb2780d2534ff4c14f76aa858c4286cd + md5: 9a2124517bfd5d792e0f7b86eefdfeb8 + depends: + - packaging >=24.0 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/wheel?source=compressed-mapping + run_exports: {} + size: 34528 + timestamp: 1786613220176 +- 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 + run_exports: {} + size: 9555 + timestamp: 1733130678956 +- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-4.1.0-pyhcf101f3_0.conda + sha256: 210bd31c22bb88f5e2a167df24c95bb5f152b2ada7502f9b8c49d1f5366db423 + md5: ba3dcdc8584155c97c648ae9c044b7a3 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/zipp?source=hash-mapping + run_exports: {} + size: 24190 + timestamp: 1779159948016 +- conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-20_gnu.conda + build_number: 20 + sha256: 8a1cee28bd0ee7451ada1cd50b64720e57e17ff994fc62dd8329bef570d382e4 + md5: 1626967b574d1784b578b52eaeb071e7 + depends: + - libgomp >=7.5.0 + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + constrains: + - openmp_impl <0.0a0 + - msys2-conda-epoch <0.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + size: 52252 + timestamp: 1770943776666 +- conda: https://conda.anaconda.org/conda-forge/win-64/aom-3.14.1-pl5321h06fc181_1.conda + sha256: 3033fa8953f7f0c1bb5b89b5af77253badc14a89ba94d743dde3c9159e10fd5e + md5: 7a8ace8100a48355a34d87386012c57b + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - aom >=3.14.1,<3.15.0a0 + size: 2214571 + timestamp: 1780752497150 +- conda: https://conda.anaconda.org/conda-forge/win-64/backports.zstd-1.7.0-py312h06d0912_0.conda + sha256: 492b36f6c1380562f16e7ac0b2aae2f74a6d66eb4806689a791ccdbd0b4fb162 + md5: d7c56279ddf11b597934de1b928e799d + 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=compressed-mapping + run_exports: {} + size: 239485 + timestamp: 1786861404460 +- conda: https://conda.anaconda.org/conda-forge/win-64/binutils_impl_win-64-2.46.1-default_ha84baeb_102.conda + sha256: 83476bc3ed6ee4f1d6e67e6e1360696a0ac3e99679f9c142674003cf721740e3 + md5: 7832bada38267be3333319febcf5e4fc + depends: + - ld_impl_win-64 2.46.1 default_hfd38196_102 + - m2w64-sysroot_win-64 >=12.0.0.r0 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 6140284 + timestamp: 1784214565466 +- conda: https://conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py312ha763cb9_3.conda + sha256: ab6bc41db5efb67b68d54dc2631131e210ac8c1930ab30c4c6a6e2470c16be0c + md5: 4d0e6b94ff31b79f35a7f341e4eb73b0 + 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 hf02afa3_3 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=compressed-mapping + run_exports: {} + size: 336846 + timestamp: 1786622959392 +- conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.conda + sha256: 04767466ee9227c9c57ab2c6503e0149177d34111c7418d2f420297acb1eb229 + md5: c3301c058362f340100d91cd8be0393f + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: bzip2-1.0.6 + license_family: BSD + purls: [] + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + size: 55919 + timestamp: 1785906343696 +- conda: https://conda.anaconda.org/conda-forge/win-64/cairo-1.18.4-h477c42c_1.conda + sha256: 9ee4ad706c5d3e1c6c469785d60e3c2b263eec569be0eac7be33fbaef978bccc + md5: 52ea1beba35b69852d210242dd20f97d + depends: + - fontconfig >=2.15.0,<3.0a0 + - fonts-conda-ecosystem + - icu >=78.1,<79.0a0 + - libexpat >=2.7.3,<3.0a0 + - libfreetype >=2.14.1 + - libfreetype6 >=2.14.1 + - libglib >=2.86.3,<3.0a0 + - libpng >=1.6.53,<1.7.0a0 + - libzlib >=1.3.1,<2.0a0 + - pixman >=0.46.4,<1.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-only or MPL-1.1 + purls: [] + run_exports: + weak: + - cairo >=1.18.4,<2.0a0 + size: 1537783 + timestamp: 1766416059188 +- conda: https://conda.anaconda.org/conda-forge/win-64/conda-gcc-specs-16.1.0-h851ee6d_2.conda + sha256: 6dde0bb3835cf83401d1e42403fd7552be4ccffe6529aaeae3e607161f71662c + md5: ae9ec9aea92b9e55c82b0e01d52c9cc9 + depends: + - gcc_impl_win-64 >=16.1.0,<16.1.1.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 47251 + timestamp: 1787166657998 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-bindings-12.9.7-py312ha085c13_1.conda + sha256: 21eb9190e0bd232918f61efc4d67e430b873e3d744b2073cdf6354ee52a04313 + md5: fe6a020333090bdf917583beaa25b1a8 + depends: + - python + - cuda-pathfinder >=1.5.5,<2 + - cuda-version >=12,<13.0a0 + - cuda-nvrtc >=12,<13.0a0 + - cuda-nvcc-impl >=12,<13.0a0 + - libnvjitlink >=12.3,<13 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + constrains: + - cuda-cudart >=12,<13.0a0 + - libnvfatbin >=12,<13.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + run_exports: {} + size: 4364910 + timestamp: 1782355189622 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-crt-tools-12.9.86-h57928b3_2.conda + sha256: fb2283a55820eeff84c861b469cfee6a9d0ac9aebe02e82aae480a60068a7659 + md5: d0057a8511cb12745675db18ccbec8f2 + depends: + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 29604 + timestamp: 1753975679251 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-12.9.79-he0c23c2_0.conda + sha256: a30cd9adf3a70d069d4d87c5728ec16778b77071629612ca5d8513cd92d89c09 + md5: 0a243d4f000a0d2f51dd94ee9132b234 + depends: + - cuda-cudart_win-64 12.9.79 he0c23c2_0 + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 170799 + timestamp: 1749218946117 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-12.9.79-he0c23c2_0.conda + sha256: 1ee68f0ffd37889f0fc438d4da7124054b124632e1c3bc15950b9851b002473e + md5: e5bb074108bc2501f8374e80748aa181 + depends: + - cuda-cudart 12.9.79 he0c23c2_0 + - cuda-cudart-dev_win-64 12.9.79 he0c23c2_0 + - cuda-cudart-static 12.9.79 he0c23c2_0 + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: + weak: + - cuda-cudart >=12.9.79,<13.0a0 + size: 23222 + timestamp: 1749219022963 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-12.9.79-he0c23c2_0.conda + sha256: 02d3ff9ec59c7f59132ffe9398746ad9422a75706e7cad19acc6c30a5c0fc763 + md5: 718879691b8119c893f587f46c734fca + depends: + - cuda-cudart-static_win-64 12.9.79 he0c23c2_0 + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 23249 + timestamp: 1749218998822 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvcc-impl-12.9.86-h53cbb54_2.conda + sha256: d52c7b77b7d4f707efb3b76f93beb1c2b97883db6605818c1727935df9babe5d + md5: 17181de579b111f1cbad7af2b45aed0e + depends: + - cuda-cudart >=12.9.79,<13.0a0 + - cuda-cudart-dev + - cuda-nvcc-dev_win-64 12.9.86 h36c15f3_2 + - cuda-nvcc-tools 12.9.86 he0c23c2_2 + - cuda-nvvm-impl 12.9.86 h2466b09_2 + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev 12.9.86 h57928b3_2 + constrains: + - vc >=14.2 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27684 + timestamp: 1753976469818 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvcc-tools-12.9.86-he0c23c2_2.conda + sha256: e28baff7cbee6bbc30797adfe09f497c9ac2b69deb7f5152fc7e238c2f37e42b + md5: b018676d60a0f1e51a120382db5221fc + depends: + - cuda-crt-tools 12.9.86 h57928b3_2 + - cuda-nvvm-tools 12.9.86 h2466b09_2 + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27361 + timestamp: 1753976245101 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-12.9.86-hac47afa_1.conda + sha256: d90ef446ac859db26286a5d39d39333c4e4cee31ba5042b5c7922bd25de531f6 + md5: d68b5d96a53c80dc3dbbd8f7c3b8106d + depends: + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 58467504 + timestamp: 1760723834711 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-dev-12.9.86-hac47afa_1.conda + sha256: 1e1c41f95d606eaf6581fccf9546ed6ee4053c42b78e11057cd6d2801b96f0e2 + md5: b97225dd005cb0dcdca7911c61ca38e5 + depends: + - cuda-nvrtc 12.9.86 hac47afa_1 + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-NVIDIA-End-User-License-Agreement + run_exports: + weak: + - cuda-nvrtc >=12.9.86,<13.0a0 + size: 35214 + timestamp: 1760724506186 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-12.9.86-h719f0c7_6.conda + sha256: 020a5bb67a35654f391d21b170ba763f95b7f133fec5678d69e676559dcd5653 + md5: b162c7fb8b19f9102bd5f801d7f58ca2 + depends: + - cuda-nvvm-dev_win-64 12.9.86.* + - cuda-nvvm-impl 12.9.86.* + - cuda-nvvm-tools 12.9.86.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 26007 + timestamp: 1771619504675 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-12.9.86-h2466b09_2.conda + sha256: 7b995ea653816b129bae6e4ee92898824a39fe82227472537bf75ac6ece7e955 + md5: d8cea7bc32045bde718d0b1ceb595445 + depends: + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 31168 + timestamp: 1753975780038 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-12.9.86-h2466b09_2.conda + sha256: 5692a559206420f77e376a598329db966da762ad574866f9cc80a447d26ac49c + md5: 25e269101d3eb39715a48998bc04289e + depends: + - cuda-version >=12.9,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 40286977 + timestamp: 1753975898550 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-12.9.79-h57928b3_1.conda + sha256: e2ea70bfd20decd9e8401b5388693e1fd8e25a120580338a22b8b890f4933520 + md5: 57d6f85f552878de71f8136cc6d2ab16 + depends: + - cuda-cudart-dev + - cuda-version >=12.9,<12.10.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 24150 + timestamp: 1761098813665 +- conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.9-py312hd245ac3_0.conda + sha256: 277887d63842d6b9d8a49f6bde1c57149fd65342c85e1f3e2aa44402125d3115 + md5: 762f58961f768b8790a215a8521d33cd + 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 + run_exports: {} + size: 3316549 + timestamp: 1785016176418 +- conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.9-py314h344ed54_0.conda + sha256: a061170102d6f1a0b64ed3be712ac653fd9c9e8b6bed6205f398dbf319dcc3c8 + md5: 8ecd457018d6f302da0945cd2169167d + depends: + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + - 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 + run_exports: {} + size: 3343814 + timestamp: 1785016211855 +- conda: https://conda.anaconda.org/conda-forge/win-64/dav1d-1.2.1-hcfcfb64_0.conda + sha256: 2aa2083c9c186da7d6f975ccfbef654ed54fff27f4bc321dbcd12cee932ec2c4 + md5: ed2c27bda330e3f0ab41577cf8b9b585 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - dav1d >=1.2.1,<1.2.2.0a0 + size: 618643 + timestamp: 1685696352968 +- conda: https://conda.anaconda.org/conda-forge/win-64/debugpy-1.8.21-py312ha1a9051_0.conda + sha256: a41f403ca4b7b0c001140ac7a39fce1c0494ba95e8359f7a47590ed4377728a2 + md5: 5628287239c9ef6df2d66dc143f7c8dd + 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 + run_exports: {} + size: 3995148 + timestamp: 1780390185301 +- conda: https://conda.anaconda.org/conda-forge/win-64/ffmpeg-9.0.1-gpl_h893bb9d_900.conda + sha256: 34ca3f87a4ee1774892024a1f9159bed2cf2f0da0a914833904a692f085e4367 + md5: 427d6171db8991b7a6554cc40da3efe2 + depends: + - aom >=3.14.1,<3.15.0a0 + - bzip2 >=1.0.8,<2.0a0 + - dav1d >=1.2.1,<1.2.2.0a0 + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + - lame >=4.0,<4.1.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libharfbuzz >=14.3.0 + - libiconv >=1.18,<2.0a0 + - libjxl >=0.12.0,<0.13.0a0 + - liblzma >=5.8.3,<6.0a0 + - libopus >=1.6.1,<2.0a0 + - librsvg >=2.62.3,<3.0a0 + - libvorbis >=1.3.7,<1.4.0a0 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - libwebp-base >=1.6.0,<2.0a0 + - libxml2 + - libxml2-16 >=2.14.6 + - libzlib >=1.3.2,<2.0a0 + - openh264 >=2.6.0,<2.6.1.0a0 + - openssl >=3.5.7,<4.0a0 + - sdl2 >=2.32.56,<3.0a0 + - svt-av1 >=4.2.0,<4.2.1.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - x264 >=1!164.3095,<1!165 + - x265 >=3.5,<3.6.0a0 + constrains: + - __cuda >=12.8 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - ffmpeg >=9.0.1,<10.0a0 + size: 11511745 + timestamp: 1786705688472 +- conda: https://conda.anaconda.org/conda-forge/win-64/fontconfig-2.18.3-hd47e2ca_1.conda + sha256: f26139e3c774a6434c8a73381c08e3d2a4c2f9d9ef9587c66aab8836211ee2ec + md5: ed95670fed91b091fe34ba6cae6677d7 + depends: + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libiconv >=1.18,<2.0a0 + - libintl >=0.22.5,<1.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - fontconfig >=2.18.3,<3.0a0 + - fonts-conda-ecosystem + size: 217988 + timestamp: 1786667461139 +- conda: https://conda.anaconda.org/conda-forge/win-64/freetype-2.14.3-h57928b3_2.conda + sha256: 32f7dd8ffe62fd485e9e6570e871f5be45af74c84fde62241a2417046a373efd + md5: 6fc6c09c05a099d58efd9b2e96598e41 + depends: + - libfreetype 2.14.3 h57928b3_2 + - libfreetype6 2.14.3 hdbac1cb_2 + - zlib + license: GPL-2.0-only OR FTL + purls: [] + run_exports: + weak: + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + size: 186945 + timestamp: 1786641050416 +- conda: https://conda.anaconda.org/conda-forge/win-64/fribidi-1.0.16-hfd05255_1.conda + sha256: 274b3e4ae5dff527062039d1dcb5cfdd9f91fa7d8eaf61358c09450b361385de + md5: 66f5ce9d0d618332023619a899ceb26f + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - fribidi >=1.0.16,<2.0a0 + size: 65318 + timestamp: 1785912637725 +- conda: https://conda.anaconda.org/conda-forge/win-64/gcc-16.1.0-hb5e953d_2.conda + sha256: ca8e5e8f5e606b494bad058201f1b3e02a7868097a0b22dfae53e676f474c4ad + md5: e4b4424b5db07664bc371f68fdc0df67 + depends: + - conda-gcc-specs + - gcc_impl_win-64 16.1.0 h0942c35_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 1357709 + timestamp: 1787166786587 +- conda: https://conda.anaconda.org/conda-forge/win-64/gcc_impl_win-64-16.1.0-h0942c35_2.conda + sha256: 4cc3aa54715f4904eda0a3a32d40341093a8b4ada9c9f78010c8bcb08e5ca489 + md5: 61b19e45d33195a0d482998f53a83c20 + depends: + - binutils_impl_win-64 >=2.46.1 + - libgcc >=16.1.0 + - libgcc-devel_win-64 16.1.0 hecf7705_102 + - libgomp >=16.1.0 + - libstdcxx >=16.1.0 + - libstdcxx-devel_win-64 16.1.0 hc76ffd0_102 + - m2w64-sysroot_win-64 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 64038389 + timestamp: 1787166553763 +- conda: https://conda.anaconda.org/conda-forge/win-64/gdk-pixbuf-2.44.8-h1f5b9c4_0.conda + sha256: 17dd50f1729768ae2583b1aed7170c55c7966e9bf931501f63c5972f5f228ea3 + md5: 192391c5b8a9fc598d4fc20e1b17d5ee + depends: + - libglib >=2.88.3,<3.0a0 + - libintl >=0.22.5,<1.0a0 + - libjpeg-turbo >=3.2.0,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libtiff >=4.7.2,<4.8.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - gdk-pixbuf >=2.44.8,<3.0a0 + size: 578422 + timestamp: 1786715362203 +- conda: https://conda.anaconda.org/conda-forge/win-64/glib-2.88.3-h89924da_1.conda + sha256: 4aadcd822cee664e41f413fc73d58ee44e9f9609dfa8bae7fedd01d569b1447c + md5: ac5df4663035b908c8bdccfd7fe45e0e + depends: + - python * + - packaging + - libglib ==2.88.3 he810d59_1 + - glib-tools ==2.88.3 hf027272_1 + - libintl-devel + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libintl >=0.22.5,<1.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libglib >=2.88.3,<3.0a0 + size: 76039 + timestamp: 1786457672418 +- conda: https://conda.anaconda.org/conda-forge/win-64/glib-tools-2.88.3-hf027272_1.conda + sha256: b4b637f6e3b408e21af8e98d635745146f7434ecf1b7ca73b8e510c1d3544ef1 + md5: a22de7dd4d070f48158307df1749c9b1 + depends: + - libglib ==2.88.3 he810d59_1 + - libffi + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libintl >=0.22.5,<1.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: {} + size: 251656 + timestamp: 1786457672418 +- conda: https://conda.anaconda.org/conda-forge/win-64/graphite2-1.3.15-h5112557_1.conda + sha256: 93a59bdf944fb6f947bd7ad2f293d5d80db3a90f8ff8dfabc591e3752141e46f + md5: 79538e7a7bc024084eda5989f73fde35 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: LGPL-2.0-or-later + license_family: LGPL + purls: [] + run_exports: + weak: + - graphite2 >=1.3.15,<2.0a0 + size: 98064 + timestamp: 1786118492029 +- conda: https://conda.anaconda.org/conda-forge/win-64/greenlet-3.5.5-py312ha1a9051_0.conda + sha256: 97094aa5236f3b5d245a3faf068fa3eb643ec17462bc92bccd45d0b13c06a9c6 + md5: 7037cdbca1ce13941d30bc6a5935594b + 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 + run_exports: {} + size: 256994 + timestamp: 1786384103960 +- conda: https://conda.anaconda.org/conda-forge/win-64/gxx-16.1.0-hb5e953d_2.conda + sha256: 4f7e79e5f51d64e594a35ef458bcd549db393459feee555f1edea7479e295d51 + md5: 9e71d5e7ce9c73f809a81b61ea765ec5 + depends: + - conda-gcc-specs + - gcc 16.1.0 hb5e953d_2 + - gxx_impl_win-64 16.1.0 he3d2c83_2 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 927372 + timestamp: 1787166826183 +- conda: https://conda.anaconda.org/conda-forge/win-64/gxx_impl_win-64-16.1.0-he3d2c83_2.conda + sha256: 0277f22b2b697df6a0cdc53225cb12975c0ca922413fd4482c1964994c0d8c29 + md5: c70ea0125b4897a3b32388203255f999 + depends: + - gcc_impl_win-64 16.1.0 h0942c35_2 + - libstdcxx-devel_win-64 16.1.0 hc76ffd0_102 + - m2w64-sysroot_win-64 + - tzdata + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 15247571 + timestamp: 1787166750693 +- conda: https://conda.anaconda.org/conda-forge/win-64/harfbuzz-14.3.1-h57928b3_0.conda + sha256: 5e410d9a7e589978aa2e11be32715db51ee4f67ac8e8ef2785f7b24172a1221d + md5: 699242debb10424f042a52d478418ded + depends: + - libharfbuzz-devel 14.3.1 h03b5201_0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 11519 + timestamp: 1786971106695 +- conda: https://conda.anaconda.org/conda-forge/win-64/icu-78.3-h5112557_2.conda + sha256: 75c549b55b673e15de8785a8e5dd85bca7eb612eee0ff4dc8d7bdaa15eacbdbb + md5: e596942e8ee6ee17fdcf1e6a77757a66 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - icu >=78.3,<79.0a0 + size: 16835644 + timestamp: 1784916416303 +- conda: https://conda.anaconda.org/conda-forge/win-64/krb5-1.22.2-h719d79b_2.conda + sha256: 63ff03324e903eb01a715ccf357df56d66224e61952fd6615d86490ebefb3285 + md5: 93f5a01dec294a2228f757fe2f3432d4 + depends: + - openssl >=3.5.7,<4.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - krb5 >=1.22.2,<1.23.0a0 + size: 753425 + timestamp: 1786762169034 +- conda: https://conda.anaconda.org/conda-forge/win-64/lame-4.0-h0c5f640_1.conda + sha256: c1df9067381c938f819639a3c1b151a28bd1880c044951b5e14785a89fd91cf5 + md5: f2520f0d4797754e640bc20bbcfdea6d + depends: + - mpg123 >=1.33.7,<1.34.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.0-only + license_family: LGPL + purls: [] + run_exports: + weak: + - lame >=4.0,<4.1.0a0 + size: 360500 + timestamp: 1786292530281 +- conda: https://conda.anaconda.org/conda-forge/win-64/ld_impl_win-64-2.46.1-default_hfd38196_102.conda + sha256: e3cb27be096acab3c8d5ed36961e291e3e6e9c2323dd3fd565623a4c093e931c + md5: 179ed4e90a5c9560bebb28292a726f12 + depends: + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_win-64 2.46.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + run_exports: {} + size: 896485 + timestamp: 1784214548635 +- conda: https://conda.anaconda.org/conda-forge/win-64/lerc-4.2.0-hd936e49_0.conda + sha256: 93d666f63f284ef77b87b0b1f77b70f7d36d315a132f9afa64bc0012d937ba39 + md5: add59e2b60ac9d4299d17c938185c75a + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - lerc >=4.2.0,<5.0a0 + size: 175297 + timestamp: 1785036247761 +- conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-9_h8455456_mkl.conda + build_number: 9 + sha256: a99c640f10a3f77efe5c6605676ddc8d365d020eec4fdf1c803d34bdaf49b357 + md5: 17b26a4ad064259983bec1eaa36f40d3 + depends: + - mkl >=2026.1.0,<2027.0a0 + constrains: + - blas 2.309 mkl + - libcblas 3.11.0 9*_mkl + - liblapack 3.11.0 9*_mkl + - liblapacke 3.11.0 9*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libblas >=3.11.0,<4.0a0 + size: 67235 + timestamp: 1786059219098 +- conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlicommon-1.2.0-hf02afa3_3.conda + sha256: c739589318a1f8a88cd1b66d385176fd1ec2c4609e9f90d23d748be94b547e4e + md5: 8ef4beb3cb18e1a876b9af9a757cc1a5 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlicommon >=1.2.0,<1.3.0a0 + size: 82655 + timestamp: 1786622832371 +- conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlidec-1.2.0-h84f9c24_3.conda + sha256: f4bdb7ec97c3122e531fc867efae5ec928b649d047aa70d42893f0d8eb110fd9 + md5: 10c479888ee4e960587967b2d0c8143a + depends: + - libbrotlicommon 1.2.0 hf02afa3_3 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlidec >=1.2.0,<1.3.0a0 + size: 34788 + timestamp: 1786622843818 +- conda: https://conda.anaconda.org/conda-forge/win-64/libbrotlienc-1.2.0-he2a975b_3.conda + sha256: c5e638ea9704c94b316238b425a3439ba38d4d8fba81682842e6d7d464472848 + md5: cb5d08dc81f52e87c27914b5636cd995 + depends: + - libbrotlicommon 1.2.0 hf02afa3_3 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libbrotlienc >=1.2.0,<1.3.0a0 + size: 253894 + timestamp: 1786622854214 +- conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-9_h2a3cdd5_mkl.conda + build_number: 9 + sha256: 8c20714bbb85c8a109e9002e76c32be64a82d9867beb1a35a20c85258cc2b535 + md5: 9d1d0c22e9ed8c31ec2efc0d063d6f48 + depends: + - libblas 3.11.0 9_h8455456_mkl + constrains: + - blas 2.309 mkl + - liblapack 3.11.0 9*_mkl + - liblapacke 3.11.0 9*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libcblas >=3.11.0,<4.0a0 + size: 67587 + timestamp: 1786059232952 +- conda: https://conda.anaconda.org/conda-forge/win-64/libdeflate-1.25-h1a1d4e4_1.conda + sha256: af1cda21d4653f594fbef20aa4e1ff158a546902b3307ef8af9a9b44b43862d2 + md5: e4e122e124676a49eebf241399ad8393 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libdeflate >=1.25,<1.26.0a0 + size: 157828 + timestamp: 1785908793271 +- conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + sha256: 1a54d874addda73b6f7164d5f3905821277a1831bcc05edd74b3085391688571 + md5: ccc490c81ffe14181861beac0e8f3169 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - expat 2.8.1.* + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 71631 + timestamp: 1781203724164 +- conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + sha256: 2ea8d2fe7b84ca37653777e15ac1e7abd35f0c90d3efbe7f6c4de9b489606369 + md5: 92bdfc0e5012660892b0e0eaf3069a5c + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libffi >=3.7.0,<3.8.0a0 + size: 50247 + timestamp: 1783521107166 +- conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype-2.14.3-h57928b3_2.conda + sha256: d794d7fddb6eea50e18a62fa27ab3819f40d51bad00b90cf4ca591fb0d4006c2 + md5: 740f99c3c91079c03874b809fedace1b + depends: + - libfreetype6 >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 8742 + timestamp: 1786641045882 +- conda: https://conda.anaconda.org/conda-forge/win-64/libfreetype6-2.14.3-hdbac1cb_2.conda + sha256: cbc650854003e434d4ff6c7b1a2667e38a4242ad8a391a1c5ff89721624065ce + md5: 8157483eb7ed3fcba71aad3b50a97131 + depends: + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - freetype >=2.14.3 + license: GPL-2.0-only OR FTL + purls: [] + run_exports: {} + size: 340385 + timestamp: 1786641044865 +- conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-16.1.0-h110b43a_2.conda + sha256: 4457d44a3ec12e7304ca248f418ed3a1a5da7152c5627dc422e33982d71fff94 + md5: a23cb46435dc757667ee85c060dea30a + depends: + - _openmp_mutex >=4.5 + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + constrains: + - libgcc-ng ==16.1.0=*_2 + - libgomp 16.1.0 h8ee18e1_2 + - msys2-conda-epoch <0.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 818811 + timestamp: 1787166490957 +- conda: https://conda.anaconda.org/conda-forge/win-64/libglib-2.88.3-he810d59_1.conda + sha256: fd94edec4f945c82ba6b983aae2bec21dd08209a5b387fb7a713534bb3db51af + md5: d8b3236ab45b58a0c4f4aa0a286cee13 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - pcre2 >=10.47,<10.48.0a0 + - libffi >=3.7.0,<3.8.0a0 + - libintl >=0.22.5,<1.0a0 + - libiconv >=1.18,<2.0a0 + - libzlib >=1.3.2,<2.0a0 + constrains: + - glib >2.66 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libglib >=2.88.3,<3.0a0 + size: 4518977 + timestamp: 1786457672418 +- conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-16.1.0-h8ee18e1_2.conda + sha256: 58d07dbe9dc4f3abd6ee6beec4e875469d0734b203161d34e156eeeff6ef41bf + md5: 9db12c082cf914035ad95b1cea237fc8 + depends: + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + constrains: + - msys2-conda-epoch <0.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: + strong: + - _openmp_mutex >=4.5 + - libgomp >=16.1.0 + size: 682073 + timestamp: 1787166441157 +- conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-14.3.1-h03b5201_0.conda + sha256: 79fa7b957cb1fa539b5be09a67872360e507a3f25501a0ceb26cda2b5091686e + md5: 72c117cd3215779e10bf16266db1d70e + depends: + - cairo >=1.18.4,<2.0a0 + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libglib >=2.88.3,<3.0a0 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 1042074 + timestamp: 1786971066342 +- conda: https://conda.anaconda.org/conda-forge/win-64/libharfbuzz-devel-14.3.1-h03b5201_0.conda + sha256: 88c637d1465c608f2096119d50cf464bd5aa271ea033c3cb830c0f1792cc1cb6 + md5: 44a5f97ff0fc9d87d935478631aee3d6 + depends: + - cairo >=1.18.4,<2.0a0 + - freetype + - glib + - graphite2 >=1.3.15,<2.0a0 + - icu >=78.3,<79.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz 14.3.1 h03b5201_0 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libharfbuzz >=14.3.1 + size: 325706 + timestamp: 1786971096676 +- conda: https://conda.anaconda.org/conda-forge/win-64/libhwloc-2.13.0-default_h049141e_1000.conda + sha256: 2ee12e37223dfcd0acd050c80a91150c482b6e2899198521e1800dce66662467 + md5: 6a01c986e30292c715038d2788aa1385 + depends: + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + - libxml2 + - libxml2-16 >=2.14.6 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libhwloc >=2.13.0,<2.13.1.0a0 + size: 2396128 + timestamp: 1770954127918 +- conda: https://conda.anaconda.org/conda-forge/win-64/libhwy-1.4.0-h2419aca_0.conda + sha256: ade3e4e8e09051bad9c75ea9e96b09e3c635216c409c87c369e6f8566a528cb1 + md5: 430378e206cf5a148fc8da7603b2466e + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 OR BSD-3-Clause + purls: [] + run_exports: + weak: + - libhwy >=1.4.0,<1.5.0a0 + size: 564121 + timestamp: 1784325614001 +- conda: https://conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_3.conda + sha256: 35e04e3ddac7720fc7c550a1c9f998604299d6a7bd1f3ec9b2825d825061daa2 + md5: a8a2abdf0f901bc4779d9b7be0845921 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-only + purls: [] + run_exports: + weak: + - libiconv >=1.18,<2.0a0 + size: 694899 + timestamp: 1787033851701 +- conda: https://conda.anaconda.org/conda-forge/win-64/libintl-0.22.5-h5728263_3.conda + sha256: c7e4600f28bcada8ea81456a6530c2329312519efcf0c886030ada38976b0511 + md5: 2cf0cf76cc15d360dfa2f17fd6cf9772 + depends: + - libiconv >=1.17,<2.0a0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libintl >=0.22.5,<1.0a0 + size: 95568 + timestamp: 1723629479451 +- conda: https://conda.anaconda.org/conda-forge/win-64/libintl-devel-0.22.5-h5728263_3.conda + sha256: be1f3c48bc750bca7e68955d57180dfd826d6f9fa7eb32994f6cb61b813f9a6a + md5: 7537784e9e35399234d4007f45cdb744 + depends: + - libiconv >=1.17,<2.0a0 + - libintl 0.22.5 h5728263_3 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libintl >=0.22.5,<1.0a0 + size: 40746 + timestamp: 1723629745649 +- conda: https://conda.anaconda.org/conda-forge/win-64/libjpeg-turbo-3.2.0-hfd05255_1.conda + sha256: df78ab4c0eecb3dd9331898f96baeed8e5ca1c363346332517abeb0b614b9a53 + md5: fc2c23bacefd1e733f1e1d6cd3b2aaeb + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - jpeg <0.0.0a + license: IJG AND BSD-3-Clause AND Zlib + purls: [] + run_exports: + weak: + - libjpeg-turbo >=3.2.0,<4.0a0 + size: 990125 + timestamp: 1785896494014 +- conda: https://conda.anaconda.org/conda-forge/win-64/libjxl-0.12.0-h932607e_2.conda + sha256: c0381a39fd601430ebe7e2686543f5b1685d2374d8bb7be0aabf4d4705327efa + md5: cf415a2296a1d862e93559645c91fd30 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libhwy >=1.4.0,<1.5.0a0 + - libbrotlienc >=1.2.0,<1.3.0a0 + - libbrotlidec >=1.2.0,<1.3.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libjxl >=0.12.0,<0.13.0a0 + size: 1199700 + timestamp: 1786691396735 +- conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-9_hf9ab0e9_mkl.conda + build_number: 9 + sha256: 62d0a7a70ee13c554d5d7ff94a2ba758c4111439822dcc81324dd4cfaf576071 + md5: bee6f13ab945c4034bdd0f722ad14dd5 + depends: + - libblas 3.11.0 9_h8455456_mkl + constrains: + - blas 2.309 mkl + - libcblas 3.11.0 9*_mkl + - liblapacke 3.11.0 9*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - liblapack >=3.11.0,<3.12.0a0 + size: 79963 + timestamp: 1786059243440 +- conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_1.conda + sha256: d36c4a1e1f80fd08e18a407e03622ff2f34dfdd022da6488ad19603dea19e6d5 + md5: 880a0c8549479b198af21ba5dc49b109 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - xz 5.8.3.* + license: 0BSD + purls: [] + run_exports: + weak: + - liblzma >=5.8.3,<6.0a0 + size: 105809 + timestamp: 1786348717883 +- conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_2.conda + sha256: f07e451de3db1836b87f7aedf95c8e65cdb06c0e6105329ba24bb5f7b5c75e2a + md5: 5ae92fd6614edd024576e14069d7ad4c + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 89109 + timestamp: 1786650384519 +- conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-12.9.82-hac47afa_2.conda + sha256: 31b31c81575656d967722ca5d795a414b069ce618714422fb2b6890583ad83e2 + md5: 24695ab1ce33e2fda666dab89c1a23f0 + depends: + - cuda-version >=12,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 345191 + timestamp: 1782920356823 +- conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-12.9.86-hac47afa_2.conda + sha256: adf35938c9ecd77d27c87ef870f7710ee422933ad95d1aac136ff39e7af0551f + md5: feaee6b1ab0e7ed9152dc88e1b0eeddd + depends: + - cuda-version >=12,<12.10.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27343190 + timestamp: 1760724535115 +- conda: https://conda.anaconda.org/conda-forge/win-64/libnvptxcompiler-dev-12.9.86-h57928b3_2.conda + sha256: b05ab0cb8c66535a9cb27cf229752c42dab1fc4bda46c050514c42ad0a74b12c + md5: ed841728d5a36ce8269c6f875c001236 + depends: + - cuda-version >=12.9,<12.10.0a0 + - libnvptxcompiler-dev_win-64 12.9.86 h57928b3_2 + license: LicenseRef-NVIDIA-End-User-License-Agreement + purls: [] + run_exports: {} + size: 27359 + timestamp: 1753976279054 +- conda: https://conda.anaconda.org/conda-forge/win-64/libogg-1.3.5-h2466b09_1.conda + sha256: c63e5fb169dbd192aacdcee6e37235407f106b8ca9c9036942a25e0366cbc73c + md5: b67ed8c9ca072695ff482e50d888a523 + depends: + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + - ucrt >=10.0.20348.0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libogg >=1.3.5,<1.4.0a0 + size: 35040 + timestamp: 1745826086628 +- conda: https://conda.anaconda.org/conda-forge/win-64/libopus-1.6.1-h6a83c73_0.conda + sha256: c3678f111866235b44fa65265966abae7d90b6387178f1459afaedcee8b4a997 + md5: 0ed21da5b6e3a0393e05762b3cce2878 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libopus >=1.6.1,<2.0a0 + size: 307373 + timestamp: 1768497136248 +- conda: https://conda.anaconda.org/conda-forge/win-64/libpng-1.6.58-hdc8cecf_1.conda + sha256: 8c49c32adf3ba2c59783630b82377f54ab72204ea99e2bafc90a47a8e25c1032 + md5: 5aa7348e73691187c81d51616f17e48a + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libzlib >=1.3.2,<2.0a0 + license: zlib-acknowledgement + purls: [] + run_exports: + weak: + - libpng >=1.6.58,<1.7.0a0 + size: 385462 + timestamp: 1786616543374 +- conda: https://conda.anaconda.org/conda-forge/win-64/librsvg-2.62.3-h15cfe45_0.conda + sha256: 6f678be6074b79fe754660d16857a6edba73dd197ad92086250dc38c11b179ab + md5: 3fffc63af7b943cde57aa72f5ffe6048 + depends: + - cairo >=1.18.4,<2.0a0 + - gdk-pixbuf >=2.44.6,<3.0a0 + - harfbuzz >=14.2.0 + - libglib >=2.88.1,<3.0a0 + - libxml2-16 >=2.14.6 + - pango >=1.56.4,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - librsvg >=2.62.3,<3.0a0 + size: 3361405 + timestamp: 1780451179155 +- conda: https://conda.anaconda.org/conda-forge/win-64/libsodium-1.0.22-h6a83c73_1.conda + sha256: de45b71224da77a1c3a7dd48d8885eb957c9f05455d4f0828463293e7144330f + md5: 7d5abf7ca1bd00b43d273f44d93d05dc + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: ISC + purls: [] + run_exports: + weak: + - libsodium >=1.0.22,<1.0.23.0a0 + size: 280234 + timestamp: 1779164124739 +- conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.conda + sha256: 0a45d7c0f20146fff787a106f8fa187872e309c70975ff8f0936e188914c26ad + md5: a72d495965b144bb7da033642d389047 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: blessing + purls: [] + run_exports: + weak: + - libsqlite >=3.53.4,<4.0a0 + size: 1314919 + timestamp: 1787051140039 +- conda: https://conda.anaconda.org/conda-forge/win-64/libstdcxx-16.1.0-hae5796f_2.conda + sha256: 3e5a28cee4547403a3f19db2bf79ce9c013ccc0f1cb1b1598df12dd05861477f + md5: 952dcf4ca72d4a886ea6e513ae478970 + depends: + - libgcc 16.1.0 h110b43a_2 + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + constrains: + - libstdcxx-ng ==16.1.0=*_2 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + purls: [] + run_exports: {} + size: 7246535 + timestamp: 1787166510830 +- conda: https://conda.anaconda.org/conda-forge/win-64/libtiff-4.7.2-h8f73337_0.conda + sha256: ec6d66308a6d6abaf3225f2f185113e6172e77eb0fa8622af982d7a5d6d47a2c + md5: e83f459471905a04ebe15e21d063c49d + depends: + - lerc >=4.1.0,<5.0a0 + - libdeflate >=1.25,<1.26.0a0 + - libjpeg-turbo >=3.1.4.1,<4.0a0 + - liblzma >=5.8.3,<6.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - zstd >=1.5.7,<1.6.0a0 + license: HPND + purls: [] + run_exports: + weak: + - libtiff >=4.7.2,<4.8.0a0 + size: 1014598 + timestamp: 1783085017197 +- conda: https://conda.anaconda.org/conda-forge/win-64/libusb-1.0.29-h1839187_0.conda + sha256: 9837f8e8de20b6c9c033561cd33b4554cd551b217e3b8d2862b353ed2c23d8b8 + md5: a656b2c367405cd24988cf67ff2675aa + depends: + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + - ucrt >=10.0.20348.0 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - libusb >=1.0.29,<2.0a0 + size: 118204 + timestamp: 1748856290542 +- conda: https://conda.anaconda.org/conda-forge/win-64/libvorbis-1.3.7-h5112557_2.conda + sha256: 429124709c73b2e8fae5570bdc6b42f5418a7551ba72e591bb960b752e87b365 + md5: 42a8a56c60882da5d451aa95b8455111 + depends: + - libogg + - 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 + - libogg >=1.3.5,<1.4.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libvorbis >=1.3.7,<1.4.0a0 + size: 243401 + timestamp: 1753879416570 +- conda: https://conda.anaconda.org/conda-forge/win-64/libvulkan-loader-1.4.357.0-h477610d_0.conda + sha256: 432d4796261bc4a4525e8ecf262361c3f69d815af823ebf60242093e47333674 + md5: 63d913ed8ee946e25b1ebf7d9f477b67 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + constrains: + - libvulkan-headers 1.4.357.0.* + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: + weak: + - libvulkan-loader >=1.4.357.0,<2.0a0 + size: 286754 + timestamp: 1785311500125 +- conda: https://conda.anaconda.org/conda-forge/win-64/libwebp-base-1.6.0-h4d5522a_1.conda + sha256: 4470d98d3178b0d45492eed4808afe421d2e7808352b8d06c2dc29166b75d94d + md5: 35a9475e4cc999d52921f57c181979fc + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - libwebp 1.6.0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - libwebp-base >=1.6.0,<2.0a0 + size: 278886 + timestamp: 1785954716703 +- conda: https://conda.anaconda.org/conda-forge/win-64/libwinpthread-12.0.0.r4.gg4f2fc60ca-h57928b3_10.conda + sha256: 0fccf2d17026255b6e10ace1f191d0a2a18f2d65088fd02430be17c701f8ffe0 + md5: 8a86073cf3b343b87d03f41790d8b4e5 + depends: + - ucrt + constrains: + - pthreads-win32 <0.0a0 + - msys2-conda-epoch <0.0a0 + license: MIT AND BSD-3-Clause-Clear + purls: [] + run_exports: {} + size: 36621 + timestamp: 1759768399557 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-16-2.15.3-h3cfd58e_0.conda + sha256: 3b61ee3caba702d2ff432fa3920835db963026e5c99c4e6fdca0c6114f59e7ce + md5: 9e8dd0d90ed830107b2c36801035b7db + depends: + - icu >=78.3,<79.0a0 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - libxml2 2.15.3 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 519871 + timestamp: 1776376969852 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-16-2.15.3-h692994f_0.conda + sha256: 8038084c60eda2006d0122d05e3364fe8db0a18935ca6ed0168b5ba5aa33f904 + md5: f7d6fcda29570e20851b78d92ea2154e + depends: + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - libxml2 2.15.3 + - icu <0.0a0 + license: MIT + license_family: MIT + purls: [] + run_exports: {} + size: 518869 + timestamp: 1776376971242 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.3-h8ef44ab_0.conda + sha256: a4599c6bbbbdd7db570896e520c557eec8e66d94e839a59d17dc1f24a3d5f82b + md5: 95591ca5671d2213f5b2d5aa7818420d + depends: + - icu >=78.3,<79.0a0 + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libxml2-16 2.15.3 h3cfd58e_0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - libxml2 + - libxml2-16 >=2.15.3 + size: 43684 + timestamp: 1776376992865 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.3-hbc0d294_0.conda + sha256: da68af9d9d28d65a6916db1bef68f8a25c64c4fdcf759f32a2d2f2f143220adf + md5: e3b5acbb857a12f5d59e8d174bc536c0 + depends: + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.3,<6.0a0 + - libxml2-16 2.15.3 h692994f_0 + - libzlib >=1.3.2,<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: [] + run_exports: + weak: + - libxml2 + - libxml2-16 >=2.15.3 + size: 43916 + timestamp: 1776376994334 +- conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + sha256: 0629c2cc0404d3bb29d6baa7b4ba62da80797015e86de050db81ea5a07050527 + md5: 5d2ff29d465097458cc3ff6569151991 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - zlib 1.3.2 *_3 + license: Zlib + license_family: Other + purls: [] + run_exports: + weak: + - libzlib >=1.3.2,<2.0a0 + size: 58529 + timestamp: 1785276664143 +- conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.8-h4fa8253_0.conda + sha256: 50c02902bb516eeb56680358f052be38b5bf74b40e78ea4b2a675e84957e7307 + md5: de3551bf6508d45ca46b714639e52823 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - openmp 22.1.8|22.1.8.* + - intel-openmp <0.0a0 + license: Apache-2.0 WITH LLVM-exception + license_family: APACHE + purls: [] + run_exports: + strong: + - llvm-openmp >=22.1.8 + size: 348002 + timestamp: 1781737042070 +- conda: https://conda.anaconda.org/conda-forge/win-64/m2-conda-epoch-20250515-0_x86_64.conda + build_number: 0 + sha256: 51e9214548f177db9c3fe70424e3774c95bf19cd69e0e56e83abe2e393228ba1 + md5: 7d60fb16df2cd07fbc3dbff1c9df4244 + constrains: + - msys2-conda-epoch <0.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - m2-conda-epoch 20250515 *_x86_64 + noarch: + - m2-conda-epoch 20250515 *_x86_64 + size: 7539 + timestamp: 1747330852019 +- conda: https://conda.anaconda.org/conda-forge/win-64/make-4.4.1-hba3369d_3.conda + sha256: 8b1a30f3e6442ed4c161e7aabab396ce35c61a3c235ece53edf2a78c95d18fed + md5: 01f0e2393626438c79e4f167f853b304 + depends: + - libgcc >=14 + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + - ucrt >=10.0.20348.0 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + run_exports: {} + size: 2207518 + timestamp: 1785879951361 +- 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=hash-mapping + run_exports: {} + size: 28510 + timestamp: 1772445175216 +- conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2026.1.0-hac47afa_234.conda + sha256: f7568a5ebf9f4a401a6d9da7be4f82a8794cf305e870e77923a5712ba7f4b964 + md5: f0510f9d5e501462d72a5c0c798dbcc3 + depends: + - llvm-openmp >=22.1.8 + - tbb >=2023.0.0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-IntelSimplifiedSoftwareOct2022 + license_family: Proprietary + purls: [] + run_exports: {} + size: 114429478 + timestamp: 1786086389935 +- conda: https://conda.anaconda.org/conda-forge/win-64/mpg123-1.33.7-h365c5b5_0.conda + sha256: 844868a7dc886bd1bf569613cd2609d335c4728c9b89a4eb6c9113ca6d67f946 + md5: bf6e07b61800a79426c4b6bdbdd0111a + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LGPL-2.1-only + license_family: LGPL + purls: [] + run_exports: + weak: + - mpg123 >=1.33.7,<1.34.0a0 + size: 268619 + timestamp: 1786232242913 +- conda: https://conda.anaconda.org/conda-forge/win-64/msgpack-python-1.2.1-py312h78d62e6_1.conda + sha256: f43cc72ae92759d661187cb4bc4fb4721b97128d150f336b9b0ebf24b8600a27 + md5: 0ac1766b278a8547f22cd0820b8a7e96 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/msgpack?source=hash-mapping + run_exports: {} + size: 89054 + timestamp: 1782460807428 +- conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.5.2-py312ha3f287d_0.conda + sha256: 1001b7aec66a029e43ced0981f804063f21779989f5be92afbe57ba6dbc9b0e0 + md5: aabb836a50a8be95424c224fcb9c4dd5 + 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=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 7310151 + timestamp: 1786330621317 +- conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.5.2-py314h02f10f6_0.conda + sha256: 14067f2c7628320708f73531c98c16753ee3991230c6ae32873baed911771b09 + md5: bd342de8875a168535a553191b405821 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libcblas >=3.9.0,<4.0a0 + - libblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + - python_abi 3.14.* *_cp314 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpy?source=hash-mapping + run_exports: + weak: + - numpy >=1.25,<3 + size: 7462504 + timestamp: 1786330617237 +- conda: https://conda.anaconda.org/conda-forge/win-64/openh264-2.6.0-h1eab103_1.conda + sha256: 8d7e4a2dcd68afcc87c1e875a19600d980ca8f792f00105a622efd5faed6b05a + md5: 91c186a483e5491170156399b2850804 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - openh264 >=2.6.0,<2.6.1.0a0 + size: 422904 + timestamp: 1782686043511 +- conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + sha256: 2ebff5a1b5793e82495bf33c91fba040e11ff23333c2385ac66d0c3aee2cc14c + md5: a978392692a910ba1c8920ccb1e784b3 + depends: + - ca-certificates + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + purls: [] + run_exports: + weak: + - openssl >=3.6.3,<4.0a0 + size: 9427535 + timestamp: 1785915614585 +- conda: https://conda.anaconda.org/conda-forge/win-64/pango-1.58.2-h13911b6_0.conda + sha256: 85fc9c2a3b805d7ad784b6b307f4cf4833d3525ab409a7f86262d476a67d441f + md5: 22d750d2ebf4109bc66c036f1e52b982 + depends: + - cairo >=1.18.4,<2.0a0 + - fontconfig >=2.18.2,<3.0a0 + - fonts-conda-ecosystem + - fribidi >=1.0.16,<2.0a0 + - libexpat >=2.8.1,<3.0a0 + - libfreetype >=2.14.3 + - libfreetype6 >=2.14.3 + - libglib >=2.88.3,<3.0a0 + - libharfbuzz >=14.3.0 + - libpng >=1.6.58,<1.7.0a0 + - libzlib >=1.3.2,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: LGPL-2.1-or-later + purls: [] + run_exports: + weak: + - pango >=1.58.2,<2.0a0 + size: 466294 + timestamp: 1786107518608 +- conda: https://conda.anaconda.org/conda-forge/win-64/pcre2-10.47-hd2b5f0e_0.conda + sha256: 3e9e02174edf02cb4bcdd75668ad7b74b8061791a3bc8bdb8a52ae336761ba3e + md5: 77eaf2336f3ae749e712f63e36b0f0a1 + depends: + - bzip2 >=1.0.8,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - pcre2 >=10.47,<10.48.0a0 + size: 995992 + timestamp: 1763655708300 +- conda: https://conda.anaconda.org/conda-forge/win-64/pixman-0.46.4-h5112557_3.conda + sha256: cad8b94c2b00264a15d469eed6dc53aac1c59c6d46f27ad1d91bfaf227cf136a + md5: 27c5be39d9e4d25fe85b89a069360d1e + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: MIT + license_family: MIT + purls: [] + run_exports: + weak: + - pixman >=0.46.4,<1.0a0 + size: 257473 + timestamp: 1786106677325 +- 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 + run_exports: {} + size: 242769 + timestamp: 1769678170631 +- conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.13-hb12b558_1_cpython.conda + build_number: 1 + sha256: 14a64c3256f018e185490fd64bbdf29c327a6143432fb6545363ddf49ceababb + md5: a028e8d8ad74ff4e53af5411cb34e9c2 + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - liblzma >=5.8.3,<6.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libzlib >=1.3.2,<2.0a0 + - openssl >=3.5.7,<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: [] + run_exports: + weak: + - python_abi 3.12.* *_cp312 + noarch: + - python + size: 15891265 + timestamp: 1786443666090 +- conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.7-h53f6dd8_100_cp314.conda + build_number: 100 + sha256: 01cd1d39e5a24f029df0a8db0878dd442d552a82f584e18fd2ed366bc881633f + md5: 99dcbb9c65cb1fb10340bc7f6984ddfa + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.8.1,<3.0a0 + - libffi >=3.7.0,<3.8.0a0 + - liblzma >=5.8.3,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.53.4,<4.0a0 + - libzlib >=1.3.2,<2.0a0 + - openssl >=3.5.7,<4.0a0 + - python_abi 3.14.* *_cp314 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - zstd >=1.5.7,<1.6.0a0 + license: Python-2.0 + purls: [] + run_exports: + weak: + - python_abi 3.14.* *_cp314 + noarch: + - python + size: 18052663 + timestamp: 1787154783216 + python_site_packages_path: Lib/site-packages +- conda: https://conda.anaconda.org/conda-forge/win-64/pywin32-312-py312h829343e_0.conda + sha256: e4560c30234075bf17c641cb651279ff6c6f2bad581dfc37ed780f159909b2d3 + md5: 47f425e058b0a4b66712784a0d24b45d + depends: + - python + - 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 + run_exports: {} + size: 4459779 + timestamp: 1781362887119 +- 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 + run_exports: {} + size: 179738 + timestamp: 1770223468771 +- conda: https://conda.anaconda.org/conda-forge/win-64/pyzmq-27.1.0-py312h343a6d4_3.conda + noarch: python + sha256: d7e65c44ea8a92f80cc0e424b4b7dbe63b8a9ec04ea774b7d4f7aed4c34cce4c + md5: ebbda9a4e5161d6e1f98146ad057dc10 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - _python_abi3_support 1.* + - cpython >=3.12 + - zeromq >=4.3.5,<4.3.6.0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyzmq?source=hash-mapping + run_exports: {} + size: 182831 + timestamp: 1779483925948 +- conda: https://conda.anaconda.org/conda-forge/win-64/rpds-py-2026.6.3-py312hd944d65_0.conda + sha256: 8df011d21a56a4fb9aa0d5b27c2d0138058a4d82af532723e1002a643c02dead + md5: 4a097aa0b62666ceb97a5ed5b9345131 + 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 + run_exports: {} + size: 217956 + timestamp: 1782831653430 +- 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 + run_exports: {} + size: 105961 + timestamp: 1766159551536 +- conda: https://conda.anaconda.org/conda-forge/win-64/scipy-1.18.0-py312h9b3c559_0.conda + sha256: 68e7c49be1e409ed2ac44f2977581d58a9a4d12e6724a4a5c5470348e5e40f34 + md5: e1fee578f6c533ff532693143919afde + depends: + - 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 >=2.0.0 + - 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 + run_exports: {} + size: 15077907 + timestamp: 1781914327034 +- conda: https://conda.anaconda.org/conda-forge/win-64/sdl2-2.32.56-h5112557_0.conda + sha256: d17da21386bdbf32bce5daba5142916feb95eed63ef92b285808c765705bbfd2 + md5: 4cffbfebb6614a1bff3fc666527c25c7 + 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 + - sdl3 >=3.2.22,<4.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl2 >=2.32.56,<3.0a0 + size: 572101 + timestamp: 1757842925694 +- conda: https://conda.anaconda.org/conda-forge/win-64/sdl3-3.4.14-h5112557_0.conda + sha256: bb70cacf72c45481ebe534d49c8c0b0ad5f72afa69d21ff741186db19f67f4b9 + md5: a9448d016627e0ff20e20fd6bbe7a928 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libvulkan-loader >=1.4.357.0,<2.0a0 + - libusb >=1.0.29,<2.0a0 + license: Zlib + purls: [] + run_exports: + weak: + - sdl3 >=3.4.14,<4.0a0 + size: 1680176 + timestamp: 1785816137266 +- conda: https://conda.anaconda.org/conda-forge/win-64/sqlalchemy-2.0.52-py312he5662c2_0.conda + sha256: 5688b521af1ba1241a821f54ecb0eabd75946f7317e18498655a695ce030a8ed + md5: 451f7566472a964ea24b86cffe8c1038 + 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 + run_exports: {} + size: 3679537 + timestamp: 1786535215569 +- conda: https://conda.anaconda.org/conda-forge/win-64/svt-av1-4.2.0-hac47afa_0.conda + sha256: 6dc6ed0e651e99d03ae25b6a358064247c96b1cb436fdbf973ab25c1c6aedcd4 + md5: c49fb5bcbd2f2537875e4b2f62c0de3b + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-2-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - svt-av1 >=4.2.0,<4.2.1.0a0 + size: 1833926 + timestamp: 1784070033860 +- conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2023.0.0-hd3d4ead_2.conda + sha256: 8a4053839b8e997a5965e2dff7d6cf3c77be62d82c0e48c8a04a5ed2d2e73035 + md5: 8ee01a693aecff5432069eaaf1183c45 + depends: + - libhwloc >=2.13.0,<2.13.1.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: APACHE + purls: [] + run_exports: {} + size: 156515 + timestamp: 1778673901757 +- conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.conda + sha256: 13fa29257d43f8e630a1e591ed77fae9bbbb236b011432f01e2034cf36e6bf03 + md5: aaf79e2af50a151fb5b5a3e3f38b7a69 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: TCL + purls: [] + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + size: 3782314 + timestamp: 1784229072899 +- conda: https://conda.anaconda.org/conda-forge/win-64/tornado-6.5.8-py312he06e257_0.conda + sha256: b7efb0de7b09e7333c11d46e04eb9a68f5c72a916e440fc451664bc3457900d3 + md5: 9104ee965ddb1d19ca60a5116582ce55 + 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 + run_exports: {} + size: 869273 + timestamp: 1786226848377 +- conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + sha256: 3005729dce6f3d3f5ec91dfc49fc75a0095f9cd23bab49efb899657297ac91a5 + md5: 71b24316859acd00bdb8b38f5e2ce328 + constrains: + - vc14_runtime >=14.29.30037 + - vs2015_runtime >=14.29.30037 + license: LicenseRef-MicrosoftWindowsSDK10 + purls: [] + run_exports: {} + size: 694692 + timestamp: 1756385147981 +- conda: https://conda.anaconda.org/conda-forge/win-64/uv-0.12.5-h7ca4a90_1.conda + sha256: 034789390395c408b2b5d336eb3811a4daf33edea59f3ee10dde1b6388077c7a + md5: 34b879efadb00ab413f78890dd0f0810 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: Apache-2.0 OR MIT + run_exports: {} + size: 16014665 + timestamp: 1787146974080 +- conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.5-ha367084_41.conda + sha256: 35444c55a92e2f7f7ba26bc70f81e56e52344f7d064c0fd4b40a46a58517b79c + md5: aa805b5522c2a98fa286e551a1f48546 + depends: + - vc14_runtime >=14.51.36247 + track_features: + - vc14 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 21383 + timestamp: 1785359368566 +- conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + sha256: 4e4cb599cdc41bf2109d1464c127b5bcbddf548ce3e322e612afb691338b48f8 + md5: ac5333bb3d429361f23adf704cc49a78 + depends: + - ucrt >=10.0.20348.0 + - vcomp14 14.51.36247 habf1de7_41 + constrains: + - vs2015_runtime 14.51.36247.* *_41 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + purls: [] + run_exports: {} + size: 767955 + timestamp: 1785359364369 +- conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda + sha256: 731e043390c9457299484d39e427221fc868a9249540a498a5a4f6456c7744d1 + md5: 350bb67a5c8e5f1c53347ac544ab6600 + depends: + - ucrt >=10.0.20348.0 + constrains: + - vs2015_runtime 14.51.36247.* *_41 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + purls: [] + run_exports: + strong: + - vcomp14 >=14.51.36247 + size: 155910 + timestamp: 1785359349999 +- conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.51.36247-h633cb9f_41.conda + sha256: ee0ae67c96b80b9fdb50c3f617c6329dbcdf1562d0267604f6c0e24f494431d6 + md5: 21504569fa34b5d3a67760219e3ff1cc + depends: + - vc14_runtime >=14.51.36247 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: {} + size: 21386 + timestamp: 1785359368990 +- conda: https://conda.anaconda.org/conda-forge/win-64/vs2022_win-64-19.44.35207-ha74f236_41.conda + sha256: 9d7d1b43cf4af5a8e8b1646175c9f899ffbcab189a33ac41127a96e7bcf41af0 + md5: 04190e0ebd886433300ce9343ee98942 + depends: + - vswhere + constrains: + - vs_win-64 2022.14 + track_features: + - vc14 + license: BSD-3-Clause + license_family: BSD + run_exports: + strong: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + size: 25462 + timestamp: 1785358620723 +- conda: https://conda.anaconda.org/conda-forge/win-64/x264-1!164.3095-h8ffe710_2.tar.bz2 + sha256: 97166b318f8c68ffe4d50b2f4bd36e415219eeaef233e7d41c54244dc6108249 + md5: 19e39905184459760ccb8cf5c75f148b + depends: + - vc >=14.1,<15 + - vs2015_runtime >=14.16.27033 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x264 >=1!164.3095,<1!165 + size: 1041889 + timestamp: 1660323726084 +- conda: https://conda.anaconda.org/conda-forge/win-64/x265-3.5-h2d74725_3.tar.bz2 + sha256: 02b9874049112f2b7335c9a3e880ac05d99a08d9a98160c5a98898b2b3ac42b2 + md5: ca7129a334198f08347fb19ac98a2de9 + depends: + - vc >=14.1,<15 + - vs2015_runtime >=14.16.27033 + license: GPL-2.0-or-later + license_family: GPL + purls: [] + run_exports: + weak: + - x265 >=3.5,<3.6.0a0 + size: 5517425 + timestamp: 1646611941216 +- 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: [] + run_exports: + weak: + - yaml >=0.2.5,<0.3.0a0 + size: 63944 + timestamp: 1753484092156 +- conda: https://conda.anaconda.org/conda-forge/win-64/zeromq-4.3.5-h3a581c9_11.conda + sha256: c3e279cb309b153152fcdd6ee6d039ad996d563c849f06be39d85b8e3351df25 + md5: f016c0c5f9c01549b259146614786192 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libsodium >=1.0.22,<1.0.23.0a0 + - krb5 >=1.22.2,<1.23.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + run_exports: + weak: + - zeromq >=4.3.5,<4.3.6.0a0 + size: 265717 + timestamp: 1779124031378 +- conda: https://conda.anaconda.org/conda-forge/win-64/zlib-1.3.2-hfd05255_3.conda + sha256: 5a0b55df66ff07b4342e04967cef69f8bf348f6a0fb1cc1eca741c7b015dfe77 + md5: 945092a9bc1d0f250f7d5ecf51ecd471 + depends: + - libzlib 1.3.2 hfd05255_3 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Zlib + license_family: Other + purls: [] + run_exports: + weak: + - libzlib >=1.3.2,<2.0a0 + size: 851288 + timestamp: 1785276674755 +- conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda + sha256: ca7daae4f218a11fab82cc2857f0ea518ec3f46acec60490485347a4c22c6b3e + md5: e4ac308c39d6d0e131154976da67cf3b + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libzlib >=1.3.2,<2.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + size: 387535 + timestamp: 1786599623274 +- conda_source: cuda-bindings[2ed80673] @ . + variants: + c_stdlib: sysroot + c_stdlib_version: '2.28' + python: 3.14.* + target_platform: linux-64 + depends: + - python + - python >=3.10 + - cuda-version 12.* + - cuda-pathfinder + - libnvjitlink + - cuda-nvrtc + - cuda-nvrtc >=12.9.86,<13.0a0 + - cuda-nvvm + - libnvfatbin + - libcufile + - libcufile >=1.14.1.1,<2.0a0 + - libgcc >=16 + - libgcc >=16 + - libstdcxx >=16 + - __glibc >=2.28,<3.0.a0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + source_depends: + cuda-pathfinder: + path: ../cuda_pathfinder + build_packages: + - 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/binutils_impl_linux-64-2.46.1-default_hfdba357_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.46.1-default_h4852527_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-16.1.0-hceef32b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-16.1.0-h5fd2508_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-16.1.0-he33a5f8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-16.1.0-h63736ef_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-16.1.0-hf2715c6_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.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/noarch/libgcc-devel_linux-64-16.1.0-h59071f9_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-16.1.0-h41cdd0d_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + host_packages: + - 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_10.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/linux-64/cuda-cudart-static-12.9.79-h5888daf_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-nvrtc-dev-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/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/linux-64/cython-3.2.9-py314h1807b08_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.78-h084b8d7_1.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/libcufile-dev-1.14.1.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-h084b8d7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.7-h399a421_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-63.0-h192683f_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/uv-0.12.5-hec9e821_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.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/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_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/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.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/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda + - conda_source: cuda-pathfinder[a267834f] @ ../cuda_pathfinder +- conda_source: cuda-bindings[eb437e7d] @ . + variants: + c_compiler: vs2022 + cxx_compiler: vs2022 + python: 3.14.* + target_platform: win-64 + depends: + - python + - python >=3.10 + - cuda-version 12.* + - cuda-pathfinder + - libnvjitlink + - cuda-nvrtc + - cuda-nvrtc >=12.9.86,<13.0a0 + - cuda-nvvm + - libnvfatbin + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + source_depends: + cuda-pathfinder: + path: ../cuda_pathfinder + build_packages: + - conda: https://conda.anaconda.org/conda-forge/noarch/vswhere-3.1.7-h40126e0_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vs2022_win-64-19.44.35207-ha74f236_41.conda + host_packages: + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.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/noarch/cuda-cudart-dev_win-64-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/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.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/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.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/win-64/cuda-cudart-static-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-nvrtc-dev-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/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/win-64/cython-3.2.9-py314h344ed54_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.7-h53f6dd8_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.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/win-64/uv-0.12.5-h7ca4a90_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.5-ha367084_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda + - conda_source: cuda-pathfinder[26c7b66e] @ ../cuda_pathfinder +- conda_source: cuda-bindings[eb5d0330] @ . + variants: + c_stdlib: sysroot + c_stdlib_version: '2.28' + python: 3.14.* + target_platform: linux-aarch64 + depends: + - python + - python >=3.10 + - cuda-version 12.* + - cuda-pathfinder + - libnvjitlink + - cuda-nvrtc + - cuda-nvrtc >=12.9.86,<13.0a0 + - cuda-nvvm + - libnvfatbin + - libcufile + - libcufile >=1.14.1.1,<2.0a0 + - libgcc >=16 + - libgcc >=16 + - libstdcxx >=16 + - __glibc >=2.28,<3.0.a0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + source_depends: + cuda-pathfinder: + path: ../cuda_pathfinder + build_packages: + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_impl_linux-aarch64-2.46.1-default_h5f4c503_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/binutils_linux-aarch64-2.46.1-default_hf1166c9_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_impl_linux-aarch64-16.1.0-h998876f_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gcc_linux-aarch64-16.1.0-hed00b63_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_impl_linux-aarch64-16.1.0-hd5c6868_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/gxx_linux-aarch64-16.1.0-hdc5d2df_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsanitizer-16.1.0-h2510bd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-aarch64-4.18.0-h05a177a_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-aarch64-16.1.0-hd673532_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-aarch64-16.1.0-h2445e1f_102.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-aarch64-2.28-h585391f_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + host_packages: + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-dev-12.9.86-h8f3c8d4_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-12.9.86-he9431aa_106.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-12.9.79-h16bee8c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.9-py314hc6b4731_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.78-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-dev-1.14.1.1-he38c790_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hfcc8634_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.7-h6bfacdd_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-63.0-h1f0f388_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/uv-0.12.5-h9b5564c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/arm-variant-1.2.0-sbsa.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-12.9.27-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.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/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda + - conda_source: cuda-pathfinder[6ab29be5] @ ../cuda_pathfinder +- conda_source: cuda-pathfinder[26c7b66e] @ ../cuda_pathfinder + variants: + target_platform: noarch + depends: + - python >=3.10 + - python * + license: Apache-2.0 + host_packages: + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_10.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.8.1-hac47afa_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.7.0-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.4-hf5d6505_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.3-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.7-h53f6dd8_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h967ab96_3.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/win-64/uv-0.12.5-h7ca4a90_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.5-ha367084_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda +- conda_source: cuda-pathfinder[6ab29be5] @ ../cuda_pathfinder + variants: + target_platform: noarch + depends: + - python >=3.10 + - python * + license: Apache-2.0 + host_packages: + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-py311h3512406_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.46.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.8.1-hfae3067_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.7.0-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-16.1.0-h205dda4_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-16.1.0-h8acb6b2_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.3-he30d5cf_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-he30d5cf_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.53.4-h399dd60_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-16.1.0-hef695bb_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42.2-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.6-h2b6f883_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.3-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.7-h6bfacdd_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-ha7194a6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h5cf4473_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/uv-0.12.5-h9b5564c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h9d15635_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda +- conda_source: cuda-pathfinder[a267834f] @ ../cuda_pathfinder + variants: + target_platform: noarch + depends: + - python >=3.10 + - python * + license: Apache-2.0 + host_packages: + - 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_10.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-py310h44b86e0_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.46.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.8.1-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.7.0-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-16.1.0-ha9f2e26_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-16.1.0-he0feb66_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.4-h13e7031_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-16.1.0-h934c35e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42.2-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.3-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.7-h399a421_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-hd6e31c0_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_hd70dff1_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/uv-0.12.5-hec9e821_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-10.2.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/vcs_versioning-2.3.1-pyhcf101f3_0.conda +- pypi: ../cuda_python_test_helpers + name: cuda-python-test-helpers + requires_python: '>=3.10' +- 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' diff --git a/cuda_bindings_12/pixi.toml b/cuda_bindings_12/pixi.toml new file mode 100644 index 00000000000..fe1078e11a3 --- /dev/null +++ b/cuda_bindings_12/pixi.toml @@ -0,0 +1,172 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +[workspace] +channels = ["conda-forge"] +platforms = ["linux-64", "linux-aarch64", "win-64"] +preview = ["pixi-build"] + +[workspace.build-variants] +python = ["3.10.*", "3.11.*", "3.12.*", "3.13.*", "3.14.*"] +cuda-version = ["12.*"] + +[feature.test.dependencies] +cuda-bindings = { path = "." } +pytest = ">=6.2.4" +pytest-benchmark = ">=3.4.1" +pytest-randomly = "*" +pytest-repeat = "*" +pyglet = ">=2.1.9" +numpy = "*" + +[feature.test.pypi-dependencies] +cuda-python-test-helpers = { path = "../cuda_python_test_helpers", editable = true } + +# Keep this dependency set aligned with cuda_python/docs/environment-docs.yml. +[feature.docs.dependencies] +cuda-bindings = "12.9.*" +python = "3.12.*" +cython = ">=3.2.5,<3.3" +enum_tools = "*" +furo = "*" +make = "*" +myst-nb = "*" +myst-parser = "*" +numpy = "*" +numpydoc = "*" +pip = "*" +pydata-sphinx-theme = "*" +pytest = "*" +scipy = "*" +sphinx = "<8.2.0" +sphinx-copybutton = "*" +sphinx-toolbox = "*" + +[feature.cython-tests.dependencies] +cython = ">=3.2.5,<3.3" # for tests that exercise APIs from cython +setuptools = "*" # for distutils +gxx = "*" # to compile the generated code +# These are necessary because running the Cython tests requires compiling +# after the package build and the tests transitively depend on CUDA headers. +cuda-cudart-dev = "*" +cuda-profiler-api = "*" + +[feature.cython-tests.target.linux-64.dependencies] +cuda-crt-dev_linux-64 = "*" + +[feature.cython-tests.target.linux-aarch64.dependencies] +cuda-crt-dev_linux-aarch64 = "*" + +[feature.cython-tests.target.win-64.dependencies] +cuda-crt-dev_win-64 = "*" + +# For finding headers when building the Cython tests. +[feature.cython-tests.target.linux-64.activation.env] +CUDA_HOME = "$CONDA_PREFIX/targets/x86_64-linux" + +[feature.cython-tests.target.linux-aarch64.activation.env] +CUDA_HOME = "$CONDA_PREFIX/targets/sbsa-linux" + +[feature.cython-tests.target.win-64.activation.env] +CUDA_HOME = "$CONDA_PREFIX/Library" + +[feature.cu12.dependencies] +cuda-version = "12.*" + +[environments] +default = { features = ["cu12", "test", "cython-tests"], solve-group = "default" } +cu12 = { features = ["cu12", "test", "cython-tests"], solve-group = "cu12" } +docs = { features = ["cu12", "docs"], solve-group = "docs" } + +[feature.docs.pypi-dependencies] +nvidia-sphinx-theme = "*" + +[package] +name = "cuda-bindings" +version = "12.9.8.dev0" + +[package.build] +backend = { name = "pixi-build-python", version = "*" } + +[package.build.config] +compilers = ["c", "cxx"] + +[package.build.target.linux-64.config.env] +CUDA_HOME = "$PREFIX/targets/x86_64-linux" +CUDA_PYTHON_PARALLEL_LEVEL = "$(nproc)" + +[package.build.target.linux-aarch64.config.env] +CUDA_HOME = "$PREFIX/targets/sbsa-linux" +CUDA_PYTHON_PARALLEL_LEVEL = "$(nproc)" + +[package.build.target.win-64.config.env] +CUDA_HOME = "$PREFIX/Library" + +[package.host-dependencies] +python = "*" +cuda-version = "12.*" +setuptools = ">=80" +setuptools-scm = ">=8,!=10.1" +cython = ">=3.2.5,<3.3" +pyclibrary = ">=0.1.7" +cuda-pathfinder = { path = "../cuda_pathfinder" } +cuda-cudart-static = "*" +cuda-nvrtc-dev = "*" +cuda-profiler-api = "*" +cuda-nvvm = "*" + +[package.target.linux.host-dependencies] +libcufile-dev = "*" + +[package.target.linux-64.host-dependencies] +cuda-crt-dev_linux-64 = "*" + +[package.target.linux-aarch64.host-dependencies] +cuda-crt-dev_linux-aarch64 = "*" + +[package.target.win-64.host-dependencies] +cuda-crt-dev_win-64 = "*" + +[package.run-dependencies] +python = "*" +cuda-version = "12.*" +cuda-pathfinder = { path = "../cuda_pathfinder" } +libnvjitlink = "*" +cuda-nvrtc = "*" +cuda-nvvm = "*" +libnvfatbin = "*" + +[package.target.linux.run-dependencies] +libcufile = "*" + +[target.linux.tasks.build-cython-tests] +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"] + +[target.linux.tasks.test] +cmd = [ + "pytest", + "$PIXI_PROJECT_ROOT", + "--override-ini", + "norecursedirs=examples", # include cython tests (ignore by default config) +] +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", + "--override-ini", + "norecursedirs=examples", # include cython tests (ignore by default config) +] +depends-on = [{ task = "build-cython-tests" }] diff --git a/cuda_bindings_12/pyproject.toml b/cuda_bindings_12/pyproject.toml new file mode 100644 index 00000000000..f66330c977b --- /dev/null +++ b/cuda_bindings_12/pyproject.toml @@ -0,0 +1,149 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[build-system] +requires = [ + "setuptools>=80.0.0", + "setuptools-scm[simple]>=8,!=10.1", + "cython>=3.2,<3.3", + "pyclibrary>=0.1.7" +] +build-backend = "build_hooks" +backend-path = ["."] + +[project] +name = "cuda-bindings" +description = "Python bindings for CUDA" +authors = [{name = "NVIDIA Corporation", email = "cuda-python-conduct@nvidia.com"},] +license = "Apache-2.0" +license-files = ["LICENSE"] +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Database", + "Topic :: Scientific/Engineering", + "Programming Language :: Python", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Environment :: GPU :: NVIDIA CUDA", +] +dynamic = [ + "version", + "readme", +] +dependencies = [ + "cuda-pathfinder ~=1.1", +] +requires-python = ">=3.10" + +[project.optional-dependencies] +all = [ + "nvidia-cuda-nvcc-cu12", + "nvidia-cuda-nvrtc-cu12", + "nvidia-nvjitlink-cu12>=12.3", + "nvidia-nvfatbin-cu12", + "nvidia-cufile-cu12; sys_platform == 'linux'", +] + +test = [ + "cython>=3.2,<3.3", + "setuptools>=77.0.0", + "numpy>=1.21.1", + "pytest>=6.2.4", + "pytest-benchmark>=3.4.1", + "pyglet>=2.1.9" +] + +[project.urls] +Repository = "https://github.com/NVIDIA/cuda-python" +Documentation = "https://nvidia.github.io/cuda-python/" + +[tool.setuptools.packages.find] +include = ["cuda*"] + +[tool.setuptools.dynamic] +readme = { file = ["DESCRIPTION.rst"], content-type = "text/x-rst" } + +[tool.cibuildwheel] +skip = "*-musllinux_*" +build-verbosity = 1 + +[tool.cibuildwheel.linux] +archs = "native" + +[tool.cibuildwheel.windows] +archs = "AMD64" +before-build = "pip install delvewheel" +repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" + +[tool.ruff] +line-length = 120 + +[tool.ruff.format] +docstring-code-format = true + +exclude = ["cuda/bindings/_version.py"] + +[tool.ruff.lint] +select = [ + # pycodestyle Error + "E", + # Pyflakes + "F", + # pycodestyle Warning + "W", + # pyupgrade + "UP", + # flake8-bugbear + "B", + # flake8-simplify + "SIM", + # isort + "I", +] + +ignore = [ + "UP007", + "E741", # ambiguous variable name such as I + "B007", # rename unsued loop variable to _name + "UP035", # UP006, UP007, UP035 complain about deprecated Typing. use, but disregard backward compatibility of python version + "B905", # preserve the imported line's zip() behavior + "I001", # preserve generated and legacy import ordering +] + +exclude = ["cuda/bindings/_version.py"] + +[tool.ruff.lint.per-file-ignores] +"setup.py" = ["F401"] +"__init__.py" = ["F401"] +"site-packages/_cuda_bindings_redirector.py" = ["F401"] +"cuda/bindings/_internal/_fast_enum.py" = ["E501"] + +"examples/**/*" = [ + "E722", + "E501" # line too long + ] + +"tests/**/*" = [ + "E722", + "UP022", + "E402", # module level import not at top of file + "F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example) + +"benchmarks/**/*" = [ + "E722", + "UP022", + "E402", # module level import not at top of file + "F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example) + +[tool.setuptools_scm] +root = ".." +version_file = "cuda/bindings/_version.py" +# We deliberately do not want to include the version suffixes (a/b/rc) in cuda-bindings versioning +tag_regex = "^(?Pv12\\.9\\.\\d+)" +# Main only contains the original v12.9.0 tag. Ignore it so development builds +# do not regress below the already-released 12.9.x wheels. +git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v12.9.[1-9]*"] +fallback_version = "12.9.8.dev0" diff --git a/cuda_bindings_12/setup.py b/cuda_bindings_12/setup.py new file mode 100644 index 00000000000..25c38941b17 --- /dev/null +++ b/cuda_bindings_12/setup.py @@ -0,0 +1,128 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import os +import pathlib +import subprocess +from warnings import warn + +from setuptools import setup +from setuptools.command.build_ext import build_ext as _build_ext +from setuptools.command.build_py import build_py +from setuptools.command.editable_wheel import _TopLevelFinder, editable_wheel + +import build_hooks + +if os.environ.get("PARALLEL_LEVEL") is not None: + warn( + "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead", + DeprecationWarning, + stacklevel=1, + ) + nthreads = int(os.environ.get("PARALLEL_LEVEL", "0")) +else: + nthreads = int(os.environ.get("CUDA_PYTHON_PARALLEL_LEVEL", "0") or "0") + + +def _is_clang(compiler): + @functools.lru_cache + def _check(compiler_cxx): + try: + output = subprocess.check_output([*compiler_cxx, "--version"]) # noqa: S603 + except subprocess.CalledProcessError: + return False + lines = output.decode().splitlines() + return len(lines) > 0 and "clang" in lines[0] + + if not hasattr(compiler, "compiler_cxx"): + return False + return _check(tuple(compiler.compiler_cxx)) + + +class build_ext(_build_ext): + def build_extensions(self): + if nthreads > 0: + self.parallel = nthreads + if _is_clang(self.compiler): + for ext in self.extensions: + ext.extra_compile_args = [a for a in ext.extra_compile_args if a != "-fno-var-tracking-assignments"] + super().build_extensions() + + +################################################################################ +# Adapted from NVIDIA/numba-cuda +# TODO: Remove this block once we get rid of cuda.__version__ and the .pth files + +REDIRECTOR_PTH = "_cuda_bindings_redirector.pth" +REDIRECTOR_PY = "_cuda_bindings_redirector.py" +SITE_PACKAGES = pathlib.Path("site-packages") + + +class build_py_with_redirector(build_py): # noqa: N801 + """Include the redirector files in the generated wheel.""" + + def copy_redirector_file(self, source, destination="."): + destination = pathlib.Path(self.build_lib) / destination + self.copy_file(str(source), str(destination), preserve_mode=0) + + def run(self): + super().run() + self.copy_redirector_file(SITE_PACKAGES / REDIRECTOR_PTH) + self.copy_redirector_file(SITE_PACKAGES / REDIRECTOR_PY) + + def get_source_files(self): + src = super().get_source_files() + src.extend( + [ + str(SITE_PACKAGES / REDIRECTOR_PTH), + str(SITE_PACKAGES / REDIRECTOR_PY), + ] + ) + return src + + def get_output_mapping(self): + mapping = super().get_output_mapping() + build_lib = pathlib.Path(self.build_lib) + mapping[str(build_lib / REDIRECTOR_PTH)] = REDIRECTOR_PTH + mapping[str(build_lib / REDIRECTOR_PY)] = REDIRECTOR_PY + return mapping + + +class TopLevelFinderWithRedirector(_TopLevelFinder): + """Include the redirector files in the editable wheel.""" + + def get_implementation(self): + for item in super().get_implementation(): # noqa: UP028 + yield item + + with open(SITE_PACKAGES / REDIRECTOR_PTH) as f: + yield (REDIRECTOR_PTH, f.read()) + + with open(SITE_PACKAGES / REDIRECTOR_PY) as f: + yield (REDIRECTOR_PY, f.read()) + + +class editable_wheel_with_redirector(editable_wheel): + def _select_strategy(self, name, tag, build_lib): + # The default mode is "lenient" - others are "strict" and "compat". + # "compat" is deprecated. "strict" creates a tree of links to files in + # the repo. It could be implemented, but we only handle the default + # case for now. + if self.mode is not None and self.mode != "lenient": + raise RuntimeError(f"Only lenient mode is supported for editable install. Current mode is {self.mode}") + + return TopLevelFinderWithRedirector(self.distribution, name) + + +################################################################################ + +setup( + ext_modules=build_hooks._extensions, + cmdclass={ + "build_ext": build_ext, + "build_py": build_py_with_redirector, + "editable_wheel": editable_wheel_with_redirector, + }, + zip_safe=False, +) diff --git a/cuda_bindings_12/site-packages/_cuda_bindings_redirector.pth b/cuda_bindings_12/site-packages/_cuda_bindings_redirector.pth new file mode 100644 index 00000000000..82a091bd35a --- /dev/null +++ b/cuda_bindings_12/site-packages/_cuda_bindings_redirector.pth @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import _cuda_bindings_redirector diff --git a/cuda_bindings_12/site-packages/_cuda_bindings_redirector.py b/cuda_bindings_12/site-packages/_cuda_bindings_redirector.py new file mode 100644 index 00000000000..e9267a0f9c9 --- /dev/null +++ b/cuda_bindings_12/site-packages/_cuda_bindings_redirector.py @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys +from types import ModuleType + + +# Make sure 'cuda' is importable as a namespace package +import cuda + + +class LazyCudaModule(ModuleType): + def __getattr__(self, name): + if name == "__version__": + import warnings + + warnings.warn( + "accessing cuda.__version__ is deprecated, please switch to use cuda.bindings.__version__ instead", + FutureWarning, + stacklevel=2, + ) + from cuda.bindings import __version__ + + return __version__ + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +# Patch in LazyCudaModule for `cuda` +sys.modules["cuda"].__class__ = LazyCudaModule diff --git a/cuda_bindings_12/tests/cufile.json b/cuda_bindings_12/tests/cufile.json new file mode 100644 index 00000000000..36b3b9bd722 --- /dev/null +++ b/cuda_bindings_12/tests/cufile.json @@ -0,0 +1,18 @@ +{ + // NOTE : Application can override custom configuration via export CUFILE_ENV_PATH_JSON= + // e.g : export CUFILE_ENV_PATH_JSON="/home//cufile.json" + + + "execution" : { + // max number of workitems in the queue; + "max_io_queue_depth": 128, + // max number of host threads per gpu to spawn for parallel IO + "max_io_threads" : 4, + // enable support for parallel IO + "parallel_io" : true, + // minimum IO threshold before splitting the IO + "min_io_threshold_size_kb" : 8192, + // maximum parallelism for a single request + "max_request_parallelism" : 4 + } +} diff --git a/cuda_bindings_12/tests/cython/build_tests.bat b/cuda_bindings_12/tests/cython/build_tests.bat new file mode 100644 index 00000000000..9edf9653b76 --- /dev/null +++ b/cuda_bindings_12/tests/cython/build_tests.bat @@ -0,0 +1,9 @@ +@echo off + +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" + cythonize -3 -i -Xfreethreading_compatible=True %~dp0test_*.pyx +endlocal diff --git a/cuda_bindings_12/tests/cython/build_tests.sh b/cuda_bindings_12/tests/cython/build_tests.sh new file mode 100755 index 00000000000..db8b97fbe7c --- /dev/null +++ b/cuda_bindings_12/tests/cython/build_tests.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# 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 +elif [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* || "$UNAME" == MSYS* ]] ; then + SCRIPTPATH="$(dirname $(cygpath -w $(realpath "$0")))" + export CL="/I\"${CUDA_HOME}\\include\" ${CL}" +else + exit 1 +fi + +cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx diff --git a/cuda_bindings_12/tests/cython/test_ccuda.pyx b/cuda_bindings_12/tests/cython/test_ccuda.pyx new file mode 100644 index 00000000000..8b3947258c4 --- /dev/null +++ b/cuda_bindings_12/tests/cython/test_ccuda.pyx @@ -0,0 +1,55 @@ +# 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 ( + memset, + memcmp + ) +# TODO: update to new module once the old ones are removed, we use the +# tests to cover backward compatibility. +cimport cuda.ccuda as ccuda + +def test_ccuda_memcpy(): + # Init CUDA + err = ccuda.cuInit(0) + assert(err == 0) + + # Get device + cdef ccuda.CUdevice device + err = ccuda.cuDeviceGet(&device, 0) + assert(err == 0) + + # Construct context + cdef ccuda.CUcontext ctx + err = ccuda.cuCtxCreate(&ctx, 0, device) + assert(err == 0) + + # Allocate dev memory + cdef ccuda.CUdeviceptr dptr + err = ccuda.cuMemAlloc(&dptr, 1024) + assert(err == 0) + + # Set h1 and h2 memory to be different + cdef char[1024] hptr1 + memset(hptr1, 1, 1024) + cdef char[1024] hptr2 + memset(hptr2, 2, 1024) + assert(memcmp(hptr1, hptr2, 1024) != 0) + + # h1 to D + err = ccuda.cuMemcpyHtoD(dptr, hptr1, 1024) + assert(err == 0) + + # D to h2 + err = ccuda.cuMemcpyDtoH(hptr2, dptr, 1024) + assert(err == 0) + + # Validate h1 == h2 + assert(memcmp(hptr1, hptr2, 1024) == 0) + + # Cleanup + err = ccuda.cuMemFree(dptr) + assert(err == 0) + err = ccuda.cuCtxDestroy(ctx) + assert(err == 0) diff --git a/cuda_bindings_12/tests/cython/test_ccudart.pyx b/cuda_bindings_12/tests/cython/test_ccudart.pyx new file mode 100644 index 00000000000..f42ce5d9456 --- /dev/null +++ b/cuda_bindings_12/tests/cython/test_ccudart.pyx @@ -0,0 +1,83 @@ +# 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 ( + memset, + memcmp + ) +# TODO: update to new module once the old ones are removed, we use the +# tests to cover backward compatibility. +cimport cuda.ccudart as ccudart + +def test_ccudart_memcpy(): + # Allocate dev memory + cdef void* dptr + err = ccudart.cudaMalloc(&dptr, 1024) + assert(err == ccudart.cudaSuccess) + + # Set h1 and h2 memory to be different + cdef char[1024] hptr1 + memset(hptr1, 1, 1024) + cdef char[1024] hptr2 + memset(hptr2, 2, 1024) + assert(memcmp(hptr1, hptr2, 1024) != 0) + + # h1 to D + err = ccudart.cudaMemcpy(dptr, hptr1, 1024, ccudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assert(err == ccudart.cudaSuccess) + + # D to h2 + err = ccudart.cudaMemcpy(hptr2, dptr, 1024, ccudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assert(err == ccudart.cudaSuccess) + + # Validate h1 == h2 + assert(memcmp(hptr1, hptr2, 1024) == 0) + + # Cleanup + err = ccudart.cudaFree(dptr) + assert(err == ccudart.cudaSuccess) + +from cuda.ccudart cimport dim3 +from cuda.ccudart cimport cudaMemAllocationHandleType +from cuda.ccudart cimport CUuuid, cudaUUID_t + +cdef extern from *: + """ + #include + dim3 copy_and_append_dim3(dim3 copy) { + return dim3(copy.x + 1, copy.y + 1, copy.z + 1); + } + void foo(cudaMemAllocationHandleType x) { + return; + } + int compareUUID(CUuuid cuType, cudaUUID_t cudaType) { + return memcmp(&cuType, &cudaType, sizeof(CUuuid)); + } + """ + void foo(cudaMemAllocationHandleType x) + dim3 copy_and_append_dim3(dim3 copy) + int compareUUID(CUuuid cuType, cudaUUID_t cudaType) + +def test_ccudart_interoperable(): + # struct + cdef dim3 oldDim, newDim + oldDim.x = 1 + oldDim.y = 2 + oldDim.z = 3 + newDim = copy_and_append_dim3(oldDim) + assert oldDim.x + 1 == newDim.x + assert oldDim.y + 1 == newDim.y + assert oldDim.z + 1 == newDim.z + + # Enum + foo(cudaMemAllocationHandleType.cudaMemHandleTypeNone) + + # typedef struct + cdef CUuuid type_one + cdef cudaUUID_t type_two + memset(type_one.bytes, 1, sizeof(type_one.bytes)) + memset(type_two.bytes, 1, sizeof(type_one.bytes)) + assert compareUUID(type_one, type_two) == 0 + memset(type_two.bytes, 2, sizeof(type_one.bytes)) + assert compareUUID(type_one, type_two) != 0 diff --git a/cuda_bindings_12/tests/cython/test_cython.py b/cuda_bindings_12/tests/cython/test_cython.py new file mode 100644 index 00000000000..a6f8133909e --- /dev/null +++ b/cuda_bindings_12/tests/cython/test_cython.py @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import functools +import importlib +import sys + + +def py_func(func): + """ + Wraps func in a plain Python function. + """ + + @functools.wraps(func) + def wrapped(*args, **kwargs): + return func(*args, **kwargs) + + return wrapped + + +cython_test_modules = ["test_ccuda", "test_ccudart", "test_interoperability_cython"] + + +for mod in cython_test_modules: + try: + # For each callable in `mod` with name `test_*`, + # wrap the callable in a plain Python function + # and set the result as an attribute of this module. + mod = importlib.import_module(mod) + for name in dir(mod): + item = getattr(mod, name) + if callable(item) and name.startswith("test_"): + item = py_func(item) + setattr(sys.modules[__name__], name, item) + except ImportError: + raise diff --git a/cuda_bindings_12/tests/cython/test_interoperability_cython.pyx b/cuda_bindings_12/tests/cython/test_interoperability_cython.pyx new file mode 100644 index 00000000000..f98660725f2 --- /dev/null +++ b/cuda_bindings_12/tests/cython/test_interoperability_cython.pyx @@ -0,0 +1,213 @@ +# 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 +import cuda.cuda as cuda +import cuda.cudart as cudart +import numpy as np +import pytest + +# TODO: update to new module once the old ones are removed, we use the +# tests to cover backward compatibility. +cimport cuda.ccuda as ccuda +cimport cuda.ccudart as ccudart + + +def supportsMemoryPool(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported, 0) + return err == cudart.cudaError_t.cudaSuccess and isSupported + + +def test_interop_stream(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + # DRV to RT + cdef ccuda.CUstream* stream_dr = calloc(1, sizeof(ccuda.CUstream)) + cerr_dr = ccuda.cuStreamCreate(stream_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaStreamDestroy(stream_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + free(stream_dr) + + # RT to DRV + cdef ccudart.cudaStream_t* stream_rt = calloc(1, sizeof(ccudart.cudaStream_t)) + cerr_rt = ccudart.cudaStreamCreate(stream_rt) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuStreamDestroy(stream_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + free(stream_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + +def test_interop_event(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + # DRV to RT + cdef ccuda.CUevent* event_dr = calloc(1, sizeof(ccuda.CUevent)) + cerr_dr = ccuda.cuEventCreate(event_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaEventDestroy(event_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + free(event_dr) + + # RT to DRV + cdef ccudart.cudaEvent_t* event_rt = calloc(1, sizeof(ccudart.cudaEvent_t)) + cerr_rt = ccudart.cudaEventCreate(event_rt) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuEventDestroy(event_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + free(event_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + +def test_interop_graph(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + # DRV to RT + cdef ccuda.CUgraph* graph_dr = calloc(1, sizeof(ccuda.CUgraph)) + cerr_dr = ccuda.cuGraphCreate(graph_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaGraphDestroy(graph_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + free(graph_dr) + + # RT to DRV + cdef ccudart.cudaGraph_t* graph_rt = calloc(1, sizeof(ccudart.cudaGraph_t)) + cerr_rt = ccudart.cudaGraphCreate(graph_rt, 0) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuGraphDestroy(graph_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + free(graph_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + +def test_interop_graphNode(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + # DRV to RT + cdef ccuda.CUgraph* graph_dr = calloc(1, sizeof(ccuda.CUgraph)) + cdef ccuda.CUgraphNode* graph_node_dr = calloc(1, sizeof(ccuda.CUgraphNode)) + cdef ccuda.CUgraphNode* dependencies_dr = NULL + + cerr_dr = ccuda.cuGraphCreate(graph_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_dr = ccuda.cuGraphAddEmptyNode(graph_node_dr, graph_dr[0], dependencies_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaGraphDestroyNode(graph_node_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + + # RT to DRV + cdef ccudart.cudaGraphNode_t* graph_node_rt = calloc(1, sizeof(ccudart.cudaGraphNode_t)) + cerr_rt = ccudart.cudaGraphAddEmptyNode(graph_node_rt, graph_dr[0], dependencies_dr, 0) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuGraphDestroyNode(graph_node_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaGraphDestroy(graph_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + + free(graph_dr) + free(graph_node_dr) + free(graph_node_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + +@pytest.mark.skipif(not supportsMemoryPool(), reason='Requires mempool operations') +def test_interop_memPool(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + # DRV to RT + cdef ccuda.CUmemoryPool* mempool_dr = calloc(1, sizeof(ccuda.CUmemoryPool)) + cerr_dr = ccuda.cuDeviceGetDefaultMemPool(mempool_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaDeviceSetMemPool(0, mempool_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + + # RT to DRV + cdef ccudart.cudaMemPool_t* mempool_rt = calloc(1, sizeof(ccudart.cudaMemPool_t)) + cerr_rt = ccudart.cudaDeviceGetDefaultMemPool(mempool_rt, 0) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuDeviceSetMemPool(cuda.CUdevice(0), mempool_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + + free(mempool_dr) + free(mempool_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + +def test_interop_graphExec(): + err_dr, = cuda.cuInit(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, device = cuda.cuDeviceGet(0) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) + + cdef ccuda.CUgraph* graph_dr = calloc(1, sizeof(ccuda.CUgraph)) + cdef ccuda.CUgraphNode* graph_node_dr = calloc(1, sizeof(ccuda.CUgraphNode)) + cdef ccuda.CUgraphExec* graph_exec_dr = calloc(1, sizeof(ccuda.CUgraphExec)) + cdef ccuda.CUgraphNode* dependencies_dr = NULL + + cerr_dr = ccuda.cuGraphCreate(graph_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_dr = ccuda.cuGraphAddEmptyNode(graph_node_dr, graph_dr[0], dependencies_dr, 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + + # DRV to RT + cerr_dr = ccuda.cuGraphInstantiate(graph_exec_dr, graph_dr[0], 0) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaGraphExecDestroy(graph_exec_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + + # RT to DRV + cdef ccudart.cudaGraphExec_t* graph_exec_rt = calloc(1, sizeof(ccudart.cudaGraphExec_t)) + + cerr_rt = ccudart.cudaGraphInstantiate(graph_exec_rt, graph_dr[0], 0) + assert(cerr_rt == ccudart.cudaSuccess) + cerr_dr = ccuda.cuGraphExecDestroy(graph_exec_rt[0]) + assert(cerr_dr == ccuda.CUDA_SUCCESS) + cerr_rt = ccudart.cudaGraphDestroy(graph_dr[0]) + assert(cerr_rt == ccudart.cudaSuccess) + + free(graph_dr) + free(graph_node_dr) + free(graph_exec_dr) + free(graph_exec_rt) + + err_dr, = cuda.cuCtxDestroy(ctx) + assert(err_dr == cuda.CUresult.CUDA_SUCCESS) diff --git a/cuda_bindings_12/tests/nvml/README.md b/cuda_bindings_12/tests/nvml/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_bindings_12/tests/nvml/__init__.py b/cuda_bindings_12/tests/nvml/__init__.py new file mode 100644 index 00000000000..c746f897d2d --- /dev/null +++ b/cuda_bindings_12/tests/nvml/__init__.py @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +import pytest + +from cuda.bindings._test_helpers.arch_check import hardware_supports_nvml + +if not hardware_supports_nvml(): + pytest.skip("NVML not supported on this platform", allow_module_level=True) diff --git a/cuda_bindings_12/tests/nvml/conftest.py b/cuda_bindings_12/tests/nvml/conftest.py new file mode 100644 index 00000000000..7d44bb7152c --- /dev/null +++ b/cuda_bindings_12/tests/nvml/conftest.py @@ -0,0 +1,132 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from collections import namedtuple + +import pytest + +from cuda.bindings import nvml +from cuda.bindings._test_helpers.arch_check import unsupported_before # noqa: F401 + + +class NVMLInitializer: + def __init__(self): + pass + + def __enter__(self): + nvml.init_v2() + + def __exit__(self, exception_type, exception, trace): + nvml.shutdown() + + +@pytest.fixture +def nvml_init(): + with NVMLInitializer(): + yield + + +@pytest.fixture(scope="session", autouse=True) +def device_info(): + dev_count = None + bus_id_to_board_details = {} + + with NVMLInitializer(): + dev_count = nvml.device_get_count_v2() + + # Store some details for each device now when we know NVML is in known state + for i in range(dev_count): + try: + dev = nvml.device_get_handle_by_index_v2(i) + except nvml.NoPermissionError: + continue + pci_info = nvml.device_get_pci_info_v3(dev) + + name = nvml.device_get_name(dev) + # Get architecture name ex: Ampere, Kepler + arch_id = nvml.device_get_architecture(dev) + + BoardCfg = namedtuple("BoardCfg", "name, ids_arr") + board = BoardCfg(name, ids_arr=[(pci_info.pci_device_id, pci_info.pci_sub_system_id)]) + + try: + serial = nvml.device_get_serial(dev) + except nvml.NvmlError: + serial = None + + bus_id = pci_info.bus_id + device_id = pci_info.device_ + uuid = nvml.device_get_uuid(dev) + + BoardDetails = namedtuple("BoardDetails", "name, board, arch_id, bus_id, device_id, serial") + bus_id_to_board_details[uuid] = BoardDetails(name, board, arch_id, bus_id, device_id, serial) + + return bus_id_to_board_details + + +def get_devices(device_info): + for uuid in list(device_info.keys()): + try: + yield nvml.device_get_handle_by_uuid(uuid) + except nvml.NoPermissionError: + continue # ignore devices that can't be accessed + + +@pytest.fixture +def all_devices(device_info): + with NVMLInitializer(): + yield sorted(list(set(get_devices(device_info)))) + + +@pytest.fixture +def driver(nvml_init, request): + driver_vsn = nvml.system_get_driver_version() + # Return "major" version only + return int(driver_vsn.split(".")[0]) + + +@pytest.fixture +def ngpus(nvml_init): + result = nvml.device_get_count_v2() + assert result > 0 + return result + + +@pytest.fixture +def handles(ngpus): + handles = [nvml.device_get_handle_by_index_v2(i) for i in range(ngpus)] + assert len(handles) == ngpus + return handles + + +@pytest.fixture +def nmigs(handles): + return nvml.device_get_max_mig_device_count(handles[0]) + + +@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 + return handles + + +@pytest.fixture +def serials(ngpus, handles): + serials = [nvml.device_get_serial(handles[i]) for i in range(ngpus)] + assert len(serials) == ngpus + return serials + + +@pytest.fixture +def uuids(ngpus, handles): + uuids = [nvml.device_get_uuid(handles[i]) for i in range(ngpus)] + assert len(uuids) == ngpus + return uuids + + +@pytest.fixture +def pci_info(ngpus, handles): + pci_info = [nvml.device_get_pci_info_v3(handles[i]) for i in range(ngpus)] + assert len(pci_info) == ngpus + return pci_info diff --git a/cuda_bindings_12/tests/nvml/test_compute_mode.py b/cuda_bindings_12/tests/nvml/test_compute_mode.py new file mode 100644 index 00000000000..83c7827f53a --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_compute_mode.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +import sys + +import pytest + +from cuda.bindings import nvml + +from .conftest import unsupported_before + +COMPUTE_MODES = [ + nvml.ComputeMode.COMPUTEMODE_DEFAULT, + nvml.ComputeMode.COMPUTEMODE_PROHIBITED, + nvml.ComputeMode.COMPUTEMODE_EXCLUSIVE_PROCESS, +] + + +@pytest.mark.skipif(sys.platform == "win32", reason="Test not supported on Windows") +def test_compute_mode_supported_nonroot(all_devices): + for device in all_devices: + with unsupported_before(device, None): + original_compute_mode = nvml.device_get_compute_mode(device) + + for cm in COMPUTE_MODES: + try: + nvml.device_set_compute_mode(device, cm) + except nvml.NoPermissionError: + pytest.skip("Insufficient permissions to set compute mode") + nvml.device_set_compute_mode(device, original_compute_mode) + assert original_compute_mode == nvml.device_get_compute_mode(device), "Compute mode shouldn't have changed" diff --git a/cuda_bindings_12/tests/nvml/test_cuda.py b/cuda_bindings_12/tests/nvml/test_cuda.py new file mode 100644 index 00000000000..d05e2634a12 --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_cuda.py @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import cuda.bindings.driver as cuda +from cuda.bindings import nvml + +from .conftest import NVMLInitializer + + +def get_nvml_device_names(): + result = [] + with NVMLInitializer(): + # uses NVML Library to get the device count, device id and device pci id + num_devices = nvml.device_get_count_v2() + for idx in range(num_devices): + handle = nvml.device_get_handle_by_index_v2(idx) + name = nvml.device_get_name(handle) + info = nvml.device_get_pci_info_v3(handle) + assert isinstance(info.bus, int) + assert isinstance(name, str) + result.append({"name": name, "id": info.bus}) + + return result + + +def get_cuda_device_names(sort_by_bus_id=True): + result = [] + + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device_count = cuda.cuDeviceGetCount() + assert err == cuda.CUresult.CUDA_SUCCESS + + for dev in range(device_count): + size = 256 + err, name = cuda.cuDeviceGetName(size, dev) + name = name.split(b"\x00")[0].decode() + assert err == cuda.CUresult.CUDA_SUCCESS + + err, pci_bus_id = cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, dev) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(pci_bus_id, int) + + result.append({"name": name, "id": pci_bus_id}) + + if sort_by_bus_id: + result = sorted(result, key=lambda k: k["id"]) + + return result + + +def test_cuda_device_order(): + cuda_devices = get_cuda_device_names() + nvml_devices = get_nvml_device_names() + + assert cuda_devices == nvml_devices, "CUDA and NVML device lists do not match" diff --git a/cuda_bindings_12/tests/nvml/test_gpu.py b/cuda_bindings_12/tests/nvml/test_gpu.py new file mode 100644 index 00000000000..55ea1bad9e2 --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_gpu.py @@ -0,0 +1,81 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import numpy as np +import pytest + +from cuda.bindings import nvml + +from . import util +from .conftest import unsupported_before + + +def test_gpu_get_module_id(nvml_init): + # Unique module IDs cannot exceed the number of GPUs on the system + device_count = nvml.device_get_count_v2() + + for i in range(device_count): + device = nvml.device_get_handle_by_index_v2(i) + uuid = nvml.device_get_uuid(device) + + if util.is_vgpu(device): + continue + + module_id = nvml.device_get_module_id(device) + assert isinstance(module_id, int) + + +def test_gpu_get_platform_info(all_devices): + for device in all_devices: + if util.is_vgpu(device): + pytest.skip(f"Not supported on vGPU device {device}") + + # Documentation says Blackwell or newer only, but this does seem to pass + # on some newer GPUs. + + with unsupported_before(device, None): + platform_info = nvml.device_get_platform_info(device) + + assert isinstance(platform_info, (nvml.PlatformInfo_v1, nvml.PlatformInfo_v2)) + + +# TODO: Test APIs related to GPU instances, which require specific hardware and root + +# def test_gpu_instance(all_devices): +# for device in all_devices: +# # Requires root +# gpu_instance = nvml.device_create_gpu_instance(device, nvml.GpuInstanceProfile.PROFILE_1_SLICE) + + +def test_conf_compute_attestation_report_t(all_devices): + report = nvml.ConfComputeGpuAttestationReport() + assert not hasattr(report, "attestation_report_size") + assert len(report.attestation_report) == 0 + assert not hasattr(report, "cec_attestation_report_size") + assert len(report.cec_attestation_report) == 0 + assert len(report.nonce) == 32 + assert report.nonce.dtype == np.uint8 + + +def test_gpu_conf_compute_attestation_report(all_devices): + for device in all_devices: + # Documentation says AMPERE or newer + with unsupported_before(device, None), pytest.raises(nvml.UnknownError): + # The nonce string is nonsensical, so if this "works", we expect an UnknownError + nvml.device_get_conf_compute_gpu_attestation_report(device, nonce=b"12345678") + + +def test_conf_compute_gpu_certificate_t(): + cert = nvml.ConfComputeGpuCertificate() + assert not hasattr(cert, "cert_chain_size") + assert len(cert.cert_chain) == 0 + assert not hasattr(cert, "attestation_cert_chain_size") + assert len(cert.attestation_cert_chain) == 0 + + +def test_conf_compute_gpu_certificate(all_devices): + for device in all_devices: + # Documentation says AMPERE or newer + with unsupported_before(device, None), pytest.raises(nvml.UnknownError): + # This is expected to fail if the device doesn't have a proper certificate + nvml.device_get_conf_compute_gpu_certificate(device) diff --git a/cuda_bindings_12/tests/nvml/test_init.py b/cuda_bindings_12/tests/nvml/test_init.py new file mode 100644 index 00000000000..94b489ab45f --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_init.py @@ -0,0 +1,72 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys +import warnings + +import pytest + +from cuda.bindings import nvml + + +def assert_nvml_is_initialized(): + assert nvml.device_get_count_v2() > 0 + + +def assert_nvml_is_uninitialized(): + with pytest.raises(nvml.UninitializedError): + nvml.device_get_count_v2() + + +def test_devices_are_the_same_architecture(all_devices): + # The tests in this directory that use `unsupported_before` will generally + # skip the entire test after the first device that isn't supported is found. + # This means that if subsequent devices are of a different architecture, + # 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 = set(nvml.DeviceArch(nvml.device_get_architecture(device)) for device in all_devices) + + if len(all_arches) > 1: + warnings.warn( # noqa: B028 + f"System has devices of multiple architectures ({', '.join(x.name 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") +def test_init_ref_count(): + """ + Verifies that we can call NVML shutdown and init(2) multiple times, and that ref counting works + """ + with pytest.raises(nvml.UninitializedError): + nvml.shutdown() + + assert_nvml_is_uninitialized() + + for i in range(3): + # Init 5 times + for j in range(5): + nvml.init_v2() + assert_nvml_is_initialized() + + # Shutdown 4 times, NVML should remain initailized + for j in range(4): + nvml.shutdown() + assert_nvml_is_initialized() + + # Shutdown the final time + nvml.shutdown() + assert_nvml_is_uninitialized() + + +def test_init_check_index(nvml_init): + """ + Verifies that the index from nvmlDeviceGetIndex is correct + """ + dev_count = nvml.device_get_count_v2() + for idx in range(dev_count): + handle = nvml.device_get_handle_by_index_v2(idx) + # Verify that the index matches + assert idx == nvml.device_get_index(handle) diff --git a/cuda_bindings_12/tests/nvml/test_nvlink.py b/cuda_bindings_12/tests/nvml/test_nvlink.py new file mode 100644 index 00000000000..2280d1fb7ad --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_nvlink.py @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +from cuda.bindings import nvml + + +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(1) + fields[0].field_id = nvml.FieldId.DEV_NVLINK_LINK_COUNT + value = nvml.device_get_field_values(device, fields)[0] + assert value.nvml_return == nvml.Return.SUCCESS or value.nvml_return == nvml.Return.ERROR_NOT_SUPPORTED, ( + f"Unexpected return {value.nvml_return} for link count field query" + ) + + # Use the alternative argument to device_get_field_values + value = nvml.device_get_field_values(device, [nvml.FieldId.DEV_NVLINK_LINK_COUNT])[0] + assert value.nvml_return == nvml.Return.SUCCESS or value.nvml_return == nvml.Return.ERROR_NOT_SUPPORTED, ( + f"Unexpected return {value.nvml_return} for link count field query" + ) + + # 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}" diff --git a/cuda_bindings_12/tests/nvml/test_page_retirement.py b/cuda_bindings_12/tests/nvml/test_page_retirement.py new file mode 100644 index 00000000000..34c6cf78625 --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_page_retirement.py @@ -0,0 +1,75 @@ +# 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 + +from . import util + +PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES = list(range(nvml.PageRetirementCause.COUNT)) + + +def supports_page_retirement(device): + try: + for source in range(nvml.PageRetirementCause.COUNT): + nvml.device_get_retired_pages(device, source) + return True + except nvml.NotSupportedError as e: + return False + except nvml.FunctionNotFoundError as e: + return False + + +def test_page_retirement_notsupported(all_devices): + """ + Verifies that on platforms that don't supports page retirement, APIs will return Not Supported + """ + skip_reasons = set() + + for device in all_devices: + if supports_page_retirement(device): + skip_reasons.add(f"page_retirement is supported for {device}") + continue + + if not util.supports_ecc(device): + skip_reasons.add(f"device doesn't support ECC for {device}") + continue + + with pytest.raises(nvml.NotSupportedError): + for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES: + nvml.device_get_retired_pages(device, source) + + with pytest.raises(nvml.NotSupportedError): + nvml.device_get_retired_pages_pending_status(device) + + if skip_reasons: + pytest.skip(" ; ".join(skip_reasons)) + + +def test_page_retirement_supported(all_devices): + """ + Verifies that on platforms that support page_retirement, APIs will return success + """ + skip_reasons = set() + + for device in all_devices: + if not supports_page_retirement(device): + skip_reasons.add(f"page_retirement not supported for {device}") + continue + + if not util.supports_ecc(device): + skip_reasons.add(f"device doesn't support ECC for {device}") + continue + + try: + for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES: + nvml.device_get_retired_pages(device, source) + except nvml.NotSupportedError: + skip_reasons.add(f"Exception case: Page retirement is not supported in this GPU {device}") + continue + + nvml.device_get_retired_pages_pending_status(device) + + if skip_reasons: + pytest.skip(" ; ".join(skip_reasons)) diff --git a/cuda_bindings_12/tests/nvml/test_pynvml.py b/cuda_bindings_12/tests/nvml/test_pynvml.py new file mode 100644 index 00000000000..a96b2c87575 --- /dev/null +++ b/cuda_bindings_12/tests/nvml/test_pynvml.py @@ -0,0 +1,294 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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 + +import os +import time + +import pytest + +from cuda.bindings import nvml + +from . import util +from .conftest import unsupported_before + +XFAIL_LEGACY_NVLINK_MSG = "Legacy NVLink test expected to fail." + + +def test_system_get_nvml_version(nvml_init): + vsn = nvml.system_get_nvml_version() + assert isinstance(vsn, str) + assert tuple(int(x) for x in vsn.split(".")[:2]) > (0, 0) + + +def test_system_get_cuda_driver_version(nvml_init): + vsn = nvml.system_get_cuda_driver_version() + assert vsn != 0.0 + + +def test_nvml_system_get_process_name(nvml_init): + try: + procname = nvml.system_get_process_name(os.getpid()) + except nvml.NotFoundError: + pytest.skip("Process not found") + return + assert procname is not None + + +def test_system_get_driver_version(nvml_init): + vsn = nvml.system_get_driver_version() + assert isinstance(vsn, str) + assert tuple(int(x) for x in vsn.split(".")[:2]) > (0, 0) + + +def test_device_get_attributes(mig_handles): + # nvmlDeviceGetAttributes requires MIG device handle + + if mig_handles: + for handle in mig_handles: + att = nvml.device_get_attributes(handle) + assert att is not None + else: + pytest.skip("No MIG devices found") + + +def test_device_get_handle_by_uuid(ngpus, uuids): + handles = [nvml.device_get_handle_by_uuid(uuids[i]) for i in range(ngpus)] + assert len(handles) == ngpus + + +def test_device_get_handle_by_pci_bus_id(ngpus, pci_info): + handles = [nvml.device_get_handle_by_pci_bus_id_v2(pci_info[i].bus_id) for i in range(ngpus)] + assert len(handles) == ngpus + + +@pytest.mark.parametrize("scope", [nvml.AffinityScope.NODE, nvml.AffinityScope.SOCKET]) +@pytest.mark.skipif(util.is_wsl() or util.is_windows(), reason="Not supported on WSL or Windows") +def test_device_get_memory_affinity(handles, scope): + size = 1024 + for handle in handles: + with unsupported_before(handle, nvml.DeviceArch.KEPLER): + node_set = nvml.device_get_memory_affinity(handle, size, scope) + assert node_set is not None + assert len(node_set) == size + + +@pytest.mark.parametrize("scope", [nvml.AffinityScope.NODE, nvml.AffinityScope.SOCKET]) +@pytest.mark.skipif(util.is_wsl() or util.is_windows(), reason="Not supported on WSL or Windows") +def test_device_get_cpu_affinity_within_scope(handles, scope): + size = 1024 + for handle in handles: + with unsupported_before(handle, nvml.DeviceArch.KEPLER): + cpu_set = nvml.device_get_cpu_affinity_within_scope(handle, size, scope) + assert cpu_set is not None + assert len(cpu_set) == size + + +@pytest.mark.parametrize( + "index", + [ + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_ATOMICS, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PROP, + nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_UNKNOWN, + ], +) +def test_device_get_p2p_status(handles, index): + for h1 in handles: + for h2 in handles: + if h1 is not h2: + status = nvml.device_get_p2p_status(h1, h2, index) + assert nvml.GpuP2PStatus.P2P_STATUS_OK <= status <= nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN + + +# [Skipping] pynvml.nvmlDeviceGetName +# [Skipping] pynvml.nvmlDeviceGetBoardId +# [Skipping] pynvml.nvmlDeviceGetMultiGpuBoard +# [Skipping] pynvml.nvmlDeviceGetBrand +# [Skipping] pynvml.nvmlDeviceGetCpuAffinity +# [Skipping] pynvml.nvmlDeviceSetCpuAffinity +# [Skipping] pynvml.nvmlDeviceClearCpuAffinity +# [Skipping] pynvml.nvmlDeviceGetMinorNumber +# [Skipping] pynvml.nvmlDeviceGetUUID +# [Skipping] pynvml.nvmlDeviceGetInforomVersion +# [Skipping] pynvml.nvmlDeviceGetInforomImageVersion +# [Skipping] pynvml.nvmlDeviceGetInforomConfigurationChecksum +# [Skipping] pynvml.nvmlDeviceValidateInforom +# [Skipping] pynvml.nvmlDeviceGetDisplayMode +# [Skipping] pynvml.nvmlDeviceGetPersistenceMode +# [Skipping] pynvml.nvmlDeviceGetClockInfo +# [Skipping] pynvml.nvmlDeviceGetMaxClockInfo +# [Skipping] pynvml.nvmlDeviceGetApplicationsCloc +# [Skipping] pynvml.nvmlDeviceGetDefaultApplicationsClock +# [Skipping] pynvml.nvmlDeviceGetSupportedMemoryClocks +# [Skipping] pynvml.nvmlDeviceGetSupportedGraphicsClocks +# [Skipping] pynvml.nvmlDeviceGetFanSpeed +# [Skipping] pynvml.nvmlDeviceGetTemperature +# [Skipping] pynvml.nvmlDeviceGetTemperatureThreshold +# [Skipping] pynvml.nvmlDeviceGetPowerState +# [Skipping] pynvml.nvmlDeviceGetPerformanceState +# [Skipping] pynvml.nvmlDeviceGetPowerManagementMode +# [Skipping] pynvml.nvmlDeviceGetPowerManagementLimit +# [Skipping] pynvml.nvmlDeviceGetPowerManagementLimitConstraints +# [Skipping] pynvml.nvmlDeviceGetPowerManagementDefaultLimit +# [Skipping] pynvml.nvmlDeviceGetEnforcedPowerLimit + + +def test_device_get_power_usage(ngpus, handles): + for i in range(ngpus): + # Note: documentation says this is supported on Fermi or newer, + # but in practice it fails on some later architectures. + with unsupported_before(handles[i], None): + power_mwatts = nvml.device_get_power_usage(handles[i]) + assert power_mwatts >= 0.0 + + +def test_device_get_total_energy_consumption(ngpus, handles): + for i in range(ngpus): + with unsupported_before(handles[i], nvml.DeviceArch.VOLTA): + energy_mjoules1 = nvml.device_get_total_energy_consumption(handles[i]) + + for j in range(10): # idle for 150 ms + time.sleep(0.015) # and check for increase every 15 ms + with unsupported_before(handles[i], nvml.DeviceArch.VOLTA): + energy_mjoules2 = nvml.device_get_total_energy_consumption(handles[i]) + assert energy_mjoules2 >= energy_mjoules1 + if energy_mjoules2 > energy_mjoules1: + break + else: + raise AssertionError("energy did not increase across 150 ms interval") + + +# [Skipping] pynvml.nvmlDeviceGetGpuOperationMode +# [Skipping] pynvml.nvmlDeviceGetCurrentGpuOperationMode +# [Skipping] pynvml.nvmlDeviceGetPendingGpuOperationMode + + +def test_device_get_memory_info(ngpus, handles): + for i in range(ngpus): + meminfo = nvml.device_get_memory_info_v2(handles[i]) + assert (meminfo.used <= meminfo.total) and (meminfo.free <= meminfo.total) + + +# [Skipping] pynvml.nvmlDeviceGetBAR1MemoryInfo +# [Skipping] pynvml.nvmlDeviceGetComputeMode +# [Skipping] pynvml.nvmlDeviceGetEccMode +# [Skipping] pynvml.nvmlDeviceGetCurrentEccMode (Python API Addition) +# [Skipping] pynvml.nvmlDeviceGetPendingEccMode (Python API Addition) +# [Skipping] pynvml.nvmlDeviceGetTotalEccErrors +# [Skipping] pynvml.nvmlDeviceGetDetailedEccErrors +# [Skipping] pynvml.nvmlDeviceGetMemoryErrorCounter + + +def test_device_get_utilization_rates(ngpus, handles): + for i in range(ngpus): + with unsupported_before(handles[i], "FERMI"): + urate = nvml.device_get_utilization_rates(handles[i]) + assert urate.gpu >= 0 + assert urate.memory >= 0 + + +# [Skipping] pynvml.nvmlDeviceGetEncoderUtilization +# [Skipping] pynvml.nvmlDeviceGetDecoderUtilization +# [Skipping] pynvml.nvmlDeviceGetPcieReplayCounter +# [Skipping] pynvml.nvmlDeviceGetDriverModel +# [Skipping] pynvml.nvmlDeviceGetCurrentDriverModel +# [Skipping] pynvml.nvmlDeviceGetPendingDriverModel +# [Skipping] pynvml.nvmlDeviceGetVbiosVersion +# [Skipping] pynvml.nvmlDeviceGetComputeRunningProcesses +# [Skipping] pynvml.nvmlDeviceGetGraphicsRunningProcesses +# [Skipping] pynvml.nvmlDeviceGetAutoBoostedClocksEnabled +# [Skipping] nvmlUnitSetLedState +# [Skipping] pynvml.nvmlDeviceSetPersistenceMode +# [Skipping] pynvml.nvmlDeviceSetComputeMode +# [Skipping] pynvml.nvmlDeviceSetEccMode +# [Skipping] pynvml.nvmlDeviceClearEccErrorCounts +# [Skipping] pynvml.nvmlDeviceSetDriverModel +# [Skipping] pynvml.nvmlDeviceSetAutoBoostedClocksEnabled +# [Skipping] pynvml.nvmlDeviceSetDefaultAutoBoostedClocksEnabled +# [Skipping] pynvml.nvmlDeviceSetApplicationsClocks +# [Skipping] pynvml.nvmlDeviceResetApplicationsClocks +# [Skipping] pynvml.nvmlDeviceSetPowerManagementLimit +# [Skipping] pynvml.nvmlDeviceSetGpuOperationMode +# [Skipping] nvmlEventSetCreate +# [Skipping] pynvml.nvmlDeviceRegisterEvents +# [Skipping] pynvml.nvmlDeviceGetSupportedEventTypes +# [Skipping] nvmlEventSetWait +# [Skipping] nvmlEventSetFree +# [Skipping] pynvml.nvmlDeviceOnSameBoard +# [Skipping] pynvml.nvmlDeviceGetCurrPcieLinkGeneration +# [Skipping] pynvml.nvmlDeviceGetMaxPcieLinkGeneration +# [Skipping] pynvml.nvmlDeviceGetCurrPcieLinkWidth +# [Skipping] pynvml.nvmlDeviceGetMaxPcieLinkWidth +# [Skipping] pynvml.nvmlDeviceGetSupportedClocksThrottleReasons +# [Skipping] pynvml.nvmlDeviceGetCurrentClocksThrottleReasons +# [Skipping] pynvml.nvmlDeviceGetIndex +# [Skipping] pynvml.nvmlDeviceGetAccountingMode +# [Skipping] pynvml.nvmlDeviceSetAccountingMode +# [Skipping] pynvml.nvmlDeviceClearAccountingPids +# [Skipping] pynvml.nvmlDeviceGetAccountingStats +# [Skipping] pynvml.nvmlDeviceGetAccountingPids +# [Skipping] pynvml.nvmlDeviceGetAccountingBufferSize +# [Skipping] pynvml.nvmlDeviceGetRetiredPages +# [Skipping] pynvml.nvmlDeviceGetRetiredPagesPendingStatus +# [Skipping] pynvml.nvmlDeviceGetAPIRestriction +# [Skipping] pynvml.nvmlDeviceSetAPIRestriction +# [Skipping] pynvml.nvmlDeviceGetBridgeChipInfo +# [Skipping] pynvml.nvmlDeviceGetSamples +# [Skipping] pynvml.nvmlDeviceGetViolationStatus + + +def test_device_get_pcie_throughput(ngpus, handles): + for i in range(ngpus): + with unsupported_before(handles[i], nvml.DeviceArch.MAXWELL): + tx_bytes_tp = nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_TX_BYTES) + assert tx_bytes_tp >= 0 + rx_bytes_tp = nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_RX_BYTES) + assert rx_bytes_tp >= 0 + + # with pytest.raises(nvml.InvalidArgumentError): + # nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_COUNT) + + +# [Skipping] pynvml.nvmlSystemGetTopologyGpuSet +# [Skipping] pynvml.nvmlDeviceGetTopologyNearestGpus +# [Skipping] pynvml.nvmlDeviceGetTopologyCommonAncestor + +# Test pynvml.nvmlDeviceGetNvLinkVersion +# Test pynvml.nvmlDeviceGetNvLinkState +# Test pynvml.nvmlDeviceGetNvLinkRemotePciInfo + + +@pytest.mark.parametrize( + "cap_type", + [ + nvml.NvLinkCapability.NVLINK_CAP_P2P_SUPPORTED, # P2P over NVLink is supported + nvml.NvLinkCapability.NVLINK_CAP_SYSMEM_ACCESS, # Access to system memory is supported + nvml.NvLinkCapability.NVLINK_CAP_P2P_ATOMICS, # P2P atomics are supported + nvml.NvLinkCapability.NVLINK_CAP_SYSMEM_ATOMICS, # System memory atomics are supported + nvml.NvLinkCapability.NVLINK_CAP_SLI_BRIDGE, # SLI is supported over this link + nvml.NvLinkCapability.NVLINK_CAP_VALID, + ], +) # Link is supported on this device +def test_device_get_nvlink_capability(ngpus, handles, cap_type): + for i in range(ngpus): + for j in range(nvml.NVLINK_MAX_LINKS): + # By the documentation, this should be supported on PASCAL or newer, + # but this also seems to fail on newer. + with unsupported_before(handles[i], None): + cap = nvml.device_get_nvlink_capability(handles[i], j, cap_type) + assert cap >= 0 + + +# Test pynvml.nvmlDeviceResetNvLinkUtilizationCounter +# Test pynvml.nvmlDeviceSetNvLinkUtilizationControl +# Test pynvml.nvmlDeviceGetNvLinkUtilizationCounter +# Test pynvml.nvmlDeviceGetNvLinkUtilizationControl +# Test pynvml.nvmlDeviceFreezeNvLinkUtilizationCounter + +# Test pynvml.nvmlDeviceResetNvLinkErrorCounters +# Test pynvml.nvmlDeviceGetNvLinkErrorCounter diff --git a/cuda_bindings_12/tests/nvml/util.py b/cuda_bindings_12/tests/nvml/util.py new file mode 100644 index 00000000000..038fe58d8be --- /dev/null +++ b/cuda_bindings_12/tests/nvml/util.py @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +import functools +import platform +from pathlib import Path + +from cuda.bindings import nvml + +current_os = platform.system() +if current_os == "VMkernel": + current_os = "Linux" # Treat VMkernel as Linux + + +def is_windows(os=current_os): + return os == "Windows" + + +def is_linux(os=current_os): + return os == "Linux" + + +@functools.cache +def is_wsl(os=current_os): + return os == "Linux" and "microsoft" in Path("/proc/version").read_text().lower() + + +def is_vgpu(device): + """ + Returns True if device in vGPU virtualization mode + """ + return nvml.device_get_virtualization_mode(device) == nvml.GpuVirtualizationMode.VGPU + + +def supports_ecc(device): + try: + (cur_ecc, pend_ecc) = nvml.device_get_ecc_mode(device) + return cur_ecc != nvml.EnableState.FEATURE_DISABLED + except nvml.NotSupportedError as e: + return False + + +def supports_nvlink(device): + fields = nvml.FieldValue(1) + fields[0].field_id = nvml.FI.DEV_NVLINK_GET_STATE + return nvml.device_get_field_values(device, fields)[0].nvml_return == nvml.Return.SUCCESS diff --git a/cuda_bindings_12/tests/pytest.ini b/cuda_bindings_12/tests/pytest.ini new file mode 100644 index 00000000000..2881d93e98f --- /dev/null +++ b/cuda_bindings_12/tests/pytest.ini @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +[pytest] +norecursedirs = cython diff --git a/cuda_bindings_12/tests/test_cuda.py b/cuda_bindings_12/tests/test_cuda.py new file mode 100644 index 00000000000..1eb46a030da --- /dev/null +++ b/cuda_bindings_12/tests/test_cuda.py @@ -0,0 +1,1301 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import platform +import shutil +import textwrap + +import numpy as np +import pytest + +import cuda.cuda as cuda +import cuda.cudart as cudart +from cuda.bindings import driver + + +def driverVersionLessThan(target): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, version = cuda.cuDriverGetVersion() + assert err == cuda.CUresult.CUDA_SUCCESS + return version < target + + +def supportsMemoryPool(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported, 0) + return err == cudart.cudaError_t.cudaSuccess and isSupported + + +def supportsManagedMemory(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrManagedMemory, 0) + return err == cudart.cudaError_t.cudaSuccess and isSupported + + +def supportsCudaAPI(name): + return name in dir(cuda) + + +def callableBinary(name): + return shutil.which(name) is not None + + +def test_cuda_memcpy(): + # Init CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Get device + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Construct context + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Allocate dev memory + size = int(1024 * np.uint8().itemsize) + err, dptr = cuda.cuMemAlloc(size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Set h1 and h2 memory to be different + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # h1 to D + (err,) = cuda.cuMemcpyHtoD(dptr, h1, size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # D to h2 + (err,) = cuda.cuMemcpyDtoH(h2, dptr, size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Validate h1 == h2 + assert np.array_equal(h1, h2) + + # Cleanup + (err,) = cuda.cuMemFree(dptr) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_array(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # No context created + desc = cuda.CUDA_ARRAY_DESCRIPTOR() + err, arr = cuda.cuArrayCreate(desc) + assert err == cuda.CUresult.CUDA_ERROR_INVALID_CONTEXT or err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Desciption not filled + err, arr = cuda.cuArrayCreate(desc) + assert err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + + # Pass + desc.Format = cuda.CUarray_format.CU_AD_FORMAT_SIGNED_INT8 + desc.NumChannels = 1 + desc.Width = 1 + err, arr = cuda.cuArrayCreate(desc) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuArrayDestroy(arr) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_repr_primitive(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + assert str(device) == "" + assert int(device) == 0 + + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + assert str(ctx).startswith(" 0 + assert hex(ctx) == hex(int(ctx)) + + # CUdeviceptr + err, dptr = cuda.cuMemAlloc(1024 * np.uint8().itemsize) + assert err == cuda.CUresult.CUDA_SUCCESS + assert str(dptr).startswith(" 0 + (err,) = cuda.cuMemFree(dptr) + size = 7 + dptr = cuda.CUdeviceptr(size) + assert str(dptr) == f"" + assert int(dptr) == size + size = 4294967295 + dptr = cuda.CUdeviceptr(size) + assert str(dptr) == f"" + assert int(dptr) == size + size = 18446744073709551615 + dptr = cuda.CUdeviceptr(size) + assert str(dptr) == f"" + assert int(dptr) == size + + # cuuint32_t + size = 7 + int32 = cuda.cuuint32_t(size) + assert str(int32) == f"" + assert int(int32) == size + size = 4294967295 + int32 = cuda.cuuint32_t(size) + assert str(int32) == f"" + assert int(int32) == size + size = 18446744073709551615 + try: + int32 = cuda.cuuint32_t(size) + raise RuntimeError("int32 = cuda.cuuint32_t(18446744073709551615) did not fail") + except OverflowError as err: + pass + + # cuuint64_t + size = 7 + int64 = cuda.cuuint64_t(size) + assert str(int64) == f"" + assert int(int64) == size + size = 4294967295 + int64 = cuda.cuuint64_t(size) + assert str(int64) == f"" + assert int(int64) == size + size = 18446744073709551615 + int64 = cuda.cuuint64_t(size) + assert str(int64) == f"" + assert int(int64) == size + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_repr_pointer(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Test 1: Classes representing pointers + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + assert str(ctx).startswith(" 0 + assert hex(ctx) == hex(int(ctx)) + randomCtxPointer = 12345 + randomCtx = cuda.CUcontext(randomCtxPointer) + assert str(randomCtx) == f"" + assert int(randomCtx) == randomCtxPointer + assert hex(randomCtx) == hex(randomCtxPointer) + + # Test 2: Function pointers + func = 12345 + b2d_cb = cuda.CUoccupancyB2DSize(func) + assert str(b2d_cb) == f"" + assert int(b2d_cb) == func + assert hex(b2d_cb) == hex(func) + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_uuid_list_access(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, uuid = cuda.cuDeviceGetUuid(device) + assert err == cuda.CUresult.CUDA_SUCCESS + assert len(uuid.bytes) <= 16 + + jit_option = cuda.CUjit_option + options = { + jit_option.CU_JIT_INFO_LOG_BUFFER: 1, + jit_option.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES: 2, + jit_option.CU_JIT_ERROR_LOG_BUFFER: 3, + jit_option.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES: 4, + jit_option.CU_JIT_LOG_VERBOSE: 5, + } + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_cuModuleLoadDataEx(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, dev = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, dev) + assert err == cuda.CUresult.CUDA_SUCCESS + + option_keys = [ + cuda.CUjit_option.CU_JIT_INFO_LOG_BUFFER, + cuda.CUjit_option.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, + cuda.CUjit_option.CU_JIT_ERROR_LOG_BUFFER, + cuda.CUjit_option.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES, + cuda.CUjit_option.CU_JIT_LOG_VERBOSE, + ] + # FIXME: This function call raises CUDA_ERROR_INVALID_VALUE + err, mod = cuda.cuModuleLoadDataEx(0, 0, option_keys, []) + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuda_repr(): + actual = cuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS() + assert isinstance(actual, cuda.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS) + + actual_repr = actual.__repr__() + expected_repr = textwrap.dedent(""" + params : + fence : + value : 0 + nvSciSync : + fence : 0x0 + keyedMutex : + key : 0 +flags : 0 +""") + assert actual_repr.split() == expected_repr.split() + + actual_repr = cuda.CUDA_KERNEL_NODE_PARAMS_st().__repr__() + expected_repr = textwrap.dedent(""" + func : +gridDimX : 0 +gridDimY : 0 +gridDimZ : 0 +blockDimX : 0 +blockDimY : 0 +blockDimZ : 0 +sharedMemBytes : 0 +kernelParams : 0 +extra : 0 +""") + assert actual_repr.split() == expected_repr.split() + + +def test_cuda_struct_list_of_enums(): + desc = cuda.CUDA_TEXTURE_DESC_st() + desc.addressMode = [ + cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_WRAP, + cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_CLAMP, + cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_MIRROR, + ] + + # # Too many args + # desc.addressMode = [cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_WRAP, + # cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_CLAMP, + # cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_MIRROR, + # cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_BORDER] + + # # Too little args + # desc.addressMode = [cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_WRAP, + # cuda.CUaddress_mode.CU_TR_ADDRESS_MODE_CLAMP] + + +def test_cuda_CUstreamBatchMemOpParams(): + params = cuda.CUstreamBatchMemOpParams() + params.operation = cuda.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_32 + params.waitValue.operation = cuda.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_32 + params.writeValue.operation = cuda.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_32 + params.flushRemoteWrites.operation = cuda.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_WAIT_VALUE_32 + params.waitValue.value64 = 666 + assert int(params.waitValue.value64) == 666 + + +@pytest.mark.skipif( + driverVersionLessThan(11030) or not supportsMemoryPool(), reason="When new attributes were introduced" +) +def test_cuda_memPool_attr(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + poolProps = cuda.CUmemPoolProps() + poolProps.allocType = cuda.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + poolProps.location.id = 0 + poolProps.location.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + + attr_list = [None] * 8 + err, pool = cuda.cuMemPoolCreate(poolProps) + assert err == cuda.CUresult.CUDA_SUCCESS + + for idx, attr in enumerate( + [ + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_HIGH, + ] + ): + err, attr_tmp = cuda.cuMemPoolGetAttribute(pool, attr) + assert err == cuda.CUresult.CUDA_SUCCESS + attr_list[idx] = attr_tmp + + for idxA, attr in enumerate( + [ + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES, + ] + ): + (err,) = cuda.cuMemPoolSetAttribute(pool, attr, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + for idx, attr in enumerate([cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD]): + (err,) = cuda.cuMemPoolSetAttribute(pool, attr, cuda.cuuint64_t(9)) + assert err == cuda.CUresult.CUDA_SUCCESS + + for idx, attr in enumerate( + [ + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES, + cuda.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + ] + ): + err, attr_tmp = cuda.cuMemPoolGetAttribute(pool, attr) + assert err == cuda.CUresult.CUDA_SUCCESS + attr_list[idx] = attr_tmp + assert attr_list[0] == 0 + assert attr_list[1] == 0 + assert attr_list[2] == 0 + assert int(attr_list[3]) == 9 + + (err,) = cuda.cuMemPoolDestroy(pool) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(11030) or not supportsManagedMemory(), reason="When new attributes were introduced" +) +def test_cuda_pointer_attr(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ptr = cuda.cuMemAllocManaged(0x1000, cuda.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL.value) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Individual version + attr_type_list = [ + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_CONTEXT, + 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_P2P_TOKENS, # TODO: Can I somehow test this? + 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, + ] + attr_value_list = [None] * len(attr_type_list) + for idx, attr in enumerate(attr_type_list): + err, attr_tmp = cuda.cuPointerGetAttribute(attr, ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + attr_value_list[idx] = attr_tmp + + # List version + err, attr_value_list_v2 = cuda.cuPointerGetAttributes(len(attr_type_list), attr_type_list, ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + for attr1, attr2 in zip(attr_value_list, attr_value_list_v2): + assert str(attr1) == str(attr2) + + # Test setting values + for val in (True, False): + (err,) = cuda.cuPointerSetAttribute(val, cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + err, attr_tmp = cuda.cuPointerGetAttribute(cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + assert attr_tmp == val + + (err,) = cuda.cuMemFree(ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(11030) or not supportsManagedMemory(), reason="When new attributes were introduced" +) +def test_pointer_get_attributes_device_ordinal(): + attributes = [ + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, + ] + + attrs = cuda.cuPointerGetAttributes(len(attributes), attributes, 0) + + # device ordinals are always small numbers. A large number would indicate + # an overflow error. + + assert abs(attrs[1][0]) < 256 + + +@pytest.mark.skipif(not supportsManagedMemory(), reason="When new attributes were introduced") +def test_cuda_mem_range_attr(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + size = 0x1000 + err, ptr = cuda.cuMemAllocManaged(size, cuda.CUmemAttach_flags.CU_MEM_ATTACH_GLOBAL.value) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY, device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_PREFERRED_LOCATION, cuda.CU_DEVICE_CPU) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, cuda.CU_DEVICE_CPU) + assert err == cuda.CUresult.CUDA_SUCCESS + err, concurrentSupported = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, device + ) + assert err == cuda.CUresult.CUDA_SUCCESS + if concurrentSupported: + (err,) = cuda.cuMemAdvise(ptr, size, cuda.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY, device) + assert err == cuda.CUresult.CUDA_SUCCESS + expected_values_list = ([1, -1, [0, -1, -2], -2],) + else: + expected_values_list = ([1, -1, [-1, -2, -2], -2], [0, -2, [-2, -2, -2], -2]) + + # Individual version + attr_type_list = [ + cuda.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, + cuda.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + cuda.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY, + cuda.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION, + ] + attr_type_size_list = [4, 4, 12, 4] + attr_value_list = [None] * len(attr_type_list) + for idx in range(len(attr_type_list)): + err, attr_tmp = cuda.cuMemRangeGetAttribute(attr_type_size_list[idx], attr_type_list[idx], ptr, size) + assert err == cuda.CUresult.CUDA_SUCCESS + attr_value_list[idx] = attr_tmp + + matched = False + for expected_values in expected_values_list: + if expected_values == attr_value_list: + matched = True + break + if not matched: + raise RuntimeError(f"attr_value_list {attr_value_list} did not match any {expected_values_list}") + + # List version + err, attr_value_list_v2 = cuda.cuMemRangeGetAttributes( + attr_type_size_list, attr_type_list, len(attr_type_list), ptr, size + ) + assert err == cuda.CUresult.CUDA_SUCCESS + for attr1, attr2 in zip(attr_value_list, attr_value_list_v2): + assert str(attr1) == str(attr2) + + (err,) = cuda.cuMemFree(ptr) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif(driverVersionLessThan(11040) or not supportsMemoryPool(), reason="Mempool for graphs not supported") +def test_cuda_graphMem_attr(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + allocSize = 1 + + params = cuda.CUDA_MEM_ALLOC_NODE_PARAMS() + params.poolProps.location.type = cuda.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + params.poolProps.location.id = device + params.poolProps.allocType = cuda.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + params.bytesize = allocSize + + err, allocNode = cuda.cuGraphAddMemAllocNode(graph, None, 0, params) + assert err == cuda.CUresult.CUDA_SUCCESS + err, freeNode = cuda.cuGraphAddMemFreeNode(graph, [allocNode], 1, params.dptr) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graphExec = cuda.cuGraphInstantiate(graph, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuGraphLaunch(graphExec, stream) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, used = cuda.cuDeviceGetGraphMemAttribute(device, cuda.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT) + assert err == cuda.CUresult.CUDA_SUCCESS + err, usedHigh = cuda.cuDeviceGetGraphMemAttribute(device, cuda.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH) + assert err == cuda.CUresult.CUDA_SUCCESS + err, reserved = cuda.cuDeviceGetGraphMemAttribute( + device, cuda.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT + ) + assert err == cuda.CUresult.CUDA_SUCCESS + err, reservedHigh = cuda.cuDeviceGetGraphMemAttribute( + device, cuda.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH + ) + assert err == cuda.CUresult.CUDA_SUCCESS + + assert int(used) >= allocSize + assert int(usedHigh) == int(used) + assert int(reserved) == int(usedHigh) + assert int(reservedHigh) == int(reserved) + + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuStreamDestroy(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(12010) + or not supportsCudaAPI("cuCoredumpSetAttributeGlobal") + or not supportsCudaAPI("cuCoredumpGetAttributeGlobal"), + reason="Coredump API not present", +) +def test_cuda_coredump_attr(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + attr_list = [None] * 6 + + (err,) = cuda.cuCoredumpSetAttributeGlobal(cuda.CUcoredumpSettings.CU_COREDUMP_TRIGGER_HOST, False) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCoredumpSetAttributeGlobal(cuda.CUcoredumpSettings.CU_COREDUMP_FILE, b"corefile") + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCoredumpSetAttributeGlobal(cuda.CUcoredumpSettings.CU_COREDUMP_PIPE, b"corepipe") + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCoredumpSetAttributeGlobal(cuda.CUcoredumpSettings.CU_COREDUMP_LIGHTWEIGHT, True) + assert err == cuda.CUresult.CUDA_SUCCESS + + for idx, attr in enumerate( + [ + cuda.CUcoredumpSettings.CU_COREDUMP_TRIGGER_HOST, + cuda.CUcoredumpSettings.CU_COREDUMP_FILE, + cuda.CUcoredumpSettings.CU_COREDUMP_PIPE, + cuda.CUcoredumpSettings.CU_COREDUMP_LIGHTWEIGHT, + ] + ): + err, attr_tmp = cuda.cuCoredumpGetAttributeGlobal(attr) + assert err == cuda.CUresult.CUDA_SUCCESS + attr_list[idx] = attr_tmp + + assert attr_list[0] is False + assert attr_list[1] == b"corefile" + assert attr_list[2] == b"corepipe" + assert attr_list[3] is True + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_get_error_name_and_string(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + _, s = cuda.cuGetErrorString(err) + assert s == b"no error" + _, s = cuda.cuGetErrorName(err) + assert s == b"CUDA_SUCCESS" + + err, device = cuda.cuDeviceGet(-1) + _, s = cuda.cuGetErrorString(err) + assert s == b"invalid device ordinal" + _, s = cuda.cuGetErrorName(err) + assert s == b"CUDA_ERROR_INVALID_DEVICE" + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif(not callableBinary("nvidia-smi"), reason="Binary existance needed") +def test_device_get_name(): + # TODO: Refactor this test once we have nvml bindings to avoid the use of subprocess + import subprocess # nosec B404 + + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + 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) + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +# TODO: cuStreamGetCaptureInfo_v2 +@pytest.mark.skipif(driverVersionLessThan(11030), reason="Driver too old for cuStreamGetCaptureInfo_v2") +def test_stream_capture(): + pass + + +def test_profiler(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuProfilerStart() + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuProfilerStop() + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_eglFrame(): + val = cuda.CUeglFrame() + # [, , ] + assert int(val.frame.pArray[0]) == 0 + assert int(val.frame.pArray[1]) == 0 + assert int(val.frame.pArray[2]) == 0 + val.frame.pArray = [1, 2, 3] + # [, , ] + assert int(val.frame.pArray[0]) == 1 + assert int(val.frame.pArray[1]) == 2 + assert int(val.frame.pArray[2]) == 3 + val.frame.pArray = [cuda.CUarray(4), 2, 3] + # [, , ] + assert int(val.frame.pArray[0]) == 4 + assert int(val.frame.pArray[1]) == 2 + assert int(val.frame.pArray[2]) == 3 + val.frame.pPitch = [4, 2, 3] + # [4, 2, 3] + assert int(val.frame.pPitch[0]) == 4 + assert int(val.frame.pPitch[1]) == 2 + assert int(val.frame.pPitch[2]) == 3 + val.frame.pPitch = [1, 2, 3] + assert int(val.frame.pPitch[0]) == 1 + assert int(val.frame.pPitch[1]) == 2 + assert int(val.frame.pPitch[2]) == 3 + + +def test_anon_assign(): + val1 = cuda.CUexecAffinityParam_st() + val2 = cuda.CUexecAffinityParam_st() + + assert val1.param.smCount.val == 0 + val1.param.smCount.val = 5 + assert val1.param.smCount.val == 5 + val2.param.smCount.val = 11 + assert val2.param.smCount.val == 11 + + val1.param = val2.param + assert val1.param.smCount.val == 11 + + +def test_union_assign(): + val = cuda.CUlaunchAttributeValue() + val.clusterDim.x, val.clusterDim.y, val.clusterDim.z = 9, 9, 9 + attr = cuda.CUlaunchAttribute() + attr.value = val + + assert val.clusterDim.x == 9 + assert val.clusterDim.y == 9 + assert val.clusterDim.z == 9 + + +def test_invalid_repr_attribute(): + val = cuda.CUlaunchAttributeValue() + string = str(val) + + +@pytest.mark.skipif( + driverVersionLessThan(12020) + or not supportsCudaAPI("cuGraphAddNode") + or not supportsCudaAPI("cuGraphNodeSetParams") + or not supportsCudaAPI("cuGraphExecNodeSetParams"), + reason="Polymorphic graph APIs required", +) +def test_graph_poly(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # cuGraphAddNode + + # Create 2 buffers + size = int(1024 * np.uint8().itemsize) + buffers = [] + for _ in range(2): + err, dptr = cuda.cuMemAlloc(size) + assert err == cuda.CUresult.CUDA_SUCCESS + buffers += [(np.full(size, 2).astype(np.uint8), dptr)] + + # Update dev buffers + for host, device in buffers: + (err,) = cuda.cuMemcpyHtoD(device, host, size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Create graph + nodes = [] + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Memset + host, device = buffers[0] + memsetParams = cuda.CUgraphNodeParams() + memsetParams.type = cuda.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEMSET + memsetParams.memset.elementSize = np.uint8().itemsize + memsetParams.memset.width = size + memsetParams.memset.height = 1 + memsetParams.memset.dst = device + memsetParams.memset.value = 1 + err, node = cuda.cuGraphAddNode(graph, None, 0, memsetParams) + assert err == cuda.CUresult.CUDA_SUCCESS + nodes += [node] + + # Memcpy + host, device = buffers[1] + memcpyParams = cuda.CUgraphNodeParams() + memcpyParams.type = cuda.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEMCPY + memcpyParams.memcpy.copyParams.srcMemoryType = cuda.CUmemorytype.CU_MEMORYTYPE_DEVICE + memcpyParams.memcpy.copyParams.srcDevice = device + memcpyParams.memcpy.copyParams.dstMemoryType = cuda.CUmemorytype.CU_MEMORYTYPE_HOST + memcpyParams.memcpy.copyParams.dstHost = host + memcpyParams.memcpy.copyParams.WidthInBytes = size + memcpyParams.memcpy.copyParams.Height = 1 + memcpyParams.memcpy.copyParams.Depth = 1 + err, node = cuda.cuGraphAddNode(graph, None, 0, memcpyParams) + assert err == cuda.CUresult.CUDA_SUCCESS + nodes += [node] + + # Instantiate, execute, validate + err, graphExec = cuda.cuGraphInstantiate(graph, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphLaunch(graphExec, stream) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuStreamSynchronize(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Validate + for host, device in buffers: + (err,) = cuda.cuMemcpyDtoH(host, device, size) + assert err == cuda.CUresult.CUDA_SUCCESS + assert np.array_equal(buffers[0][0], np.full(size, 1).astype(np.uint8)) + assert np.array_equal(buffers[1][0], np.full(size, 2).astype(np.uint8)) + + # cuGraphNodeSetParams + host, device = buffers[1] + err, memcpyParamsCopy = cuda.cuGraphMemcpyNodeGetParams(nodes[1]) + assert err == cuda.CUresult.CUDA_SUCCESS + assert int(memcpyParamsCopy.srcDevice) == int(device) + host, device = buffers[0] + memcpyParams.memcpy.copyParams.srcDevice = device + (err,) = cuda.cuGraphNodeSetParams(nodes[1], memcpyParams) + assert err == cuda.CUresult.CUDA_SUCCESS + err, memcpyParamsCopy = cuda.cuGraphMemcpyNodeGetParams(nodes[1]) + assert err == cuda.CUresult.CUDA_SUCCESS + assert int(memcpyParamsCopy.srcDevice) == int(device) + + # cuGraphExecNodeSetParams + memsetParams.memset.value = 11 + (err,) = cuda.cuGraphExecNodeSetParams(graphExec, nodes[0], memsetParams) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphLaunch(graphExec, stream) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuStreamSynchronize(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuMemcpyDtoH(buffers[0][0], buffers[0][1], size) + assert err == cuda.CUresult.CUDA_SUCCESS + assert np.array_equal(buffers[0][0], np.full(size, 11).astype(np.uint8)) + + # Cleanup + (err,) = cuda.cuMemFree(buffers[0][1]) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuMemFree(buffers[1][1]) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphExecDestroy(graphExec) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuStreamDestroy(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(12040) or not supportsCudaAPI("cuDeviceGetDevResource"), + reason="Polymorphic graph APIs required", +) +def test_cuDeviceGetDevResource(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, resource_in = cuda.cuDeviceGetDevResource(device, cuda.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM) + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, res, count, rem = cuda.cuDevSmResourceSplitByCount(0, resource_in, 0, 2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert count != 0 + assert len(res) == 0 + err, res, count_same, rem = cuda.cuDevSmResourceSplitByCount(count, resource_in, 0, 2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert count == count_same + assert len(res) == count + err, res, count, rem = cuda.cuDevSmResourceSplitByCount(3, resource_in, 0, 2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert len(res) == 3 + + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(12030) or not supportsCudaAPI("cuGraphConditionalHandleCreate"), + reason="Conditional graph APIs required", +) +def test_conditional(): + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, handle = cuda.cuGraphConditionalHandleCreate(graph, ctx, 0, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + params = cuda.CUgraphNodeParams() + params.type = cuda.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + params.conditional.handle = handle + params.conditional.type = cuda.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF + params.conditional.size = 1 + params.conditional.ctx = ctx + + assert len(params.conditional.phGraph_out) == 1 + assert int(params.conditional.phGraph_out[0]) == 0 + err, node = cuda.cuGraphAddNode(graph, None, 0, params) + assert err == cuda.CUresult.CUDA_SUCCESS + + assert len(params.conditional.phGraph_out) == 1 + assert int(params.conditional.phGraph_out[0]) != 0 + + +def test_CUmemDecompressParams_st(): + desc = cuda.CUmemDecompressParams_st() + assert int(desc.dstActBytes) == 0 + + +def test_all_CUresult_codes(): + max_code = int(max(cuda.CUresult)) + # Smoke test. CUDA_ERROR_UNKNOWN = 999, but intentionally using literal value. + assert max_code >= 999 + num_good = 0 + for code in range(max_code + 2): # One past max_code + try: + error = cuda.CUresult(code) + except ValueError: + pass # cython-generated enum does not exist for this code + else: + err_name, name = cuda.cuGetErrorName(error) + if err_name == cuda.CUresult.CUDA_SUCCESS: + assert name + err_desc, desc = cuda.cuGetErrorString(error) + assert err_desc == cuda.CUresult.CUDA_SUCCESS + assert desc + num_good += 1 + else: + # cython-generated enum exists but is not known to an older driver + # (example: cuda-bindings built with CTK 12.8, driver from CTK 12.0) + assert name is None + assert err_name == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + err_desc, desc = cuda.cuGetErrorString(error) + assert err_desc == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + assert desc is None + # Smoke test: Do we have at least some "good" codes? + # The number will increase over time as new enums are added and support for + # old CTKs is dropped, but it is not critical that this number is updated. + assert num_good >= 76 # CTK 11.0.3_450.51.06 + + +@pytest.mark.skipif(driverVersionLessThan(12030), reason="Driver too old for cuKernelGetName") +def test_cuKernelGetName_failure(): + err, name = cuda.cuKernelGetName(0) + assert err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + assert name is None + + +@pytest.mark.skipif(driverVersionLessThan(12030), reason="Driver too old for cuFuncGetName") +def test_cuFuncGetName_failure(): + err, name = cuda.cuFuncGetName(0) + assert err == cuda.CUresult.CUDA_ERROR_INVALID_VALUE + assert name is None + + +@pytest.mark.skipif( + driverVersionLessThan(12080) or not supportsCudaAPI("cuCheckpointProcessGetState"), + reason="When API was introduced", +) +def test_cuCheckpointProcessGetState_failure(): + err, state = cuda.cuCheckpointProcessGetState(123434) + assert err != cuda.CUresult.CUDA_SUCCESS + assert state is None + + +def test_private_function_pointer_inspector(): + from cuda.bindings._internal.driver import _inspect_function_pointer + + assert _inspect_function_pointer("__cuGetErrorString") != 0 + + +@pytest.mark.parametrize( + "target", + ( + driver.CUcontext, + driver.CUstream, + driver.CUevent, + driver.CUmodule, + driver.CUlibrary, + driver.CUfunction, + driver.CUkernel, + driver.CUgraph, + driver.CUgraphNode, + driver.CUgraphExec, + driver.CUmemoryPool, + ), +) +def test_struct_pointer_comparison(target): + a = target(123) + b = target(123) + assert a == b + assert hash(a) == hash(b) + c = target(456) + assert a != c + assert hash(a) != hash(c) + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphGetId"), + reason="Requires CUDA 13.1+", +) +def test_cuGraphGetId(device, ctx): + """Test cuGraphGetId - get graph ID.""" + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graph_id = cuda.cuGraphGetId(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(graph_id, int) + assert graph_id > 0 + + # Create another graph and verify it has a different ID + err, graph2 = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, graph_id2 = cuda.cuGraphGetId(graph2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert graph_id2 != graph_id + + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphDestroy(graph2) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphExecGetId"), + reason="Requires CUDA 13.1+", +) +def test_cuGraphExecGetId(device, ctx): + """Test cuGraphExecGetId - get graph exec ID.""" + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Add an empty node to make the graph valid + err, node = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graphExec = cuda.cuGraphInstantiate(graph, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, graph_exec_id = cuda.cuGraphExecGetId(graphExec) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(graph_exec_id, int) + assert graph_exec_id > 0 + + # Create another graph exec and verify it has a different ID + err, graph2 = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, node2 = cuda.cuGraphAddEmptyNode(graph2, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, graphExec2 = cuda.cuGraphInstantiate(graph2, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, graph_exec_id2 = cuda.cuGraphExecGetId(graphExec2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert graph_exec_id2 != graph_exec_id + + (err,) = cuda.cuGraphExecDestroy(graphExec) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphExecDestroy(graphExec2) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphDestroy(graph2) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuStreamDestroy(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphNodeGetLocalId"), + reason="Requires CUDA 13.1+", +) +def test_cuGraphNodeGetLocalId(device, ctx): + """Test cuGraphNodeGetLocalId - get node local ID.""" + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Add multiple nodes + err, node1 = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, node2 = cuda.cuGraphAddEmptyNode(graph, [node1], 1) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, node3 = cuda.cuGraphAddEmptyNode(graph, [node1, node2], 2) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Get local IDs for each node + err, node_id1 = cuda.cuGraphNodeGetLocalId(node1) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(node_id1, int) + assert node_id1 >= 0 + + err, node_id2 = cuda.cuGraphNodeGetLocalId(node2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(node_id2, int) + assert node_id2 >= 0 + assert node_id2 != node_id1 + + err, node_id3 = cuda.cuGraphNodeGetLocalId(node3) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(node_id3, int) + assert node_id3 >= 0 + assert node_id3 != node_id1 + assert node_id3 != node_id2 + + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphNodeGetToolsId"), + reason="Requires CUDA 13.1+", +) +def test_cuGraphNodeGetToolsId(device, ctx): + """Test cuGraphNodeGetToolsId - get node tools ID.""" + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, node = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, tools_node_id = cuda.cuGraphNodeGetToolsId(node) + assert err == cuda.CUresult.CUDA_SUCCESS + assert isinstance(tools_node_id, int) + # toolsNodeId is unsigned long long, so it can be any non-negative value + assert tools_node_id >= 0 + + # Add another node and verify it has a different tools ID + err, node2 = cuda.cuGraphAddEmptyNode(graph, [node], 1) + assert err == cuda.CUresult.CUDA_SUCCESS + err, tools_node_id2 = cuda.cuGraphNodeGetToolsId(node2) + assert err == cuda.CUresult.CUDA_SUCCESS + assert tools_node_id2 != tools_node_id + + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphNodeGetContainingGraph"), + reason="Requires CUDA 13.1+", +) +def test_cuGraphNodeGetContainingGraph(device, ctx): + """Test cuGraphNodeGetContainingGraph - get graph containing a node.""" + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, node = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Get the containing graph + err, containing_graph = cuda.cuGraphNodeGetContainingGraph(node) + assert err == cuda.CUresult.CUDA_SUCCESS + # Verify it's the same graph + assert int(containing_graph) == int(graph) + + # Test with a child graph node (if supported) + # Create a child graph node + err, child_graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, child_node = cuda.cuGraphAddEmptyNode(child_graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Add child graph node to parent graph + childGraphNodeParams = cuda.CUgraphNodeParams() + childGraphNodeParams.type = cuda.CUgraphNodeType.CU_GRAPH_NODE_TYPE_GRAPH + childGraphNodeParams.graph.graph = child_graph + err, child_graph_node = cuda.cuGraphAddNode(graph, None, None, 0, childGraphNodeParams) + if err == cuda.CUresult.CUDA_SUCCESS: + # Get containing graph for the child graph node + err, containing_graph_for_child = cuda.cuGraphNodeGetContainingGraph(child_graph_node) + assert err == cuda.CUresult.CUDA_SUCCESS + assert int(containing_graph_for_child) == int(graph) + + # Get containing graph for node inside child graph + err, containing_graph_for_nested = cuda.cuGraphNodeGetContainingGraph(child_node) + assert err == cuda.CUresult.CUDA_SUCCESS + assert int(containing_graph_for_nested) == int(child_graph) + + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuGraphDestroy(child_graph) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuStreamGetDevResource"), + reason="Requires CUDA 13.1+", +) +def test_cuStreamGetDevResource(device, ctx): + """Test cuStreamGetDevResource - get device resource from stream.""" + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Get SM resource from stream + err, resource = cuda.cuStreamGetDevResource(stream, cuda.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM) + assert err == cuda.CUresult.CUDA_SUCCESS + # Verify resource is valid (non-None) + assert resource is not None + + (err,) = cuda.cuStreamDestroy(stream) + assert err == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif( + driverVersionLessThan(13010) or not supportsCudaAPI("cuDevSmResourceSplit"), + reason="Requires CUDA 13.1+", +) +def test_cuDevSmResourceSplit(device, ctx): + """Test cuDevSmResourceSplit - split SM resource into structured groups.""" + err, resource_in = cuda.cuDeviceGetDevResource(device, cuda.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Create group params for splitting into 1 group (simpler test) + nb_groups = 1 + group_params = cuda.CU_DEV_SM_RESOURCE_GROUP_PARAMS() + # Set up group: request 4 SMs with coscheduled count of 2 + group_params.smCount = 4 + group_params.coscheduledSmCount = 2 + + # Split the resource + err, res, rem = cuda.cuDevSmResourceSplit(nb_groups, resource_in, 0, group_params) + assert err == cuda.CUresult.CUDA_SUCCESS + # Verify we got results + assert len(res) == nb_groups + # Verify remainder is valid (may be None if no remainder) + assert rem is not None or len(res) > 0 + + +def test_buffer_reference(): + # Create a host buffer + size = int(1024 * np.uint8().itemsize) + host = np.full(size, 2).astype(np.uint8) + + # Set the buffer to a struct member + memcpyParams = cuda.CUgraphNodeParams() + memcpyParams.memcpy.copyParams.dstHost = host + + # Delete the local reference to the host buffer. The reference in the + # struct should keep it alive. + del host + + # Create a new numpy array from the pointer and make sure the memory is + # intact and hasn't been freed. If the reference counting in + # copyParams.dstHost is incorrect, we will either see over-written memory or + # a segmentation fault here. + 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) diff --git a/cuda_bindings_12/tests/test_cudart.py b/cuda_bindings_12/tests/test_cudart.py new file mode 100644 index 00000000000..0ef975a9ee7 --- /dev/null +++ b/cuda_bindings_12/tests/test_cudart.py @@ -0,0 +1,1394 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import math + +import numpy as np +import pytest + +import cuda.cuda as cuda +import cuda.cudart as cudart +from cuda.bindings import runtime + + +def isSuccess(err): + return err == cudart.cudaError_t.cudaSuccess + + +def assertSuccess(err): + assert isSuccess(err) + + +def driverVersionLessThan(target): + err, version = cudart.cudaDriverGetVersion() + assertSuccess(err) + return version < target + + +def supportsMemoryPool(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported, 0) + return isSuccess(err) and isSupported + + +def supportsSparseTexturesDeviceFilter(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported, 0) + return isSuccess(err) and isSupported + + +def supportsCudaAPI(name): + return name in dir(cuda) or dir(cudart) + + +def test_cudart_memcpy(): + # Allocate dev memory + size = 1024 * np.uint8().itemsize + err, dptr = cudart.cudaMalloc(size) + assertSuccess(err) + + # Set h1 and h2 memory to be different + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # h1 to D + (err,) = cudart.cudaMemcpy(dptr, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # D to h2 + (err,) = cudart.cudaMemcpy(h2, dptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # Validate h1 == h2 + assert np.array_equal(h1, h2) + + # Cleanup + (err,) = cudart.cudaFree(dptr) + assertSuccess(err) + + +def test_cudart_hostRegister(): + # Use hostRegister API to check for correct enum return values + page_size = 80 + addr_host = np.full(page_size * 3, 1).astype(np.uint8) + addr = addr_host.ctypes.data + + size_0 = (16 * page_size) / 8 + addr_0 = addr + int((0 * page_size) / 8) + size_1 = (16 * page_size) / 8 + addr_1 = addr + int((8 * page_size) / 8) + + (err,) = cudart.cudaHostRegister(addr_0, size_0, 3) + assertSuccess(err) + (err,) = cudart.cudaHostRegister(addr_1, size_1, 3) + assert err == cudart.cudaError_t.cudaErrorHostMemoryAlreadyRegistered + + (err,) = cudart.cudaHostUnregister(addr_1) + assert err == cudart.cudaError_t.cudaErrorInvalidValue + (err,) = cudart.cudaHostUnregister(addr_0) + assertSuccess(err) + + +def test_cudart_class_reference(): + offset = 1 + width = 4 + height = 5 + depth = 6 + flags = 0 + numMipLevels = 1 + + extent = cudart.cudaExtent() + formatDesc = cudart.cudaChannelFormatDesc() + externalMemoryMipmappedArrayDesc = cudart.cudaExternalMemoryMipmappedArrayDesc() + + # Get/set class attributes + extent.width = width + extent.height = height + extent.depth = depth + + formatDesc.x = 8 + formatDesc.y = 0 + formatDesc.z = 0 + formatDesc.w = 0 + formatDesc.f = cudart.cudaChannelFormatKind.cudaChannelFormatKindSigned + + externalMemoryMipmappedArrayDesc.offset = offset + externalMemoryMipmappedArrayDesc.formatDesc = formatDesc + externalMemoryMipmappedArrayDesc.extent = extent + externalMemoryMipmappedArrayDesc.flags = flags + externalMemoryMipmappedArrayDesc.numLevels = numMipLevels + + # Can manipulate child structure values directly + externalMemoryMipmappedArrayDesc.extent.width = width + 1 + externalMemoryMipmappedArrayDesc.extent.height = height + 1 + externalMemoryMipmappedArrayDesc.extent.depth = depth + 1 + assert externalMemoryMipmappedArrayDesc.extent.width == width + 1 + assert externalMemoryMipmappedArrayDesc.extent.height == height + 1 + assert externalMemoryMipmappedArrayDesc.extent.depth == depth + 1 + + externalMemoryMipmappedArrayDesc.formatDesc.x = 20 + externalMemoryMipmappedArrayDesc.formatDesc.y = 21 + externalMemoryMipmappedArrayDesc.formatDesc.z = 22 + externalMemoryMipmappedArrayDesc.formatDesc.w = 23 + externalMemoryMipmappedArrayDesc.formatDesc.f = cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat + assert externalMemoryMipmappedArrayDesc.formatDesc.x == 20 + assert externalMemoryMipmappedArrayDesc.formatDesc.y == 21 + assert externalMemoryMipmappedArrayDesc.formatDesc.z == 22 + assert externalMemoryMipmappedArrayDesc.formatDesc.w == 23 + assert externalMemoryMipmappedArrayDesc.formatDesc.f == cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat + + # Can copy classes over + externalMemoryMipmappedArrayDesc.extent = extent + assert externalMemoryMipmappedArrayDesc.extent.width == width + assert externalMemoryMipmappedArrayDesc.extent.height == height + assert externalMemoryMipmappedArrayDesc.extent.depth == depth + + externalMemoryMipmappedArrayDesc.formatDesc = formatDesc + assert externalMemoryMipmappedArrayDesc.formatDesc.x == 8 + assert externalMemoryMipmappedArrayDesc.formatDesc.y == 0 + assert externalMemoryMipmappedArrayDesc.formatDesc.z == 0 + assert externalMemoryMipmappedArrayDesc.formatDesc.w == 0 + assert externalMemoryMipmappedArrayDesc.formatDesc.f == cudart.cudaChannelFormatKind.cudaChannelFormatKindSigned + + +@pytest.mark.skipif(not supportsSparseTexturesDeviceFilter(), reason="Sparse Texture Device Filter") +def test_cudart_class_inline(): + extent = cudart.cudaExtent() + extent.width = 1000 + extent.height = 500 + extent.depth = 0 + + desc = cudart.cudaChannelFormatDesc() + desc.x = 32 + desc.y = 32 + desc.z = 32 + desc.w = 32 + desc.f = cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat + + numChannels = 4 + numBytesPerChannel = desc.x / 8 + numBytesPerTexel = numChannels * numBytesPerChannel + + flags = cudart.cudaArraySparse + maxDim = max(extent.width, extent.height) + numLevels = int(1.0 + math.log(maxDim, 2)) + + err, mipmap = cudart.cudaMallocMipmappedArray(desc, extent, numLevels, flags) + assertSuccess(err) + + err, sparseProp = cudart.cudaMipmappedArrayGetSparseProperties(mipmap) + assertSuccess(err) + + # tileExtent + # TODO: Will these values always be this same? Maybe need a more stable test? + # TODO: Are these values even correct? Need to research the function some more.. Maybe need an easier API test + assert sparseProp.tileExtent.width == 64 + assert sparseProp.tileExtent.height == 64 + assert sparseProp.tileExtent.depth == 1 + + sparsePropNew = cudart.cudaArraySparseProperties() + sparsePropNew.tileExtent.width = 15 + sparsePropNew.tileExtent.height = 16 + sparsePropNew.tileExtent.depth = 17 + + # Check that we can copy inner structs + sparseProp.tileExtent = sparsePropNew.tileExtent + assert sparseProp.tileExtent.width == 15 + assert sparseProp.tileExtent.height == 16 + assert sparseProp.tileExtent.depth == 17 + + assert sparseProp.miptailFirstLevel == 3 + assert sparseProp.miptailSize == 196608 + assert sparseProp.flags == 0 + + (err,) = cudart.cudaFreeMipmappedArray(mipmap) + assertSuccess(err) + + # TODO + example = cudart.cudaExternalSemaphoreSignalNodeParams() + example.extSemArray = [ + cudart.cudaExternalSemaphore_t(0), + cudart.cudaExternalSemaphore_t(123), + cudart.cudaExternalSemaphore_t(999), + ] + a1 = cudart.cudaExternalSemaphoreSignalParams() + a1.params.fence.value = 7 + a1.params.nvSciSync.fence = 999 + a1.params.keyedMutex.key = 9 + a1.flags = 1 + a2 = cudart.cudaExternalSemaphoreSignalParams() + a2.params.fence.value = 7 + a2.params.nvSciSync.fence = 999 + a2.params.keyedMutex.key = 9 + a2.flags = 2 + a3 = cudart.cudaExternalSemaphoreSignalParams() + a3.params.fence.value = 7 + a3.params.nvSciSync.fence = 999 + a3.params.keyedMutex.key = 9 + a3.flags = 3 + example.paramsArray = [a1] + # Note: Setting is a pass by value. Changing the object does not reflect internal value + a3.params.fence.value = 4 + a3.params.nvSciSync.fence = 4 + a3.params.keyedMutex.key = 4 + a3.flags = 4 + example.numExtSems = 3 + + +def test_cudart_graphs(): + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + + err, pGraphNode0 = cudart.cudaGraphAddEmptyNode(graph, None, 0) + assertSuccess(err) + err, pGraphNode1 = cudart.cudaGraphAddEmptyNode(graph, [pGraphNode0], 1) + assertSuccess(err) + err, pGraphNode2 = cudart.cudaGraphAddEmptyNode(graph, [pGraphNode0, pGraphNode1], 2) + assertSuccess(err) + + err, nodes, numNodes = cudart.cudaGraphGetNodes(graph) + err, nodes, numNodes = cudart.cudaGraphGetNodes(graph, numNodes) + + stream_legacy = cudart.cudaStream_t(cudart.cudaStreamLegacy) + stream_per_thread = cudart.cudaStream_t(cudart.cudaStreamPerThread) + err, stream_with_flags = cudart.cudaStreamCreateWithFlags(cudart.cudaStreamNonBlocking) + assertSuccess(err) + + +def test_cudart_list_access(): + err, prop = cudart.cudaGetDeviceProperties(0) + prop.name = prop.name + b" " * (256 - len(prop.name)) + + +def test_cudart_class_setters(): + dim = cudart.dim3() + + dim.x = 1 + dim.y = 2 + dim.z = 3 + + assert dim.x == 1 + assert dim.y == 2 + assert dim.z == 3 + + +def test_cudart_both_type(): + err, mode = cudart.cudaThreadExchangeStreamCaptureMode(cudart.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal) + assertSuccess(err) + err, mode = cudart.cudaThreadExchangeStreamCaptureMode(cudart.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed) + assertSuccess(err) + assert mode == cudart.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal + err, mode = cudart.cudaThreadExchangeStreamCaptureMode( + cudart.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal + ) + assertSuccess(err) + assert mode == cudart.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed + err, mode = cudart.cudaThreadExchangeStreamCaptureMode(cudart.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal) + assertSuccess(err) + assert mode == cudart.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal + + +def test_cudart_cudaGetDeviceProperties(): + err, prop = cudart.cudaGetDeviceProperties(0) + assertSuccess(err) + attrs = [ + "accessPolicyMaxWindowSize", + "asyncEngineCount", + "canMapHostMemory", + "canUseHostPointerForRegisteredMem", + "clockRate", + "computeMode", + "computePreemptionSupported", + "concurrentKernels", + "concurrentManagedAccess", + "cooperativeLaunch", + "cooperativeMultiDeviceLaunch", + "deviceOverlap", + "directManagedMemAccessFromHost", + "getPtr", + "globalL1CacheSupported", + "hostNativeAtomicSupported", + "integrated", + "isMultiGpuBoard", + "kernelExecTimeoutEnabled", + "l2CacheSize", + "localL1CacheSupported", + "luid", + "luidDeviceNodeMask", + "major", + "managedMemory", + "maxBlocksPerMultiProcessor", + "maxGridSize", + "maxSurface1D", + "maxSurface1DLayered", + "maxSurface2D", + "maxSurface2DLayered", + "maxSurface3D", + "maxSurfaceCubemap", + "maxSurfaceCubemapLayered", + "maxTexture1D", + "maxTexture1DLayered", + "maxTexture1DLinear", + "maxTexture1DMipmap", + "maxTexture2D", + "maxTexture2DGather", + "maxTexture2DLayered", + "maxTexture2DLinear", + "maxTexture2DMipmap", + "maxTexture3D", + "maxTexture3DAlt", + "maxTextureCubemap", + "maxTextureCubemapLayered", + "maxThreadsDim", + "maxThreadsPerBlock", + "maxThreadsPerMultiProcessor", + "memPitch", + "memoryBusWidth", + "memoryClockRate", + "minor", + "multiGpuBoardGroupID", + "multiProcessorCount", + "name", + "pageableMemoryAccess", + "pageableMemoryAccessUsesHostPageTables", + "pciBusID", + "pciDeviceID", + "pciDomainID", + "persistingL2CacheMaxSize", + "regsPerBlock", + "regsPerMultiprocessor", + "reservedSharedMemPerBlock", + "sharedMemPerBlock", + "sharedMemPerBlockOptin", + "sharedMemPerMultiprocessor", + "singleToDoublePrecisionPerfRatio", + "streamPrioritiesSupported", + "surfaceAlignment", + "tccDriver", + "textureAlignment", + "texturePitchAlignment", + "totalConstMem", + "totalGlobalMem", + "unifiedAddressing", + "uuid", + "warpSize", + ] + for attr in attrs: + assert hasattr(prop, attr) + assert len(prop.name.decode("utf-8")) != 0 + assert len(prop.uuid.bytes.hex()) != 0 + + example = cudart.cudaExternalSemaphoreSignalNodeParams() + example.extSemArray = [ + cudart.cudaExternalSemaphore_t(0), + cudart.cudaExternalSemaphore_t(123), + cudart.cudaExternalSemaphore_t(999), + ] + a1 = cudart.cudaExternalSemaphoreSignalParams() + a1.params.fence.value = 7 + a1.params.nvSciSync.fence = 999 + a1.params.keyedMutex.key = 9 + a1.flags = 1 + a2 = cudart.cudaExternalSemaphoreSignalParams() + a2.params.fence.value = 7 + a2.params.nvSciSync.fence = 999 + a2.params.keyedMutex.key = 9 + a2.flags = 2 + a3 = cudart.cudaExternalSemaphoreSignalParams() + a3.params.fence.value = 7 + a3.params.nvSciSync.fence = 999 + a3.params.keyedMutex.key = 9 + a3.flags = 3 + example.paramsArray = [a1] + # Note: Setting is a pass by value. Changing the object does not reflect internal value + a3.params.fence.value = 4 + a3.params.nvSciSync.fence = 4 + a3.params.keyedMutex.key = 4 + a3.flags = 4 + example.numExtSems = 3 + + +@pytest.mark.skipif( + driverVersionLessThan(11030) or not supportsMemoryPool(), reason="When new attributes were introduced" +) +def test_cudart_MemPool_attr(): + poolProps = cudart.cudaMemPoolProps() + poolProps.allocType = cudart.cudaMemAllocationType.cudaMemAllocationTypePinned + poolProps.location.id = 0 + poolProps.location.type = cudart.cudaMemLocationType.cudaMemLocationTypeDevice + + attr_list = [None] * 8 + err, pool = cudart.cudaMemPoolCreate(poolProps) + assertSuccess(err) + + for idx, attr in enumerate( + [ + cudart.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies, + cudart.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold, + cudart.cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent, + cudart.cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh, + cudart.cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent, + cudart.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh, + ] + ): + err, attr_tmp = cudart.cudaMemPoolGetAttribute(pool, attr) + assertSuccess(err) + attr_list[idx] = attr_tmp + + for idxA, attr in enumerate( + [ + cudart.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies, + ] + ): + (err,) = cudart.cudaMemPoolSetAttribute(pool, attr, 0) + assertSuccess(err) + for idx, attr in enumerate([cudart.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold]): + (err,) = cudart.cudaMemPoolSetAttribute(pool, attr, cuda.cuuint64_t(9)) + assertSuccess(err) + + for idx, attr in enumerate( + [ + cudart.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic, + cudart.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies, + cudart.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold, + ] + ): + err, attr_tmp = cudart.cudaMemPoolGetAttribute(pool, attr) + assertSuccess(err) + attr_list[idx] = attr_tmp + assert attr_list[0] == 0 + assert attr_list[1] == 0 + assert attr_list[2] == 0 + assert int(attr_list[3]) == 9 + + (err,) = cudart.cudaMemPoolDestroy(pool) + assertSuccess(err) + + +def test_cudart_make_api(): + err, channelDesc = cudart.cudaCreateChannelDesc( + 32, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat + ) + assertSuccess(err) + assert channelDesc.x == 32 + assert channelDesc.y == 0 + assert channelDesc.z == 0 + assert channelDesc.w == 0 + assert channelDesc.f == cudart.cudaChannelFormatKind.cudaChannelFormatKindFloat + + # make_cudaPitchedPtr + cudaPitchedPtr = cudart.make_cudaPitchedPtr(1, 2, 3, 4) + assert cudaPitchedPtr.ptr == 1 + assert cudaPitchedPtr.pitch == 2 + assert cudaPitchedPtr.xsize == 3 + assert cudaPitchedPtr.ysize == 4 + + # make_cudaPos + cudaPos = cudart.make_cudaPos(1, 2, 3) + assert cudaPos.x == 1 + assert cudaPos.y == 2 + assert cudaPos.z == 3 + + # make_cudaExtent + cudaExtent = cudart.make_cudaExtent(1, 2, 3) + assert cudaExtent.width == 1 + assert cudaExtent.height == 2 + assert cudaExtent.depth == 3 + + +def test_cudart_cudaStreamGetCaptureInfo(): + # create stream + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + + # validate that stream is not capturing + err, status, *info = cudart.cudaStreamGetCaptureInfo(stream) + assertSuccess(err) + assert status == cudart.cudaStreamCaptureStatus.cudaStreamCaptureStatusNone + + # start capture + (err,) = cudart.cudaStreamBeginCapture(stream, cudart.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal) + assertSuccess(err) + + # validate that stream is capturing now + err, status, *info = cudart.cudaStreamGetCaptureInfo(stream) + assertSuccess(err) + assert status == cudart.cudaStreamCaptureStatus.cudaStreamCaptureStatusActive + + # clean up + err, pgraph = cudart.cudaStreamEndCapture(stream) + assertSuccess(err) + + +def test_cudart_cudaArrayGetInfo(): + # create channel descriptor + x, y, z, w = 8, 0, 0, 0 + f = cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + err, desc = cudart.cudaCreateChannelDesc(x, y, z, w, f) + assertSuccess(err) + + # allocate device array + width = 10 + height = 0 + inFlags = 0 + err, arr = cudart.cudaMallocArray(desc, width, height, inFlags) + assertSuccess(err) + + # get device array info + err, desc, extent, outFlags = cudart.cudaArrayGetInfo(arr) + assertSuccess(err) + + # validate descriptor, extent, flags + assert desc.x == x + assert desc.y == y + assert desc.z == z + assert desc.w == w + assert desc.f == f + assert extent.width == width + assert extent.height == height + assert inFlags == outFlags + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + + +def test_cudart_cudaMemcpy2DToArray(): + # create host arrays + size = int(1024 * np.uint8().itemsize) + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to arr + (err,) = cudart.cudaMemcpy2DToArray(arr, 0, 0, h1, size, size, 1, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # arr to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, arr, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + + +def test_cudart_cudaMemcpy2DToArray_DtoD(): + # allocate device memory + size = 1024 * np.uint8().itemsize + err, d1 = cudart.cudaMalloc(size) + assertSuccess(err) + err, d2 = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to d1 + (err,) = cudart.cudaMemcpy(d1, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # d1 to arr + (err,) = cudart.cudaMemcpy2DToArray(arr, 0, 0, d1, size, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice) + assertSuccess(err) + + # arr to d2 + (err,) = cudart.cudaMemcpy2DFromArray(d2, size, arr, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice) + assertSuccess(err) + + # d2 to h2 + (err,) = cudart.cudaMemcpy(h2, d2, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + (err,) = cudart.cudaFree(d2) + assertSuccess(err) + (err,) = cudart.cudaFree(d1) + assertSuccess(err) + + +def test_cudart_cudaMemcpy2DArrayToArray(): + # create host arrays + size = 1024 * np.uint8().itemsize + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device arrays + err, a1 = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + err, a2 = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to a1 + (err,) = cudart.cudaMemcpy2DToArray(a1, 0, 0, h1, size, size, 1, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # a1 to a2 + (err,) = cudart.cudaMemcpy2DArrayToArray( + a2, 0, 0, a1, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice + ) + assertSuccess(err) + + # a2 to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, a2, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(a2) + assertSuccess(err) + (err,) = cudart.cudaFreeArray(a1) + assertSuccess(err) + + +def test_cudart_cudaMemcpyArrayToArray(): + # create host arrays + size = 1024 * np.uint8().itemsize + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device arrays + err, a1 = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + err, a2 = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to a1 + (err,) = cudart.cudaMemcpy2DToArray(a1, 0, 0, h1, size, size, 1, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # a1 to a2 + (err,) = cudart.cudaMemcpyArrayToArray(a2, 0, 0, a1, 0, 0, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice) + assertSuccess(err) + + # a2 to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, a2, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(a2) + assertSuccess(err) + (err,) = cudart.cudaFreeArray(a1) + assertSuccess(err) + + +def test_cudart_cudaGetChannelDesc(): + # create channel descriptor + x, y, z, w = 8, 0, 0, 0 + f = cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + err, desc = cudart.cudaCreateChannelDesc(x, y, z, w, f) + assertSuccess(err) + + # allocate device array + width = 10 + height = 0 + flags = 0 + err, arr = cudart.cudaMallocArray(desc, width, height, flags) + assertSuccess(err) + + # get channel descriptor from array + err, desc = cudart.cudaGetChannelDesc(arr) + assertSuccess(err) + + # validate array channel descriptor + assert desc.x == x + assert desc.y == y + assert desc.z == z + assert desc.w == w + assert desc.f == f + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + + +def test_cudart_cudaGetTextureObjectTextureDesc(): + # create channel descriptor + err, channelDesc = cudart.cudaCreateChannelDesc( + 8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + ) + assertSuccess(err) + + # allocate device arrays + err, arr = cudart.cudaMallocArray(channelDesc, 1024, 0, 0) + assertSuccess(err) + + # create descriptors for texture object + resDesc = cudart.cudaResourceDesc() + resDesc.res.array.array = arr + inTexDesc = cudart.cudaTextureDesc() + + # create texture object + err, texObject = cudart.cudaCreateTextureObject(resDesc, inTexDesc, None) + assertSuccess(err) + + # get texture descriptor + err, outTexDesc = cudart.cudaGetTextureObjectTextureDesc(texObject) + assertSuccess(err) + + # validate texture descriptor + for attr in dir(outTexDesc): + if attr in ["borderColor", "getPtr"]: + continue + if not attr.startswith("_"): + assert getattr(outTexDesc, attr) == getattr(inTexDesc, attr) + + # clean up + (err,) = cudart.cudaDestroyTextureObject(texObject) + assertSuccess(err) + + +def test_cudart_cudaMemset3D(): + # create host arrays + size = 1024 * np.uint8().itemsize + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # allocate device memory + devExtent = cudart.make_cudaExtent(32, 32, 1) + err, devPitchedPtr = cudart.cudaMalloc3D(devExtent) + assertSuccess(err) + + # set memory + memExtent = cudart.make_cudaExtent(devPitchedPtr.pitch, devPitchedPtr.ysize, 1) + (err,) = cudart.cudaMemset3D(devPitchedPtr, 1, memExtent) + assertSuccess(err) + + # D to h2 + (err,) = cudart.cudaMemcpy(h2, devPitchedPtr.ptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFree(devPitchedPtr.ptr) + assertSuccess(err) + + +def test_cudart_cudaMemset3D_2D(): + # create host arrays + size = 512 * np.uint8().itemsize + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # allocate device memory + devExtent = cudart.make_cudaExtent(1024, 1, 1) + err, devPitchedPtr = cudart.cudaMalloc3D(devExtent) + assertSuccess(err) + + # set memory + memExtent = cudart.make_cudaExtent(size, devPitchedPtr.ysize, 1) + (err,) = cudart.cudaMemset3D(devPitchedPtr, 1, memExtent) + assertSuccess(err) + + # D to h2 + (err,) = cudart.cudaMemcpy(h2, devPitchedPtr.ptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFree(devPitchedPtr.ptr) + assertSuccess(err) + + +def test_cudart_cudaMemcpyToArray(): + # create host arrays + size = 1024 * np.uint8().itemsize + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to arr + (err,) = cudart.cudaMemcpyToArray(arr, 0, 0, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # arr to h2 + (err,) = cudart.cudaMemcpyFromArray(h2, arr, 0, 0, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + + +def test_cudart_cudaMemcpyToArray_DtoD(): + # allocate device memory + size = int(1024 * np.uint8().itemsize) + err, d1 = cudart.cudaMalloc(size) + assertSuccess(err) + err, d2 = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # h1 to d1 + (err,) = cudart.cudaMemcpy(d1, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # d1 to arr + (err,) = cudart.cudaMemcpyToArray(arr, 0, 0, d1, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice) + assertSuccess(err) + + # arr to d2 + (err,) = cudart.cudaMemcpyFromArray(d2, arr, 0, 0, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToDevice) + assertSuccess(err) + + # d2 to h2 + (err,) = cudart.cudaMemcpy(h2, d2, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + (err,) = cudart.cudaFree(d2) + assertSuccess(err) + (err,) = cudart.cudaFree(d1) + assertSuccess(err) + + +def test_cudart_cudaMemcpy3DAsync(): + # create host arrays + size = int(1024 * np.uint8().itemsize) + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # create stream + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + + # create memcpy params + params = cudart.cudaMemcpy3DParms() + params.srcPtr = cudart.make_cudaPitchedPtr(h1, size, 1, 1) + params.dstArray = arr + params.extent = cudart.make_cudaExtent(size, 1, 1) + params.kind = cudart.cudaMemcpyKind.cudaMemcpyHostToDevice + + # h1 to arr + (err,) = cudart.cudaMemcpy3DAsync(params, stream) + assertSuccess(err) + + # await results + (err,) = cudart.cudaStreamSynchronize(stream) + assertSuccess(err) + + # arr to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, arr, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + + +def test_cudart_cudaGraphAddMemcpyNode1D(): + # allocate device memory + size = 1024 * np.uint8().itemsize + err, dptr = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # build graph + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + + # add nodes + err, hToDNode = cudart.cudaGraphAddMemcpyNode1D( + graph, [], 0, dptr, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice + ) + assertSuccess(err) + err, dToHNode = cudart.cudaGraphAddMemcpyNode1D( + graph, [hToDNode], 1, h2, dptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost + ) + assertSuccess(err) + + # create stream + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + + # execute graph + err, execGraph = cudart.cudaGraphInstantiate(graph, 0) + assertSuccess(err) + (err,) = cudart.cudaGraphLaunch(execGraph, stream) + + # await results + (err,) = cudart.cudaStreamSynchronize(stream) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFree(dptr) + assertSuccess(err) + + +def test_cudart_cudaGraphAddMemsetNode(): + # allocate device memory + size = 1024 * np.uint8().itemsize + err, dptr = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # build graph + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + + # set memset params + params = cudart.cudaMemsetParams() + params.dst = dptr + params.pitch = size + params.value = 1 + params.elementSize = 1 + params.width = size + params.height = 1 + + # add nodes + err, setNode = cudart.cudaGraphAddMemsetNode(graph, [], 0, params) + assertSuccess(err) + err, cpyNode = cudart.cudaGraphAddMemcpyNode1D( + graph, [setNode], 1, h2, dptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost + ) + assertSuccess(err) + + # create stream + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + + # execute graph + err, execGraph = cudart.cudaGraphInstantiate(graph, 0) + assertSuccess(err) + (err,) = cudart.cudaGraphLaunch(execGraph, stream) + assertSuccess(err) + + # await results + (err,) = cudart.cudaStreamSynchronize(stream) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFree(dptr) + assertSuccess(err) + + +def test_cudart_cudaMemcpy3DPeer(): + # allocate device memory + size = int(1024 * np.uint8().itemsize) + err, dptr = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # create memcpy params + params = cudart.cudaMemcpy3DPeerParms() + params.srcPtr = cudart.make_cudaPitchedPtr(dptr, size, 1, 1) + params.dstArray = arr + params.extent = cudart.make_cudaExtent(size, 1, 1) + + # h1 to D + (err,) = cudart.cudaMemcpy(dptr, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # D to arr + (err,) = cudart.cudaMemcpy3DPeer(params) + assertSuccess(err) + + # arr to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, arr, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + (err,) = cudart.cudaFree(dptr) + assertSuccess(err) + + +def test_cudart_cudaMemcpy3DPeerAsync(): + # allocate device memory + size = 1024 * np.uint8().itemsize + err, dptr = cudart.cudaMalloc(size) + assertSuccess(err) + + # create host arrays + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # create channel descriptor + err, desc = cudart.cudaCreateChannelDesc(8, 0, 0, 0, cudart.cudaChannelFormatKind.cudaChannelFormatKindUnsigned) + assertSuccess(err) + + # allocate device array + err, arr = cudart.cudaMallocArray(desc, size, 0, 0) + assertSuccess(err) + + # create stream + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + + # create memcpy params + params = cudart.cudaMemcpy3DPeerParms() + params.srcPtr = cudart.make_cudaPitchedPtr(dptr, size, 1, 1) + params.dstArray = arr + params.extent = cudart.make_cudaExtent(size, 1, 1) + + # h1 to D + (err,) = cudart.cudaMemcpy(dptr, h1, size, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice) + assertSuccess(err) + + # ensure the DMA to device memory has completed + (err,) = cudart.cudaStreamSynchronize(0) + assertSuccess(err) + + # D to arr + (err,) = cudart.cudaMemcpy3DPeerAsync(params, stream) + assertSuccess(err) + + # await results + (err,) = cudart.cudaStreamSynchronize(stream) + assertSuccess(err) + + # arr to h2 + (err,) = cudart.cudaMemcpy2DFromArray(h2, size, arr, 0, 0, size, 1, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assertSuccess(err) + + # validate h1 == h2 + assert np.array_equal(h1, h2) + + # clean up + (err,) = cudart.cudaFreeArray(arr) + assertSuccess(err) + (err,) = cudart.cudaFree(dptr) + assertSuccess(err) + + +def test_profiler(): + (err,) = cudart.cudaProfilerStart() + assertSuccess(err) + (err,) = cudart.cudaProfilerStop() + assertSuccess(err) + + +def test_cudart_eglFrame(): + frame = cudart.cudaEglFrame() + # [, , ] + assert int(frame.frame.pArray[0]) == 0 + assert int(frame.frame.pArray[1]) == 0 + assert int(frame.frame.pArray[2]) == 0 + frame.frame.pArray = [1, 2, 3] + # [, , ] + assert int(frame.frame.pArray[0]) == 1 + assert int(frame.frame.pArray[1]) == 2 + assert int(frame.frame.pArray[2]) == 3 + frame.frame.pArray = [1, 2, cudart.cudaArray_t(4)] + # [, , ] + assert int(frame.frame.pArray[0]) == 1 + assert int(frame.frame.pArray[1]) == 2 + assert int(frame.frame.pArray[2]) == 4 + # frame.frame.pPitch + # [ptr : 0x1 + # pitch : 2 + # xsize : 4 + # ysize : 0, ptr : 0x0 + # pitch : 0 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 0 + # xsize : 0 + # ysize : 0] + assert int(frame.frame.pPitch[0].ptr) == 1 + assert int(frame.frame.pPitch[0].pitch) == 2 + assert int(frame.frame.pPitch[0].xsize) == 4 + assert int(frame.frame.pPitch[0].ysize) == 0 + assert int(frame.frame.pPitch[1].ptr) == 0 + assert int(frame.frame.pPitch[1].pitch) == 0 + assert int(frame.frame.pPitch[1].xsize) == 0 + assert int(frame.frame.pPitch[1].ysize) == 0 + assert int(frame.frame.pPitch[2].ptr) == 0 + assert int(frame.frame.pPitch[2].pitch) == 0 + assert int(frame.frame.pPitch[2].xsize) == 0 + assert int(frame.frame.pPitch[2].ysize) == 0 + frame.frame.pPitch = [cudart.cudaPitchedPtr(), cudart.cudaPitchedPtr(), cudart.cudaPitchedPtr()] + # [ptr : 0x0 + # pitch : 0 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 0 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 0 + # xsize : 0 + # ysize : 0] + assert int(frame.frame.pPitch[0].ptr) == 0 + assert int(frame.frame.pPitch[0].pitch) == 0 + assert int(frame.frame.pPitch[0].xsize) == 0 + assert int(frame.frame.pPitch[0].ysize) == 0 + assert int(frame.frame.pPitch[1].ptr) == 0 + assert int(frame.frame.pPitch[1].pitch) == 0 + assert int(frame.frame.pPitch[1].xsize) == 0 + assert int(frame.frame.pPitch[1].ysize) == 0 + assert int(frame.frame.pPitch[2].ptr) == 0 + assert int(frame.frame.pPitch[2].pitch) == 0 + assert int(frame.frame.pPitch[2].xsize) == 0 + assert int(frame.frame.pPitch[2].ysize) == 0 + x = frame.frame.pPitch[0] + x.pitch = 123 + frame.frame.pPitch = [x, x, x] + # [ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0] + assert int(frame.frame.pPitch[0].ptr) == 0 + assert int(frame.frame.pPitch[0].pitch) == 123 + assert int(frame.frame.pPitch[0].xsize) == 0 + assert int(frame.frame.pPitch[0].ysize) == 0 + assert int(frame.frame.pPitch[1].ptr) == 0 + assert int(frame.frame.pPitch[1].pitch) == 123 + assert int(frame.frame.pPitch[1].xsize) == 0 + assert int(frame.frame.pPitch[1].ysize) == 0 + assert int(frame.frame.pPitch[2].ptr) == 0 + assert int(frame.frame.pPitch[2].pitch) == 123 + assert int(frame.frame.pPitch[2].xsize) == 0 + assert int(frame.frame.pPitch[2].ysize) == 0 + x.pitch = 1234 + # [ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0, ptr : 0x0 + # pitch : 123 + # xsize : 0 + # ysize : 0] + assert int(frame.frame.pPitch[0].ptr) == 0 + assert int(frame.frame.pPitch[0].pitch) == 123 + assert int(frame.frame.pPitch[0].xsize) == 0 + assert int(frame.frame.pPitch[0].ysize) == 0 + assert int(frame.frame.pPitch[1].ptr) == 0 + assert int(frame.frame.pPitch[1].pitch) == 123 + assert int(frame.frame.pPitch[1].xsize) == 0 + assert int(frame.frame.pPitch[1].ysize) == 0 + assert int(frame.frame.pPitch[2].ptr) == 0 + assert int(frame.frame.pPitch[2].pitch) == 123 + assert int(frame.frame.pPitch[2].xsize) == 0 + assert int(frame.frame.pPitch[2].ysize) == 0 + + +def cudart_func_stream_callback(use_host_api): + class testStruct(ctypes.Structure): + _fields_ = [ + ("a", ctypes.c_int), + ("b", ctypes.c_int), + ("c", ctypes.c_int), + ] + + def task_callback_host(userData): + data = testStruct.from_address(userData) + assert data.a == 1 + assert data.b == 2 + assert data.c == 3 + return 0 + + def task_callback_stream(stream, status, userData): + data = testStruct.from_address(userData) + assert data.a == 1 + assert data.b == 2 + assert data.c == 3 + return 0 + + if use_host_api: + callback_type = ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_void_p) + target_task = task_callback_host + else: + callback_type = ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p) + target_task = task_callback_stream + + # Construct ctype data + c_callback = callback_type(target_task) + c_data = testStruct(1, 2, 3) + + # ctypes is managing the pointer value for us + if use_host_api: + callback = cudart.cudaHostFn_t(_ptr=ctypes.addressof(c_callback)) + else: + callback = cudart.cudaStreamCallback_t(_ptr=ctypes.addressof(c_callback)) + + # Run + err, stream = cudart.cudaStreamCreate() + assertSuccess(err) + if use_host_api: + (err,) = cudart.cudaLaunchHostFunc(stream, callback, ctypes.addressof(c_data)) + assertSuccess(err) + else: + (err,) = cudart.cudaStreamAddCallback(stream, callback, ctypes.addressof(c_data), 0) + assertSuccess(err) + (err,) = cudart.cudaDeviceSynchronize() + assertSuccess(err) + + +def test_cudart_func_callback(): + cudart_func_stream_callback(use_host_api=False) + cudart_func_stream_callback(use_host_api=True) + + +@pytest.mark.skipif( + driverVersionLessThan(12030) or not supportsCudaAPI("cudaGraphConditionalHandleCreate"), + reason="Conditional graph APIs required", +) +def test_cudart_conditional(): + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + err, handle = cudart.cudaGraphConditionalHandleCreate(graph, 0, 0) + assertSuccess(err) + + params = cudart.cudaGraphNodeParams() + params.type = cudart.cudaGraphNodeType.cudaGraphNodeTypeConditional + params.conditional.handle = handle + params.conditional.type = cudart.cudaGraphConditionalNodeType.cudaGraphCondTypeIf + params.conditional.size = 1 + + assert len(params.conditional.phGraph_out) == 1 + assert int(params.conditional.phGraph_out[0]) == 0 + err, node = cudart.cudaGraphAddNode(graph, None, 0, params) + assertSuccess(err) + + assert len(params.conditional.phGraph_out) == 1 + assert int(params.conditional.phGraph_out[0]) != 0 + + +@pytest.mark.parametrize( + "target", + ( + runtime.cudaStream_t, + runtime.cudaEvent_t, + runtime.cudaGraph_t, + runtime.cudaGraphNode_t, + runtime.cudaGraphExec_t, + runtime.cudaMemPool_t, + ), +) +def test_struct_pointer_comparison(target): + a = target(123) + b = target(123) + assert a == b + assert hash(a) == hash(b) + c = target(456) + assert a != c + assert hash(a) != hash(c) diff --git a/cuda_bindings_12/tests/test_cufile.py b/cuda_bindings_12/tests/test_cufile.py new file mode 100644 index 00000000000..abd7c7d5f12 --- /dev/null +++ b/cuda_bindings_12/tests/test_cufile.py @@ -0,0 +1,1864 @@ +# 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 tempfile +from contextlib import suppress +from functools import cache + +import pytest + +import cuda.bindings.driver as cuda + +# Configure logging to show INFO level and above +logging.basicConfig( + level=logging.INFO, + format="%(levelname)s: %(message)s", + force=True, # Override any existing logging configuration +) + +try: + from cuda.bindings import cufile +except ImportError: + cufile = None + + +def platform_is_wsl(): + """Check if running on Windows Subsystem for Linux (WSL).""" + return platform.system() == "Linux" and "microsoft" in pathlib.Path("/proc/version").read_text().lower() + + +if cufile is None: + pytest.skip("skipping tests on Windows", allow_module_level=True) + +if platform_is_wsl(): + pytest.skip("skipping cuFile tests on WSL", allow_module_level=True) + + +@pytest.fixture(scope="module") +def cufile_env_json(): + """Set CUFILE_ENV_PATH_JSON environment variable for async tests.""" + original_value = os.environ.get("CUFILE_ENV_PATH_JSON") + + # Use /etc/cufile.json if it exists, otherwise fallback to cufile.json in tests directory + if os.path.exists("/etc/cufile.json"): + config_path = "/etc/cufile.json" + else: + # Get absolute path to cufile.json in the same directory as this test file + test_dir = os.path.dirname(os.path.abspath(__file__)) + config_path = os.path.join(test_dir, "cufile.json") + + logging.info(f"Using cuFile config: {config_path}") + os.environ["CUFILE_ENV_PATH_JSON"] = config_path + yield + # Restore original value or remove if it wasn't set + if original_value is not None: + os.environ["CUFILE_ENV_PATH_JSON"] = original_value + else: + os.environ.pop("CUFILE_ENV_PATH_JSON", None) + + +@cache +def cufileLibraryAvailable(): + """Check if cuFile library is available on the system.""" + try: + # Try to get cuFile library version - this will fail if library is not available + version = cufile.get_version() + logging.info(f"cuFile library available, version: {version}") + return True + except Exception as e: + logging.warning(f"cuFile library not available: {e}") + return False + + +@cache +def cufileVersionLessThan(target): + """Check if cuFile library version is less than target version.""" + try: + # Get cuFile library version + version = cufile.get_version() + logging.info(f"cuFile library version: {version}") + # Check if version is less than target + if version < target: + logging.warning(f"cuFile library version {version} is less than required {target}") + return True + return False + except Exception as e: + logging.error(f"Error checking cuFile version: {e}") + return True # Assume old version if any error occurs + + +@cache +def isSupportedFilesystem(): + """Check if the current filesystem is supported (ext4 or xfs).""" + try: + # Try to get filesystem type from /proc/mounts + with open("/proc/mounts") as f: + for line in f: + parts = line.split() + if len(parts) >= 2: + mount_point = parts[1] + fs_type = parts[2] + + # Check if current directory is under this mount point + current_dir = os.path.abspath(".") + if current_dir.startswith(mount_point): + fs_type_lower = fs_type.lower() + logging.info(f"Current filesystem type: {fs_type_lower}") + return fs_type_lower in ["ext4", "xfs"] + + # If we get here, we couldn't determine the filesystem type + logging.warning("Could not determine filesystem type from /proc/mounts") + return False + except Exception as e: + logging.error(f"Error checking filesystem type: {e}") + return False + + +# Global skip condition for all tests if cuFile library is not available +pytestmark = pytest.mark.skipif(not cufileLibraryAvailable(), reason="cuFile library not available on this system") + + +def test_cufile_success_defined(): + """Check if CUFILE_SUCCESS is defined in OpError enum.""" + assert hasattr(cufile.OpError, "SUCCESS") + + +def test_driver_open(): + """Test cuFile driver initialization.""" + cufile.driver_open() + cufile.driver_close() + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_handle_register(): + """Test file handle registration with cuFile.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_handle_register.bin" + + # Create file with POSIX operations + fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) + + # Write test data using POSIX write + test_data = b"Test data for cuFile - POSIX write" + bytes_written = os.write(fd, test_data) + + # Sync to ensure data is on disk + os.fsync(fd) + + # Close and reopen with O_DIRECT for cuFile operations + os.close(fd) + + # Reopen with O_DIRECT + flags = os.O_RDWR | os.O_DIRECT + fd = os.open(file_path, flags) + + try: + # Create and initialize the descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register the handle + handle = cufile.handle_register(descr.ptr) + + # Deregister the handle + cufile.handle_deregister(handle) + + finally: + os.close(fd) + with suppress(OSError): + os.unlink(file_path) + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_simple(): + """Simple test for buffer registration with cuFile.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate CUDA memory + buffer_size = 4096 # 4KB, aligned to 4096 bytes + err, buf_ptr = cuda.cuMemAlloc(buffer_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Register the buffer with cuFile + flags = 0 + buf_ptr_int = int(buf_ptr) + cufile.buf_register(buf_ptr_int, buffer_size, flags) + + # Deregister the buffer + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free CUDA memory + cuda.cuMemFree(buf_ptr) + + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_host_memory(): + """Test buffer registration with host memory.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate host memory + buffer_size = 4096 # 4KB, aligned to 4096 bytes + err, buf_ptr = cuda.cuMemHostAlloc(buffer_size, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Register the host buffer with cuFile + flags = 0 + buf_ptr_int = int(buf_ptr) + cufile.buf_register(buf_ptr_int, buffer_size, flags) + + # Deregister the buffer + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free host memory + cuda.cuMemFreeHost(buf_ptr) + + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_multiple_buffers(): + """Test registering multiple buffers.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate multiple CUDA buffers + buffer_sizes = [4096, 16384, 65536] # All aligned to 4096 bytes + buffers = [] + + for size in buffer_sizes: + err, buf_ptr = cuda.cuMemAlloc(size) + assert err == cuda.CUresult.CUDA_SUCCESS + buffers.append(buf_ptr) + + try: + # Register all buffers + flags = 0 + for buf_ptr, size in zip(buffers, buffer_sizes): + buf_ptr_int = int(buf_ptr) + cufile.buf_register(buf_ptr_int, size, flags) + + # Deregister all buffers + for buf_ptr in buffers: + buf_ptr_int = int(buf_ptr) + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free all buffers + for buf_ptr in buffers: + cuda.cuMemFree(buf_ptr) + + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_invalid_flags(): + """Test buffer registration with invalid flags.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate CUDA memory + buffer_size = 65536 + err, buf_ptr = cuda.cuMemAlloc(buffer_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Try to register with invalid flags + invalid_flags = 999 + buf_ptr_int = int(buf_ptr) + + with suppress(Exception): + cufile.buf_register(buf_ptr_int, buffer_size, invalid_flags) + # If we get here, deregister to clean up + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free CUDA memory + cuda.cuMemFree(buf_ptr) + + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_large_buffer(): + """Test buffer registration with a large buffer.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate large CUDA memory (1MB, aligned to 4096 bytes) + buffer_size = 1024 * 1024 # 1MB, aligned to 4096 bytes (1048576 % 4096 == 0) + err, buf_ptr = cuda.cuMemAlloc(buffer_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Register the large buffer with cuFile + flags = 0 + buf_ptr_int = int(buf_ptr) + cufile.buf_register(buf_ptr_int, buffer_size, flags) + + # Deregister the buffer + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free CUDA memory + cuda.cuMemFree(buf_ptr) + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +def test_buf_register_already_registered(): + """Test that registering an already registered buffer fails.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Allocate CUDA memory + buffer_size = 4096 # 4KB, aligned to 4096 bytes + err, buf_ptr = cuda.cuMemAlloc(buffer_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Register the buffer first time + flags = 0 + buf_ptr_int = int(buf_ptr) + cufile.buf_register(buf_ptr_int, buffer_size, flags) + + # Try to register the same buffer again + try: + cufile.buf_register(buf_ptr_int, buffer_size, flags) + # If we get here, deregister both times + cufile.buf_deregister(buf_ptr_int) + cufile.buf_deregister(buf_ptr_int) + except Exception: + # Expected error when registering buffer twice + # Deregister the first registration + cufile.buf_deregister(buf_ptr_int) + + finally: + # Free CUDA memory + cuda.cuMemFree(buf_ptr) + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_read_write(): + """Test cuFile read and write operations.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_cufile_rw.bin" + + # Allocate CUDA memory for write and read + write_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) + err, write_buf = cuda.cuMemAlloc(write_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, read_buf = cuda.cuMemAlloc(write_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Allocate host memory for data verification + host_buf = ctypes.create_string_buffer(write_size) + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register buffers with cuFile + write_buf_int = int(write_buf) + read_buf_int = int(read_buf) + + cufile.buf_register(write_buf_int, write_size, 0) + cufile.buf_register(read_buf_int, write_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Prepare test data + test_string = b"Hello cuFile! This is test data for read/write operations. " + test_string_len = len(test_string) + repetitions = write_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:write_size] # Ensure it fits exactly in buffer + host_buf = ctypes.create_string_buffer(test_data, write_size) + + # Copy test data to CUDA write buffer + cuda.cuMemcpyHtoDAsync(write_buf, host_buf, write_size, 0) + cuda.cuStreamSynchronize(0) + + # Write data using cuFile + bytes_written = cufile.write(handle, write_buf_int, write_size, 0, 0) + + # Read data back using cuFile + bytes_read = cufile.read(handle, read_buf_int, write_size, 0, 0) + + # Copy read data back to host + cuda.cuMemcpyDtoHAsync(host_buf, read_buf, write_size, 0) + cuda.cuStreamSynchronize(0) + + # Verify the data + read_data = host_buf.value + assert read_data == test_data, "Read data doesn't match written data" + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + cufile.buf_deregister(write_buf_int) + cufile.buf_deregister(read_buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_read_write_host_memory(): + """Test cuFile read and write operations using host memory.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_cufile_rw_host.bin" + + # Allocate host memory for write and read + write_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) + err, write_buf = cuda.cuMemHostAlloc(write_size, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, read_buf = cuda.cuMemHostAlloc(write_size, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register host buffers with cuFile + write_buf_int = int(write_buf) + read_buf_int = int(read_buf) + + cufile.buf_register(write_buf_int, write_size, 0) + cufile.buf_register(read_buf_int, write_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Prepare test data + test_string = b"Host memory test data for cuFile operations! " + test_string_len = len(test_string) + repetitions = write_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:write_size] # Ensure it fits exactly in buffer + + # Copy test data to host write buffer + host_buf = ctypes.create_string_buffer(test_data, write_size) + write_buf_content = ctypes.string_at(write_buf, write_size) + + # Write data using cuFile + bytes_written = cufile.write(handle, write_buf_int, write_size, 0, 0) + + # Sync to ensure data is on disk + os.fsync(fd) + + # Read data back using cuFile + bytes_read = cufile.read(handle, read_buf_int, write_size, 0, 0) + + # Verify the data + read_data = ctypes.string_at(read_buf, write_size) + expected_data = write_buf_content + assert read_data == expected_data, "Read data doesn't match written data" + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + cufile.buf_deregister(write_buf_int) + cufile.buf_deregister(read_buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_read_write_large(): + """Test cuFile read and write operations with large data.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "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) + err, write_buf = cuda.cuMemAlloc(write_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, read_buf = cuda.cuMemAlloc(write_size) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Allocate host memory for data verification + host_buf = ctypes.create_string_buffer(write_size) + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register buffers with cuFile + write_buf_int = int(write_buf) + read_buf_int = int(read_buf) + + cufile.buf_register(write_buf_int, write_size, 0) + cufile.buf_register(read_buf_int, write_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Generate large test data + import random + + test_data = bytes(random.getrandbits(8) for _ in range(write_size)) + host_buf = ctypes.create_string_buffer(test_data, write_size) + + # Copy test data to CUDA write buffer + cuda.cuMemcpyHtoDAsync(write_buf, host_buf, write_size, 0) + cuda.cuStreamSynchronize(0) + + # Get the actual data that was written to CUDA buffer + cuda.cuMemcpyDtoHAsync(host_buf, write_buf, write_size, 0) + cuda.cuStreamSynchronize(0) + expected_data = host_buf.value + + # Write data using cuFile + bytes_written = cufile.write(handle, write_buf_int, write_size, 0, 0) + + # Read data back using cuFile + bytes_read = cufile.read(handle, read_buf_int, write_size, 0, 0) + + # Copy read data back to host + cuda.cuMemcpyDtoHAsync(host_buf, read_buf, write_size, 0) + cuda.cuStreamSynchronize(0) + + # Verify the data + read_data = host_buf.value + assert read_data == expected_data, "Large read data doesn't match written data" + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + cufile.buf_deregister(write_buf_int) + cufile.buf_deregister(read_buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_write_async(cufile_env_json): + """Test cuFile asynchronous write operations.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_cufile_write_async.bin" + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + try: + # Register file handle + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + handle = cufile.handle_register(descr.ptr) + + # Allocate and register device buffer + buf_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) + err, buf_ptr = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + cufile.buf_register(int(buf_ptr), buf_size, 0) + + # Create CUDA stream + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Register stream with cuFile + cufile.stream_register(int(stream), 0) + + # Prepare test data in device buffer + test_string = b"Async write test data for cuFile!" + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:buf_size] # Ensure it fits exactly in buffer + host_buf = ctypes.create_string_buffer(test_data, buf_size) + cuda.cuMemcpyHtoDAsync(buf_ptr, host_buf, buf_size, 0) + cuda.cuStreamSynchronize(0) + + # Create parameter arrays for async write + size_p = ctypes.c_size_t(buf_size) + file_offset_p = ctypes.c_int64(0) + buf_ptr_offset_p = ctypes.c_int64(0) + bytes_written_p = ctypes.c_ssize_t(0) + + # Perform async write + cufile.write_async( + int(handle), + int(buf_ptr), + ctypes.addressof(size_p), + ctypes.addressof(file_offset_p), + ctypes.addressof(buf_ptr_offset_p), + ctypes.addressof(bytes_written_p), + int(stream), + ) + + # Synchronize stream to wait for completion + cuda.cuStreamSynchronize(stream) + + # Verify bytes written + assert bytes_written_p.value == buf_size, f"Expected {buf_size} bytes written, got {bytes_written_p.value}" + + # Deregister stream + cufile.stream_deregister(int(stream)) + + # Deregister and cleanup + cufile.buf_deregister(int(buf_ptr)) + cufile.handle_deregister(handle) + cuda.cuStreamDestroy(stream) + cuda.cuMemFree(buf_ptr) + + finally: + os.close(fd) + with suppress(OSError): + os.unlink(file_path) + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_read_async(cufile_env_json): + """Test cuFile asynchronous read operations.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_cufile_read_async.bin" + + # First create and write test data without O_DIRECT + fd_temp = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) + # Create test data that's aligned to 4096 bytes + test_string = b"Async read test data for cuFile!" + test_string_len = len(test_string) + buf_size = 65536 # 64KB, aligned to 4096 bytes + repetitions = buf_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:buf_size] # Ensure exact 64KB + os.write(fd_temp, test_data) + os.fsync(fd_temp) + os.close(fd_temp) + + # Now open with O_DIRECT for cuFile operations + fd = os.open(file_path, os.O_RDWR | os.O_DIRECT) + + try: + # Register file handle + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + handle = cufile.handle_register(descr.ptr) + + # Allocate and register device buffer + buf_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) + err, buf_ptr = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + cufile.buf_register(int(buf_ptr), buf_size, 0) + + # Create CUDA stream + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Register stream with cuFile + cufile.stream_register(int(stream), 0) + + # Create parameter arrays for async read + size_p = ctypes.c_size_t(buf_size) + file_offset_p = ctypes.c_int64(0) + buf_ptr_offset_p = ctypes.c_int64(0) + bytes_read_p = ctypes.c_ssize_t(0) + + # Perform async read + cufile.read_async( + int(handle), + int(buf_ptr), + ctypes.addressof(size_p), + ctypes.addressof(file_offset_p), + ctypes.addressof(buf_ptr_offset_p), + ctypes.addressof(bytes_read_p), + int(stream), + ) + + # Synchronize stream to wait for completion + cuda.cuStreamSynchronize(stream) + + # Verify bytes read + assert bytes_read_p.value > 0, f"Expected bytes read, got {bytes_read_p.value}" + + # Copy read data back to host and verify + host_buf = ctypes.create_string_buffer(buf_size) + cuda.cuMemcpyDtoHAsync(host_buf, buf_ptr, buf_size, 0) + cuda.cuStreamSynchronize(0) + read_data = host_buf.value[: bytes_read_p.value] + expected_data = test_data[: bytes_read_p.value] + assert read_data == expected_data, "Read data doesn't match written data" + + # Deregister stream + cufile.stream_deregister(int(stream)) + + # Deregister and cleanup + cufile.buf_deregister(int(buf_ptr)) + cufile.handle_deregister(handle) + cuda.cuStreamDestroy(stream) + cuda.cuMemFree(buf_ptr) + + finally: + os.close(fd) + with suppress(OSError): + os.unlink(file_path) + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_cufile_async_read_write(cufile_env_json): + """Test cuFile asynchronous read and write operations in sequence.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_cufile_async_rw.bin" + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + try: + # Register file handle + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + handle = cufile.handle_register(descr.ptr) + + # Allocate and register device buffers + buf_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) + err, write_buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + cufile.buf_register(int(write_buf), buf_size, 0) + + err, read_buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + cufile.buf_register(int(read_buf), buf_size, 0) + + # Create CUDA stream + err, stream = cuda.cuStreamCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Register stream with cuFile + cufile.stream_register(int(stream), 0) + + # Prepare test data in write buffer + test_string = b"Async RW test data for cuFile!" + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:buf_size] # Ensure it fits exactly in buffer + host_buf = ctypes.create_string_buffer(test_data, buf_size) + cuda.cuMemcpyHtoDAsync(write_buf, host_buf, buf_size, 0) + cuda.cuStreamSynchronize(0) + + # Create parameter arrays for async write + write_size_p = ctypes.c_size_t(buf_size) + write_file_offset_p = ctypes.c_int64(0) + write_buf_ptr_offset_p = ctypes.c_int64(0) + bytes_written_p = ctypes.c_ssize_t(0) + + # Perform async write + cufile.write_async( + int(handle), + int(write_buf), + ctypes.addressof(write_size_p), + ctypes.addressof(write_file_offset_p), + ctypes.addressof(write_buf_ptr_offset_p), + ctypes.addressof(bytes_written_p), + int(stream), + ) + + # Synchronize stream to wait for write completion + cuda.cuStreamSynchronize(stream) + + # Verify bytes written + assert bytes_written_p.value == buf_size, f"Expected {buf_size} bytes written, got {bytes_written_p.value}" + + # Create parameter arrays for async read + read_size_p = ctypes.c_size_t(buf_size) + read_file_offset_p = ctypes.c_int64(0) + read_buf_ptr_offset_p = ctypes.c_int64(0) + bytes_read_p = ctypes.c_ssize_t(0) + + # Perform async read + cufile.read_async( + int(handle), + int(read_buf), + ctypes.addressof(read_size_p), + ctypes.addressof(read_file_offset_p), + ctypes.addressof(read_buf_ptr_offset_p), + ctypes.addressof(bytes_read_p), + int(stream), + ) + + # Synchronize stream to wait for read completion + cuda.cuStreamSynchronize(stream) + + # Verify bytes read + assert bytes_read_p.value == buf_size, f"Expected {buf_size} bytes read, got {bytes_read_p.value}" + + # Copy read data back to host and verify + host_buf = ctypes.create_string_buffer(buf_size) + cuda.cuMemcpyDtoHAsync(host_buf, read_buf, buf_size, 0) + cuda.cuStreamSynchronize(0) + read_data = host_buf.value + assert read_data == test_data, "Read data doesn't match written data" + + # Deregister stream + cufile.stream_deregister(int(stream)) + + # Deregister and cleanup + cufile.buf_deregister(int(write_buf)) + cufile.buf_deregister(int(read_buf)) + cufile.handle_deregister(handle) + cuda.cuStreamDestroy(stream) + cuda.cuMemFree(write_buf) + cuda.cuMemFree(read_buf) + + finally: + os.close(fd) + with suppress(OSError): + os.unlink(file_path) + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_batch_io_basic(): + """Test basic batch IO operations with multiple read/write operations.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_batch_io.bin" + + # Allocate CUDA memory for multiple operations + buf_size = 65536 # 64KB + num_operations = 4 + + buffers = [] + read_buffers = [] # Initialize read_buffers to avoid UnboundLocalError + + for i in range(num_operations): + err, buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + buffers.append(buf) + + # Allocate host memory for data verification + host_buf = ctypes.create_string_buffer(buf_size) + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register buffers with cuFile + for buf in buffers: + buf_int = int(buf) + cufile.buf_register(buf_int, buf_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Set up batch IO + batch_handle = cufile.batch_io_set_up(num_operations) + + # Create IOParams array for batch operations + io_params = cufile.IOParams(num_operations) + io_events = cufile.IOEvents(num_operations) + + # Prepare test data for each operation + test_strings = [ + b"Batch operation 1 data for testing cuFile! ", + b"Batch operation 2 data for testing cuFile! ", + b"Batch operation 3 data for testing cuFile! ", + b"Batch operation 4 data for testing cuFile! ", + ] + + # Set up write operations + for i in range(num_operations): + # Prepare test data + test_string = test_strings[i] + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:buf_size] # Ensure it fits exactly in buffer + host_buf = ctypes.create_string_buffer(test_data, buf_size) + + # Copy test data to CUDA buffer + cuda.cuMemcpyHtoDAsync(buffers[i], host_buf, buf_size, 0) + cuda.cuStreamSynchronize(0) + + # Set up IOParams for this operation + io_params[i].mode = cufile.BatchMode.BATCH # Batch mode + io_params[i].fh = handle + io_params[i].opcode = cufile.Opcode.WRITE # Write opcode + io_params[i].cookie = i # Use index as cookie for identification + io_params[i].u.batch.dev_ptr_base = int(buffers[i]) + io_params[i].u.batch.file_offset = i * buf_size # Sequential file offsets + io_params[i].u.batch.dev_ptr_offset = 0 + io_params[i].u.batch.size_ = buf_size + + # Submit batch write operations + cufile.batch_io_submit(batch_handle, num_operations, io_params.ptr, 0) + + # Get batch status + min_nr = num_operations # Wait for all operations to complete + nr_completed = ctypes.c_uint(num_operations) # Initialize to max operations posted + timeout = ctypes.c_int(5000) # 5 second timeout + + cufile.batch_io_get_status( + batch_handle, min_nr, ctypes.addressof(nr_completed), io_events.ptr, ctypes.addressof(timeout) + ) + + # Verify all operations completed successfully + assert nr_completed.value == num_operations, f"Expected {num_operations} operations, got {nr_completed.value}" + + # Collect all returned cookies + returned_cookies = set() + for i in range(num_operations): + assert io_events[i].status == cufile.Status.COMPLETE, ( + f"Operation {i} failed with status {io_events[i].status}" + ) + assert io_events[i].ret == buf_size, f"Expected {buf_size} bytes, got {io_events[i].ret} for operation {i}" + returned_cookies.add(io_events[i].cookie) + + # Verify all expected cookies are present + expected_cookies = set(range(num_operations)) # cookies 0, 1, 2, 3 + assert returned_cookies == expected_cookies, ( + f"Cookie mismatch. Expected {expected_cookies}, got {returned_cookies}" + ) + + # Now test batch read operations + read_buffers = [] + for i in range(num_operations): + err, buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + read_buffers.append(buf) + buf_int = int(buf) + cufile.buf_register(buf_int, buf_size, 0) + + # Create fresh io_events array for read operations + io_events_read = cufile.IOEvents(num_operations) + + # Set up read operations + for i in range(num_operations): + io_params[i].mode = cufile.BatchMode.BATCH # Batch mode + io_params[i].fh = handle + io_params[i].opcode = cufile.Opcode.READ # Read opcode + io_params[i].cookie = i + 100 # Different cookie for reads + io_params[i].u.batch.dev_ptr_base = int(read_buffers[i]) + io_params[i].u.batch.file_offset = i * buf_size + io_params[i].u.batch.dev_ptr_offset = 0 + io_params[i].u.batch.size_ = buf_size + + # Submit batch read operations + cufile.batch_io_submit(batch_handle, num_operations, io_params.ptr, 0) + + # Get batch status for reads + cufile.batch_io_get_status( + batch_handle, min_nr, ctypes.addressof(nr_completed), io_events_read.ptr, ctypes.addressof(timeout) + ) + + # Verify read operations completed successfully + assert nr_completed.value == num_operations, ( + f"Expected {num_operations} read operations, got {nr_completed.value}" + ) + + # Collect all returned cookies for read operations + returned_cookies_read = set() + for i in range(num_operations): + assert io_events_read[i].status == cufile.Status.COMPLETE, ( + f"Operation {i} failed with status {io_events_read[i].status}" + ) + assert io_events_read[i].ret == buf_size, ( + f"Expected {buf_size} bytes read, got {io_events_read[i].ret} for operation {i}" + ) + returned_cookies_read.add(io_events_read[i].cookie) + + # Verify all expected cookies are present + expected_cookies_read = set(range(100, 100 + num_operations)) # cookies 100, 101, 102, 103 + assert returned_cookies_read == expected_cookies_read, ( + f"Cookie mismatch. Expected {expected_cookies_read}, got {returned_cookies_read}" + ) + + # Verify the read data matches the written data + for i in range(num_operations): + # Copy read data back to host + cuda.cuMemcpyDtoHAsync(host_buf, read_buffers[i], buf_size, 0) + cuda.cuStreamSynchronize(0) + read_data = host_buf.value + + # Prepare expected data + test_string = test_strings[i] + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + expected_data = (test_string * repetitions)[:buf_size] + + assert read_data == expected_data, f"Read data doesn't match written data for operation {i}" + + # Clean up batch IO + cufile.batch_io_destroy(batch_handle) + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + for buf in buffers + read_buffers: + buf_int = int(buf) + cufile.buf_deregister(buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_batch_io_cancel(): + """Test batch IO cancellation.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_batch_cancel.bin" + + # Allocate CUDA memory + buf_size = 4096 # 4KB, aligned to 4096 bytes + num_operations = 2 + + buffers = [] + for i in range(num_operations): + err, buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + buffers.append(buf) + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register buffers with cuFile + for buf in buffers: + buf_int = int(buf) + cufile.buf_register(buf_int, buf_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Set up batch IO + batch_handle = cufile.batch_io_set_up(num_operations) + + # Create IOParams array for batch operations + io_params = cufile.IOParams(num_operations) + + # Set up write operations + for i in range(num_operations): + io_params[i].mode = cufile.BatchMode.BATCH # Batch mode + io_params[i].fh = handle + io_params[i].opcode = cufile.Opcode.WRITE # Write opcode + io_params[i].cookie = i + io_params[i].u.batch.dev_ptr_base = int(buffers[i]) + io_params[i].u.batch.file_offset = i * buf_size + io_params[i].u.batch.dev_ptr_offset = 0 + io_params[i].u.batch.size_ = buf_size + + # Submit batch operations + cufile.batch_io_submit(batch_handle, num_operations, io_params.ptr, 0) + + # Cancel the batch operations + cufile.batch_io_cancel(batch_handle) + + # Clean up batch IO + cufile.batch_io_destroy(batch_handle) + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + for buf in buffers: + buf_int = int(buf) + cufile.buf_deregister(buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") +def test_batch_io_large_operations(): + """Test batch IO with large buffer operations.""" + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Open cuFile driver + cufile.driver_open() + + # Create test file + file_path = "test_batch_large.bin" + + # Allocate large CUDA memory (1MB, aligned to 4096 bytes) + buf_size = 1024 * 1024 # 1MB, aligned to 4096 bytes + num_operations = 2 + + write_buffers = [] + read_buffers = [] + all_buffers = [] # Initialize all_buffers to avoid UnboundLocalError + + for i in range(num_operations): + err, buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + write_buffers.append(buf) + + err, buf = cuda.cuMemAlloc(buf_size) + assert err == cuda.CUresult.CUDA_SUCCESS + read_buffers.append(buf) + + # Allocate host memory for data verification + host_buf = ctypes.create_string_buffer(buf_size) + + try: + # Create file with O_DIRECT + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) + + # Register all buffers with cuFile + all_buffers = write_buffers + read_buffers + for buf in all_buffers: + buf_int = int(buf) + cufile.buf_register(buf_int, buf_size, 0) + + # Create file descriptor + descr = cufile.Descr() + descr.type = cufile.FileHandleType.OPAQUE_FD + descr.handle.fd = fd + descr.fs_ops = 0 + + # Register file handle + handle = cufile.handle_register(descr.ptr) + + # Set up batch IO + batch_handle = cufile.batch_io_set_up(num_operations * 2) # 2 writes + 2 reads + + # Create IOParams array for batch operations + io_params = cufile.IOParams(num_operations * 2) + io_events = cufile.IOEvents(num_operations * 2) + + # Prepare test data + test_strings = [ + b"Large batch operation 1 data for testing cuFile with 1MB buffers! ", + b"Large batch operation 2 data for testing cuFile with 1MB buffers! ", + ] + + # Prepare write data + for i in range(num_operations): + test_string = test_strings[i] + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + test_data = test_string * repetitions + test_data = test_data[:buf_size] + host_buf = ctypes.create_string_buffer(test_data, buf_size) + cuda.cuMemcpyHtoDAsync(write_buffers[i], host_buf, buf_size, 0) + cuda.cuStreamSynchronize(0) + + # Set up write operations + for i in range(num_operations): + io_params[i].mode = cufile.BatchMode.BATCH # Batch mode + io_params[i].fh = handle + io_params[i].opcode = cufile.Opcode.WRITE # Write opcode + io_params[i].cookie = i + io_params[i].u.batch.dev_ptr_base = int(write_buffers[i]) + io_params[i].u.batch.file_offset = i * buf_size + io_params[i].u.batch.dev_ptr_offset = 0 + io_params[i].u.batch.size_ = buf_size + + # Set up read operations + for i in range(num_operations): + idx = i + num_operations + io_params[idx].mode = cufile.BatchMode.BATCH # Batch mode + io_params[idx].fh = handle + io_params[idx].opcode = cufile.Opcode.READ # Read opcode + io_params[idx].cookie = i + 100 + io_params[idx].u.batch.dev_ptr_base = int(read_buffers[i]) + io_params[idx].u.batch.file_offset = i * buf_size + io_params[idx].u.batch.dev_ptr_offset = 0 + io_params[idx].u.batch.size_ = buf_size + + # Submit batch operations + cufile.batch_io_submit(batch_handle, num_operations * 2, io_params.ptr, 0) + + # Get batch status + min_nr = num_operations * 2 # Wait for all operations to complete + nr_completed = ctypes.c_uint(num_operations * 2) # Initialize to max operations posted + timeout = ctypes.c_int(10000) # 10 second timeout for large operations + + cufile.batch_io_get_status( + batch_handle, min_nr, ctypes.addressof(nr_completed), io_events.ptr, ctypes.addressof(timeout) + ) + + # Verify all operations completed successfully + assert nr_completed.value == num_operations * 2, ( + f"Expected {num_operations * 2} operations, got {nr_completed.value}" + ) + + # Collect all returned cookies + returned_cookies = set() + for i in range(num_operations * 2): + assert io_events[i].status == cufile.Status.COMPLETE, ( + f"Operation {i} failed with status {io_events[i].status}" + ) + returned_cookies.add(io_events[i].cookie) + + # Verify all expected cookies are present + expected_cookies = set(range(num_operations)) | set( + range(100, 100 + num_operations) + ) # write cookies 0,1 + read cookies 100,101 + assert returned_cookies == expected_cookies, ( + f"Cookie mismatch. Expected {expected_cookies}, got {returned_cookies}" + ) + + # Verify the read data matches the written data + for i in range(num_operations): + # Copy read data back to host + cuda.cuMemcpyDtoHAsync(host_buf, read_buffers[i], buf_size, 0) + cuda.cuStreamSynchronize(0) + read_data = host_buf.value + + # Prepare expected data + test_string = test_strings[i] + test_string_len = len(test_string) + repetitions = buf_size // test_string_len + expected_data = (test_string * repetitions)[:buf_size] + + assert read_data == expected_data, f"Read data doesn't match written data for operation {i}" + + # Clean up batch IO + cufile.batch_io_destroy(batch_handle) + + # Deregister file handle + cufile.handle_deregister(handle) + + # Deregister buffers + for buf in all_buffers: + buf_int = int(buf) + cufile.buf_deregister(buf_int) + + finally: + # Close file + os.close(fd) + # 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 + # Close cuFile driver + cufile.driver_close() + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif( + cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" +) +def test_set_get_parameter_size_t(): + """Test setting and getting size_t parameters with cuFile validation.""" + + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Test setting and getting various size_t parameters + + # Test poll threshold size (in KB) + poll_threshold_kb = 64 # 64KB threshold + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.POLLTHRESHOLD_SIZE_KB, poll_threshold_kb) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.POLLTHRESHOLD_SIZE_KB) + assert retrieved_value == poll_threshold_kb, ( + f"Poll threshold mismatch: set {poll_threshold_kb}, got {retrieved_value}" + ) + + # Test max direct IO size (in KB) + max_direct_io_kb = 1024 # 1MB max direct IO size + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_MAX_DIRECT_IO_SIZE_KB, max_direct_io_kb) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_MAX_DIRECT_IO_SIZE_KB) + assert retrieved_value == max_direct_io_kb, ( + f"Max direct IO size mismatch: set {max_direct_io_kb}, got {retrieved_value}" + ) + + # Test max device cache size (in KB) + max_cache_kb = 512 # 512KB max cache size + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB, max_cache_kb) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_MAX_DEVICE_CACHE_SIZE_KB) + assert retrieved_value == max_cache_kb, f"Max cache size mismatch: set {max_cache_kb}, got {retrieved_value}" + + # Test per buffer cache size (in KB) + per_buffer_cache_kb = 128 # 128KB per buffer cache + cufile.set_parameter_size_t( + cufile.SizeTConfigParameter.PROPERTIES_PER_BUFFER_CACHE_SIZE_KB, per_buffer_cache_kb + ) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_PER_BUFFER_CACHE_SIZE_KB) + assert retrieved_value == per_buffer_cache_kb, ( + f"Per buffer cache size mismatch: set {per_buffer_cache_kb}, got {retrieved_value}" + ) + + # Test max device pinned memory size (in KB) + max_pinned_kb = 2048 # 2MB max pinned memory + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB, max_pinned_kb) + retrieved_value = cufile.get_parameter_size_t( + cufile.SizeTConfigParameter.PROPERTIES_MAX_DEVICE_PINNED_MEM_SIZE_KB + ) + assert retrieved_value == max_pinned_kb, ( + f"Max pinned memory size mismatch: set {max_pinned_kb}, got {retrieved_value}" + ) + + # Test IO batch size + batch_size = 16 # 16 operations per batch + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_IO_BATCHSIZE, batch_size) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_IO_BATCHSIZE) + assert retrieved_value == batch_size, f"IO batch size mismatch: set {batch_size}, got {retrieved_value}" + + # Test batch IO timeout (in milliseconds) + timeout_ms = 5000 # 5 second timeout + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_BATCH_IO_TIMEOUT_MS, timeout_ms) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.PROPERTIES_BATCH_IO_TIMEOUT_MS) + assert retrieved_value == timeout_ms, f"Batch IO timeout mismatch: set {timeout_ms}, got {retrieved_value}" + + # Test execution parameters + max_io_queue_depth = 32 # Max 32 operations in queue + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MAX_IO_QUEUE_DEPTH, max_io_queue_depth) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MAX_IO_QUEUE_DEPTH) + assert retrieved_value == max_io_queue_depth, ( + f"Max IO queue depth mismatch: set {max_io_queue_depth}, got {retrieved_value}" + ) + + max_io_threads = 8 # Max 8 IO threads + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MAX_IO_THREADS, max_io_threads) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MAX_IO_THREADS) + assert retrieved_value == max_io_threads, ( + f"Max IO threads mismatch: set {max_io_threads}, got {retrieved_value}" + ) + + min_io_threshold_kb = 4 # 4KB minimum IO threshold + cufile.set_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MIN_IO_THRESHOLD_SIZE_KB, min_io_threshold_kb) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MIN_IO_THRESHOLD_SIZE_KB) + assert retrieved_value == min_io_threshold_kb, ( + f"Min IO threshold mismatch: set {min_io_threshold_kb}, got {retrieved_value}" + ) + + max_request_parallelism = 4 # Max 4 parallel requests + cufile.set_parameter_size_t( + cufile.SizeTConfigParameter.EXECUTION_MAX_REQUEST_PARALLELISM, max_request_parallelism + ) + retrieved_value = cufile.get_parameter_size_t(cufile.SizeTConfigParameter.EXECUTION_MAX_REQUEST_PARALLELISM) + assert retrieved_value == max_request_parallelism, ( + f"Max request parallelism mismatch: set {max_request_parallelism}, got {retrieved_value}" + ) + + finally: + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif( + cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" +) +def test_set_get_parameter_bool(): + """Test setting and getting boolean parameters with cuFile validation.""" + + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Test setting and getting various boolean parameters + + # Test poll mode + cufile.set_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_USE_POLL_MODE, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_USE_POLL_MODE) + assert retrieved_value is True, f"Poll mode mismatch: set True, got {retrieved_value}" + + # Test compatibility mode + cufile.set_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_ALLOW_COMPAT_MODE, False) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_ALLOW_COMPAT_MODE) + assert retrieved_value is False, f"Compatibility mode mismatch: set False, got {retrieved_value}" + + # Test force compatibility mode + cufile.set_parameter_bool(cufile.BoolConfigParameter.FORCE_COMPAT_MODE, False) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.FORCE_COMPAT_MODE) + assert retrieved_value is False, f"Force compatibility mode mismatch: set False, got {retrieved_value}" + + # Test aggressive API check + cufile.set_parameter_bool(cufile.BoolConfigParameter.FS_MISC_API_CHECK_AGGRESSIVE, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.FS_MISC_API_CHECK_AGGRESSIVE) + assert retrieved_value is True, f"Aggressive API check mismatch: set True, got {retrieved_value}" + + # Test parallel IO + cufile.set_parameter_bool(cufile.BoolConfigParameter.EXECUTION_PARALLEL_IO, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.EXECUTION_PARALLEL_IO) + assert retrieved_value is True, f"Parallel IO mismatch: set True, got {retrieved_value}" + + # Test NVTX profiling + cufile.set_parameter_bool(cufile.BoolConfigParameter.PROFILE_NVTX, False) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.PROFILE_NVTX) + assert retrieved_value is False, f"NVTX profiling mismatch: set False, got {retrieved_value}" + + # Test system memory allowance + cufile.set_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_ALLOW_SYSTEM_MEMORY, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.PROPERTIES_ALLOW_SYSTEM_MEMORY) + assert retrieved_value is True, f"System memory allowance mismatch: set True, got {retrieved_value}" + + # Test PCI P2P DMA + cufile.set_parameter_bool(cufile.BoolConfigParameter.USE_PCIP2PDMA, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.USE_PCIP2PDMA) + assert retrieved_value is True, f"PCI P2P DMA mismatch: set True, got {retrieved_value}" + + # Test IO uring preference + cufile.set_parameter_bool(cufile.BoolConfigParameter.PREFER_IO_URING, False) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.PREFER_IO_URING) + assert retrieved_value is False, f"IO uring preference mismatch: set False, got {retrieved_value}" + + # Test force O_DIRECT mode + cufile.set_parameter_bool(cufile.BoolConfigParameter.FORCE_ODIRECT_MODE, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.FORCE_ODIRECT_MODE) + assert retrieved_value is True, f"Force O_DIRECT mode mismatch: set True, got {retrieved_value}" + + # Test topology detection skip + cufile.set_parameter_bool(cufile.BoolConfigParameter.SKIP_TOPOLOGY_DETECTION, False) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.SKIP_TOPOLOGY_DETECTION) + assert retrieved_value is False, f"Topology detection skip mismatch: set False, got {retrieved_value}" + + # Test stream memops bypass + cufile.set_parameter_bool(cufile.BoolConfigParameter.STREAM_MEMOPS_BYPASS, True) + retrieved_value = cufile.get_parameter_bool(cufile.BoolConfigParameter.STREAM_MEMOPS_BYPASS) + assert retrieved_value is True, f"Stream memops bypass mismatch: set True, got {retrieved_value}" + + finally: + cuda.cuDevicePrimaryCtxRelease(device) + + +@pytest.mark.skipif( + cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" +) +def test_set_get_parameter_string(): + """Test setting and getting string parameters with cuFile validation.""" + + # Initialize CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, ctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + try: + # Test setting and getting various string parameters + # Note: String parameter tests may have issues with the current implementation + + # Test logging level + logging_level = "INFO" + try: + # Convert Python string to null-terminated C string + logging_level_bytes = logging_level.encode("utf-8") + b"\x00" + logging_level_buffer = ctypes.create_string_buffer(logging_level_bytes) + cufile.set_parameter_string( + cufile.StringConfigParameter.LOGGING_LEVEL, int(ctypes.addressof(logging_level_buffer)) + ) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.LOGGING_LEVEL, 256) + logging.info(f"Logging level test: set {logging_level}, got {retrieved_value}") + # The retrieved value should be a string, so we can compare directly + assert retrieved_value == logging_level, ( + f"Logging level mismatch: set {logging_level}, got {retrieved_value}" + ) + except Exception as e: + logging.error(f"Logging level test failed: {e}") + # Re-raise the exception to make the test fail + raise + + # Test environment log file path + logfile_path = tempfile.gettempdir() + "/cufile.log" + try: + # Convert Python string to null-terminated C string + logfile_path_bytes = logfile_path.encode("utf-8") + b"\x00" + logfile_buffer = ctypes.create_string_buffer(logfile_path_bytes) + cufile.set_parameter_string( + cufile.StringConfigParameter.ENV_LOGFILE_PATH, int(ctypes.addressof(logfile_buffer)) + ) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.ENV_LOGFILE_PATH, 256) + logging.info(f"Log file path test: set {logfile_path}, got {retrieved_value}") + # The retrieved value should be a string, so we can compare directly + assert retrieved_value == logfile_path, f"Log file path mismatch: set {logfile_path}, got {retrieved_value}" + except Exception as e: + logging.error(f"Log file path test failed: {e}") + # Re-raise the exception to make the test fail + raise + + # Test log directory + log_dir = tempfile.gettempdir() + "/cufile_logs" + try: + # Convert Python string to null-terminated C string + log_dir_bytes = log_dir.encode("utf-8") + b"\x00" + log_dir_buffer = ctypes.create_string_buffer(log_dir_bytes) + cufile.set_parameter_string(cufile.StringConfigParameter.LOG_DIR, int(ctypes.addressof(log_dir_buffer))) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.LOG_DIR, 256) + logging.info(f"Log directory test: set {log_dir}, got {retrieved_value}") + # The retrieved value should be a string, so we can compare directly + assert retrieved_value == log_dir, f"Log directory mismatch: set {log_dir}, got {retrieved_value}" + except Exception as e: + logging.error(f"Log directory test failed: {e}") + # Re-raise the exception to make the test fail + raise + + finally: + cuda.cuDevicePrimaryCtxRelease(device) diff --git a/cuda_bindings_12/tests/test_graphics_apis.py b/cuda_bindings_12/tests/test_graphics_apis.py new file mode 100644 index 00000000000..0cfbac4e870 --- /dev/null +++ b/cuda_bindings_12/tests/test_graphics_apis.py @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from cuda.bindings import runtime as cudart + + +def test_graphics_api_smoketest(): + # Due to lazy importing in pyglet, pytest.importorskip doesn't work + try: + import pyglet + + tex = pyglet.image.Texture.create(512, 512) + except (ImportError, AttributeError, OSError): + pytest.skip("pyglet not available or could not create GL context") + # return to make linters happy + return + + err, gfx_resource = cudart.cudaGraphicsGLRegisterImage( + tex.id, tex.target, cudart.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard + ) + error_name = cudart.cudaGetErrorName(err)[1].decode() + if error_name == "cudaSuccess": + assert int(gfx_resource) != 0 + else: + assert error_name in ("cudaErrorInvalidValue", "cudaErrorUnknown") + + +def test_cuda_register_image_invalid(): + """Exercise cudaGraphicsGLRegisterImage with dummy handle only using CUDA runtime API.""" + fake_gl_texture_id = 1 + fake_gl_target = 0x0DE1 + flags = cudart.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard + + err, resource = cudart.cudaGraphicsGLRegisterImage(fake_gl_texture_id, fake_gl_target, flags) + err_name = cudart.cudaGetErrorName(err)[1].decode() + err_str = cudart.cudaGetErrorString(err)[1].decode() + + if err == 0: + cudart.cudaGraphicsUnregisterResource(resource) + raise AssertionError("Expected error from invalid GL texture ID") diff --git a/cuda_bindings_12/tests/test_interoperability.py b/cuda_bindings_12/tests/test_interoperability.py new file mode 100644 index 00000000000..5262524d9a2 --- /dev/null +++ b/cuda_bindings_12/tests/test_interoperability.py @@ -0,0 +1,240 @@ +# 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.cuda as cuda +import cuda.cudart as cudart + + +def supportsMemoryPool(): + err, isSupported = cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported, 0) + return err == cudart.cudaError_t.cudaSuccess and isSupported + + +def test_interop_stream(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, stream = cuda.cuStreamCreate(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_rt,) = cudart.cudaStreamDestroy(stream) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # RT to DRV + err_rt, stream = cudart.cudaStreamCreate() + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuStreamDestroy(stream) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_event(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, event = cuda.cuEventCreate(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_rt,) = cudart.cudaEventDestroy(event) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # RT to DRV + err_rt, event = cudart.cudaEventCreate() + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuEventDestroy(event) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_graph(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, graph = cuda.cuGraphCreate(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_rt,) = cudart.cudaGraphDestroy(graph) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # RT to DRV + err_rt, graph = cudart.cudaGraphCreate(0) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuGraphDestroy(graph) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_graphNode(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + err_dr, graph = cuda.cuGraphCreate(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, node = cuda.cuGraphAddEmptyNode(graph, [], 0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_rt,) = cudart.cudaGraphDestroyNode(node) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # RT to DRV + err_rt, node = cudart.cudaGraphAddEmptyNode(graph, [], 0) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuGraphDestroyNode(node) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_rt,) = cudart.cudaGraphDestroy(graph) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_userObject(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # cudaUserObject_t + # TODO + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_function(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # cudaFunction_t + # TODO + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +@pytest.mark.skipif(not supportsMemoryPool(), reason="Requires mempool operations") +def test_interop_memPool(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, pool = cuda.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) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuDeviceSetMemPool(0, pool) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_graphExec(): + (err_dr,) = cuda.cuInit(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, device = cuda.cuDeviceGet(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, ctx = cuda.cuCtxCreate(0, device) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, graph = cuda.cuGraphCreate(0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + err_dr, node = cuda.cuGraphAddEmptyNode(graph, [], 0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # DRV to RT + err_dr, graphExec = cuda.cuGraphInstantiate(graph, 0) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_rt,) = cudart.cudaGraphExecDestroy(graphExec) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # RT to DRV + err_rt, graphExec = cudart.cudaGraphInstantiate(graph, 0) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuGraphExecDestroy(graphExec) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + (err_rt,) = cudart.cudaGraphDestroy(graph) + assert err_rt == cudart.cudaError_t.cudaSuccess + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + +def test_interop_deviceptr(): + # Init CUDA + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Get device + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Construct context + err, ctx = cuda.cuCtxCreate(0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Allocate dev memory + size = 1024 * np.uint8().itemsize + err_dr, dptr = cuda.cuMemAlloc(size) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + + # Allocate host memory + h1 = np.full(size, 1).astype(np.uint8) + h2 = np.full(size, 2).astype(np.uint8) + assert np.array_equal(h1, h2) is False + + # Initialize device memory + (err_rt,) = cudart.cudaMemset(dptr, 1, size) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # D to h2 + (err_rt,) = cudart.cudaMemcpy(h2, dptr, size, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost) + assert err_rt == cudart.cudaError_t.cudaSuccess + + # Validate h1 == h2 + assert np.array_equal(h1, h2) + + # Cleanup + (err_dr,) = cuda.cuMemFree(dptr) + assert err_dr == cuda.CUresult.CUDA_SUCCESS + (err_dr,) = cuda.cuCtxDestroy(ctx) + assert err_dr == cuda.CUresult.CUDA_SUCCESS diff --git a/cuda_bindings_12/tests/test_kernelParams.py b/cuda_bindings_12/tests/test_kernelParams.py new file mode 100644 index 00000000000..040ba839418 --- /dev/null +++ b/cuda_bindings_12/tests/test_kernelParams.py @@ -0,0 +1,862 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import ctypes + +import numpy as np + +from cuda import cuda, cudart, nvrtc + + +def ASSERT_DRV(err): + if isinstance(err, cuda.CUresult): + if err != cuda.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"Cuda Error: {err}") + elif isinstance(err, cudart.cudaError_t): + if err != cudart.cudaError_t.cudaSuccess: + raise RuntimeError(f"Cudart Error: {err}") + elif isinstance(err, nvrtc.nvrtcResult): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(f"Nvrtc Error: {err}") + else: + raise RuntimeError(f"Unknown error type: {err}") + + +def common_nvrtc(allKernelStrings, dev): + err, major = cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, dev) + ASSERT_DRV(err) + err, minor = cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, dev) + ASSERT_DRV(err) + err, _, nvrtc_minor = nvrtc.nvrtcVersion() + ASSERT_DRV(err) + use_cubin = nvrtc_minor >= 1 + prefix = "sm" if use_cubin else "compute" + arch_arg = bytes(f"--gpu-architecture={prefix}_{major}{minor}", "ascii") + + err, prog = nvrtc.nvrtcCreateProgram(str.encode(allKernelStrings), b"allKernelStrings.cu", 0, None, None) + ASSERT_DRV(err) + opts = (b"--fmad=false", arch_arg) + (err,) = nvrtc.nvrtcCompileProgram(prog, len(opts), 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) + + if use_cubin: + err, dataSize = nvrtc.nvrtcGetCUBINSize(prog) + ASSERT_DRV(err) + data = b" " * dataSize + (err,) = nvrtc.nvrtcGetCUBIN(prog, data) + ASSERT_DRV(err) + else: + err, dataSize = nvrtc.nvrtcGetPTXSize(prog) + ASSERT_DRV(err) + data = b" " * dataSize + (err,) = nvrtc.nvrtcGetPTX(prog, data) + ASSERT_DRV(err) + + err, module = cuda.cuModuleLoadData(np.char.array(data)) + ASSERT_DRV(err) + + return module + + +def test_kernelParams_empty(): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + + kernelString = """\ + static __device__ bool isDone; + extern "C" __global__ + void empty_kernel() + { + isDone = true; + if (isDone) return; + } + """ + + module = common_nvrtc(kernelString, cuDevice) + + # cudaStructs kernel + err, kernel = cuda.cuModuleGetFunction(module, b"empty_kernel") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + ((), ()), + 0, + ) # arguments + ASSERT_DRV(err) + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + None, + 0, + ) # arguments + ASSERT_DRV(err) + + # Retrieve global and validate + isDone_host = ctypes.c_bool() + err, isDonePtr_device, isDonePtr_device_size = cuda.cuModuleGetGlobal(module, b"isDone") + ASSERT_DRV(err) + assert isDonePtr_device_size == ctypes.sizeof(ctypes.c_bool) + (err,) = cuda.cuMemcpyDtoHAsync(isDone_host, isDonePtr_device, ctypes.sizeof(ctypes.c_bool), stream) + ASSERT_DRV(err) + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + assert isDone_host.value is True + + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +def kernelParams_basic(use_ctypes_as_values): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + + if use_ctypes_as_values: + assertValues_host = ( + ctypes.c_bool(True), + ctypes.c_char(b"Z"), + ctypes.c_wchar("Ā"), + ctypes.c_byte(-127), + ctypes.c_ubyte(255), + ctypes.c_short(1), + ctypes.c_ushort(1), + ctypes.c_int(2), + ctypes.c_uint(2), + ctypes.c_long(3), + ctypes.c_ulong(3), + ctypes.c_longlong(4), + ctypes.c_ulonglong(4), + ctypes.c_size_t(5), + ctypes.c_float(123.456), + ctypes.c_float(123.456), + ctypes.c_void_p(0xDEADBEEF), + ) + else: + assertValues_host = ( + True, + b"Z", + "Ā", + -127, + 255, + 90, + 72, + 85, + 82, + 66, + 65, + 86, + 90, + 33, + 123.456, + 123.456, + 0xDEADBEEF, + ) + assertTypes_host = ( + ctypes.c_bool, + ctypes.c_char, + ctypes.c_wchar, + ctypes.c_byte, + ctypes.c_ubyte, + ctypes.c_short, + ctypes.c_ushort, + ctypes.c_int, + ctypes.c_uint, + ctypes.c_long, + ctypes.c_ulong, + ctypes.c_longlong, + ctypes.c_ulonglong, + ctypes.c_size_t, + ctypes.c_float, + ctypes.c_double, + ctypes.c_void_p, + ) + + basicKernelString = """\ + extern "C" __global__ + void basic(bool b, + char c, wchar_t wc, + signed char byte, unsigned char ubyte, + short s, unsigned short us, + int i, unsigned int ui, + long l, unsigned long ul, + long long ll, unsigned long long ull, + size_t size, + float f, double d, + void *p, + bool *pb, + char *pc, wchar_t *pwc, + signed char *pbyte, unsigned char *pubyte, + short *ps, unsigned short *pus, + int *pi, unsigned int *pui, + long *pl, unsigned long *pul, + long long *pll, unsigned long long *pull, + size_t *psize, + float *pf, double *pd) + { + assert(b == {}); + assert(c == {}); + assert(wc == {}); + assert(byte == {}); + assert(ubyte == {}); + assert(s == {}); + assert(us == {}); + assert(i == {}); + assert(ui == {}); + assert(l == {}); + assert(ul == {}); + assert(ll == {}); + assert(ull == {}); + assert(size == {}); + assert(f == {}); + assert(d == {}); + assert(p == (void*){}); + *pb = b; + *pc = c; + *pwc = wc; + *pbyte = byte; + *pubyte = ubyte; + *ps = s; + *pus = us; + *pi = i; + *pui = ui; + *pl = l; + *pul = ul; + *pll = ll; + *pull = ull; + *psize = size; + *pf = f; + *pd = d; + } + """ + idx = 0 + while "{}" in basicKernelString: + val = assertValues_host[idx].value if use_ctypes_as_values else assertValues_host[idx] + if assertTypes_host[idx] == ctypes.c_float: + basicKernelString = basicKernelString.replace("{}", str(float(val)) + "f", 1) + elif assertTypes_host[idx] == ctypes.c_double: + basicKernelString = basicKernelString.replace("{}", str(float(val)), 1) + elif assertTypes_host[idx] == ctypes.c_char: + basicKernelString = basicKernelString.replace("{}", str(val)[1:], 1) + elif assertTypes_host[idx] == ctypes.c_wchar: + basicKernelString = basicKernelString.replace("{}", str(ord(val)), 1) + else: + basicKernelString = basicKernelString.replace("{}", str(int(val)), 1) + idx += 1 + + module = common_nvrtc(basicKernelString, cuDevice) + + err, kernel = cuda.cuModuleGetFunction(module, b"basic") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + # Prepare kernel + err, pb = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_bool)) + ASSERT_DRV(err) + err, pc = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_char)) + ASSERT_DRV(err) + err, pwc = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_wchar)) + ASSERT_DRV(err) + err, pbyte = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_byte)) + ASSERT_DRV(err) + err, pubyte = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_ubyte)) + ASSERT_DRV(err) + err, ps = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_short)) + ASSERT_DRV(err) + err, pus = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_ushort)) + ASSERT_DRV(err) + err, pi = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + err, pui = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_uint)) + ASSERT_DRV(err) + err, pl = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_long)) + ASSERT_DRV(err) + err, pul = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_ulong)) + ASSERT_DRV(err) + err, pll = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_longlong)) + ASSERT_DRV(err) + err, pull = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_ulonglong)) + ASSERT_DRV(err) + err, psize = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_size_t)) + ASSERT_DRV(err) + err, pf = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_float)) + ASSERT_DRV(err) + err, pd = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_double)) + ASSERT_DRV(err) + + assertValues_device = (pb, pc, pwc, pbyte, pubyte, ps, pus, pi, pui, pl, pul, pll, pull, psize, pf, pd) + assertTypes_device = ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ) + + basicKernelValues = assertValues_host + assertValues_device + basicKernelTypes = assertTypes_host + assertTypes_device + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + (basicKernelValues, basicKernelTypes), + 0, + ) # arguments + ASSERT_DRV(err) + + # Retrieve each dptr + host_params = tuple([valueType() for valueType in assertTypes_host[:-1]]) + for i in range(len(host_params)): + (err,) = cuda.cuMemcpyDtoHAsync( + host_params[i], assertValues_device[i], ctypes.sizeof(assertTypes_host[i]), stream + ) + ASSERT_DRV(err) + + # Validate retrieved values + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + for i in range(len(host_params)): + val = basicKernelValues[i].value if use_ctypes_as_values else basicKernelValues[i] + if basicKernelTypes[i] == ctypes.c_float: + if use_ctypes_as_values: + assert val == host_params[i].value + else: + assert val == (int(host_params[i].value * 1000) / 1000) + else: + assert val == host_params[i].value + + (err,) = cuda.cuMemFree(pb) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pc) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pwc) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pbyte) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pubyte) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(ps) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pus) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pi) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pui) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pl) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pul) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pll) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pull) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(psize) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pf) + ASSERT_DRV(err) + (err,) = cuda.cuMemFree(pd) + ASSERT_DRV(err) + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +def test_kernelParams_basic(): + # Kernel is given basic Python primative values as value input + kernelParams_basic(use_ctypes_as_values=False) + + +def test_kernelParams_basic_ctypes(): + # Kernel is given basic c_type instances as primative value input + kernelParams_basic(use_ctypes_as_values=True) + + +def test_kernelParams_types_cuda(): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + err, uvaSupported = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice + ) + ASSERT_DRV(err) + + err, perr = cudart.cudaMalloc(ctypes.sizeof(ctypes.c_int)) + ASSERT_DRV(err) + err, pSurface_host = cudart.cudaHostAlloc(cudart.sizeof(cudart.cudaSurfaceObject_t), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + err, pDim3_host = cudart.cudaHostAlloc(cudart.sizeof(cudart.dim3), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + + # Get device pointer if UVM is not enabled + if uvaSupported: + kernelValues = ( + cudart.cudaError_t.cudaErrorUnknown, + perr, # enums + cudart.cudaSurfaceObject_t(248), + cudart.cudaSurfaceObject_t(_ptr=pSurface_host), # typedef of primative + cudart.dim3(), + cudart.dim3(_ptr=pDim3_host), + ) # struct + else: + err, pSurface_device = cudart.cudaHostGetDevicePointer(pSurface_host, 0) + ASSERT_DRV(err) + err, pDim3_device = cudart.cudaHostGetDevicePointer(pDim3_host, 0) + ASSERT_DRV(err) + kernelValues = ( + cudart.cudaError_t.cudaErrorUnknown, + perr, # enums + cudart.cudaSurfaceObject_t(248), + cudart.cudaSurfaceObject_t(_ptr=pSurface_device), # typedef of primative + cudart.dim3(), + cudart.dim3(_ptr=pDim3_device), + ) # struct + kernelTypes = (None, ctypes.c_void_p, None, ctypes.c_void_p, None, ctypes.c_void_p) + kernelValues[4].x = 1 + kernelValues[4].y = 2 + kernelValues[4].z = 3 + + kernelString = """\ + extern "C" __global__ + void structsCuda(cudaError_t err, cudaError_t *perr, + cudaSurfaceObject_t surface, cudaSurfaceObject_t *pSurface, + dim3 dim, dim3* pdim) + { + *perr = err; + *pSurface = surface; + pdim->x = dim.x; + pdim->y = dim.y; + pdim->z = dim.z; + } + """ + + module = common_nvrtc(kernelString, cuDevice) + + # cudaStructs kernel + err, kernel = cuda.cuModuleGetFunction(module, b"structsCuda") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + (kernelValues, kernelTypes), + 0, + ) # arguments + ASSERT_DRV(err) + + # Retrieve each dptr + host_err = ctypes.c_int() + (err,) = cudart.cudaMemcpyAsync( + ctypes.addressof(host_err), + perr, + ctypes.sizeof(ctypes.c_int()), + cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost, + stream, + ) + ASSERT_DRV(err) + + # Validate kernel values + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + cuda_err = cudart.cudaError_t(host_err.value) + + if uvaSupported: + assert kernelValues[0] == cuda_err + assert int(kernelValues[2]) == int(kernelValues[3]) + assert kernelValues[4].x == kernelValues[5].x + assert kernelValues[4].y == kernelValues[5].y + assert kernelValues[4].z == kernelValues[5].z + else: + surface_host = cudart.cudaSurfaceObject_t(_ptr=pSurface_host) + dim3_host = cudart.dim3(_ptr=pDim3_host) + assert kernelValues[0] == cuda_err + assert int(kernelValues[2]) == int(surface_host) + assert kernelValues[4].x == dim3_host.x + assert kernelValues[4].y == dim3_host.y + assert kernelValues[4].z == dim3_host.z + + (err,) = cudart.cudaFree(perr) + ASSERT_DRV(err) + (err,) = cudart.cudaFreeHost(pSurface_host) + ASSERT_DRV(err) + (err,) = cudart.cudaFreeHost(pDim3_host) + ASSERT_DRV(err) + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +def test_kernelParams_struct_custom(): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + err, uvaSupported = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice + ) + ASSERT_DRV(err) + + kernelString = """\ + struct testStruct { + int value; + }; + + extern "C" __global__ + void structCustom(struct testStruct src, struct testStruct *dst) + { + dst->value = src.value; + } + """ + + module = common_nvrtc(kernelString, cuDevice) + + err, kernel = cuda.cuModuleGetFunction(module, b"structCustom") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + # structCustom kernel + class testStruct(ctypes.Structure): + _fields_ = [("value", ctypes.c_int)] + + err, pStruct_host = cudart.cudaHostAlloc(ctypes.sizeof(testStruct), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + + # Get device pointer if UVM is not enabled + if uvaSupported: + kernelValues = (testStruct(5), pStruct_host) + else: + err, pStruct_device = cudart.cudaHostGetDevicePointer(pStruct_host, 0) + ASSERT_DRV(err) + kernelValues = (testStruct(5), pStruct_device) + kernelTypes = (None, ctypes.c_void_p) + + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + (kernelValues, kernelTypes), + 0, + ) # arguments + ASSERT_DRV(err) + + # Validate kernel values + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + struct_shared = testStruct.from_address(pStruct_host) + assert kernelValues[0].value == struct_shared.value + + (err,) = cudart.cudaFreeHost(pStruct_host) + ASSERT_DRV(err) + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +def kernelParams_buffer_protocol_ctypes_common(pass_by_address): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + err, uvaSupported = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice + ) + ASSERT_DRV(err) + + kernelString = """\ + struct testStruct { + int value; + }; + extern "C" __global__ + void testkernel(int i, int *pi, + float f, float *pf, + struct testStruct s, struct testStruct *ps) + { + *pi = i; + *pf = f; + ps->value = s.value; + } + """ + + module = common_nvrtc(kernelString, cuDevice) + + err, kernel = cuda.cuModuleGetFunction(module, b"testkernel") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + # testkernel kernel + class testStruct(ctypes.Structure): + _fields_ = [("value", ctypes.c_int)] + + err, pInt_host = cudart.cudaHostAlloc(ctypes.sizeof(ctypes.c_int), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + err, pFloat_host = cudart.cudaHostAlloc(ctypes.sizeof(ctypes.c_float), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + err, pStruct_host = cudart.cudaHostAlloc(ctypes.sizeof(testStruct), cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + + # Get device pointer if UVM is not enabled + if uvaSupported: + kernelValues = ( + ctypes.c_int(1), + ctypes.c_void_p(pInt_host), + ctypes.c_float(123.456), + ctypes.c_void_p(pFloat_host), + testStruct(5), + ctypes.c_void_p(pStruct_host), + ) + else: + err, pInt_device = cudart.cudaHostGetDevicePointer(pInt_host, 0) + ASSERT_DRV(err) + err, pFloat_device = cudart.cudaHostGetDevicePointer(pFloat_host, 0) + ASSERT_DRV(err) + err, pStruct_device = cudart.cudaHostGetDevicePointer(pStruct_host, 0) + ASSERT_DRV(err) + kernelValues = ( + ctypes.c_int(1), + ctypes.c_void_p(pInt_device), + ctypes.c_float(123.456), + ctypes.c_void_p(pFloat_device), + testStruct(5), + ctypes.c_void_p(pStruct_device), + ) + + packagedParams = (ctypes.c_void_p * len(kernelValues))() + for idx in range(len(packagedParams)): + packagedParams[idx] = ctypes.addressof(kernelValues[idx]) + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + ctypes.addressof(packagedParams) if pass_by_address else packagedParams, + 0, + ) # arguments + ASSERT_DRV(err) + + # Validate kernel values + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + assert kernelValues[0].value == ctypes.c_int.from_address(pInt_host).value + assert kernelValues[2].value == ctypes.c_float.from_address(pFloat_host).value + assert kernelValues[4].value == testStruct.from_address(pStruct_host).value + + (err,) = cudart.cudaFreeHost(pStruct_host) + ASSERT_DRV(err) + (err,) = cuda.cuStreamDestroy(stream) + ASSERT_DRV(err) + (err,) = cuda.cuModuleUnload(module) + ASSERT_DRV(err) + (err,) = cuda.cuCtxDestroy(context) + ASSERT_DRV(err) + + +def test_kernelParams_buffer_protocol_ctypes(): + kernelParams_buffer_protocol_ctypes_common(pass_by_address=True) + kernelParams_buffer_protocol_ctypes_common(pass_by_address=False) + + +def test_kernelParams_buffer_protocol_numpy(): + (err,) = cuda.cuInit(0) + ASSERT_DRV(err) + err, cuDevice = cuda.cuDeviceGet(0) + ASSERT_DRV(err) + err, context = cuda.cuCtxCreate(0, cuDevice) + ASSERT_DRV(err) + err, uvaSupported = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cuDevice + ) + ASSERT_DRV(err) + + kernelString = """\ + struct testStruct { + int value; + }; + extern "C" __global__ + void testkernel(int i, int *pi, + float f, float *pf, + struct testStruct s, struct testStruct *ps) + { + *pi = i; + *pf = f; + ps->value = s.value; + } + """ + + module = common_nvrtc(kernelString, cuDevice) + + err, kernel = cuda.cuModuleGetFunction(module, b"testkernel") + ASSERT_DRV(err) + + err, stream = cuda.cuStreamCreate(0) + ASSERT_DRV(err) + + # testkernel kernel + testStruct = np.dtype([("value", np.int32)]) + + err, pInt_host = cudart.cudaHostAlloc(np.dtype(np.int32).itemsize, cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + err, pFloat_host = cudart.cudaHostAlloc(np.dtype(np.float32).itemsize, cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + err, pStruct_host = cudart.cudaHostAlloc(testStruct.itemsize, cudart.cudaHostAllocMapped) + ASSERT_DRV(err) + + # Get device pointer if UVM is not enabled + if uvaSupported: + kernelValues = ( + np.array(1, dtype=np.uint32), + np.array([pInt_host], dtype=np.uint64), + np.array(123.456, dtype=np.float32), + np.array([pFloat_host], dtype=np.uint64), + np.array([5], testStruct), + np.array([pStruct_host], dtype=np.uint64), + ) + else: + err, pInt_device = cudart.cudaHostGetDevicePointer(pInt_host, 0) + ASSERT_DRV(err) + err, pFloat_device = cudart.cudaHostGetDevicePointer(pFloat_host, 0) + ASSERT_DRV(err) + err, pStruct_device = cudart.cudaHostGetDevicePointer(pStruct_host, 0) + ASSERT_DRV(err) + kernelValues = ( + np.array(1, dtype=np.int32), + np.array([pInt_device], dtype=np.uint64), + np.array(123.456, dtype=np.float32), + np.array([pFloat_device], dtype=np.uint64), + np.array([5], testStruct), + np.array([pStruct_device], dtype=np.uint64), + ) + + packagedParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.uint64) + (err,) = cuda.cuLaunchKernel( + kernel, + 1, + 1, + 1, # grid dim + 1, + 1, + 1, # block dim + 0, + stream, # shared mem and stream + packagedParams, + 0, + ) # arguments + ASSERT_DRV(err) + + # Validate kernel values + (err,) = cuda.cuStreamSynchronize(stream) + ASSERT_DRV(err) + + class numpy_address_wrapper: + def __init__(self, address, typestr): + self.__array_interface__ = {"data": (address, False), "typestr": typestr, "shape": (1,)} + + assert kernelValues[0] == np.array(numpy_address_wrapper(pInt_host, "; + .reg .b64 %rd<5>; + + + ld.param.u64 %rd1, [_Z6kernelPi_param_0]; + cvta.to.global.u64 %rd2, %rd1; + mov.u32 %r1, %tid.x; + mov.u32 %r2, %ctaid.x; + mov.u32 %r3, %ntid.x; + mad.lo.s32 %r4, %r2, %r3, %r1; + mul.wide.s32 %rd3, %r4, 4; + add.s64 %rd4, %rd2, %rd3; + ld.global.u32 %r5, [%rd4]; + add.s32 %r6, %r5, 1; + st.global.u32 [%rd4], %r6; + ret; + +}} +""" + +CODE = """ +int __device__ inc(int x) { + return x + 1; +} +""" + +# Base64 encoded TileIR generated by the toolshed/dump_cutile_b64.py script. +TILEIR_b64 = ( + "f1RpbGVJUgANAQAAgo0BCAECBgYBCwEECgCBAUQHBgQIEAAABgUMAQABBgUIEAALQwEICgEMAAYE" + "CBAAAwYFDAEABAYFCBAAD0MBCA4BEAAGBAgQAAYGBQwBAAcGBQgQABNDAQgSARQAMAUFBUIJDT4C" + "CgcEABkBFglCCRE+AgoHBAAcARYJAgoAABodQgkVZgEHBAAfIAEWCVwAAIQICADLy8vLy8vLg5oC" + "CMvLy8sBy8vLAAAAABfLy8vLy8vLBAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAA" + "AAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAA" + "AAAABAAAAAAAAAAEAAAAAAAAAAUAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAcAAAAAAAAABwAAAAAA" + "AAAIAAAAAAAAAAkAAAAAAAAACQAAAAAAAAAEAAAAAAAAAAnLy8sAAAAAAwAAAAUAAAAMAAAAEQAA" + "ABYAAAAbAAAAIAAAACUAAAACAAEBAQUBFwICAhcEAwMYBAQDAxkTBAMDGhEEAwMbEQQDAx0WBAMD" + "HgiFdATLy8sLy8vLAAAAAAEAAAACAAAAAwAAAAUAAAAIAAAACwAAABcAAAAYAAAALAAAADkAAAAA" + "AwcMAg0DAA0BABAJBAUFBAUFBAUFABEOAgEAAAAAAAAAgAEBAAAAAAAAAA8BEAAAAAgBAAAAAAAN" + "AgEQAAAAAAAAAIGIAQQFy8vLAAAAABIAAAAsAAAAPQAAAGoAAABkdW1wX2N1dGlsZV9iNjQucHkv" + "bG9jYWxob21lL2xvY2FsLXdhbmdtL3RveXZlY3Rvcl9hZGRfa2VybmVsL2xvY2FsaG9tZS9sb2Nh" + "bC13YW5nbS90b3kvZHVtcF9jdXRpbGVfYjY0LnB5c21fMTIwAA==" +) + + +def get_version() -> tuple[int, int]: + return nvfatbin.version() + + +@pytest.fixture(params=ARCHITECTURES) +def arch(request): + return request.param + + +@pytest.fixture(params=PTX_VERSIONS) +def ptx_version(request): + return request.param + + +@pytest.fixture +def PTX(arch, ptx_version): + return PTX_TEMPLATE.format(PTX_VERSION=ptx_version, ARCH=arch) + + +@pytest.fixture +def nvcc_smoke(tmpdir) -> str: + # TODO: Use cuda-pathfinder to locate nvcc on system. + nvcc = shutil.which("nvcc") + if nvcc is None: + pytest.skip("nvcc not found on PATH") + + # Smoke test: make sure nvcc is actually usable (toolkit + host compiler are set up), + # not merely present on PATH. + src = tmpdir / "nvcc_smoke.cu" + out = tmpdir / "nvcc_smoke.o" + with open(src, "w") as f: + f.write("") + try: + subprocess.run( # noqa: S603 + [nvcc, "-c", str(src), "-o", str(out)], + check=True, + capture_output=True, + shell=False, + ) + except subprocess.CalledProcessError as e: + stdout = (e.stdout or b"").decode(errors="replace") + stderr = (e.stderr or b"").decode(errors="replace") + pytest.skip( + "nvcc found on PATH but failed to compile a trivial input.\n" + f"command: {[nvcc, '-c', str(src), '-o', str(out)]!r}\n" + f"exit_code: {e.returncode}\n" + f"stdout:\n{stdout}\n" + f"stderr:\n{stderr}\n" + ) + + return nvcc + + +def _build_cubin(arch): + def CHECK_NVRTC(err): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(repr(err)) + + err, program_handle = nvrtc.nvrtcCreateProgram(CODE.encode(), b"", 0, [], []) + CHECK_NVRTC(err) + err = nvrtc.nvrtcCompileProgram(program_handle, 1, [f"-arch={arch}".encode()])[0] + CHECK_NVRTC(err) + err, size = nvrtc.nvrtcGetCUBINSize(program_handle) + CHECK_NVRTC(err) + cubin = b" " * size + (err,) = nvrtc.nvrtcGetCUBIN(program_handle, cubin) + CHECK_NVRTC(err) + (err,) = nvrtc.nvrtcDestroyProgram(program_handle) + 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): + arch = arch.replace("sm", "compute") + + def CHECK_NVRTC(err): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(repr(err)) + + empty_cplusplus_kernel = "__global__ void A() {}" + err, program_handle = nvrtc.nvrtcCreateProgram(empty_cplusplus_kernel.encode(), b"", 0, [], []) + CHECK_NVRTC(err) + err = nvrtc.nvrtcCompileProgram(program_handle, 1, [b"-dlto", f"-arch={arch}".encode()])[0] + CHECK_NVRTC(err) + err, size = nvrtc.nvrtcGetLTOIRSize(program_handle) + CHECK_NVRTC(err) + empty_kernel_ltoir = b" " * size + (err,) = nvrtc.nvrtcGetLTOIR(program_handle, empty_kernel_ltoir) + CHECK_NVRTC(err) + (err,) = nvrtc.nvrtcDestroyProgram(program_handle) + CHECK_NVRTC(err) + return empty_kernel_ltoir + + +@pytest.fixture +def OBJECT(arch, tmpdir, nvcc_smoke): + empty_cplusplus_kernel = "__global__ void A() {}" + with open(tmpdir / "object.cu", "w") as f: + f.write(empty_cplusplus_kernel) + + nvcc = nvcc_smoke + + # This is a test fixture that intentionally invokes a trusted tool (`nvcc`) to + # compile a temporary CUDA translation unit. + cmd = [nvcc, "-c", "-arch", arch, "-o", str(tmpdir / "object.o"), str(tmpdir / "object.cu")] + try: + subprocess.run( # noqa: S603 + cmd, + check=True, + capture_output=True, + shell=False, + ) + except subprocess.CalledProcessError as e: + stdout = (e.stdout or b"").decode(errors="replace") + stderr = (e.stderr or b"").decode(errors="replace") + raise RuntimeError( + "nvcc smoke test passed, but nvcc failed while compiling the test object.\n" + f"command: {cmd!r}\n" + f"exit_code: {e.returncode}\n" + f"stdout:\n{stdout}\n" + f"stderr:\n{stderr}\n" + ) from e + with open(tmpdir / "object.o", "rb") as f: + object = f.read() + + return object + + +@pytest.fixture +def TILEIR(tmpdir): + try: + binary_data = base64.b64decode(TILEIR_b64) + except binascii.Error as e: + raise ValueError( + "Base64 encoded TileIR is corrupted. Please regenerate the TileIR" + "by executing the toolshed/dump_cutile_b64.py script." + ) from e + return binary_data + + +@pytest.mark.parametrize("error_enum", nvfatbin.Result) +def test_get_error_string(error_enum): + es = nvfatbin.get_error_string(error_enum) + + if error_enum is nvfatbin.Result.SUCCESS: + assert es == "" + else: + assert es != "" + + +def test_nvfatbin_get_version(): + major, minor = nvfatbin.version() + assert major is not None + assert minor is not None + + +def test_nvfatbin_empty_create_and_destroy(): + handle = nvfatbin.create([], 0) + assert handle is not None + nvfatbin.destroy(handle) + + +def test_nvfatbin_invalid_input_create(): + with pytest.raises(nvfatbin.nvFatbinError, match="ERROR_UNRECOGNIZED_OPTION"): + nvfatbin.create(["--unsupported_option"], 1) + + +def test_nvfatbin_get_empty(): + handle = nvfatbin.create([], 0) + size = nvfatbin.size(handle) + + buffer = bytearray(size) + nvfatbin.get(handle, buffer) + + nvfatbin.destroy(handle) + + +def test_nvfatbin_add_ptx(PTX, arch): + arch_numeric = arch.split("_")[1] + + handle = nvfatbin.create([], 0) + nvfatbin.add_ptx(handle, PTX.encode(), len(PTX), arch_numeric, "add", f"-arch={arch}") + + buffer = bytearray(nvfatbin.size(handle)) + + nvfatbin.get(handle, buffer) + nvfatbin.destroy(handle) + + +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.destroy(handle) + + +def test_nvfatbin_add_cubin(CUBIN, arch): + arch_numeric = arch.split("_")[1] + + handle = nvfatbin.create([], 0) + nvfatbin.add_cubin(handle, CUBIN, len(CUBIN), arch_numeric, "inc") + + buffer = bytearray(nvfatbin.size(handle)) + + nvfatbin.get(handle, buffer) + nvfatbin.destroy(handle) + + +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.destroy(handle) + + +def test_nvdfatbin_add_ltoir(LTOIR, arch): + arch_numeric = arch.split("_")[1] + + handle = nvfatbin.create([], 0) + nvfatbin.add_ltoir(handle, LTOIR, len(LTOIR), arch_numeric, "inc", "") + + buffer = bytearray(nvfatbin.size(handle)) + + nvfatbin.get(handle, buffer) + nvfatbin.destroy(handle) + + +def test_nvfatbin_add_reloc(OBJECT): + handle = nvfatbin.create([], 0) + nvfatbin.add_reloc(handle, OBJECT, len(OBJECT)) + + buffer = bytearray(nvfatbin.size(handle)) + + nvfatbin.get(handle, buffer) + nvfatbin.destroy(handle) + + +@pytest.mark.skipif(get_version() < (13, 1), reason="TileIR API is not supported in CUDA < 13.1") +def test_nvfatbin_add_tile_ir(TILEIR): + handle = nvfatbin.create([], 0) + nvfatbin.add_tile_ir(handle, TILEIR, len(TILEIR), "VectorAdd", "") + + buffer = bytearray(nvfatbin.size(handle)) + + nvfatbin.get(handle, buffer) + nvfatbin.destroy(handle) diff --git a/cuda_bindings_12/tests/test_nvjitlink.py b/cuda_bindings_12/tests/test_nvjitlink.py new file mode 100644 index 00000000000..19dc040e47d --- /dev/null +++ b/cuda_bindings_12/tests/test_nvjitlink.py @@ -0,0 +1,178 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from cuda.bindings import nvjitlink, nvrtc + +# Establish a handful of compatible architectures and PTX versions to test with +ARCHITECTURES = ["sm_60", "sm_75", "sm_80", "sm_90"] +PTX_VERSIONS = ["5.0", "6.4", "7.0", "8.5"] + + +PTX_HEADER = """\ +.version {VERSION} +.target {ARCH} +.address_size 64 +""" + +PTX_KERNEL = """ +.visible .entry _Z6kernelPi( + .param .u64 _Z6kernelPi_param_0 +) +{ + .reg .pred %p<2>; + .reg .b32 %r<3>; + .reg .b64 %rd<3>; + + ld.param.u64 %rd1, [_Z6kernelPi_param_0]; + cvta.to.global.u64 %rd2, %rd1; + mov.u32 %r1, %tid.x; + st.global.u32 [%rd2+0], %r1; + ret; +} +""" + + +def _build_arch_ptx_parametrized_callable(): + av = tuple(zip(ARCHITECTURES, PTX_VERSIONS)) + return pytest.mark.parametrize( + ("arch", "ptx_bytes"), + [(a, (PTX_HEADER.format(VERSION=v, ARCH=a) + PTX_KERNEL).encode("utf-8")) for a, v in av], + ids=[f"{a}_{v}" for a, v in av], + ) + + +ARCH_PTX_PARAMETRIZED_CALLABLE = _build_arch_ptx_parametrized_callable() + + +def arch_ptx_parametrized(func): + return ARCH_PTX_PARAMETRIZED_CALLABLE(func) + + +def check_nvjitlink_usable(): + from cuda.bindings._internal import nvjitlink as inner_nvjitlink + + return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0 + + +pytestmark = pytest.mark.skipif( + not check_nvjitlink_usable(), reason="nvJitLink not usable, maybe not installed or too old (<12.3)" +) + + +# create a valid LTOIR input for testing +@pytest.fixture +def get_dummy_ltoir(): + def CHECK_NVRTC(err): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(repr(err)) + + empty_cplusplus_kernel = "__global__ void A() {}" + err, program_handle = nvrtc.nvrtcCreateProgram(empty_cplusplus_kernel.encode(), b"", 0, [], []) + CHECK_NVRTC(err) + err = nvrtc.nvrtcCompileProgram(program_handle, 1, [b"-dlto"])[0] + CHECK_NVRTC(err) + err, size = nvrtc.nvrtcGetLTOIRSize(program_handle) + CHECK_NVRTC(err) + empty_kernel_ltoir = b" " * size + (err,) = nvrtc.nvrtcGetLTOIR(program_handle, empty_kernel_ltoir) + CHECK_NVRTC(err) + (err,) = nvrtc.nvrtcDestroyProgram(program_handle) + CHECK_NVRTC(err) + return empty_kernel_ltoir + + +def test_unrecognized_option_error(): + with pytest.raises(nvjitlink.nvJitLinkError, match="ERROR_UNRECOGNIZED_OPTION"): + nvjitlink.create(1, ["-fictitious_option"]) + + +def test_invalid_arch_error(): + with pytest.raises(nvjitlink.nvJitLinkError, match="ERROR_UNRECOGNIZED_OPTION"): + nvjitlink.create(1, ["-arch=sm_XX"]) + + +@pytest.mark.parametrize("option", ARCHITECTURES) +def test_create_and_destroy(option): + handle = nvjitlink.create(1, [f"-arch={option}"]) + assert handle != 0 + nvjitlink.destroy(handle) + + +@pytest.mark.parametrize("option", ARCHITECTURES) +def test_complete_empty(option): + handle = nvjitlink.create(1, [f"-arch={option}"]) + nvjitlink.complete(handle) + nvjitlink.destroy(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) + + +@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) + + +@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) + + +@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) + + +@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) + + +@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) + + +def test_package_version(): + ver = nvjitlink.version() + assert len(ver) == 2 + assert ver >= (12, 0) diff --git a/cuda_bindings_12/tests/test_nvrtc.py b/cuda_bindings_12/tests/test_nvrtc.py new file mode 100644 index 00000000000..e887260e990 --- /dev/null +++ b/cuda_bindings_12/tests/test_nvrtc.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from cuda import nvrtc + + +def ASSERT_DRV(err): + if isinstance(err, nvrtc.nvrtcResult): + if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: + raise RuntimeError(f"Nvrtc Error: {err}") + else: + raise RuntimeError(f"Unknown error type: {err}") + + +def nvrtcVersionLessThan(major, minor): + err, major_version, minor_version = nvrtc.nvrtcVersion() + ASSERT_DRV(err) + return major_version < major or (major == major_version and minor_version < minor) + + +@pytest.mark.skipif(nvrtcVersionLessThan(11, 3), reason="When nvrtcGetSupportedArchs was introduced") +def test_nvrtcGetSupportedArchs(): + err, supportedArchs = nvrtc.nvrtcGetSupportedArchs() + ASSERT_DRV(err) + assert len(supportedArchs) != 0 + + +@pytest.mark.skipif(nvrtcVersionLessThan(12, 1), reason="Preempt Segmentation Fault (see #499)") +def test_nvrtcGetLoweredName_failure(): + err, name = nvrtc.nvrtcGetLoweredName(None, b"I'm an elevated name!") + assert err == nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM + assert name is None + err, name = nvrtc.nvrtcGetLoweredName(0, b"I'm another elevated name!") + assert err == nvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM + assert name is None diff --git a/cuda_bindings_12/tests/test_nvvm.py b/cuda_bindings_12/tests/test_nvvm.py new file mode 100644 index 00000000000..d154097d99a --- /dev/null +++ b/cuda_bindings_12/tests/test_nvvm.py @@ -0,0 +1,273 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import binascii +import re +from contextlib import contextmanager + +import pytest + +from cuda.bindings import nvvm + +MINIMAL_NVVMIR_TXT_TEMPLATE = b"""\ +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" + +target triple = "nvptx64-nvidia-cuda" + +define void @kernel() { +entry: + ret void +} + +!nvvm.annotations = !{!0} +!0 = !{void ()* @kernel, !"kernel", i32 1} + +!nvvmir.version = !{!1} +!1 = !{i32 %d, i32 0, i32 %d, i32 0} +""" # noqa: E501 + +MINIMAL_NVVMIR_BITCODE_STATIC = { + (1, 3): # (major, debug_major) + "4243c0de3514000005000000620c30244a59be669dfbb4bf0b51804c01000000210c00007f010000" + "0b02210002000000160000000781239141c80449061032399201840c250508191e048b62800c4502" + "42920b42641032143808184b0a3232884870c421234412878c1041920264c808b1142043468820c9" + "01323284182a282a90317cb05c9120c3c8000000892000000b0000003222c80820624600212b2498" + "0c212524980c19270c85a4906032645c20246382a01801300128030173046000132677b00778a007" + "7cb0033a680377b0877420877408873618877a208770d8e012e5d006f0a0077640077a600774a007" + "7640076d900e71a00778a00778d006e980077a80077a80076d900e7160077a100776a0077160076d" + "900e7320077a300772a0077320076d900e7640077a600774a0077640076d900e71200778a0077120" + "0778a00771200778d006e6300772a0077320077a300772d006e6600774a0077640077a600774d006" + "f6100776a0077160077a100776d006f6300772a0077320077a300772d006f6600774a0077640077a" + "600774d006f610077280077a10077280077a10077280076de00e7160077a300772a0077640071a21" + "4c0e11de9c2e4fbbcfbe211560040000000000000000000000000620b141a0e86000004016080000" + "06000000321e980c19114c908c092647c6044362098c009401000000b1180000ac0000003308801c" + "c4e11c6614013d88433884c38c4280077978077398710ce6000fed100ef4800e330c421ec2c11dce" + "a11c6630053d88433884831bcc033dc8433d8c033dcc788c7470077b08077948877070077a700376" + "788770208719cc110eec900ee1300f6e300fe3f00ef0500e3310c41dde211cd8211dc2611e663089" + "3bbc833bd04339b4033cbc833c84033bccf0147660077b6807376887726807378087709087706007" + "76280776f8057678877780875f08877118877298877998812ceef00eeee00ef5c00eec300362c8a1" + "1ce4a11ccca11ce4a11cdc611cca211cc4811dca6106d6904339c84339984339c84339b8c3389443" + "3888033b94c32fbc833cfc823bd4033bb0c30cc7698770588772708374680778608774188774a087" + "19ce530fee000ff2500ee4900ee3400fe1200eec500e3320281ddcc11ec2411ed2211cdc811edce0" + "1ce4e11dea011e66185138b0433a9c833bcc50247660077b68073760877778077898514cf4900ff0" + "500e331e6a1eca611ce8211ddec11d7e011ee4a11ccc211df0610654858338ccc33bb0433dd04339" + "fcc23ce4433b88c33bb0c38cc50a877998877718877408077a28077298815ce3100eecc00ee5500e" + "f33023c1d2411ee4e117d8e11dde011e6648193bb0833db4831b84c3388c4339ccc33cb8c139c8c3" + "3bd4033ccc48b471080776600771088771588719dbc60eec600fede006f0200fe5300fe5200ff650" + "0e6e100ee3300ee5300ff3e006e9e00ee4500ef83023e2ec611cc2811dd8e117ec211de6211dc421" + "1dd8211de8211f66209d3bbc433db80339948339cc58bc7070077778077a08077a488777708719cb" + "e70eef300fe1e00ee9400fe9a00fe530c3010373a8077718875f988770708774a08774d087729881" + "844139e0c338b0433d904339cc40c4a01dcaa11de0411edec11c662463300ee1c00eec300fe9400f" + "e5000000792000001d000000721e482043880c19097232482023818c9191d144a01028643c313242" + "8e9021a318100a00060000006b65726e656c0000230802308240042308843082400c330c4230cc40" + "0c4441c84860821272b3b36b730973737ba30ba34b7b739b1b2528d271b3b36b4b9373b12b939b4b" + "7b731b2530000000a9180000250000000b0a7228877780077a587098433db8c338b04339d0c382e6" + "1cc6a10de8411ec2c11de6211de8211ddec11d1634e3600ee7500fe1200fe4400fe1200fe7500ef4" + "b08081077928877060077678877108077a28077258709cc338b4013ba4833d94c3026b1cd8211cdc" + "e11cdc201ce4611cdc201ce8811ec2611cd0a11cc8611cc2811dd861c1010ff4200fe1500ff4800e" + "00000000d11000000600000007cc3ca4833b9c033b94033da0833c94433890c30100000061200000" + "06000000130481860301000002000000075010cd14610000000000007120000003000000320e1022" + "8400fb020000000000000000650c00001f000000120394f000000000030000000600000006000000" + "4c000000010000005800000000000000580000000100000070000000000000000c00000013000000" + "1f000000080000000600000000000000700000000000000000000000010000000000000000000000" + "060000000000000006000000ffffffff00240000000000005d0c00000d0000001203946700000000" + "6b65726e656c31352e302e376e7670747836342d6e76696469612d637564613c737472696e673e00" + "00000000", + (2, 3): # (major, debug_major) + "4243c0de3514000005000000620c30244a59be669dfbb4bf0b51804c01000000210c000080010000" + "0b02210002000000160000000781239141c80449061032399201840c250508191e048b62800c4502" + "42920b42641032143808184b0a3232884870c421234412878c1041920264c808b1142043468820c9" + "01323284182a282a90317cb05c9120c3c8000000892000000b0000003222c80820624600212b2498" + "0c212524980c19270c85a4906032645c20246382a01801300128030173046000132677b00778a007" + "7cb0033a680377b0877420877408873618877a208770d8e012e5d006f0a0077640077a600774a007" + "7640076d900e71a00778a00778d006e980077a80077a80076d900e7160077a100776a0077160076d" + "900e7320077a300772a0077320076d900e7640077a600774a0077640076d900e71200778a0077120" + "0778a00771200778d006e6300772a0077320077a300772d006e6600774a0077640077a600774d006" + "f6100776a0077160077a100776d006f6300772a0077320077a300772d006f6600774a0077640077a" + "600774d006f610077280077a10077280077a10077280076de00e7160077a300772a0077640071a21" + "4c0e11de9c2e4fbbcfbe211560040000000000000000000000000620b141a0286100004016080000" + "06000000321e980c19114c908c092647c60443620914c10840190000b1180000ac0000003308801c" + "c4e11c6614013d88433884c38c4280077978077398710ce6000fed100ef4800e330c421ec2c11dce" + "a11c6630053d88433884831bcc033dc8433d8c033dcc788c7470077b08077948877070077a700376" + "788770208719cc110eec900ee1300f6e300fe3f00ef0500e3310c41dde211cd8211dc2611e663089" + "3bbc833bd04339b4033cbc833c84033bccf0147660077b6807376887726807378087709087706007" + "76280776f8057678877780875f08877118877298877998812ceef00eeee00ef5c00eec300362c8a1" + "1ce4a11ccca11ce4a11cdc611cca211cc4811dca6106d6904339c84339984339c84339b8c3389443" + "3888033b94c32fbc833cfc823bd4033bb0c30cc7698770588772708374680778608774188774a087" + "19ce530fee000ff2500ee4900ee3400fe1200eec500e3320281ddcc11ec2411ed2211cdc811edce0" + "1ce4e11dea011e66185138b0433a9c833bcc50247660077b68073760877778077898514cf4900ff0" + "500e331e6a1eca611ce8211ddec11d7e011ee4a11ccc211df0610654858338ccc33bb0433dd04339" + "fcc23ce4433b88c33bb0c38cc50a877998877718877408077a28077298815ce3100eecc00ee5500e" + "f33023c1d2411ee4e117d8e11dde011e6648193bb0833db4831b84c3388c4339ccc33cb8c139c8c3" + "3bd4033ccc48b471080776600771088771588719dbc60eec600fede006f0200fe5300fe5200ff650" + "0e6e100ee3300ee5300ff3e006e9e00ee4500ef83023e2ec611cc2811dd8e117ec211de6211dc421" + "1dd8211de8211f66209d3bbc433db80339948339cc58bc7070077778077a08077a488777708719cb" + "e70eef300fe1e00ee9400fe9a00fe530c3010373a8077718875f988770708774a08774d087729881" + "844139e0c338b0433d904339cc40c4a01dcaa11de0411edec11c662463300ee1c00eec300fe9400f" + "e5000000792000001e000000721e482043880c19097232482023818c9191d144a01028643c313242" + "8e9021a318100a00060000006b65726e656c0000230802308240042308843082400c23080431c320" + "04c30c045118858c04262821373bbb36973037b737ba30bab437b7b95102231d373bbbb6343917bb" + "32b9b9b437b7518203000000a9180000250000000b0a7228877780077a587098433db8c338b04339" + "d0c382e61cc6a10de8411ec2c11de6211de8211ddec11d1634e3600ee7500fe1200fe4400fe1200f" + "e7500ef4b08081077928877060077678877108077a28077258709cc338b4013ba4833d94c3026b1c" + "d8211cdce11cdc201ce4611cdc201ce8811ec2611cd0a11cc8611cc2811dd861c1010ff4200fe150" + "0ff4800e00000000d11000000600000007cc3ca4833b9c033b94033da0833c94433890c301000000" + "6120000006000000130481860301000002000000075010cd14610000000000007120000003000000" + "320e10228400fc020000000000000000650c00001f000000120394f0000000000300000006000000" + "060000004c000000010000005800000000000000580000000100000070000000000000000c000000" + "130000001f0000000800000006000000000000007000000000000000000000000100000000000000" + "00000000060000000000000006000000ffffffff00240000000000005d0c00000d00000012039467" + "000000006b65726e656c31352e302e376e7670747836342d6e76696469612d637564613c73747269" + "6e673e0000000000", +} + + +@pytest.fixture(params=("txt", "bitcode_static")) +def minimal_nvvmir(request): + major, minor, debug_major, debug_minor = nvvm.ir_version() + + if request.param == "txt": + return MINIMAL_NVVMIR_TXT_TEMPLATE % (major, debug_major) + + bitcode_static_binascii = MINIMAL_NVVMIR_BITCODE_STATIC.get((major, debug_major)) + if bitcode_static_binascii: + return binascii.unhexlify(bitcode_static_binascii) + raise RuntimeError( + "Static bitcode for NVVM IR version " + f"{major}.{debug_major} is not available in this test.\n" + "Maintainers: Please run the helper script to generate it and add the " + "output to the MINIMAL_NVVMIR_BITCODE_STATIC dict:\n" + " ../../toolshed/build_static_bitcode_input.py" + ) + + +@pytest.fixture(params=[nvvm.compile_program, nvvm.verify_program]) +def compile_or_verify(request): + return request.param + + +def match_exact(s): + return "^" + re.escape(s) + "$" + + +@contextmanager +def nvvm_program() -> int: + prog: int = nvvm.create_program() + try: + yield prog + finally: + nvvm.destroy_program(prog) + + +def get_program_log(prog): + buffer = bytearray(nvvm.get_program_log_size(prog)) + nvvm.get_program_log(prog, buffer) + return buffer.decode(errors="backslashreplace") + + +def test_get_error_string(): + num_success = 0 + num_errors = 0 + for enum_obj in nvvm.Result: + es = nvvm.get_error_string(enum_obj) + if enum_obj is nvvm.Result.SUCCESS: + num_success += 1 + else: + assert es.startswith("NVVM_ERROR") + num_errors += 1 + assert num_success == 1 + assert num_errors > 1 # smoke check is sufficient + + +def test_nvvm_version(): + ver = nvvm.version() + assert len(ver) == 2 + assert ver >= (1, 0) + + +def test_nvvm_ir_version(): + ver = nvvm.ir_version() + assert len(ver) == 4 + assert ver >= (1, 0, 0, 0) + + +def test_create_and_destroy(): + with nvvm_program() as prog: + assert isinstance(prog, int) + assert prog != 0 + + +@pytest.mark.parametrize("add_fn", [nvvm.add_module_to_program, nvvm.lazy_add_module_to_program]) +def test_add_module_to_program_fail(add_fn): + with nvvm_program() as prog, pytest.raises(ValueError): + # Passing a C NULL pointer generates "ERROR_INVALID_INPUT (4)", + # but that is not possible through our Python bindings. + # The ValueError originates from the cython bindings code. + add_fn(prog, None, 0, "FileNameHere.ll") + + +def test_c_or_v_program_fail_no_module(compile_or_verify): + with nvvm_program() as prog, pytest.raises(nvvm.nvvmError, match=match_exact("ERROR_NO_MODULE_IN_PROGRAM (8)")): + compile_or_verify(prog, 0, []) + + +def test_c_or_v_program_fail_invalid_ir(compile_or_verify): + expected_error = "ERROR_COMPILATION (9)" if compile_or_verify is nvvm.compile_program else "ERROR_INVALID_IR (6)" + nvvm_ll = b"This is not NVVM IR" + with nvvm_program() as prog: + nvvm.add_module_to_program(prog, nvvm_ll, len(nvvm_ll), "FileNameHere.ll") + with pytest.raises(nvvm.nvvmError, match=match_exact(expected_error)): + compile_or_verify(prog, 0, []) + assert get_program_log(prog) == "FileNameHere.ll (1, 0): parse expected top-level entity\x00" + + +def test_c_or_v_program_fail_bad_option(minimal_nvvmir, compile_or_verify): + with nvvm_program() as prog: + nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll") + with pytest.raises(nvvm.nvvmError, match=match_exact("ERROR_INVALID_OPTION (7)")): + compile_or_verify(prog, 1, ["BadOption"]) + assert get_program_log(prog) == "libnvvm : error: BadOption is an unsupported option\x00" + + +@pytest.mark.parametrize( + ("get_size", "get_buffer"), + [ + (nvvm.get_compiled_result_size, nvvm.get_compiled_result), + (nvvm.get_program_log_size, nvvm.get_program_log), + ], +) +def test_get_buffer_empty(get_size, get_buffer): + with nvvm_program() as prog: + buffer_size = get_size(prog) + assert buffer_size == 1 + buffer = bytearray(buffer_size) + get_buffer(prog, buffer) + assert buffer == b"\x00" + + +@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]]) +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") + try: + nvvm.compile_program(prog, len(options), options) + except nvvm.nvvmError as e: + raise RuntimeError(get_program_log(prog)) from e + else: + log_size = nvvm.get_program_log_size(prog) + assert log_size == 1 + buffer = bytearray(log_size) + nvvm.get_program_log(prog, buffer) + assert buffer == b"\x00" + result_size = nvvm.get_compiled_result_size(prog) + buffer = bytearray(result_size) + nvvm.get_compiled_result(prog, buffer) + assert ".visible .entry kernel()" in buffer.decode() + + +@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]]) +def test_verify_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") + nvvm.verify_program(prog, len(options), options) diff --git a/cuda_bindings_12/tests/test_utils.py b/cuda_bindings_12/tests/test_utils.py new file mode 100644 index 00000000000..8904d65d2ed --- /dev/null +++ b/cuda_bindings_12/tests/test_utils.py @@ -0,0 +1,117 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import random +import subprocess # nosec B404 +import sys +from pathlib import Path + +import pytest + +from cuda.bindings import driver, runtime +from cuda.bindings.utils import get_cuda_native_handle, get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver + +ptx_88_kernel = r""" +.version 8.8 +.target sm_75 +.address_size 64 + + // .globl empty_kernel + +.visible .entry empty_kernel() +{ + ret; +} +""" + + +ptx_72_kernel = r""" +.version 7.2 +.target sm_75 +.address_size 64 + + // .globl empty_kernel + +.visible .entry empty_kernel() +{ + ret; +} +""" + + +@pytest.mark.parametrize( + "kernel,actual_ptx_ver,min_cuda_ver", ((ptx_88_kernel, "8.8", 12090), (ptx_72_kernel, "7.2", 11020)) +) +def test_ptx_utils(kernel, actual_ptx_ver, min_cuda_ver): + ptx_ver = get_ptx_ver(kernel) + assert ptx_ver == actual_ptx_ver + cuda_ver = get_minimal_required_cuda_ver_from_ptx_ver(ptx_ver) + assert cuda_ver == min_cuda_ver + + +@pytest.mark.parametrize( + "target", + ( + driver.CUcontext, + driver.CUstream, + driver.CUevent, + driver.CUmodule, + driver.CUlibrary, + driver.CUfunction, + driver.CUkernel, + driver.CUgraph, + driver.CUgraphNode, + driver.CUgraphExec, + driver.CUmemoryPool, + runtime.cudaStream_t, + runtime.cudaEvent_t, + runtime.cudaGraph_t, + runtime.cudaGraphNode_t, + runtime.cudaGraphExec_t, + runtime.cudaMemPool_t, + ), +) +def test_get_handle(target): + ptr = random.randint(1, 1024) + obj = target(ptr) + handle = get_cuda_native_handle(obj) + assert handle == ptr + + +@pytest.mark.parametrize( + "target", + ( + (1, 2, 3, 4), + [5, 6], + {}, + None, + ), +) +def test_get_handle_error(target): + with pytest.raises(TypeError) as e: + handle = get_cuda_native_handle(target) + + +@pytest.mark.parametrize( + "module", + [ + # Top-level modules for external Python use + # TODO: Import cycle detected: (('numeric',), ''), stack: [((), + # 'cuda.bindings.cufile'), ((), 'cuda.bindings.cycufile'), + # (('show_config',), 'numpy.__config__'), (('__cpu_features__', + # '__cpu_baseline__', '__cpu_dispatch__'), + # 'numpy._core._multiarray_umath'), (('numeric',), ''), + # (('shape_base',), '')] + # "cufile", + "driver", + "nvjitlink", + "nvrtc", + "nvvm", + # TODO: cuda.bindings.cyruntime -> cuda.bindings._lib.cyruntime.cyruntime cycle + # "runtime", + ], +) +def test_cyclical_imports(module): + subprocess.check_call( # noqa: S603 + [sys.executable, Path(__file__).parent / "utils" / "check_cyclical_import.py", f"cuda.bindings.{module}"], + ) diff --git a/cuda_bindings_12/tests/utils/check_cyclical_import.py b/cuda_bindings_12/tests/utils/check_cyclical_import.py new file mode 100644 index 00000000000..5c2106612e3 --- /dev/null +++ b/cuda_bindings_12/tests/utils/check_cyclical_import.py @@ -0,0 +1,42 @@ +# 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. + +See https://github.com/NVIDIA/cuda-python/issues/789 for more info. +""" + +import argparse + +orig_import = __builtins__.__import__ + +import_stack = [] + + +def import_hook(name, globals=None, locals=None, fromlist=(), *args, **kwargs): + """Approximate a custom import system that does not allow import cycles.""" + + stack_entry = (tuple(fromlist) if fromlist is not None else None, name) + if stack_entry in import_stack and name.startswith("cuda.bindings."): + raise ImportError(f"Import cycle detected: {stack_entry}, stack: {import_stack}") + import_stack.append(stack_entry) + try: + res = orig_import(name, globals, locals, fromlist, *args, **kwargs) + finally: + import_stack.pop() + return res + + +__builtins__.__import__ = import_hook + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "module", + type=str, + ) + args = parser.parse_args() + + __import__(args.module) diff --git a/cuda_python/docs/environment-docs.yml b/cuda_python/docs/environment-docs.yml index 3152f0a3a93..baf825ab4d9 100644 --- a/cuda_python/docs/environment-docs.yml +++ b/cuda_python/docs/environment-docs.yml @@ -19,6 +19,7 @@ dependencies: - sphinx-copybutton - myst-nb - enum_tools + - furo - sphinx-toolbox - pyclibrary - pip: diff --git a/cuda_python/setup.py b/cuda_python/setup.py index dad8a596c95..7c9aaf75b26 100644 --- a/cuda_python/setup.py +++ b/cuda_python/setup.py @@ -2,19 +2,39 @@ # # SPDX-License-Identifier: Apache-2.0 -import ast +import os from packaging.version import Version from setuptools import setup from setuptools_scm import get_version -version = get_version( - root="..", - relative_to=__file__, - # Preserve a/b pre-release suffixes, but intentionally strip rc suffixes. - tag_regex="^(?Pv\\d+\\.\\d+\\.\\d+(?:[ab]\\d+)?)", - git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"], -) +build_major = os.environ.get("CUDA_PYTHON_BUILD_MAJOR", "13") +if build_major not in {"12", "13"}: + raise ValueError(f"CUDA_PYTHON_BUILD_MAJOR must be 12 or 13, got {build_major!r}") + +version_options = { + "root": "..", + "relative_to": __file__, + "dist_name": "cuda-python", + # Preserve the established version policy of each release line. CUDA 12.9 + # strips prerelease suffixes, while CUDA 13 preserves a/b suffixes. + "tag_regex": (r"^(?Pv12\.9\.\d+)" if build_major == "12" else r"^(?Pv13\.\d+\.\d+(?:[ab]\d+)?)"), + "git_describe_command": [ + "git", + "describe", + "--dirty", + "--tags", + "--long", + "--match", + "v12.9.[1-9]*" if build_major == "12" else "v13.*", + ], +} +if build_major == "12": + # Main predates the active 12.9 tags. This fallback is used until the first + # post-migration v12.9 tag is reachable from main. + version_options["fallback_version"] = "12.9.8.dev0" + +version = get_version(**version_options) base_version = Version(version).base_version @@ -27,14 +47,19 @@ # Pre-release version matcher = "==" +install_requires = [f"cuda-bindings{matcher}{version}"] +if build_major == "13": + install_requires.extend( + [ + "cuda-core~=1.0.0", + "cuda-pathfinder~=1.1", + ] + ) + setup( version=version, - install_requires=[ - f"cuda-bindings{matcher}{version}", - "cuda-core~=1.0.0", - "cuda-pathfinder~=1.1", - ], + install_requires=install_requires, extras_require={ "all": [f"cuda-bindings[all]{matcher}{version}"], }, diff --git a/pixi.toml b/pixi.toml index f73d299e012..32aae357adb 100644 --- a/pixi.toml +++ b/pixi.toml @@ -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 @@ -43,7 +43,15 @@ cmd = [ cmd = [ "bash", "-c", - 'pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_bindings" -e "$PIXI_ENVIRONMENT_NAME" test', + ''' +if [[ "$PIXI_ENVIRONMENT_NAME" == "cu12" ]]; then + pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_bindings_12" \ + -e "$PIXI_ENVIRONMENT_NAME" test +else + pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_bindings" \ + -e "$PIXI_ENVIRONMENT_NAME" test +fi +''', ] [target.linux.tasks.test-core] diff --git a/ruff.toml b/ruff.toml index 210f852cd3e..6e919de2e8d 100644 --- a/ruff.toml +++ b/ruff.toml @@ -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 line-length = 120 @@ -124,7 +124,7 @@ inline-quotes = "double" # CUDA bindings mirror C API naming conventions (CamelCase types, camelCase functions) # Keep examples opted-in to enforce naming conventions in example-local identifiers. -"cuda_bindings/{cuda,docs,tests}/**" = [ +"{cuda_bindings,cuda_bindings_12}/{cuda,docs,tests}/**" = [ "N801", # invalid-class-name "N802", # invalid-function-name "N803", # invalid-argument-name @@ -136,7 +136,7 @@ inline-quotes = "double" "N802", # invalid-function-name "N806", # non-lowercase-variable-in-function ] -"cuda_bindings/{build_hooks.py,setup.py}" = ["N801", "N802", "N803", "N806", "N816"] +"{cuda_bindings,cuda_bindings_12}/{build_hooks.py,setup.py}" = ["N801", "N802", "N803", "N806", "N816"] # scripts and build tooling — print is the expected output method "qa/**" = ["T201"] diff --git a/toolshed/check_generated_file_seals.py b/toolshed/check_generated_file_seals.py index 4863fe32d61..1b7afb1e64b 100644 --- a/toolshed/check_generated_file_seals.py +++ b/toolshed/check_generated_file_seals.py @@ -63,6 +63,7 @@ def load_previously_sealed_paths(): "HEAD", "--", "cuda_bindings", + "cuda_bindings_12", ], capture_output=True, text=True, diff --git a/toolshed/check_spdx.py b/toolshed/check_spdx.py index d4c9430673c..6ba2d6c53b3 100644 --- a/toolshed/check_spdx.py +++ b/toolshed/check_spdx.py @@ -26,6 +26,7 @@ "benchmarks": "Apache-2.0", "ci": "Apache-2.0", "cuda_bindings": "Apache-2.0", + "cuda_bindings_12": "Apache-2.0", "cuda_core": "Apache-2.0", "cuda_pathfinder": "Apache-2.0", "cuda_python": "Apache-2.0", @@ -36,6 +37,10 @@ } SPDX_IGNORE_FILENAME = ".spdx-ignore" +PACKAGE_LICENSE_FILES = ( + "cuda_bindings/LICENSE", + "cuda_bindings_12/LICENSE", +) def load_spdx_ignore(): @@ -206,6 +211,12 @@ def main(args): ignore_spec = load_spdx_ignore() returncode = 0 + repository_license = Path("LICENSE").read_bytes() + for license_file in PACKAGE_LICENSE_FILES: + if Path(license_file).read_bytes() != repository_license: + print(f"PACKAGE LICENSE {license_file!r} does not match repository LICENSE") + returncode = 1 + for filepath in args: if ignore_spec.match_file(filepath): continue diff --git a/toolshed/setup-docs-env.sh b/toolshed/setup-docs-env.sh index 9acbaa8e391..73afbbf06f9 100755 --- a/toolshed/setup-docs-env.sh +++ b/toolshed/setup-docs-env.sh @@ -51,6 +51,7 @@ conda create -y -n "${ENV_NAME}" \ sphinx-copybutton \ myst-nb \ enum_tools \ + furo \ sphinx-toolbox \ pyclibrary